From: Soheil Hassas Yeganeh <soheil@google.com>
To: Mahesh Bandewar <maheshb@google.com>
Cc: Netdev <netdev@vger.kernel.org>,
Mahesh Bandewar <mahesh@bandewar.net>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH next] sysctl: expose all net/core sysctls inside netns
Date: Thu, 22 Dec 2022 15:16:25 -0500 [thread overview]
Message-ID: <CACSApvbGDoO+fwizJK+y-aufi66Zd-xB60-f8KF5WZOJZ8mqcw@mail.gmail.com> (raw)
In-Reply-To: <20221222191005.71787-1-maheshb@google.com>
On Thu, Dec 22, 2022 at 2:10 PM Mahesh Bandewar <maheshb@google.com> wrote:
>
> All were not visible to the non-priv users inside netns. However,
> with 4ecb90090c84 ("sysctl: allow override of /proc/sys/net with
> CAP_NET_ADMIN"), these vars are protected from getting modified.
> A proc with capable(CAP_NET_ADMIN) can change the values so
> not having them visible inside netns is just causing nuisance to
> process that check certain values (e.g. net.core.somaxconn) and
> see different behavior in root-netns vs. other-netns
>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: Soheil Hassas Yeganeh <soheil@google.com>
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Thanks!
> ---
> net/core/sysctl_net_core.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
> index 5b1ce656baa1..e7b98162c632 100644
> --- a/net/core/sysctl_net_core.c
> +++ b/net/core/sysctl_net_core.c
> @@ -643,11 +643,6 @@ static __net_init int sysctl_core_net_init(struct net *net)
>
> for (tmp = tbl; tmp->procname; tmp++)
> tmp->data += (char *)net - (char *)&init_net;
> -
> - /* Don't export any sysctls to unprivileged users */
> - if (net->user_ns != &init_user_ns) {
> - tbl[0].procname = NULL;
> - }
> }
>
> net->core.sysctl_hdr = register_net_sysctl(net, "net/core", tbl);
> --
> 2.39.0.314.g84b9a713c41-goog
next prev parent reply other threads:[~2022-12-22 20:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 19:10 [PATCH next] sysctl: expose all net/core sysctls inside netns Mahesh Bandewar
2022-12-22 20:16 ` Soheil Hassas Yeganeh [this message]
2022-12-23 2:12 ` Jakub Kicinski
2022-12-28 18:40 ` Mahesh Bandewar (महेश बंडेवार)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACSApvbGDoO+fwizJK+y-aufi66Zd-xB60-f8KF5WZOJZ8mqcw@mail.gmail.com \
--to=soheil@google.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=mahesh@bandewar.net \
--cc=maheshb@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).