mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
net: remove WARN_ON_ONCE() from sk_mc_loop()
[ Upstream commitb8a39a09ae] sk_mc_loop() can be called for sockets that are neither AF_INET nor AF_INET6 (e.g. AF_PACKET sockets when sending packets via raw/packet socket over virtual devices such as VRF or ipvlan). In such cases, sk_family is not AF_INET/AF_INET6 and sk_mc_loop() falls through the switch statement and triggers WARN_ON_ONCE(1). Non-INET sockets do not support IP_MULTICAST_LOOP or IPV6_MULTICAST_LOOP options, so loopback should default to true without generating a warning. Fixes:f60e5990d9("ipv6: protect skb->sk accesses from recursive dereference inside the stack") Reported-by: syzbot+22c3218a6fa219e47321@syzkaller.appspotmail.com Closes: https://lore.kernel.org/netdev/6a72024c.13623e66.bdc14.0019.GAE@google.com/T/#u Signed-off-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20260804152048.2134341-1-edumazet@google.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6fad06bb79
commit
d2adc4e80b
@@ -776,7 +776,6 @@ bool sk_mc_loop(struct sock *sk)
|
||||
return inet6_sk(sk)->mc_loop;
|
||||
#endif
|
||||
}
|
||||
WARN_ON_ONCE(1);
|
||||
return true;
|
||||
}
|
||||
EXPORT_SYMBOL(sk_mc_loop);
|
||||
|
||||
Reference in New Issue
Block a user