From: Steffen Klassert <steffen.klassert@secunet.com>
To: Qi Tang <tpluszz77@gmail.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Florian Westphal <fw@strlen.de>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, David Ahern <dsahern@kernel.org>,
<netdev@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH v3] xfrm: hold dev ref until after transport_finish NF_HOOK
Date: Tue, 7 Apr 2026 10:18:08 +0200 [thread overview]
Message-ID: <adS9wGJ_JlLXdwtt@secunet.com> (raw)
In-Reply-To: <20260402114401.62212-1-tpluszz77@gmail.com>
On Thu, Apr 02, 2026 at 07:44:01PM +0800, Qi Tang wrote:
> After async crypto completes, xfrm_input_resume() calls dev_put()
> immediately on re-entry before the skb reaches transport_finish.
> The skb->dev pointer is then used inside NF_HOOK and its okfn,
> which can race with device teardown.
>
> Remove the dev_put from the async resumption entry and instead
> drop the reference after the NF_HOOK call in transport_finish,
> using a saved device pointer since NF_HOOK may consume the skb.
> This covers NF_DROP, NF_QUEUE and NF_STOLEN paths that skip
> the okfn.
>
> For non-transport exits (decaps, gro, drop) and secondary
> async return points, release the reference inline when
> async is set.
>
> Suggested-by: Florian Westphal <fw@strlen.de>
> Fixes: acf568ee859f ("xfrm: Reinject transport-mode packets through tasklet")
> Cc: stable@vger.kernel.org
> Signed-off-by: Qi Tang <tpluszz77@gmail.com>
Applied to the ipsec tree, thanks a lot!
prev parent reply other threads:[~2026-04-07 8:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 11:44 [PATCH v3] xfrm: hold dev ref until after transport_finish NF_HOOK Qi Tang
2026-04-07 8:18 ` Steffen Klassert [this message]
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=adS9wGJ_JlLXdwtt@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=tpluszz77@gmail.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