diff options
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
-rw-r--r-- | net/unix/sysctl_net_unix.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c index b34b5b9792f0..8800604c93f4 100644 --- a/net/unix/sysctl_net_unix.c +++ b/net/unix/sysctl_net_unix.c | |||
@@ -34,6 +34,10 @@ int __net_init unix_sysctl_register(struct net *net) | |||
34 | if (table == NULL) | 34 | if (table == NULL) |
35 | goto err_alloc; | 35 | goto err_alloc; |
36 | 36 | ||
37 | /* Don't export sysctls to unprivileged users */ | ||
38 | if (net->user_ns != &init_user_ns) | ||
39 | table[0].procname = NULL; | ||
40 | |||
37 | table[0].data = &net->unx.sysctl_max_dgram_qlen; | 41 | table[0].data = &net->unx.sysctl_max_dgram_qlen; |
38 | net->unx.ctl = register_net_sysctl(net, "net/unix", table); | 42 | net->unx.ctl = register_net_sysctl(net, "net/unix", table); |
39 | if (net->unx.ctl == NULL) | 43 | if (net->unx.ctl == NULL) |