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

Published Nov 30, 2026
·
Updated

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

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

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

When the function returns an error, caamrsasetprivkey() jumps to its err label and calls caamrsafreekey(), 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 caamreadrsacrt() return NULL.

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

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    In caam_rsa_set_priv_key_form(), set each key-component pointer to NULL immediately after freeing it with kfree_sensitive(), so caam_rsa_free_key() does not free it again.

Event History

Nov 30, 2026
CVE Published
via MITRE·01:26 PM
Data Sourced
via MITRE·01:26 PM
Description

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203