projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
170d6f9
)
neigh: disallow un-init_net to change thresh of neigh
author
Gao feng
<gaofeng@cn.fujitsu.com>
Thu, 20 Jun 2013 02:01:34 +0000
(10:01 +0800)
committer
David S. Miller
<davem@davemloft.net>
Thu, 20 Jun 2013 04:13:24 +0000
(21:13 -0700)
thresh and interval are global resources,
only init net can change them.
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/neighbour.c
patch
|
blob
|
history
diff --git
a/net/core/neighbour.c
b/net/core/neighbour.c
index 86f9b165bbba69482f151010d05ad8fe6243b293..2569ab2cafbe0e557b65a68166d932118a28ffc9 100644
(file)
--- a/
net/core/neighbour.c
+++ b/
net/core/neighbour.c
@@
-2049,6
+2049,12
@@
static int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh)
}
}
+ err = -ENOENT;
+ 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]);