From: Daniel Lezcano Date: Wed, 5 Mar 2008 18:46:31 +0000 (-0800) Subject: [NETNS][IPV6] proc - protect snmp6 from non-init_net calls X-Git-Tag: v2.6.26-rc1~1138^2~481 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=300bf591deca8d108799e70e9300dc31765643e3;p=linux-2.6-omap-h63xx.git [NETNS][IPV6] proc - protect snmp6 from non-init_net calls This patchset avoids creation of the /proc entry for snmp6 when the call is made from a network namespace different from the init_net. Signed-off-by: Daniel Lezcano Signed-off-by: David S. Miller --- diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index 5ba7ae849d0..2453f2229ef 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c @@ -220,6 +220,9 @@ int snmp6_register_dev(struct inet6_dev *idev) if (!idev || !idev->dev) return -EINVAL; + if (idev->dev->nd_net != &init_net) + return 0; + if (!proc_net_devsnmp6) return -ENOENT;