Netdev List
 help / color / mirror / Atom feed
From: tanjingguo <tanjingguo@huawei.com>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Chenzhe <chenzhe@huawei.com>, "malin (R)" <malin89@huawei.com>,
	michenyuan <michenyuan@huawei.com>,
	cenxianlong <cenxianlong@huawei.com>,
	"steffen.klassert@secunet.com" <steffen.klassert@secunet.com>,
	"herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"dsahern@kernel.org" <dsahern@kernel.org>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"horms@kernel.org" <horms@kernel.org>
Subject: Re: [PATCH net] xfrm: esp: restore combined single-frag length gate
Date: Thu, 21 May 2026 12:06:14 +0000	[thread overview]
Message-ID: <b43087ad8088496eb18d19bfd80790f8@huawei.com> (raw)

Hi, Sabrina.


Thanks for the review.

I have sent the v2 patch with below link:
https://lore.kernel.org/netdev/ab4c5808478d48978292c318d85c4484@huawei.com/T/#u

> note: patches to xfrm should go through the "ipsec" tree, not "net"
> (with the subject prefix [PATCH ipsec]).

Thanks also for pointing out that, I have sent v2 with correct prefix.

> If I'm following correctly, the issue comes from the
> skb_len_add(tailen)? So esp_output_tail() does skb_page_frag_refill()
> with [what we checked in esp_output_head() + tailen]?

Yes, your understanding is correct. esp_output_head() appends tailen to
the skb before esp_output_tail() reaches the out-of-place allocation path.
In IPv4 this happens through skb_len_add(skb, tailen), and in IPv6 through
the explicit skb->len / skb->data_len / skb->truesize updates. After that,
esp_output_tail() computes:

  allocsize = ALIGN(skb->data_len, L1_CACHE_BYTES);

and uses that size for skb_page_frag_refill(). So the page-frag fast path
needs to validate the combined post-trailer data length, not skb->data_len
and tailen independently.

> nit: there's already an allocsize variable in this function. no
> shadowing please.

You are right. The new allocsize variable in v1 shadows the existing variable.
In v2 I wrote the combined-length check directly, avoiding the shadowed variable.

Thanks

             reply	other threads:[~2026-05-21 12:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21 12:06 tanjingguo [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-05-21  7:52 [PATCH net] xfrm: esp: restore combined single-frag length gate tanjingguo
2026-05-21 10:56 ` Sabrina Dubroca

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=b43087ad8088496eb18d19bfd80790f8@huawei.com \
    --to=tanjingguo@huawei.com \
    --cc=cenxianlong@huawei.com \
    --cc=chenzhe@huawei.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=malin89@huawei.com \
    --cc=michenyuan@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sd@queasysnail.net \
    --cc=steffen.klassert@secunet.com \
    /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