]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ip6mr: fix tables suspicious RCU usage
authorPaolo Abeni <pabeni@redhat.com>
Sun, 24 Nov 2024 15:40:57 +0000 (16:40 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 28 Nov 2024 09:23:18 +0000 (10:23 +0100)
commitf1553c9894b4dbeb10a2ab15ab1aa113b3b4047c
tree049c4aac59b98105b211c0cfd0cf0e2c1446c927
parent11b6e701bce96f98474084f26821157cb0dccf69
ip6mr: fix tables suspicious RCU usage

Several places call ip6mr_get_table() with no RCU nor RTNL lock.
Add RCU protection inside such helper and provide a lockless variant
for the few callers that already acquired the relevant lock.

Note that some users additionally reference the table outside the RCU
lock. That is actually safe as the table deletion can happen only
after all table accesses are completed.

Fixes: e2d57766e674 ("net: Provide compat support for SIOCGETMIFCNT_IN6 and SIOCGETSGCNT_IN6.")
Fixes: d7c31cbde4bc ("net: ip6mr: add RTM_GETROUTE netlink op")
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/ipv6/ip6mr.c