]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ipv6: mcast: add RCU protection to mld_newpack()
authorEric Dumazet <edumazet@google.com>
Wed, 12 Feb 2025 14:10:21 +0000 (14:10 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 12:50:09 +0000 (13:50 +0100)
commite8af3632a7f2da83e27b083f787bced1faba00b1
treea751a12192a0bd40d4502ad9a61bf5ef6fcca51d
parenta9319d800b5701e7f5e3fa71a5b7c4831fc20d6d
ipv6: mcast: add RCU protection to mld_newpack()

[ Upstream commit a527750d877fd334de87eef81f1cb5f0f0ca3373 ]

mld_newpack() can be called without RTNL or RCU being held.

Note that we no longer can use sock_alloc_send_skb() because
ipv6.igmp_sk uses GFP_KERNEL allocations which can sleep.

Instead use alloc_skb() and charge the net->ipv6.igmp_sk
socket under RCU protection.

Fixes: b8ad0cbc58f7 ("[NETNS][IPV6] mcast - handle several network namespace")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20250212141021.1663666-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv6/mcast.c