]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
neighbour: fix various data-races
authorEric Dumazet <edumazet@google.com>
Thu, 19 Oct 2023 12:21:04 +0000 (12:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Nov 2023 08:35:27 +0000 (09:35 +0100)
commitfa28949c72db100b448cb9a3e6c1cfa59a8fefd0
treec7657f6b198016f03045f20195e21b6d279f44b9
parentc166dd51b628702bda57c18afbfc3c8887f09844
neighbour: fix various data-races

[ Upstream commit a9beb7e81bcb876615e1fbb3c07f3f9dba69831f ]

1) tbl->gc_thresh1, tbl->gc_thresh2, tbl->gc_thresh3 and tbl->gc_interval
   can be written from sysfs.

2) tbl->last_flush is read locklessly from neigh_alloc()

3) tbl->proxy_queue.qlen is read locklessly from neightbl_fill_info()

4) neightbl_fill_info() reads cpu stats that can be changed concurrently.

Fixes: c7fb64db001f ("[NETLINK]: Neighbour table configuration and statistics via rtnetlink")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20231019122104.1448310-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/neighbour.c