Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5712386pxj; Wed, 23 Jun 2021 07:27:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx7ZIpCUqQPtbAF/lVmYIh1CVf+32dq9mri1LQ9pEE7PDQCbmSnARVjiA3QgxwiehhYort X-Received: by 2002:a92:dcc1:: with SMTP id b1mr3286785ilr.119.1624458438917; Wed, 23 Jun 2021 07:27:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624458438; cv=none; d=google.com; s=arc-20160816; b=PobY0ryR/O/jWQJLKGpFudka5V+AnLAQuEetWNS7GSb8LTPzIskbfqwi8qP33zrJpG NTAzgNJKXvOVHq3fJByHPEVQ2DpsoqKE3ojBbS8GQlJI+DmgqVTC9mcdBJxkWB+pByVW pjXwg7+Z3O5FwymSW+faLsp0JD/zg7y0ap1phRQGdTtsv59kvCSQD4AGBe/VTKSv1Byu I4uBjQQ8oPU9QMYL3unNKUgTcXuo6x172lbtJIMvCQPRQxMLBORuw+1Mp2/7OWPDRoMU q0dYqVS3HKRzh/mf+gRZiE6Leg73+2EJOoubGcAd42Kp9TlXa2/RiiQFJvwPqn2BUwQb ln+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=wOpfW+SMCj4iIZR7LREUawDSAfUCffgyrqoA1rKvA/8=; b=eTtcpEPHAjJ2m58wTyChh9769gexnLU3nMzWyga5is1tRhGJUqyEGHxZMnXbKJQwlc MUyWe/9sU+e/geDCtmPZvElsW2n1a9Y9A8UnuI5N2hJHJBDmiM46QhJh+Xkf8BtnmNpg 5XkRxiPSEH16vBtLSO/GidD4/mJyVP3fKr8adpbb/o7eURRMkg8Cio0r8Yg1IJatETMX sahqwShndZPXGGPjlG46OeC3BrO0K2U15AlgXBJS/F3+mzhD0LGhbqFdeTGj3rPEv7H9 uuMZILs0ZH/jBeYBNunTvXnoAnPtvQXXTcvka9Wupk7wyyYZj8ZE9NKxMmYIkm8BLgRn t7/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q13si171659iog.27.2021.06.23.07.27.05; Wed, 23 Jun 2021 07:27:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230449AbhFWO2y (ORCPT + 99 others); Wed, 23 Jun 2021 10:28:54 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:56102 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230061AbhFWO2y (ORCPT ); Wed, 23 Jun 2021 10:28:54 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 92DC71C0B77; Wed, 23 Jun 2021 16:26:35 +0200 (CEST) Date: Wed, 23 Jun 2021 16:26:35 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Changbin Du , Cong Wang , Jakub Kicinski , David Laight , Christian Brauner , "David S. Miller" , Sasha Levin Subject: Re: [PATCH 5.10 045/146] net: make get_net_ns return error if NET_NS is disabled Message-ID: <20210623142635.GB27348@amd> References: <20210621154911.244649123@linuxfoundation.org> <20210621154912.823486108@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LpQ9ahxlCli8rRTG" Content-Disposition: inline In-Reply-To: <20210621154912.823486108@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --LpQ9ahxlCli8rRTG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! >=20 > There is a panic in socket ioctl cmd SIOCGSKNS when NET_NS is not enabled. > The reason is that nsfs tries to access ns->ops but the proc_ns_operations > is not implemented in this case. >=20 > [7.670023] Unable to handle kernel NULL pointer dereference at virtual ad= dress 00000010 > [7.670268] pgd =3D 32b54000 > [7.670544] [00000010] *pgd=3D00000000 > [7.671861] Internal error: Oops: 5 [#1] SMP ARM > [7.672315] Modules linked in: > [7.672918] CPU: 0 PID: 1 Comm: systemd Not tainted 5.13.0-rc3-00375-g6799= d4f2da49 #16 > [7.673309] Hardware name: Generic DT based system > [7.673642] PC is at nsfs_evict+0x24/0x30 > [7.674486] LR is at clear_inode+0x20/0x9c >=20 > The same to tun SIOCGSKNS command. >=20 > To fix this problem, we make get_net_ns() return -EINVAL when NET_NS is > disabled. Meanwhile move it to right place net/core/net_namespace.c. -EINVAL sounds like wrong error code for valid operation kernel was configured to do. -ENOTSUPP? Best regards, Pavel =09 --=20 http://www.livejournal.com/~pavelmachek --LpQ9ahxlCli8rRTG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmDTRJoACgkQMOfwapXb+vKLSgCgmVri4C1MoNWL+M+Rsa38QWIa yEcAnRdpSF14hmblCXYBiOBkla8L08lc =BmRA -----END PGP SIGNATURE----- --LpQ9ahxlCli8rRTG--