Skip to content

Commit 300bf59

Browse files
Daniel Lezcanodavem330
authored andcommitted
[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 <dlezcano@fr.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 075de93 commit 300bf59

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/ipv6/proc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ int snmp6_register_dev(struct inet6_dev *idev)
220220
if (!idev || !idev->dev)
221221
return -EINVAL;
222222

223+
if (idev->dev->nd_net != &init_net)
224+
return 0;
225+
223226
if (!proc_net_devsnmp6)
224227
return -ENOENT;
225228

0 commit comments

Comments
 (0)