CVE-2025-37984: crypto: ecdsa - Harden against integer overflows in DIV_ROUND_UP()
In the Linux kernel, the following vulnerability has been resolved:
crypto: ecdsa - Harden against integer overflows in DIVROUNDUP()
Herbert notes that DIVROUNDUP() may overflow unnecessarily if an ecdsa implementation's ->keysize() callback returns an unusually large value. Herbert instead suggests (for a division by 8):
X / 8 + !!(X & 7)
Based on this formula, introduce a generic DIVROUNDUPPOW2() macro and use it in lieu of DIVROUNDUP() for ->keysize() return values.
Additionally, use the macro in eccdigitsfrombytes(), whose "nbytes" parameter is a ->keysize() return value in some instances, or a user-specified ASN.1 length in the case of ecdsagetsignaturers().
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.113-1Fixed in 7.2.12-1Fixed in 7.2.13-1 - Compensating control
Introduce a generic DIV_ROUND_UP_POW2() macro using X / 8 + !!(X & 7), and use it instead of DIV_ROUND_UP() for ->key_size() return values and in ecc_digits_from_bytes(), including cases where nbytes is a ->key_size() return value or a user-specified ASN.1 length passed by ecdsa_get_signature_rs().
Event History
Frequently Asked Questions
What is the severity of CVE-2025-37984?
CVE-2025-37984 is considered a medium severity vulnerability due to its potential for causing integer overflows in the Linux kernel.
How do I fix CVE-2025-37984?
To fix CVE-2025-37984, you should update your Linux kernel to the latest patched version that resolves this integer overflow issue.
Which versions of the Linux kernel are affected by CVE-2025-37984?
CVE-2025-37984 affects various versions of the Linux kernel that have the vulnerable ecdsa implementation.
What systems are at risk due to CVE-2025-37984?
Any systems running an affected version of the Linux kernel with the ecdsa implementation may be at risk from CVE-2025-37984.
Is there a workaround for CVE-2025-37984?
There is no widely recognized workaround for CVE-2025-37984; the best course of action is to apply the necessary kernel updates.