netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] udp_tunnel: properly deal with xfrm gro encap.
@ 2025-03-18 18:47 Paolo Abeni
  2025-03-19 14:35 ` Willem de Bruijn
  0 siblings, 1 reply; 7+ messages in thread
From: Paolo Abeni @ 2025-03-18 18:47 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, David Ahern, Eric Dumazet, Jakub Kicinski,
	Simon Horman, Willem de Bruijn

The blamed commit below does not take in account that xfrm
can enable GRO over UDP encapsulation without going through
setup_udp_tunnel_sock().

At deletion time such socket will still go through
udp_tunnel_cleanup_gro(), and the failed GRO type lookup will
trigger the reported warning.

We can safely remove such warning, simply performing no action
on failed GRO type lookup at deletion time.

Reported-by: syzbot+8c469a2260132cd095c1@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=8c469a2260132cd095c1
Fixes: 311b36574ceac ("udp_tunnel: use static call for GRO hooks when possible")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/ipv4/udp_offload.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index 088aa8cb8ac0c..2e0b52ae665bc 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -110,14 +110,7 @@ void udp_tunnel_update_gro_rcv(struct sock *sk, bool add)
 		cur = &udp_tunnel_gro_types[udp_tunnel_gro_type_nr++];
 		refcount_set(&cur->count, 1);
 		cur->gro_receive = up->gro_receive;
-	} else {
-		/*
-		 * The stack cleanups only successfully added tunnel, the
-		 * lookup on removal should never fail.
-		 */
-		if (WARN_ON_ONCE(!cur))
-			goto out;
-
+	} else if (cur) {
 		if (!refcount_dec_and_test(&cur->count))
 			goto out;
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-03-20 14:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-18 18:47 [PATCH net-next] udp_tunnel: properly deal with xfrm gro encap Paolo Abeni
2025-03-19 14:35 ` Willem de Bruijn
2025-03-19 15:49   ` Paolo Abeni
2025-03-19 17:44     ` Willem de Bruijn
2025-03-19 22:15       ` Paolo Abeni
2025-03-20 13:50         ` Willem de Bruijn
2025-03-20 14:44     ` Sabrina Dubroca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).