🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #11835

[PATCH net] sctp: linearize GSO skb when frag_list skbs are shared

#11835
From: Xin Long
Date: Thu, 05 Nov 2026 18:21
42 lines
12224 bytes
When the iptables TEE target copies an SCTP GSO packet with pskb_copy(),
the new skb shares the frag_list skbs by reference (their refcounts are
bumped but they are not deep-copied). The SCTP receive path skips
linearization for uncloned GSO packets, so it later operates directly on
the shared frag_list entries. If skb_copy_bits() encounters a length
discrepancy or invalid offset in such a shared frag_list skb, it returns
-EFAULT, which triggers a BUG_ON in __pskb_pull_tail().

Extend the linearization condition to also cover GSO packets whose
frag_list head is shared, so SCTP obtains an exclusive, contiguous
copy of the data before processing it.

Fixes: 4c2f24549644 ("sctp: linearize early if it's not GSO")
Reported-by: syzbot+f15a6eff7a53f6eb7dc3@syzkaller.appspotmail.com
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/sctp/input.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/sctp/input.c b/net/sctp/input.c
index 9494cfa51106..db3c7818724b 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -117,8 +117,13 @@ int sctp_rcv(struct sk_buff *skb)
 	 * it's better to just linearize it otherwise crc computing
 	 * takes longer.
 	 */
-	if (((!is_gso || skb_cloned(skb)) && skb_linearize(skb)) ||
-	    !pskb_may_pull(skb, sizeof(struct sctphdr)))
+	if (!is_gso || skb_cloned(skb) ||
+	    (skb_has_frag_list(skb) && skb_shared(skb_shinfo(skb)->frag_list))) {
+		if (skb_linearize(skb))
+			goto discard_it;
+	}
+
+	if (!pskb_may_pull(skb, sizeof(struct sctphdr)))
 		goto discard_it;
 
 	/* Pull up the IP header. */
