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

State
Published
Severity
Not Scored
Published
Nov 30, 2026
Updated
Nov 30, 2026
Reserved
Nov 30, 2026

Read the record on cve.org

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.

ProductVersions
Linux Linux52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 to before 068e85ed81838a9d98c3018d532402dbd360fd1f Affected52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 to before 35b3176839fa1842ae1a6e3b2bbbc37d34237614 Affected52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 to before a5e1e36dace783c8d1688a299a3919f4d624217d Affected52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 to before ad78e2cd8b4dde0b8c52bb5227e09faf3f49b939 Affected52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 to before e7a5cea8804f1210fe45c3a0281b11943c58553f Affected52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 to before f3e503a31d3cfdc8fae1baeb0ad5ba8471ceea9d Affected52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 to before 523eb58df5c11531a99f2e75d08e10f20cc28565 Affected52e26d77b8b3de2e9ed6c7126f68e04cad5fe852 to before a91d9346a70b68f77884cba9d9ec3b70f96bf9d2 Affected
Linux Linux4.13 Affectedbefore 4.13 Not Affected5.10.275 through 5.10.* Not Affected5.15.226 through 5.15.* Not Affected6.1.193 through 6.1.* Not Affected6.6.163 through 6.6.* Not Affected6.12.117 through 6.12.* Not Affected6.18.63 through 6.18.* Not Affected7.3.4 through 7.3.* Not Affected7.4-rc1 and later Not Affected

Weaknesses

The record names no weakness.

References

Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.

© 2026 NVIDIA, the NVIDIA logo, and NVIDIA Inception are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and other countries.