🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12503

Re: [PATCH] net: skbuff: don't BUG() when skb_copy_bits() fails in __pskb_pull_tail

#12503
From: shao.mingyin
Date: Sat, 07 Nov 2026 15:22
44 lines
10138 bytes
On Sat, Nov 07, 2026 at 10:04:25AM -0500, Willem de Bruijn wrote:
> In the series, Josef reported
>
>   Two BUG_ON()s are left on purpose.  __pskb_pull_tail() and
>   skb_pull_rcsum() have callers that can't otherwise fail, so they don't
>   check the return.  Some of them would carry on and BUG() somewhere
>   else, or push back a pull that never happened.  Those need their
>   callers fixed first and will come as separate series.

Yes, and this is that separate series for __pskb_pull_tail();
skb_pull_rcsum() is still untouched.

The return contract is not new.  __pskb_pull_tail() already returns NULL
today when skb_frags_readable() is false or pskb_expand_head() fails; the
patch only stops BUG()ing on the third failure, skb_copy_bits() failing on
a frag_list child.  That failure returns before the commit block at the
bottom, so the skb is left exactly as it was (apart from a possible head
realloc) and there is no half-done pull to push back.

Of the direct callers that ignore the return:

- skb_condense() is the one that can reach it.  It runs on receive skbs
  that can carry a frag_list, i.e. the GRO-merged skb from
  skb_gro_receive() that the patch is about; it now checks the return and
  keeps truesize.

- xen-netfront pulls pull_to - skb_headlen() only when nr_frags is already
  MAX_SKB_FRAGS.  On failure nothing is committed, so nr_frags is still
  MAX_SKB_FRAGS and the check right below drops the skb with -ENOENT.
  That is the same path the existing NULL returns already take.

- niu, mlx5 and ftmac100 cannot reach it: delta is bounded by
  skb->data_len at the call site (niu caps the pull at sizeof(*rh) +
  VLAN_ETH_HLEN, mlx5 clamps to skb->data_len, ftmac100 pulls ETH_HLEN or
  the frame length), and their skbs are built from page frags only, never
  with a frag_list child, so skb_copy_bits() cannot fail.

skb_pull() propagates the same NULL as before; on the GRO path the
protocol handlers get at the data through pskb_may_pull().  A length
mismatch is a driver bug, and DEBUG_NET_WARN_ON_ONCE() reports it.

Thanks,
Shao
Technical Details
Message-ID: <20261107232258297K0a2CCYzVIOXLNuYCYeq6@zte.com.cn>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358417-linux-kernel-netdev=dewy.ru
References: 20261107215051120CrLjo_cGXWfdJxXk4ae8s@zte.com.cn,willemdebruijn.kernel.703e96022339@gmail.com

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-358417-linux-kernel-netdev=dewy.ru
From: shao.mingyin@zte.com.cn
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] net: skbuff: don't BUG() when skb_copy_bits() fails in __pskb_pull_tail
Date: Sat, 7 Nov 2026 23:22:58 +0800 (CST)
Organization: Usenet Network
Message-ID: <20261107232258297K0a2CCYzVIOXLNuYCYeq6@zte.com.cn>
References: 20261107215051120CrLjo_cGXWfdJxXk4ae8s@zte.com.cn,willemdebruijn.kernel.703e96022339@gmail.com
MIME-Version: 1.0
Content-Type: text/plain;
	charset="UTF-8"
