netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gao feng <gaofeng@cn.fujitsu.com>
To: davem@davemloft.net
Cc: ebiederm@xmission.com, netdev@vger.kernel.org,
	Gao feng <gaofeng@cn.fujitsu.com>
Subject: [PATCH v2 4/4] neigh: don't leak default parms to uninitial netns
Date: Fri, 14 Jun 2013 10:06:47 +0800	[thread overview]
Message-ID: <1371175607-1405-4-git-send-email-gaofeng@cn.fujitsu.com> (raw)
In-Reply-To: <1371175607-1405-1-git-send-email-gaofeng@cn.fujitsu.com>

Only allow initial net namespace to get default parms
through netlink.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
 net/core/neighbour.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 5e0fe89..3bb6115 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2094,7 +2094,8 @@ static int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb)
 		if (tidx < tbl_skip || (family && tbl->family != family))
 			continue;
 
-		if (neightbl_fill_info(skb, tbl, NETLINK_CB(cb->skb).portid,
+		if (net_eq(net, &init_net) &&
+		    neightbl_fill_info(skb, tbl, NETLINK_CB(cb->skb).portid,
 				       cb->nlh->nlmsg_seq, RTM_NEWNEIGHTBL,
 				       NLM_F_MULTI) <= 0)
 			break;
-- 
1.8.1.4

  parent reply	other threads:[~2013-06-14  2:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14  2:06 [PATCH v2 1/4] neigh: no need to call lookup_neigh_parms in neigh_parms_alloc Gao feng
2013-06-14  2:06 ` [PATCH v2 2/4] neigh: only allow init_net to change the default neigh_parms Gao feng
2013-06-14  2:06 ` [PATCH v2 3/4] neigh: disallow un-init_net to change thresh of neigh Gao feng
2013-06-14  2:06 ` Gao feng [this message]
2013-06-20  1:05   ` [PATCH v2 4/4] neigh: don't leak default parms to uninitial netns David Miller
2013-06-20  1:18     ` Gao feng
2013-06-20  1:29       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371175607-1405-4-git-send-email-gaofeng@cn.fujitsu.com \
    --to=gaofeng@cn.fujitsu.com \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).