sysctl: expose all net/core sysctls inside netns
Subsystems (2)
PATCH 1/1 sysctl: expose all net/core sysctls inside netns
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
--- net/core/sysctl_net_core.c | 5 ----- 1 file changed, 5 deletions(-)
net/core/sysctl_net_core.c +0 -5
@@ -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);
Signature · 1 line
2.39.0.314.g84b9a713c41-goog
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Quoted 9 lines · On Wed, 4 Jan 2023 18:28:42 -0800 you wrote:
All were not visible to the non-priv users inside netns. However, with
4ecb90090c84("sysctl: allow override of/proc/sys/netwithCAP_NET_ADMIN"), these vars are protected from getting modified. A proc withcapable(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[...]
Here is the summary with links:
- [(repost),next] sysctl: expose all net/core sysctls inside netns
https://git.kernel.org/netdev/net-next/c/6b754d7bd007
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html