Injection-Info: usenet.network;
	logging-data="4132400"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:444cOgn3+4XzSj1MLwBcgXTEyws= sha256:qI6MduWYPQo1nfhDLpH2jf7I17tGr1ICn9pKfF7YSaw=
	sha1:wfcMjVW/1mMLOufUDB8GbHkWk30= sha256:9KpCS9fuYUs389Xs3Vvs0kQ59mR4z8akRL+XTu9Ae/4=
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 BEF32113449; Sat,  7 Nov 2026 18:44:13 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.95
X-Spam-Status: No, score=-2.95 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=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, UNPARSEABLE_RELAY=0.001]
	autolearn=ham autolearn_force=no
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 gJn4ESBld2T0;
	Sat,  7 Nov 2026 18:44:08 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-358417-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=zte.com.cn
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 7143B113448; Sat,  7 Nov 2026 18:44:05 +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 1EABDA59F1; Sat,  7 Nov 2026 15:23:50 +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=1794064994;
	b=aKXpDICGHfMFI6e+NjRj+tgtNxBcrH18f4eApIg9dhTP04/jZRollaF57Ur5UUQ9Wbla
	 3lA/zFP3Q/qKVa6T72VVzHjt5n2pZClvaoAW/IigoBXA9REtpSGHbWQBHnVfivv/oWHM4
	 8Gx5vW0vrac30Zp/Wawqry+Xn0waO0+C4jJLO+ts0mNzjpXcTQAtAU7UxjBJYc9evzV2S
	 gHrRcahlGlAS1f4LqETvLc3/zFT3GQ18YtdtoYPXScOEDkFBL9eZ7f/iyw6q8h84tHjue
	 iy5O70iTtdWBvDkx2fgBnC1g5q2ZQeS2l9fKgyF1EnUPAQV1qSxkshw+7KfzFeJETOQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794064994;
	h=X-Original-To:Received:DMARC-Filter:Received:Received:Received:
	 X-Zmail-TransId:X-Mailer:Message-ID:In-Reply-To:References:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:Mime-Version:From:To:Cc:
	 Subject:Content-Type:X-MAIL:X-TLS:X-ENVELOPE-SENDER:X-SOURCE-IP:
	 X-CLEAN:X-Fangmail-Anti-Spam-Filtered:X-Fangmail-MID-QID;
	bh=rmV/drJwFzjGVIpMrdq/RYdfM4Dnd81hhWt/4N/tmbU=;
	b=pLhmaOcrdCJsZMuXhh1owS47NHlHOihGSD8aWvRLcde2rI3AaA1hW5UgWR7SMqt6hM6L
	 YgU0aL9+XCTua5BuXcKoVjosM30EDGGgPXaRTtSFDrKHD4vdgMlRdQwTdr2stoTqDXWud
	 HKlXCEISTDDNMJlnf9JdTCxOkbbci3yDUJsUMitDqUq8VODorLPm3JK4lEHm0Zrbv6QDy
	 5GOtEftg/Pv+I55mtaQ+Ifu3K8DHVilz/x8hGOd20M7ZW6OT1PYCDlHQWJYgHbc02ENPh
	 q4wcI98q+DAY487Wd4Nlir6O6VCygGQS7SaECq+tctmAyanfX4gOzBNzHJj4XnrzuKQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=pass header.from=zte.com.cn;
	spf=pass smtp.mailfrom=zte.com.cn;
	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 D0B70606B89E;
	Sat,  7 Nov 2026 15:23:14 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=183.62.165.209
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794064989;
	b=MTq7TEWwCEdE6ibyozNe14ct3w8BkbHgMDwMOska8CmPByrzLNiAzA/VTkTDIDlCbbc6
	 2hps66yBvkmwDFxxOkMYZFDM5AKruE/TlGhilPkjPCFsN59g9bBsX/N/k6dLVSLRnU8mb
	 jizc3fek0Giw0uoM+3EZn8Ghf5HZxSeutL1/euSRn/6pN/aXQB05gN02OeoaCi5xOusff
	 BEl2Y5S+H750LAxRHACytS4qOP7DQ6+jbM3hrYX8wKMaInYeUCX+UxI/GEkHi8DdkRtzr
	 4CE7HHGdiKwM5g1+5Um7U3AZ69YYZ6id7dKVB1nVeK08qSxEg30xP9v1KumvpTnn3fg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794064989;
	h=DMARC-Filter:Received:Received:Received:X-Zmail-TransId:X-Mailer:
	 Message-ID:In-Reply-To:References:Date:Mime-Version:From:To:Cc:
	 Subject:Content-Type:X-MAIL:X-TLS:X-ENVELOPE-SENDER:X-SOURCE-IP:
	 X-CLEAN:X-Fangmail-Anti-Spam-Filtered:X-Fangmail-MID-QID;
	bh=rmV/drJwFzjGVIpMrdq/RYdfM4Dnd81hhWt/4N/tmbU=;
	b=vJgFahtAthJxytfWfILxqg7MH8VhwyGa9yDkKjPs5LPIRyRqjzqFszudo6z+Er+Tm8rr
	 iKAgkpBAGVOu9p+rXDUShbTRtltVVOIWeIzjVrvxoqrkgoaVCu8PZl+hTxzxp12XuBYMW
	 wX0AH6fduLkQJXDyNZajybW7F9CD96iByEAyx6eWgqgrK2u5uZEO7sWBtr7g9Mb/QBtCU
	 L6EdY4HPQrpQlF04WTI3FZKHaOzASziyWd1Ol+s1a73Krg8Vuh43VLcIfh71+Pp9p23xZ
	 m+w6o+KaxEnP0ZscAMUaFO9moti3MJTy/cpKWBEJHTjZDOEjwXM/Xr5JMTVXGp3gg7w==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=zte.com.cn;
	spf=pass smtp.mailfrom=zte.com.cn;
	arc=none smtp.remote-ip=183.62.165.209
X-Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 881E2606A9FC;
	Sat,  7 Nov 2026 15:23:07 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 881E2606A9FC
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zte.com.cn
X-Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by mxct.zte.com.cn (FangMail) with ESMTPS id 4jMKYc30Jdz51Sm4;
	Sat, 07 Nov 2026 23:23:00 +0800 (CST)
X-Received: from xaxapp04.zte.com.cn ([10.99.98.157])
	by mse-fl1.zte.com.cn with SMTP id 6A7FMutY052234;
	Sat, 7 Nov 2026 23:22:56 +0800 (+08)
	(envelope-from shao.mingyin@zte.com.cn)
X-Received: from mapi (xaxapp04[null])
	by mapi (Zmail) with MAPI id mid32;
	Sat, 7 Nov 2026 23:22:58 +0800 (CST)
X-Zmail-TransId: 2afb6aef42527d1-331d1
X-Mailer: Zmail v1.0
X-In-Reply-To: <willemdebruijn.kernel.703e96022339@gmail.com>
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
X-Cc: <josef@toxicpanda.com>, <horms@kernel.org>, <almasrymina@google.com>,
        <linux-kernel@vger.kernel.org>
X-MAIL: mse-fl1.zte.com.cn 6A7FMutY052234
X-TLS: YES
X-ENVELOPE-SENDER: shao.mingyin@zte.com.cn
X-SOURCE-IP: 10.5.228.132 unknown Sat, 07 Nov 2026 23:23:00 +0800
X-CLEAN: YES
X-Fangmail-Anti-Spam-Filtered: true
X-Fangmail-MID-QID: 6AEF4254.000/4jMKYc30Jdz51Sm4