-- 
2.47.1
Technical Details
Message-ID: <9997493edadfe9faa713c73de9c70e36cee9ffea.1793902911.git.lucien.xin@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357539-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357539-linux-kernel-netdev=dewy.ru
From: lucien.xin@gmail.com (Xin Long)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net] sctp: linearize GSO skb when frag_list skbs are shared
Date: Thu,  5 Nov 2026 13:21:51 -0500
Organization: Usenet Network
Message-ID: <9997493edadfe9faa713c73de9c70e36cee9ffea.1793902911.git.lucien.xin@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3700650"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:zm9mKf9FKmKDIKOZt5x23LK8hYY= sha256:g1OIKtHS16GG27mS9l4MJtkz4urcD+RkD+MOP8wTkWM=
	sha1:FeYOzXBiR3gHWtSwqudsa54bvfg= sha256:BuTHBlzy/4dNfoBhieQVcyTwsWKNH40Rz/sv6ZwCAB4=
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 D1B6F113050; Thu,  5 Nov 2026 21:26:03 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, 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] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
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 TLsQGBw7-cPQ;
	Thu,  5 Nov 2026 21:25:58 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-357539-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 8BA3E11303F; Thu,  5 Nov 2026 21:25:48 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 926CE27360; Thu,  5 Nov 2026 18:21: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=1793902915;
	b=B5+qqSXS4I25r2sS/r0VYs7vC7YXqhj10RpRRR55CT2WA+MQWri3+OTLnaHviJ5XBBnj
	 w6xprGABQdPvAlg/hLcYgGpTIDwSgr1N9mZJrNJcFAwUsO0bgVTatm9uCuiZz3B2vjpUO
	 FAPrdanY0Myw6XHTLMgD7uqMO4l5iYAjKdhqzMAKRMxOh/pjW3lXkdI10AgK/P2jx2SLw
	 3Rc5v4exjTD3erwVzFjYaoLSj5SU8lY+XFihkVLn1xBBv/RRfcbvryoFq7nnjYy84uC8u
	 wcCH+sXeIT5C0w+K454NZiGUdCdVaHt2m+Oj3J7RFA0BP/YacPpElikbzdV59ZIeJAw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793902915;
	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=Xe5bXUoSjdyUS5Z/rgEUMSGbH/+ArslOY+WPxBZy8QA=;
	b=DRa5i9jUDudkN1nz/BWuehFztI9G4kzZC5zmw7HW8iAx7Tisbfo50NZXNDesxyuDEIwM
	 Wp4Vj+NZ3s4sCJ/H6t3IFTkLpzU6dZk5LatNzO/bqrRaQMw0uyZWFVOqU9lJowZdw5SRq
	 zsRHO0+LRWRys9xlWBtpdkOA32BAN3KD4Bj7oqC38zLcup41GMKjnNxn8DMviH4pg9NyF
	 WmYrYT2PuMcp8WyKRtZm5OoxpU8bDZX84Dzb4U9LJfry/VEr5ZW8fqOnhxM735hJvtVgL
	 hI5EBu5lD1Iqn+Gxtw+C9uWYODeMf2ZRU3h/9KPvECmioXQEqL/dxicpLdug298wNuw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=T2h0DhmR;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	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 67687606A32C;
	Thu,  5 Nov 2026 18:21:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=T2h0DhmR
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.176
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793902914;
	b=allWg6IeQ0J9OhtX3p/ZWjTwx2rWrq+gjiyr5Ni7Y7ylFT4HYEuoenZOUzGEkzpRr2wx
	 K8c+SFGlJLlKpYjV6jfzaVEnlARGKt0q5NZATSezceZT9qwXiue5hC2tNSL+Sa0dTGBPj
	 j5aP5k8zZURCRrI/l8UQ1vv44OzG7A7Iiu48sF8t3XSLXATIwV/3th8HS2twLnhScmbA1
	 XfldWGoi4T3Y71tbcaqNNnvf60h4J2D2tNuBzayiljxQfsEzKuY+dUbk0YNi+qqdHhJTz
	 awGJ0YrV+CKDhbP1BjnWGarYLvbl1RQpLD2T6q0WSUSxr7jK9jWHgLLPDpXi0pWWOrA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793902914;
	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=Xe5bXUoSjdyUS5Z/rgEUMSGbH/+ArslOY+WPxBZy8QA=;
	b=sShQVmAlOcUIVG0/lcYZ+Fe632s8LIIgjMJoqdM2GytgtKXfcUIUiufsoXPiCRFexfKH
	 itaxSDImnvjxegMyrb1XlP09B9W8INr9lKPDPt5dsVL/CtxHdihMx+PbA0S5grgrJtarh
	 vmp5CuV7sQpX6eDvRWLDbv6cyxTRz1LhaVatrMKXualCYhfO7f9w8zST3KhmBQ3KEb7oM
	 CY19VZ1JAqqkgocNAhQHhqPKdIsUKRIOErID0cw4jgEcPrVk4wzI9cQVTQInyBcCWQwio
	 GSDGRfkFV6/MMzA2IvpemcLXxNmpWKDbdjQUButQjfhb/RvMZ7zRzxOeg2IIwYqqO+Q==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=T2h0DhmR;
	arc=none smtp.remote-ip=209.85.128.176
