]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ip6mr: fix tables suspicious RCU usage
authorPaolo Abeni <pabeni@redhat.com>
Sun, 24 Nov 2024 15:40:57 +0000 (16:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 12:54:01 +0000 (13:54 +0100)
commit877a5fd85ebe7210a1e96f2ab2955f3dfb5f8e38
tree85515d381fb3df1785c0960f5f47ae2e53b7ad83
parentd0eb14cb8c08b00c36a3d5dc57a6f428b301f721
ip6mr: fix tables suspicious RCU usage

[ Upstream commit f1553c9894b4dbeb10a2ab15ab1aa113b3b4047c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv6/ip6mr.c