diff options
author | Denis V. Lunev <den@openvz.org> | 2007-11-30 08:21:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:54:24 -0500 |
commit | b854272b3c732316676e9128f7b9e6f1e1ff88b0 (patch) | |
tree | c90c74b9ec068453881f1173da4c57d6bb00a7d9 /net/decnet/dn_table.c | |
parent | ad5d20a63940fcfb40af76ba06148f36d5d0b433 (diff) |
[NET]: Modify all rtnetlink methods to only work in the initial namespace (v2)
Before I can enable rtnetlink to work in all network namespaces I need
to be certain that something won't break. So this patch deliberately
disables all of the rtnletlink methods in everything except the
initial network namespace. After the methods have been audited this
extra check can be disabled.
Changes from v1:
- added IPv6 addrlabel protection
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'net/decnet/dn_table.c')
-rw-r--r-- | net/decnet/dn_table.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c index fda0772fa215..a3bdb8dd1fb2 100644 --- a/net/decnet/dn_table.c +++ b/net/decnet/dn_table.c | |||
@@ -463,12 +463,16 @@ static int dn_fib_table_dump(struct dn_fib_table *tb, struct sk_buff *skb, | |||
463 | 463 | ||
464 | int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb) | 464 | int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb) |
465 | { | 465 | { |
466 | struct net *net = skb->sk->sk_net; | ||
466 | unsigned int h, s_h; | 467 | unsigned int h, s_h; |
467 | unsigned int e = 0, s_e; | 468 | unsigned int e = 0, s_e; |
468 | struct dn_fib_table *tb; | 469 | struct dn_fib_table *tb; |
469 | struct hlist_node *node; | 470 | struct hlist_node *node; |
470 | int dumped = 0; | 471 | int dumped = 0; |
471 | 472 | ||
473 | if (net != &init_net) | ||
474 | return 0; | ||
475 | |||
472 | if (NLMSG_PAYLOAD(cb->nlh, 0) >= sizeof(struct rtmsg) && | 476 | if (NLMSG_PAYLOAD(cb->nlh, 0) >= sizeof(struct rtmsg) && |
473 | ((struct rtmsg *)NLMSG_DATA(cb->nlh))->rtm_flags&RTM_F_CLONED) | 477 | ((struct rtmsg *)NLMSG_DATA(cb->nlh))->rtm_flags&RTM_F_CLONED) |
474 | return dn_cache_dump(skb, cb); | 478 | return dn_cache_dump(skb, cb); |