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 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.