Article View: linux.kernel.netdev
Article #24035[PATCH net] udp: unlink GSO segments before per-segment receive
From: Xiang Mei
Date: Sun, 29 Nov 2026 01:48
Date: Sun, 29 Nov 2026 01:48
76 lines
13458 bytes
13458 bytes
udp_queue_rcv_skb() and udpv6_queue_rcv_skb() split a GSO packet into
segments and pass them on one by one, but each segment still points to
the next one via skb->next. If the receiver sends the skb back out (the
GTP echo responder does), the transmit path sends the whole chain, and
the loop then uses segments it no longer owns:
Oops: general protection fault, ... address 0xdffffc0000000021: ...
KASAN: null-ptr-deref in range [0x0000000000000108-0x000000000000010f]
RIP: 0010:__xfrm_policy_check2.constprop.0 (./include/net/xfrm.h:1311)
Call Trace:
<IRQ>
udpv6_queue_rcv_one_skb (./include/net/xfrm.h:1353 net/ipv6/udp.c:820)
udpv6_queue_rcv_skb (net/ipv6/udp.c:899 net/ipv6/udp.c:885)
udp6_unicast_rcv_skb (net/ipv6/udp.c:1037)
ip6_protocol_deliver_rcu (net/ipv6/ip6_input.c:479)
ip6_input_finish (net/ipv6/ip6_input.c:538)
ip6_input (... net/ipv6/ip6_input.c:549)
ipv6_rcv (... net/ipv6/ip6_input.c:351)
__netif_receive_skb_one_core (net/core/dev.c:6451)
process_backlog (net/core/dev.c:6564 net/core/dev.c:6915)
__napi_poll (net/core/dev.c:8001)
net_rx_action (net/core/dev.c:8064 net/core/dev.c:8221)
handle_softirqs (kernel/softirq.c:669)
do_softirq.part.0 (kernel/softirq.c:569)
</IRQ>
...
__local_bh_enable_ip (kernel/softirq.c:561 kernel/softirq.c:473)
__dev_queue_xmit (... net/core/dev.c:5135)
packet_sendmsg (net/packet/af_packet.c:3177 net/packet/af_packet.c:3209)
__sock_sendmsg (net/socket.c:800 net/socket.c:818)
__sys_sendto (net/socket.c:2283)
__x64_sys_sendto (net/socket.c:2290 net/socket.c:2286)
do_syscall_64 (arch/x86/entry/syscall_64.c:61 arch/x86/entry/syscall_64.c:89)
entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
Kernel panic - not syncing: Fatal exception in interrupt
Clear skb->next before passing each segment on, as the similar segment
loops in ip_finish_output_gso() and ip6_finish_output_gso_slowpath_drop()
already do.
Cc: stable@vger.kernel.org
Fixes: cf329aa42b66 ("udp: cope with UDP GRO packet misdirection")
Reported-by: co+24977a105aa177de@bugs.sh
Signed-off-by: Xiang Mei <xmei5@asu.edu>
---
net/ipv4/udp.c | 1 +
net/ipv6/udp.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 2e5562f353f8..a4cd085e3855 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2476,6 +2476,7 @@ static int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
__skb_push(skb, -skb_mac_offset(skb));
segs = udp_rcv_segment(sk, skb, true);
skb_list_walk_safe(segs, skb, next) {
+ skb_mark_not_on_list(skb);
__skb_pull(skb, skb_transport_offset(skb));
udp_post_segment_fix_csum(skb);
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index a6886a0432f9..fabd097f6a32 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -893,6 +893,7 @@ static int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
__skb_push(skb, -skb_mac_offset(skb));
segs = udp_rcv_segment(sk, skb, false);
skb_list_walk_safe(segs, skb, next) {
+ skb_mark_not_on_list(skb);
__skb_pull(skb, skb_transport_offset(skb));
udp_post_segment_fix_csum(skb);
--
2.43.0
Technical Details
Message-ID:
<20261129014848.3203646-1-xmei5@asu.edu>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373330-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373330-linux-kernel-netdev=dewy.ru
From: xmei5@asu.edu (Xiang Mei)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net] udp: unlink GSO segments before per-segment receive
Date: Sat, 28 Nov 2026 18:48:48 -0700
Organization: Usenet Network
Message-ID: <20261129014848.3203646-1-xmei5@asu.edu>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="1078469"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:UvFIrfoXvImf+nqzn1z5uLAIJk4= sha256:ElItQ+iHCsXOcyUM86A3058KQZa6+29ZeAiHNe1TyUs=
sha1:53gRP7MjCQfgZOVsG2qZg71jKRA= sha256:RL7Uk0VWfDfDbJ5WO+fMCMJvtwFQXfPFygrS3C0xKO8=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 75468125F8A; Sun, 29 Nov 2026 04:49:14 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.15
X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31
tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=asu.edu
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id Tn97BJxgMU9D;
Sun, 29 Nov 2026 04:49:07 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-373330-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=asu.edu
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 36E65125F90; Sun, 29 Nov 2026 04:48:58 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id A4F8327947; Sun, 29 Nov 2026 01:48:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1795916933;
b=adpV0J75KfJykQGlhmfxGcYOvQ8FBNnbf3U2OT54DyCgJbhm98u3U7jNRUW4ngzzFGOR
VgpNPw6bYDZH7mFnthxYduJJAqL6e6KOQVu3JGj+nTl7Y8PCPfxV/frMrxVEetOZfcRsO
B+mlBcI+2ssFU6vOVte5/jBSRFGtPrpScJzSJBLyH3W4fZgp/TR6TP5w4QqqRAFmWNi7F
VIgKFAqZiLr35kwyA+YvISyUUHn6u8vJb4YspA4pbeJ8mgQt+74F4h4uPaGTx0zLAdfh8
9xaoPSNQjlB6Rh4RuPZEWj6Ux+bHzNT1ZIfgcf6Y/uT0Y6yF8FJalnYjP2GnY5nBrXw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795916933;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:
List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
bh=nfUUQRHvRBYy8evvbW4bk9a9VnEsFUgZXfE/s5QPNWk=;
b=h6O0CPyIffhGTh98VQO6mdfPUsHtzlsTBHIow5wZeQW4LyIY0mz9I9Kserk7868MOMHC
ShGUyNOpCL8CimxM+w2QL5veqOyxYk9gJAHOkU8Hg8JZ7SBCPfhg8ClGXRlDQ4EulpV9f
l7D6h8m1vDtcpRoOfrs3+2JX1n1N7G01KThr2kOWOoym7dcJBSdgRGAD83rvbP47w2jG6
1NvbClkcD5u9TKPSRCIXLBTNRXBKti0ATRle4igrMrgN4uD96orbWE+OLV9NPzSHmFK/9
rJmn9afXLk5LEg3TdUvUWTJ3/UZeQJXhmT0NG1ockQTiDcd8BSUF92SDC60RDwDTQeg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=asu.edu header.i=@asu.edu header.a=rsa-sha256 header.s=google header.b="gh/68HR/";
dmarc=pass header.from=asu.edu;
spf=pass smtp.mailfrom=asu.edu;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F23B606A68C;
Sun, 29 Nov 2026 01:48:53 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=asu.edu header.i=@asu.edu header.a=rsa-sha256 header.s=google header.b=gh/68HR/
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.44
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795916932;
b=W1IY04KKl85qeGQrheyJFKZdnwn+i6i5AH0xOmLrjYcX+l0rQ7RFvNmGGzOM8uBbORAe
J3V6dXkfBIMjok1KRdjjemk2/gmByr0K0S3rslg6ppVQjEHsH+LeMyLvpj14f/K8mi0TN
F6gUTjc6msg9MFambdr5ZvU6cpWodjeIM9EkZ8mfRZIp4aKfQPrY4cbGblTJvjWNqlBdS
ekNKZ9y0YGjYChY975KSbGjGcLZ9noumc+xZqp+wrIRzmLWSydoJW2S2A3L+kditVMaiH
L03ZSvL/+iKiw8FJcaAuDfsONcoZLiPHmXVkEbid/y06pEFjne2VKLZrly0MwuG3nVw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795916932;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding;
bh=nfUUQRHvRBYy8evvbW4bk9a9VnEsFUgZXfE/s5QPNWk=;
b=Mwxb2OfxklJjtHt/46kO8XTXQfkVkgvHBPRXjxXWML2Zl8kZQKS7redkNDukTwC3LAoz
BY2IUy7VX5JXA/wQ514xdAXc2lX7mQAtDZuPoLKJYB7i1LNKEkpIk6jYIXX2Tig2s/MTt
FxcK7Rp6aWPKWL9ZhqUUd+qtVuK+KwQFHKBKzXR2DvDS8nfjElPJk8GhWhJjCBknu3UIL
aGVXKoGjMkGdE10ir8kZp4/SiThLiUUHG3s2/BelgemNymKmMjIziSecKsjIcyzNQBN7N
PjDGzW1BsMqzTr+70oDdQjN7tzTDlM/3TTQtqnEAxv008fYyDxo4E8AIztYEhoSWs8w==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=asu.edu;
spf=pass smtp.mailfrom=asu.edu;
dkim=pass header.d=asu.edu header.i=@asu.edu header.a=rsa-sha256 header.s=google header.b="gh/68HR/";
arc=none smtp.remote-ip=74.125.82.44
X-Received: from mail-dl1-f44.google.com (mail-dl1-f44.google.com [74.125.82.44])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id E923C606A33D
for <netdev@vger.kernel.org>; Sun, 29 Nov 2026 01:48:51 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E923C606A33D
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=asu.edu
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=asu.edu
X-Received: by mail-dl1-f44.google.com with SMTP id a92af1059eb24-15dd124bbe7so14784988c88.1
for <netdev@vger.kernel.org>; Sat, 28 Nov 2026 17:48:51 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=asu.edu; s=google; t=1795916931; x=1796521731; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=nfUUQRHvRBYy8evvbW4bk9a9VnEsFUgZXfE/s5QPNWk=;
b=gh/68HR/HU6jvD7WABWGjIwRPHdbX1U67jEQk/RdSBSHuMbK/zwQK6yli0zYCRRIeN
ZrSgjLeztANTC4hSg1/krHmBFyB1OEoDW+EFsJawnNCiJZDDW5vzMu0sV1JxYCWF1SCi
7+buCLAriyENTRjbFFd8G8Evyv7E4HLSIbrSQvpCTiny/GGC9KFWbGemP4hkLSjnLOXK
6R1MU4OMeMSLyFerELoDIGP6FPff25sAYvjQiKuavLf+R/rffDkQY8ZuWxKeiizOeIG0
Kx9sgi+mLOe2WbiS7DfSpOu9lNL5IrpmE3ETcUnQoKwNajM4waZJJmVN+t/XTu5Csngp
wKxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795916931; x=1796521731;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=nfUUQRHvRBYy8evvbW4bk9a9VnEsFUgZXfE/s5QPNWk=;
b=vxUtr8muOg3iwB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6VOwmMlhZw
DUDAOzYlSbJaxjRHtWE/semPRREOXOZ2Jgy8WqXOW9cZACcla4dJWaV7Y5JO6mD+w2C0
X-Received: by 2002:a05:693c:61cc:b0:386:98bf:c6c1 with SMTP id 5a478bee46e88-38698bfddfemr27288325eec.26.1795916931009;
Sat, 28 Nov 2026 17:48:51 -0800 (PST)
X-Received: from p1.. (209-147-138-4.nat.asu.edu. [209.147.138.4])
by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38567ea2cc5sm78104349eec.29.2026.11.28.17.48.50
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sat, 28 Nov 2026 17:48:50 -0800 (PST)
X-Cc: netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
stable@vger.kernel.org,
co+24977a105aa177de@bugs.sh,
Xiang Mei <xmei5@asu.edu>
X-Mailer: git-send-email 2.43.0
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list