{"id":"CVE-2026-138921","summary":"crypto: caam - fix double-free in caam_rsa_set_priv_key_form()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: caam - fix double-free in caam_rsa_set_priv_key_form()\n\ncaam_rsa_set_priv_key_form() frees the partially allocated key\ncomponents (p, q, tmp1, tmp2, dp, dq) with kfree_sensitive() on its\nerror path, but does not set those pointers to NULL afterward.\n\nWhen the function returns an error, caam_rsa_set_priv_key() jumps to\nits err label and calls caam_rsa_free_key(), which frees all of those\nsame pointers again, resulting in a double-free.\n\nThis is reachable when the allocation of q, tmp1, tmp2, dp, dq or qinv\nfails, e.g. under memory pressure, or for a malformed key whose CRT\nmembers decode to zero length and make caam_read_rsa_crt() return NULL.\n\nSet each pointer to NULL right after freeing it so that the subsequent\ncaam_rsa_free_key() call becomes a no-op for the already-freed fields.","modified":"2026-12-01T07:00:44.107349290Z","published":"2026-11-30T13:26:13.456Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138921.json","cna_assigner":"Linux"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/068e85ed81838a9d98c3018d532402dbd360fd1f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/35b3176839fa1842ae1a6e3b2bbbc37d34237614"},{"type":"WEB","url":"https://git.kernel.org/stable/c/523eb58df5c11531a99f2e75d08e10f20cc28565"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a5e1e36dace783c8d1688a299a3919f4d624217d"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a91d9346a70b68f77884cba9d9ec3b70f96bf9d2"},{"type":"WEB","url":"https://git.kernel.org/stable/c/ad78e2cd8b4dde0b8c52bb5227e09faf3f49b939"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e7a5cea8804f1210fe45c3a0281b11943c58553f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f3e503a31d3cfdc8fae1baeb0ad5ba8471ceea9d"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138921.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138921"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"52e26d77b8b3de2e9ed6c7126f68e04cad5fe852"},{"fixed":"068e85ed81838a9d98c3018d532402dbd360fd1f"},{"fixed":"35b3176839fa1842ae1a6e3b2bbbc37d34237614"},{"fixed":"a5e1e36dace783c8d1688a299a3919f4d624217d"},{"fixed":"ad78e2cd8b4dde0b8c52bb5227e09faf3f49b939"},{"fixed":"e7a5cea8804f1210fe45c3a0281b11943c58553f"},{"fixed":"f3e503a31d3cfdc8fae1baeb0ad5ba8471ceea9d"},{"fixed":"523eb58df5c11531a99f2e75d08e10f20cc28565"},{"fixed":"a91d9346a70b68f77884cba9d9ec3b70f96bf9d2"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138921.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.13.0"},{"fixed":"5.10.275"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.226"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.193"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.117"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.63"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138921.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"}]}