Thread (3 messages) flat view 3 messages, 2 authors, 5d ago

Re: [PATCH ipsec 1/1] xfrm: fix xfrm_state_construct() auth-trunc leak

From: Steffen Klassert <steffen.klassert@secunet.com>
Date: 2026-07-29 06:07:24

On Tue, Jul 28, 2026 at 01:30:32AM +0800, Ren Wei wrote:
From: Zihan Xi <redacted>

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 <redacted>
Assisted-by: Codex:gpt-5.4
Signed-off-by: Zihan Xi <redacted>
Signed-off-by: Ren Wei <redacted>
Patch applied, thanks a lot!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help