# CVE-2026-138921: crypto: caam - fix double-free in caam_rsa_set_priv_key_form()

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.19%, higher than 9% of CVEs (2026-12-01)
- Published: 2026-11-30T13:26:13.456Z
- Modified: 2026-12-01T06:17:31.240Z
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

crypto: caam - fix double-free in caam_rsa_set_priv_key_form()

caam_rsa_set_priv_key_form() frees the partially allocated key
components (p, q, tmp1, tmp2, dp, dq) with kfree_sensitive() on its
error path, but does not set those pointers to NULL afterward.

When the function returns an error, caam_rsa_set_priv_key() jumps to
its err label and calls caam_rsa_free_key(), which frees all of those
same pointers again, resulting in a double-free.

This is reachable when the allocation of q, tmp1, tmp2, dp, dq or qinv
fails, e.g. under memory pressure, or for a malformed key whose CRT
members decode to zero length and make caam_read_rsa_crt() return NULL.

Set each pointer to NULL right after freeing it so that the subsequent
caam_rsa_free_key() call becomes a no-op for the already-freed fields.

(As written by CVE List.)

## Affected

- Linux Linux: from 52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 before 068e85ed81838a9d98c3018d532402dbd360fd1f; from 52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 before 35b3176839fa1842ae1a6e3b2bbbc37d34237614; from 52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 before a5e1e36dace783c8d1688a299a3919f4d624217d; from 52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 before ad78e2cd8b4dde0b8c52bb5227e09faf3f49b939; from 52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 before e7a5cea8804f1210fe45c3a0281b11943c58553f; from 52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 before f3e503a31d3cfdc8fae1baeb0ad5ba8471ceea9d; from 52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 before 523eb58df5c11531a99f2e75d08e10f20cc28565; from 52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 before a91d9346a70b68f77884cba9d9ec3b70f96bf9d2; 4.13 (not affected: before 4.13; from 5.10.275 up to 5.10.*; from 5.15.226 up to 5.15.*; from 6.1.193 up to 6.1.*; from 6.6.163 up to 6.6.*; from 6.12.117 up to 6.12.*; from 6.18.63 up to 6.18.*; from 7.3.4 up to 7.3.*; from 7.4-rc1 up to *)

## References

- <https://git.kernel.org/stable/c/068e85ed81838a9d98c3018d532402dbd360fd1f>
- <https://git.kernel.org/stable/c/35b3176839fa1842ae1a6e3b2bbbc37d34237614>
- <https://git.kernel.org/stable/c/a5e1e36dace783c8d1688a299a3919f4d624217d>
- <https://git.kernel.org/stable/c/ad78e2cd8b4dde0b8c52bb5227e09faf3f49b939>
- <https://git.kernel.org/stable/c/e7a5cea8804f1210fe45c3a0281b11943c58553f>
- <https://git.kernel.org/stable/c/f3e503a31d3cfdc8fae1baeb0ad5ba8471ceea9d>
- <https://git.kernel.org/stable/c/523eb58df5c11531a99f2e75d08e10f20cc28565>
- <https://git.kernel.org/stable/c/a91d9346a70b68f77884cba9d9ec3b70f96bf9d2>

## Sources

- CVE List: [CVE-2026-138921](https://www.cve.org/CVERecord?id=CVE-2026-138921), CVE Terms of Use, modified 2026-12-01
- NVD: [CVE-2026-138921](https://nvd.nist.gov/vuln/detail/CVE-2026-138921), Public domain, modified 2026-12-01

---

Page: https://cve.day/CVE-2026-138921 · Whole record: https://cve.day/CVE-2026-138921.json · Rebuilt by cve.day 2026-12-01T06:32:17.187Z
