mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-20 16:30:53 +00:00
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@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
170d6f9954
commit
dc25c676f5
@ -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]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user