Skip to content

Commit

Permalink
[NETNS][IPV6] proc - protect snmp6 from non-init_net calls
Browse files Browse the repository at this point in the history
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 <dlezcano@fr.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Daniel Lezcano authored and David S. Miller committed Mar 5, 2008
1 parent 075de93 commit 300bf59
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ipv6/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 300bf59

Please sign in to comment.