Article View: linux.kernel.netdev
Article #6019[PATCH net-next v2 15/15] net: update comments that still describe the skb BUG_ON()s
From: Josef Bacik
Date: Wed, 21 Oct 2026 13:46
Date: Wed, 21 Oct 2026 13:46
56 lines
13940 bytes
13940 bytes
The skbuff BUG_ON() conversions left a few comments behind:
- bpf_skb_net_grow() says skb_segment() BUG()s on a frag_list with
head_frag set at the downgraded MSS. It fails the segmentation and
the packet is dropped, which is still why the skb gets linearized.
- The skb_to_sgvec() kernel-doc doesn't list the -EINVAL that
__skb_to_sgvec() returns when @offset and @len run past the end of
the skb.
No functional change.
Acked-by: Mina Almasry <almasrymina@google.com>
Assisted-by: LLM
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
net/core/filter.c | 6 +++---
net/core/skbuff.c | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 3ee1a093337e..f5bce0dc43fe 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3696,9 +3696,9 @@ static int bpf_skb_net_grow(struct sk_buff *skb, u32 off, u32 len_diff,
shinfo->gso_segs = 0;
/* Due to header growth, MSS needs to be downgraded.
- * There is a BUG_ON() when segmenting the frag_list with
- * head_frag true, so linearize the skb after downgrading
- * the MSS.
+ * Segmenting a frag_list with head_frag true at the new MSS
+ * fails and the packet gets dropped, so linearize the skb
+ * after downgrading the MSS.
*/
if (!(flags & BPF_F_ADJ_ROOM_FIXED_GSO)) {
skb_decrease_gso_size(shinfo, len_diff);
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index c5e28a52114b..e0c8f2f6bfac 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -5551,8 +5551,9 @@ __skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len,
*
* Fill the specified scatter-gather list with mappings/pointers into a
* region of the buffer space attached to a socket buffer. Returns either
- * the number of scatterlist items used, or -EMSGSIZE if the contents
- * could not fit.
+ * the number of scatterlist items used, -EMSGSIZE if the contents
+ * could not fit, or -EINVAL if @offset and @len run past the end of
+ * the skb.
*/
int skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
{
--
2.55.0
Technical Details
Message-ID:
<20261021-b4-skbuff-bug-on-followups-v2-15-2aa780a03524@toxicpanda.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-350040-linux-kernel-netdev=dewy.ruReferences:
<20261021-b4-skbuff-bug-on-followups-v2-0-2aa780a03524@toxicpanda.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-350040-linux-kernel-netdev=dewy.ru
From: josef@toxicpanda.com (Josef Bacik)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v2 15/15] net: update comments that still describe
the skb BUG_ON()s
Date: Wed, 21 Oct 2026 13:46:59 +0000
Organization: Usenet Network
Message-ID: <20261021-b4-skbuff-bug-on-followups-v2-15-2aa780a03524@toxicpanda.com>
References: <20261021-b4-skbuff-bug-on-followups-v2-0-2aa780a03524@toxicpanda.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="4159079"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:rkTvL2e1tbTIYHdzp1xyJR5vwoo= sha256:1Gjssq5Sm6GUxJQKHtFGBWDAHScLNFBNQl52T0knGz8=
sha1:Sr9jsHZtLmy3NRbyXxzHfYUhicg= sha256:86RniiQokKzjhd3s1B5lK4P+Re4lM6rRC1RS4htQGx8=
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 BE5D6111021; Wed, 21 Oct 2026 16:55:10 +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, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
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=toxicpanda.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 XAOVrDHiqeCS;
Wed, 21 Oct 2026 16:55: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-350040-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=toxicpanda.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 181A6111010; Wed, 21 Oct 2026 16:54:59 +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 E3EA661BF2; Wed, 21 Oct 2026 13:48:07 +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=1792590459;
b=KOkM1AjBIxuRyKo0Lb7X0BpKPcjCwX7EJBoXcqJChi7hugdWLZoU9eCF6tvjXpAlIwKw
mVDoEWeXhUjZjguSe19Tu7j8wl5+hQxPSiO5w6Lw+FoiHWmy7zrg6oO+TDv0zHjERSuwk
gul3pA/nbvTaJ4FrddJWMjia8bA9ZbPMJJA8wgGoA1Qw2TRRiTWUtQIwSEVuhGzaXSD8a
BNbaCfk2zKvLkoT6nA4n4HfCq+MjU8/MYv9KdLok/4iifMvcIyIsegL++topfmXqnaiqb
uilvIrLKCCmhUPWf8p/Vs8vSmNBCmMp54zlT+4+s1Eub6PINfJ6hxLxu3Nfe355Y6aQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792590459;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id:
List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding:
Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
X-Developer-Signature:X-Developer-Key;
bh=B3Vx6nCjfDKI1O0Rv8fJf2F45AGRs7XGpGz0epefQ+g=;
b=3Lwxd+gtxIr81srcm3frE9iITalf3kLwFCwmSlRPvEkVneu1ajjUXIIfgNUEy3SqLp9J
g/EdRLJIJ7Y/+pxtW555wv2n6hq+U6XTRzGvmALnWXlKqmaquhlh4ubVCHAxO4p2VS6dR
GqPLwDFS+4v6oZQlQ3AUGAmGTaCbtJI3KRQ7/DJ7MUttcHKZLzVKuXn8c+vwKMenumKql
SatPZ2OHKautUkMhk/BNMbzmcm+gKngsPOjeTU+vI6zqcM/r8Ob4xO9vnK+Qvm9vknHuS
GaM7ugaUVqNNtqS8//ONxilOEVlQMYOGdTCeJ84c0BJ4gy7ATvTDPOGVi5gLGxe89bw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=toxicpanda.com header.i=@toxicpanda.com header.a=rsa-sha256 header.s=google header.b=hJJ59iRH;
dmarc=none header.from=toxicpanda.com;
spf=pass smtp.mailfrom=toxicpanda.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 47FEE60A2605;
Wed, 21 Oct 2026 13:47:39 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=toxicpanda.com header.i=@toxicpanda.com header.a=rsa-sha256 header.s=google header.b=hJJ59iRH
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.178
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792590458;
b=5HyUQaeUcPHF57G84qpl2aSgzAW2N1+IID4GzhbT/8iSIewlYZq9e3Xw1pMuyj0Q4HJy
f/U+66+gnb9CqI2VSOa5kAQwDJ3BCGFz1KKUPBysXqiVeaGwSyLO1ufcIHgs/iZMO3ShJ
uxDlhoUptIk/flnBA6uMjzauEmA77PKZIDTs4EXsK8vuazL6bZRu7VAxUlZiWzPC4XSl1
g7GJnByIrZYzRFOAVmX/KLt+8eNSDnyg+Jem4enxz6czzF0gfPpPnPxaaWuvr3qFuAJlT
/LjtFsUMUuadAK82uJ0rgEASFDyUwLSnepaL4KwVTQQL5QINWV61ElRyeU7itBvE6Cw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792590458;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:
Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
X-Developer-Signature:X-Developer-Key;
bh=B3Vx6nCjfDKI1O0Rv8fJf2F45AGRs7XGpGz0epefQ+g=;
b=UCo0zTfkHB0NQw8yVBxWJsg2skpVYfaRLloooQsu0Om0oyBiAQlJtdUd3QuFxzZuGATY
NIQufZk681vLeYv1yLTCgiBdvxxohrlTknJcxd3c5vJ0DQsKkZg3P4DHHO/odPdSMI3gs
N7mRhU/uoxjQMzfb9DlJ1MTYy2n0bh0XMY5hl2f7F8dfOIaw8VRgy6flVJIMa3LzYCwv2
lBPOQnpyg0vpCaUh1QRjwCFjjkcoVYlKbLMnfBIvGcCaB4V9roxQ6r13/Hg5SNV/+tPXh
mji9Utr9Li0qtrVW6chaNeRkflPrjT63UBZ/LYY+JiJ+J3qm7UTSnSSyVCr0NEs918Q==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=none header.from=toxicpanda.com;
spf=pass smtp.mailfrom=toxicpanda.com;
dkim=pass header.d=toxicpanda.com header.i=@toxicpanda.com header.a=rsa-sha256 header.s=google header.b=hJJ59iRH;
arc=none smtp.remote-ip=209.85.128.178
X-Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com [209.85.128.178])
(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 0F59D606A31A
for <netdev@vger.kernel.org>; Wed, 21 Oct 2026 13:47:37 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0F59D606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=toxicpanda.com
X-Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-8ae8607e8afso5101717b3.3
for <netdev@vger.kernel.org>; Wed, 21 Oct 2026 06:47:37 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=toxicpanda.com; s=google; t=1792590457; x=1793195257; darn=vger.kernel.org;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:content-type:mime-version:subject:date:from:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=B3Vx6nCjfDKI1O0Rv8fJf2F45AGRs7XGpGz0epefQ+g=;
b=hJJ59iRHC30A1gTQEDDDJVoWYsaG51zZ0HYS7C+ZOOzLNVAelcvR10wRjWsY9ejH3Z
wC3hyzj2R+YckUSh1v8I1lPXjZLv1pZHyIwdZ980uL+nKX+qKSwB59KdlJkEsBRE6QYP
V+BwsHpB3//5jRd/RY8u9WCduv0+JjzSe6wDFNWm2AFKR5Yo3qAcYvURTDcT4I+iAV1I
PfEIYvl7tQxRj10Br6pEjSE6BpgCZgMLEJZQDahTuiNqgNwWf3wE17HUnkEzYq6V9hBs
sm8GJrQHoxJUkpYinHbCMQUg5RploqWOK9VOAf7XD3YDhPnLKcHiWbG4IBZwDZ7mkovY
C5jQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792590457; x=1793195257;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:content-type:mime-version:subject:date:from:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=B3Vx6nCjfDKI1O0Rv8fJf2F45AGRs7XGpGz0epefQ+g=;
b=WSP5dPDK+EZ7WC7c8/1W6GDX6B+3qFYH3w4uopt3O0n12FOik+60Y3LsL1HawQqK7y
DbfdeHaqjNIEc+LFpvZeVIAPXFMOJFvZp26eX+lx/E39OnEnc525B2Ucbm3HPr+1jtN5
kSjG31VBiQQ1xKwA/9o96sJajT/SihipgXu6ZuHlotHJwANiiHLVuEhl4QfWsqil5FpA
Df98Ovd0Qau03UeCHp715b97H5CoGclNO/K7WC9OCfB2QzF1/eAihpIL7VITV/DgEF0u
7UA7BOpneeOFZmNHFMhZPz/cuvCfsDCap2ZoCxbTOq511bu6iXSwGLABKbnaT5+x2JI6
d/lg==
X-Forwarded-Encrypted: i=1; AKwUvBzUTfnE1xi+ne5rj0KunZL78AZDx6sygXThR8aK/X8yY2vqOFKycgUSPUI+mtHfX3UIlK62uU8=@vger.kernel.org
X-Gm-Message-State: AFq9FYLTmfyeKKFQQlM6KxbeIaySEpuUDzi5JgOZAm4KNj+xRc7Z9HCj
YWn/wCn28ps6AOZML5hGKpNiBu8qVDsAEHK4dp2UUPw+8DpmZ//TmrLnqOmQdNUMa3g=
X-Gm-Gg: AYBFou0gx36Mnx3E+h2gFmI5PpdrizpIEsKTsAJEf83m+ip9jHnnY5E2T076dzL3Yp9
5dwTLMDC45LWRCmcGe/lTr0563JGW8EsGP1daYSqpiamZ1o60ehyCRNXQTbbc+4V5LYAVn1auVY
MgAFCsuZk9BP1OSFx2mnSbtheOZsDz5/kd1oykFOljy88BV1WTmQ/sQveQED5+0f14xkAV4F2Th
wO0ATy6+7RnnGumOM1APK4/JKwWJDQsSB0FG7jl5TMPP7iafeNqApUspOdtwd3iwt/Uh1a3XArp
HN2CuTWN6kkBG0P+azp4a/GhLqIEDHfr5P6j5V9wC+WXza8aER4D0u5h343rFua3WaVYk7MpXJ9
BfyjR+cWWotGMOQ/z0oHFH+OngvcZmwO24ZZ5BKvHY70zNN3GLjUIjUtFAj+dIE28afTYNdQU1W
cNCzzq+PnGtkPoSG1Q2oV4XCMKb73cdc6ItLgAvjTePPfvKKcybf8OpZvTgl8uFX7Ygmk5RTRjU
+D/Er3050bme6AZTLsR6Q3r39hRvq4fp3S7Es2rrkh10he86Tpp3j+8/YckR1vC1iiL3w+w
X-Received: by 2002:a05:690c:4:b0:873:5c6b:a314 with SMTP id 00721157ae682-8b134389b4dmr10867637b3.66.1792590457017;
Wed, 21 Oct 2026 06:47:37 -0700 (PDT)
X-Received: from toxicpanda.com ([153.61.196.250])
by smtp.gmail.com with ESMTPSA id 00721157ae682-8b13018e0d1sm11045597b3.41.2026.10.21.06.47.36
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 21 Oct 2026 06:47:36 -0700 (PDT)
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-In-Reply-To: <20261021-b4-skbuff-bug-on-followups-v2-0-2aa780a03524@toxicpanda.com>
X-Cc: Juergen Gross <jgross@suse.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Fernando Fernandez Mancera <fmancera@suse.de>,
Mina Almasry <almasrymina@google.com>,
David Laight <david.laight.linux@gmail.com>, netdev@vger.kernel.org,
xen-devel@lists.xenproject.org, Josef Bacik <josef@toxicpanda.com>
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openssh-sha256; t=1792590424; l=2172;
i=josef@toxicpanda.com; h=from:subject:message-id;
bh=MDGe2ZQJ+rI3P7PzLeUdDmFI72t2b7q58f2qUsQ4Bag=;
b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgUBr36M/n0nWN0DNbnxwzIiCZez6MG
JiruuNaSCI/zXsAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA
QBAD74Tlz2UL8T7L2mQyY7NisozlhPe3QQxIgCRdFLU8kx33xd6A5QYzW2kATM5/cjWZtxWiPe3
SKnGmgkQI4gA=
X-Developer-Key: i=josef@toxicpanda.com; a=openssh;
fpr=SHA256:C8kOX2QUJCMqnCX+KEeoqRAjLo9L+ELOSH2NSAJHqGA