# 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 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/02/11318599
- Thread: https://ratatoskr.run/netdev/2025/02/11318509/t.md

```text
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>

```
