From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Josef Bacik <josef@toxicpanda.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>
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>
Subject: Re: [PATCH net-next v3 12/15] net: test the skb layouts skb_segment() refuses
Date: Tue, 03 Nov 2026 21:57:54 -0500 [thread overview]
Message-ID: <willemdebruijn.kernel.2b23680b4ca01@gmail.com> (raw)
In-Reply-To: <20261103-b4-skbuff-bug-on-followups-v3-12-54ad0ab57614@toxicpanda.com>
Josef Bacik wrote:
> The GSO KUnit test only checks layouts skb_segment() can segment. Add
> the ones it has to refuse with -EINVAL:
>
> - The non-uniform frag_list with SG on, which used to hit the
> BUG_ON(i >= nfrags) the existing test steps around.
> - A frag_list member that has its own frag_list.
> - An skb whose len counts bytes it doesn't hold. The data runs out on
> a segment boundary, in the middle of a segment, after the last
> frag_list member, and with GSO_BY_FRAGS.
>
> They warn on CONFIG_DEBUG_NET kernels, so run them with the warning
> backtrace suppressed. Also update the comment on the non-uniform case,
> which still says SG would hit that BUG_ON().
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
> - /* TODO: this should also work with SG,
> - * rather than hit BUG_ON(i >= nfrags)
> + /* TODO: this should also work with SG, rather than fail the
> + * i >= nfrags check in skb_segment()
> */
> if (tcase->id == GSO_TEST_FRAG_LIST_NON_UNIFORM)
> features &= ~NETIF_F_SG;
The previous patch also addresses non-SG.
Do you want to run the new tests in both SG and non-SG mode?
>
> SKB_GSO_CB(skb)->max_segs = tcase->max_segs;
> +
> + if (tcase->err) {
> + /* the suppression block doesn't run if it can't be set up */
> + segs = NULL;
> + kunit_warning_suppress(test) {
> + segs = skb_segment(skb, features);
> + }
> + KUNIT_EXPECT_EQ(test, PTR_ERR_OR_ZERO(segs), tcase->err);
> + if (!IS_ERR_OR_NULL(segs))
> + kfree_skb_list(segs);
> + goto free_gso_skb;
> + }
> +
next prev parent reply other threads:[~2026-11-04 2:57 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 2:28 [PATCH net-next v3 00/15] net: skbuff: follow-ups to the BUG_ON() removal Josef Bacik
2026-11-03 2:28 ` [PATCH net-next v3 01/15] net: skbuff: make skb_copy_and_csum_bits() report unreadable frags Josef Bacik
2026-11-03 2:58 ` Mina Almasry
2026-11-03 2:28 ` [PATCH net-next v3 02/15] net: skbuff: add skb_checksum_full() that reports failure Josef Bacik
2026-11-03 2:44 ` Mina Almasry
2026-11-03 17:28 ` Josef Bacik
2026-11-03 2:28 ` [PATCH net-next v3 03/15] net: skbuff: fail checksum validation when the skb can't be checksummed Josef Bacik
2026-11-03 2:28 ` [PATCH net-next v3 04/15] net: skbuff: fail segmentation when a segment " Josef Bacik
2026-11-03 2:36 ` Mina Almasry
2026-11-03 2:28 ` [PATCH net-next v3 05/15] net: skbuff: drop hw csum if trim can't checksum tail Josef Bacik
2026-11-03 2:28 ` [PATCH net-next v3 06/15] net: skbuff: add skb_crc32c_full() that reports failure Josef Bacik
2026-11-03 2:28 ` [PATCH net-next v3 07/15] net: skbuff: let skb_zerocopy() copy a short skb without head_frag Josef Bacik
2026-11-03 2:28 ` [PATCH net-next v3 08/15] net: skbuff: make skb_try_coalesce()'s len unsigned Josef Bacik
2026-11-03 2:28 ` [PATCH net-next v3 09/15] net: skbuff: reject data_len > len in copy_and_csum_dev Josef Bacik
2026-11-03 2:28 ` [PATCH net-next v3 10/15] net: skbuff: reject a negative length in skb_copy_and_csum_bits() Josef Bacik
2026-11-03 2:28 ` [PATCH net-next v3 11/15] net: skbuff: don't run off frag_list in skb_segment() Josef Bacik
2026-11-04 2:53 ` Willem de Bruijn
2026-11-03 2:28 ` [PATCH net-next v3 12/15] net: test the skb layouts skb_segment() refuses Josef Bacik
2026-11-04 2:57 ` Willem de Bruijn [this message]
2026-11-03 2:28 ` [PATCH net-next v3 13/15] xen-netfront: don't BUG() when skb_copy_bits() fails in bounce_skb() Josef Bacik
2026-11-03 6:27 ` Jürgen Groß
2026-11-03 2:28 ` [PATCH net-next v3 14/15] net/tls: don't BUG() on leftover length in __skb_nsg() Josef Bacik
2026-11-03 2:28 ` [PATCH net-next v3 15/15] net: update comments that still describe the skb BUG_ON()s Josef Bacik
2026-11-03 3:02 ` [PATCH net-next v3 00/15] net: skbuff: follow-ups to the BUG_ON() removal Mina Almasry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=willemdebruijn.kernel.2b23680b4ca01@gmail.com \
--to=willemdebruijn.kernel@gmail.com \
--cc=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=david.laight.linux@gmail.com \
--cc=edumazet@kernel.org \
--cc=fmancera@suse.de \
--cc=horms@kernel.org \
--cc=jgross@suse.com \
--cc=josef@toxicpanda.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox