public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Fred Li <dracodingfly@gmail•com>
To: pabeni@redhat•com
Cc: aleksander.lobakin@intel•com, andrii@kernel•org, ast@kernel•org,
	bpf@vger•kernel.org, daniel@iogearbox•net, davem@davemloft•net,
	dracodingfly@gmail•com, edumazet@google•com, haoluo@google•com,
	hawk@kernel•org, john.fastabend@gmail•com, jolsa@kernel•org,
	kpsingh@kernel•org, kuba@kernel•org,
	linux-kernel@vger•kernel.org, linux@weissschuh•net,
	martin.lau@linux•dev, mkhalfella@purestorage•com, nbd@nbd•name,
	netdev@vger•kernel.org, sashal@kernel•org, sdf@google•com,
	song@kernel•org, yonghong.song@linux•dev,
	herbert@gondor•apana.org.au
Subject: Re: [PATCH v2 1/2] net: Fix skb_segment when splitting gso_size mangled skb having linear-headed frag_list whose head_frag=true
Date: Wed,  3 Jul 2024 20:21:53 +0800	[thread overview]
Message-ID: <20240703122153.25381-1-dracodingfly@gmail.com> (raw)
In-Reply-To: <fd44c91884d0ebf3625ac85a1049679a987f8f79.camel@redhat.com>

> I must admit I more than a bit lost in the many turns of skb_segment(),
> but the above does not look like the correct solution, as it will make
> the later BUG_ON() unreachable/meaningless.

Sorry, the subsequent BUG_ON maybe should be removed in this patch, because
for skb_headlen(list_skb) > len, it will continue splitting as commit 13acc94eff122 
(net: permit skb_segment on head_frag frag_list skb) does.

> 
> Do I read correctly that when the BUG_ON() triggers:
> 
> list_skb->len is 125
> len is 75
> list_skb->frag_head is true
>

yes, it's correct.
list_skb->len is 125
gso_size is 75, also the len in the BUG_ON conditon
list_skb->head_frag is true
 
> It looks like skb_segment() is becoming even and ever more complex to
> cope with unexpected skb layouts, only possibly when skb_segment() is
> called by some BPF helpers.
> 
> Thanks,
> 
> Paolo

I'll wait for more suggestions from others.

Thanks

Fred Li



  reply	other threads:[~2024-07-03 12:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-26  6:55 [PATCH v2 2/2] test_bpf: Introduce an skb_segment test for frag_list whose head_frag=true and gso_size was mangled Fred Li
2024-06-26  6:55 ` [PATCH v2 1/2] net: Fix skb_segment when splitting gso_size mangled skb having linear-headed frag_list whose head_frag=true Fred Li
2024-07-02  9:23   ` Paolo Abeni
2024-07-03 12:21     ` Fred Li [this message]
2024-07-06 14:26       ` Willem de Bruijn
2024-07-08 14:31         ` [PATCH] net: linearizing skb when downgrade gso_size Fred Li
2024-07-09 15:53           ` Willem de Bruijn
2024-07-09 20:16             ` Herbert Xu
2024-07-09 21:29               ` Willem de Bruijn
2024-07-10 23:06                 ` Herbert Xu
2024-07-12  8:17             ` Fred Li
2024-07-17  5:35         ` [PATCH v3] " Fred Li
2024-07-17 16:32           ` Willem de Bruijn
2024-07-18  7:42             ` Fred Li
2024-07-19  2:46         ` [PATCH v4] bpf: Fixed a segment issue " Fred Li
2024-07-19 18:22           ` Willem de Bruijn
2024-07-22  3:08         ` [PATCH bpf v5] bpf: Fixed " Fred Li
2024-07-22 16:29           ` Willem de Bruijn
2024-07-24 13:37             ` Fred Li
2024-07-25 10:09               ` Daniel Borkmann
2024-06-26  6:55 ` [PATCH v2 0/2] net: Fix BUG_ON for segment frag_list with mangled gso_size and head_frag is true Fred Li

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=20240703122153.25381-1-dracodingfly@gmail.com \
    --to=dracodingfly@gmail$(echo .)com \
    --cc=aleksander.lobakin@intel$(echo .)com \
    --cc=andrii@kernel$(echo .)org \
    --cc=ast@kernel$(echo .)org \
    --cc=bpf@vger$(echo .)kernel.org \
    --cc=daniel@iogearbox$(echo .)net \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=haoluo@google$(echo .)com \
    --cc=hawk@kernel$(echo .)org \
    --cc=herbert@gondor$(echo .)apana.org.au \
    --cc=john.fastabend@gmail$(echo .)com \
    --cc=jolsa@kernel$(echo .)org \
    --cc=kpsingh@kernel$(echo .)org \
    --cc=kuba@kernel$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux@weissschuh$(echo .)net \
    --cc=martin.lau@linux$(echo .)dev \
    --cc=mkhalfella@purestorage$(echo .)com \
    --cc=nbd@nbd$(echo .)name \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=sashal@kernel$(echo .)org \
    --cc=sdf@google$(echo .)com \
    --cc=song@kernel$(echo .)org \
    --cc=yonghong.song@linux$(echo .)dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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