From: Andrii Tereshchenko <opensource@andrii.net>
To: Piyus Kedia <piyus@iiitd.ac.in>
Cc: Steffen Klassert <steffen.klassert@secunet.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Christian Hopps <chopps@chopps.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] xfrm: iptfs: bound the reassembly copy by the buffer it copies into
Date: Fri, 20 Nov 2026 01:06:45 -0800 [thread overview]
Message-ID: <bee0a5cf-dada-479b-8417-dc3621109a15@mid.andrii.net> (raw)
In-Reply-To: <20261119142308.3272570-1-piyus@iiitd.ac.in>
On Thu, 19 Nov 2026 19:53:08 +0530, Piyus Kedia wrote:
> Bound both copies by the tailroom actually available and abandon the
> reassembly otherwise, which is how the function already handles a stream it
> cannot complete.
The inner packet that reaches this check can be valid: its first piece
arrives in an outer packet whose data is shared as page frags, and a
later piece in one that has to be copied. After skb_linearize() the
tailroom is only the slack of that reallocation, so the check drops the
packet whenever the piece is larger than the slack.
On ipsec master with this patch, a test that sends a 1200-byte inner
packet that way, 450 bytes and then 750, and a 100-byte packet after
it, shows no panic, but only the 100-byte packet is delivered. The
other is counted in XfrmInBufferError.
I had a fix for the same overrun and have posted it now, with
Reported-by and Closes for your mail:
https://lore.kernel.org/all/70d0cc8d-e2ff-4293-a416-eaf2705a0b9c@mid.andrii.net/
It makes room with pskb_expand_head() before linearizing, for the frag
data and for the rest of the inner packet, and abandons only when that
allocation fails. The same test gets both packets.
next prev parent reply other threads:[~2026-11-20 9:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 14:23 Piyus Kedia
2026-11-19 14:28 ` netdev-bot+sinfo
2026-11-20 9:06 ` Andrii Tereshchenko [this message]
2026-11-23 14:39 ` netdev-bot+sashiko
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=bee0a5cf-dada-479b-8417-dc3621109a15@mid.andrii.net \
--to=opensource@andrii.net \
--cc=chopps@chopps.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=piyus@iiitd.ac.in \
--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
all inboxes | Powered by JetHome®