CVE-2025-40019
kernel: crypto: essiv - Check ssize for decryption and in-place encryption
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · October 24, 2025
Updated · June 30, 2026
Description
In the Linux kernel, the following vulnerability has been resolved:
crypto: essiv - Check ssize for decryption and in-place encryption
Move the ssize check to the start in essiv_aead_crypt so that it's also checked for decryption and in-place encryption.
Statement
The ESSIV AEAD path failed to validate ssize = assoclen - ivsize for decryption and in-place encryption. A negative ssize could flow into scatterwalk_map_and_copy(), causing out-of-bounds writes/reads of the IV region and kernel crashes or memory corruption. The fix computes ivsize/ssize up front, rejects ssize < 0, and consistently uses these locals across branches, covering decrypt and in-place cases. Privilege required is local (e.g., reachable via kernel crypto consumers or AF_ALG setups), with primary impact on availability and potential integrity compromise. The system is not vulnerable if ESSIV is not in use (i.e. the essiv/aes-cbc-essiv implementation is not present or not being used by any disk/crypto consumer).
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 6.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:H
CWE-787 · Out-of-bounds Write