Skip to content

Commit 6b754d7

Browse files
Mahesh Bandewardavem330
authored andcommitted
sysctl: expose all net/core sysctls inside netns
All were not visible to the non-priv users inside netns. However, with 4ecb900 ("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> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3d759e9 commit 6b754d7

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

net/core/sysctl_net_core.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,6 @@ static __net_init int sysctl_core_net_init(struct net *net)
643643

644644
for (tmp = tbl; tmp->procname; tmp++)
645645
tmp->data += (char *)net - (char *)&init_net;
646-
647-
/* Don't export any sysctls to unprivileged users */
648-
if (net->user_ns != &init_user_ns) {
649-
tbl[0].procname = NULL;
650-
}
651646
}
652647

653648
net->core.sysctl_hdr = register_net_sysctl(net, "net/core", tbl);

0 commit comments

Comments
 (0)