[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACSApvbGDoO+fwizJK+y-aufi66Zd-xB60-f8KF5WZOJZ8mqcw@mail.gmail.com>
Date: Thu, 22 Dec 2022 15:16:25 -0500
From: Soheil Hassas Yeganeh <soheil@...gle.com>
To: Mahesh Bandewar <maheshb@...gle.com>
Cc: Netdev <netdev@...r.kernel.org>,
Mahesh Bandewar <mahesh@...dewar.net>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH next] sysctl: expose all net/core sysctls inside netns
On Thu, Dec 22, 2022 at 2:10 PM Mahesh Bandewar <maheshb@...gle.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@...emloft.net>
> Cc: Eric Dumazet <edumazet@...gle.com>
> Cc: Jakub Kicinski <kuba@...nel.org>
> Cc: Paolo Abeni <pabeni@...hat.com>
> Cc: Soheil Hassas Yeganeh <soheil@...gle.com>
> Signed-off-by: Mahesh Bandewar <maheshb@...gle.com>
Acked-by: Soheil Hassas Yeganeh <soheil@...gle.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
Powered by blists - more mailing lists