Re: [PATCH net 8/8] ipv6: mcast: extend RCU protection in igmp6_send()

From
David Ahern <dsahern@kernel.org>
Date
2025-02-07 20:50:50
Reply to
Eric Dumazet, 2025-02-07
On 2/7/25 6:58 AM, Eric Dumazet wrote:
igmp6_send() can be called without RTNL or RCU being held.

Extend RCU protection so that we can safely fetch the net pointer
and avoid a potential UAF.

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 <redacted>
---
 net/ipv6/mcast.c | 31 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 16 deletions(-)
Reviewed-by: David Ahern <dsahern@kernel.org>
Thread (25 messages) 25 messages, 4 authors, last reply 2025-02-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help