Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Gao feng and committed by
David S. Miller
dc25c676 170d6f99

+6
+6
net/core/neighbour.c
··· 2049 2049 } 2050 2050 } 2051 2051 2052 + err = -ENOENT; 2053 + if ((tb[NDTA_THRESH1] || tb[NDTA_THRESH2] || 2054 + tb[NDTA_THRESH3] || tb[NDTA_GC_INTERVAL]) && 2055 + !net_eq(net, &init_net)) 2056 + goto errout_tbl_lock; 2057 + 2052 2058 if (tb[NDTA_THRESH1]) 2053 2059 tbl->gc_thresh1 = nla_get_u32(tb[NDTA_THRESH1]); 2054 2060