X-Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com [209.85.128.176])
	(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 3BC82606A329
	for <netdev@vger.kernel.org>; Thu,  5 Nov 2026 18:21:54 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3BC82606A329
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-8b0a921ee46so22091567b3.2
        for <netdev@vger.kernel.org>; Thu, 05 Nov 2026 10:21:54 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1793902913; x=1794507713; 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=Xe5bXUoSjdyUS5Z/rgEUMSGbH/+ArslOY+WPxBZy8QA=;
        b=T2h0DhmR02KOcmPE3YSD3Y18dAo1C69YstjJVJS3mpOsZgFM0hiT0zJagopeMurV4s
         GKfG+7h8mU4t12KFU+dSIRGQhSKjfRX3zLKEFKB5kK9JCGQKDNm6iqBr/d+1R017glvl
         UGZIrRfWrMGhkno2kGGr0FleUY43JQdOCx28g/W+lezrqyPTldeTrq7Vkj0+MNkgeeyG
         wxIKpxytgEeY7Hubcpo8l6VkECHQuFLvnSO7cGtkRbfLhamCQSUdRPdQWW/dJk4eOVpB
         e2wN+OIY2gCwwGR6wPMF+99UjlqIgnmh3ji07XoaG57SZb3AKC3QweXNbObTGDb3M47K
         Za7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793902913; x=1794507713;
        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=Xe5bXUoSjdyUS5Z/rgEUMSGbH/+ArslOY+WPxBZy8QA=;
        b=olces0XuuNKwGYlvUMBE8IMkkxSmH4ohD7ocqlMnxgW4tJoR6Kva7rWpwV5NTQM+W4
         3Po3IFyoitcTbao154CfaUUTC2dSVYwa63p6ueOKgA7t/Nr4J6trsaPjGzF+utHTScse
         56pElqDfYGRT/9OeMylaIxlokpmnY9ZLWUudHZi0ucJiPQsypG1KdKwcChazSf8rsPhN
         AXBsCRoJ+5F54pQnTMOCCesEh4xB+9l6gn1BcGBnRF8id745ME4HW2p3ST9Ze5Tjd+SF
         XsmIRfleXQBrctTbedyxbyl5LecnGgzrGAMXMgWMkpJujndq1OdH0JdeHy2aqxsmpwop
         eD3g==
X-Gm-Message-State: APuU4Z968Egy6pg5/2vbHVs7rr0dfbpKGEOSGS/bRa8IlnITz743ubfj
	72fOdbX/hWtJqmIGc6Xs0I99qtEcC++P0uM5oDdc5E2BKwH28MBsuTARpIjqd+Qv
X-Gm-Gg: AYBFou3s0JhBlj795cQpndWJRYRxDZV1dhdNSh61S1TiDnpk/PsMMZPlMMckdLya99d
	IBZx77VcLBUEgaepv+7FOUHmolI+UHSHKZQMD1itK0wAZW9Cqt7jjVVVRnC5KL6cQ8+UiZGLoCH
	x3l8Vk0ATC7XT8Li53meSvLo2FmRFfHVpJfqgOAl99uKREpTDflkeAWgSOJiOUAaDw4aKNX4wXl
	H9Az+EkvuhGSjLB00qwAeHyY5thftmDojjocfMTVRXVP2ktraQWmuqxfra3fRWR7f43XI/NMzmd
	W5fly82WXHvtrzR9Qp65jQv6RasLsZcwrSO2dDn9Chko4UC+EfMpOy5BSCybRcWMI0zLIJN+VDl
	JcBY4VUc8RA80xJZVQ5lIOz1SNC5KdDUReKejEfwdHFUJ1pgleoMHlxdP+a/4R6ddcEjHb/zZIK
	Cekv62Zos3czR51YiQYldQWNw4JOuPqtYJjsbRI7HONifslNDw2MRkleWH+2lHf/t5WGioQRaWs
	DDvHERJDgq9R6KeJR/Q4upMZSWGKq0Q1FS+FfYf5onwpdfsJJtblNDCOlBdhTzkewjeLpv35Biw
	cAcvx0H0ZZxtc5SVF3pj4cpEDf0/EKP5y+LOzJYo3BTcYsPpb2wdJTXTybes5tOtU7qzBqspECN
	Ns9RGBSK/p2HB/sQM0tJIp4XaZqRTjnMxMvBhfuRV6A8vjB4/GyHDThiePjtKrjxy1wjF3iS3BK
	KnVuRDC4QBRMOYmPRO
X-Received: by 2002:a05:690c:e3ce:b0:8b3:343d:af6 with SMTP id 00721157ae682-8b3343d0bcemr9671047b3.91.1793902913216;
        Thu, 05 Nov 2026 10:21:53 -0800 (PST)
X-Received: from wsfd-netdev58.anl.eng.rdu2.dc.redhat.com ([66.187.232.140])
        by smtp.gmail.com with ESMTPSA id 00721157ae682-8b33f7f084fsm1284817b3.20.2026.11.05.10.21.52
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 05 Nov 2026 10:21:52 -0800 (PST)
X-Cc: davem@davemloft.net,
	kuba@kernel.org,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
X-Mailer: git-send-email 2.47.1
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