CVE-2026-90052: dm-integrity: fix buffer overflow with keyed discard
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
dm-integrity: fix buffer overflow with keyed discard
Since commit 68c5c42567bc ("dm-integrity: replace forgeable discard filler with a keyed sector marker"), integrity_metadata computes a checksum for every discarded block into the "checksums" buffer. integrity_sector_checksum always writes the whole digest. So if the tag size is smaller than the digest size, the checksum of the last block that fits into the buffer is written past the end of it. For example, with hmac(sha256) and tag size 16, a 4MiB discard writes 16 bytes past the kmalloc'ed page.
Fix this by subtracting extra_space from the buffer size when computing max_blocks, like we do for writes.
The Linux kernel CVE team has assigned CVE-2026-90052 to this issue.
Affected and fixed versions
===========================
Issue introduced in 7.3-rc1 with commit 68c5c42567bc462139128968ebbfadd0aefff519 and fixed in 7.3-rc2 with commit 59e6f919d77d72ec79cbf171256f2f7819737580
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-90052
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/md/dm-integrity.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/9988c1c9e0d1c78391e3d8e2817beb667470c76f https://git.kernel.org/stable/c/dd08a645195f410f2dcaa40de379a45ce110e873 https://git.kernel.org/stable/c/59e6f919d77d72ec79cbf171256f2f7819737580