From: Steffen Klassert <steffen.klassert@secunet.com>
To: Petr Wozniak <petr.wozniak@gmail.com>
Cc: <netdev@vger.kernel.org>, <sd@queasysnail.net>,
<herbert@gondor.apana.org.au>, <kuba@kernel.org>,
<horms@kernel.org>, <pabeni@redhat.com>, <edumazet@google.com>,
<davem@davemloft.net>
Subject: Re: [PATCH net v5 0/2] xfrm: fix async crypto (-EINPROGRESS) handling in validate_xmit_xfrm()
Date: Tue, 30 Jun 2026 16:01:52 +0200 [thread overview]
Message-ID: <akPMUICkNLVwrGPl@secunet.com> (raw)
In-Reply-To: <20260621100327.40203-1-petr.wozniak@gmail.com>
On Sun, Jun 21, 2026 at 12:03:25PM +0200, Petr Wozniak wrote:
> This series fixes how the async crypto path (-EINPROGRESS from ->xmit())
> is handled in validate_xmit_xfrm() and its callers.
>
> Patch 1 (previously sent on its own, v1-v4) makes validate_xmit_xfrm()
> return ERR_PTR(-EINPROGRESS) instead of NULL when a packet is stolen by
> async crypto, so __dev_queue_xmit() can tell it apart from a real drop
> and stop reporting -ENOMEM on noqueue/bridge interfaces. v5 also covers
> the GSO segment loop, as Sabrina pointed out.
>
> Patch 2 fixes a use-after-free found while looking at that GSO loop:
> validate_xmit_xfrm() unlinks async-stolen segments but never updates the
> list head ->prev, which validate_xmit_skb_list() later dereferences.
>
> Changes in v5:
> - 1/2: also propagate ERR_PTR(-EINPROGRESS) from the GSO segment loop
> (the 2nd ->xmit() call); v4 only handled the single-skb path. Restore
> the blank line in validate_xmit_skb_list(). Add the missing
> maintainers to Cc. (Sabrina Dubroca)
> - 2/2: new patch -- fix the stale skb->prev use-after-free (also flagged
> by Sashiko)
>
> Changes in v4:
> - Drop bool stolen tracking and the ERR_PTR return in
> validate_xmit_skb_list(); use IS_ERR_OR_NULL() so stolen skbs are
> silently skipped (Sabrina Dubroca)
> - Drop ERR_PTR(-EINPROGRESS) handling in __dev_direct_xmit() (Sabrina Dubroca)
> - Move validate_xmit_skb() return-value comment above the function
> (Sabrina Dubroca)
>
> Changes in v3:
> - validate_xmit_skb_list(): set stolen=true only for -EINPROGRESS
> (Sabrina Dubroca)
>
> Changes in v2:
> - Reset rc to NET_XMIT_SUCCESS only when PTR_ERR(skb) == -EINPROGRESS
> (Sabrina Dubroca)
>
> Petr Wozniak (2):
> xfrm: propagate -EINPROGRESS from validate_xmit_xfrm()
> xfrm: fix stale skb->prev after async crypto steals a GSO segment
>
> net/core/dev.c | 10 ++++++++--
> net/xfrm/xfrm_device.c | 12 ++++++++++--
> 2 files changed, 18 insertions(+), 4 deletions(-)
Series applied, thanks a lot!
next prev parent reply other threads:[~2026-06-30 14:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 6:46 [PATCH net v4] xfrm: propagate -EINPROGRESS from validate_xmit_xfrm() Petr Wozniak
2026-06-04 11:29 ` Sabrina Dubroca
2026-06-21 10:03 ` [PATCH net v5 0/2] xfrm: fix async crypto (-EINPROGRESS) handling in validate_xmit_xfrm() Petr Wozniak
2026-06-21 10:03 ` [PATCH net v5 1/2] xfrm: propagate -EINPROGRESS from validate_xmit_xfrm() Petr Wozniak
2026-06-21 10:03 ` [PATCH net v5 2/2] xfrm: fix stale skb->prev after async crypto steals a GSO segment Petr Wozniak
2026-06-30 14:01 ` Steffen Klassert [this message]
2026-06-21 10:06 ` [PATCH net v4] xfrm: propagate -EINPROGRESS from validate_xmit_xfrm() Petr Wozniak
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=akPMUICkNLVwrGPl@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petr.wozniak@gmail.com \
--cc=sd@queasysnail.net \
/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