From: Steffen Klassert <steffen.klassert@secunet.com>
To: Ren Wei <enjou1224z@gmail.com>
Cc: <netdev@vger.kernel.org>, <herbert@gondor.apana.org.au>,
<davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>,
<horms@kernel.org>, <martin@strongswan.org>, <vega@nebusec.ai>,
<zihanx@nebusec.ai>
Subject: Re: [PATCH ipsec 1/1] xfrm: fix xfrm_state_construct() auth-trunc leak
Date: Wed, 29 Jul 2026 08:07:19 +0200 [thread overview]
Message-ID: <ammYl8rluWvrv7FE@secunet.com> (raw)
In-Reply-To: <49598e6a475f779e96c58a0d587790694862edf5.1784963896.git.zihanx@nebusec.ai>
On Tue, Jul 28, 2026 at 01:30:32AM +0800, Ren Wei wrote:
> From: Zihan Xi <zihanx@nebusec.ai>
>
> attach_auth_trunc() can allocate x->aalg while leaving
> x->props.aalgo at zero when the selected auth algorithm has no
> sadb_alg_id. One real case is cmac(aes).
>
> xfrm_state_construct() then treats !x->props.aalgo as "no auth
> algorithm attached yet" and calls attach_auth(). That overwrites
> x->aalg and loses the first allocation. Any later failure or teardown
> only frees the replacement pointer.
>
> Check whether x->aalg is already attached instead of inferring that
> state from x->props.aalgo.
>
> Fixes: 4447bb33f094 ("xfrm: Store aalg in xfrm_state with a user specified truncation length")
> Cc: stable@vger.kernel.org
> Reported-by: Vega <vega@nebusec.ai>
> Assisted-by: Codex:gpt-5.4
> Signed-off-by: Zihan Xi <zihanx@nebusec.ai>
> Signed-off-by: Ren Wei <enjou1224z@gmail.com>
Patch applied, thanks a lot!
prev parent reply other threads:[~2026-07-29 6:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 17:30 [PATCH ipsec 0/1] xfrm: fix xfrm_state_construct() auth-trunc leak Ren Wei
2026-07-27 17:30 ` [PATCH ipsec 1/1] " Ren Wei
2026-07-29 6:07 ` 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=ammYl8rluWvrv7FE@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=enjou1224z@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=martin@strongswan.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vega@nebusec.ai \
--cc=zihanx@nebusec.ai \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.