AZL-118130: CVE-2026-143113 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
crypto: caam - reject overlong RSA CRT parameters
caamreadrsacrt() right-aligns dP, dQ, and qInv in buffers sized from the corresponding prime. rsaparseprivkey() only bounds these integers against n, so a malformed key can provide, for example, a two-byte dP with a one-byte p. dstlen - nbytes then underflows and memcpy() writes outside the allocation during setprivkey(). KASAN reports a slab-out-of-bounds write in caamreadrsacrt().
Reject empty or overlong CRT parameters after stripping leading zeros. qInv is consumed by CAAM as a p-sized value, so size it from p rather than q to match the DMA mapping in setrsaprivf3pdb(). Let the top-level key cleanup handle partial form-3 allocations and return the specific error to the caller.
Also test nbytes before dereferencing it while stripping zeros, so an all-zero integer does not read one byte beyond its input.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In caam_read_rsa_crt(), check nbytes before dereferencing input while stripping leading zeros; reject empty or overlong CRT parameters after stripping leading zeros; size qInv from p rather than q to match the DMA mapping in set_rsa_priv_f3_pdb(); and make top-level key cleanup handle partial form-3 allocations and return the specific error to the caller.
Event History
Frequently Asked Questions
What input is required to trigger the out-of-bounds write?
An attacker would need to cause a malformed RSA private key to be processed through the CAAM RSA private-key setup path. The key must contain empty or overlong CRT parameters such as dP, dQ, or qInv relative to the associated prime sizes, after leading zero bytes are removed.
Which deployments are relevant?
The vulnerable code is in the Linux kernel CAAM crypto driver and is reached while setting an RSA private key. Systems that do not use this CAAM RSA key-processing path are not described as affected by the provided data.
What failure behavior is associated with exploitation?
The malformed parameter sizing can underflow a destination-length calculation and cause memcpy() to write outside an allocation during private-key setup. KASAN reports this as a slab-out-of-bounds write in caam_read_rsa_crt().
Are all-zero CRT integer values also handled by the fix?
Yes. The resolved issue includes checking the input length before dereferencing it while stripping leading zeros, preventing an all-zero integer from causing a one-byte read beyond its input.