[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1371012275-31735-2-git-send-email-gaofeng@cn.fujitsu.com>
Date: Wed, 12 Jun 2013 12:44:35 +0800
From: Gao feng <gaofeng@...fujitsu.com>
To: davem@...emloft.net
Cc: ebiederm@...ssion.com, netdev@...r.kernel.org,
Gao feng <gaofeng@...fujitsu.com>
Subject: [PATCH RESEND 2/2] neigh: disallow un-init_net to change thresh of neigh
thresh and interval are global resources,
only init net can change them.
Signed-off-by: Gao feng <gaofeng@...fujitsu.com>
---
net/core/neighbour.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index e4027ff..8feb382 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2056,6 +2056,12 @@ static int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh)
}
}
+ err = -EPERM;
+ if ((tb[NDTA_THRESH1] || tb[NDTA_THRESH2] ||
+ tb[NDTA_THRESH3] || tb[NDTA_GC_INTERVAL]) &&
+ !net_eq(net, &init_net))
+ goto errout_tbl_lock;
+
if (tb[NDTA_THRESH1])
tbl->gc_thresh1 = nla_get_u32(tb[NDTA_THRESH1]);
--
1.8.1.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists