CVE-2026-80843: xfrm: fix xfrm_state_construct() auth-trunc leak
In the Linux kernel, the following vulnerability has been resolved:
xfrm: fix xfrmstateconstruct() auth-trunc leak
attachauthtrunc() can allocate x->aalg while leaving x->props.aalgo at zero when the selected auth algorithm has no sadbalgid. One real case is cmac(aes).
xfrmstateconstruct() then treats !x->props.aalgo as "no auth algorithm attached yet" and calls attachauth(). 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.
Event History
Frequently Asked Questions
What configuration is needed to trigger the leak?
The affected path requires an auth-trunc algorithm that allocates x->aalg but has no sadb_alg_id. The description identifies cmac(aes) as a real example.
When does memory remain leaked?
After attach_auth_trunc() allocates x->aalg, xfrm_state_construct() can incorrectly call attach_auth() and overwrite that pointer. A subsequent failure or teardown frees only the replacement allocation, leaving the original allocation leaked.
What code change resolves the issue?
The fix checks whether x->aalg is already attached rather than using x->props.aalgo being zero to determine whether an authentication algorithm has been attached.