xfrm: fix xfrm_state_construct() auth-trunc leak
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 4447bb33f09444920a8f1d89e1540137429351b6 · < cf67361e78dca488d6e4df8396a53e6745a3a80e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
xfrm: fix xfrm_state_construct() auth-trunc leak
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.
From the CVE record · Linux
The Linux kernel's xfrm state construction can leak memory when an auth-trunc algorithm without a sadb_alg_id, such as cmac(aes), is selected. A second allocation overwrites the first, leaving it unfreed. The input does not specify how an attacker could trigger this or whether authentication or user interaction is required.
Engineers running the Linux kernel should check their versions against the vendor advisory; affected versions are not specified.