CVE-2026-99135: dm-integrity: fix infinite loop on discard with large tag size
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
dm-integrity: fix infinite loop on discard with large tag size
When integrity_metadata handles a discard, it fills a buffer with DISCARD_FILLER and writes it over the tags, max_blocks blocks at a time. If the kmalloc fails, the buffer is the on-stack array checksums_onstack and max_size is set to HASH_MAX_DIGESTSIZE. So if the tag size is larger than HASH_MAX_DIGESTSIZE, max_blocks is zero, bi_size is never decremented and the loop never terminates.
Fix this by using sizeof(checksums_onstack) as max_size. The array has MAX_TAG_SIZE bytes since commit b93b6643e9b5 ("dm integrity: fix a crash with unusually large tag size"), so max_blocks is at least 1.
The Linux kernel CVE team has assigned CVE-2026-99135 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.7 with commit 84597a44a9d86ac949900441cea7da0af0f2f473 and fixed in 6.18.59 with commit fc512700f1413fed652dac22fa1c4e837210b9c0 Issue introduced in 5.7 with commit 84597a44a9d86ac949900441cea7da0af0f2f473 and fixed in 7.2.13 with commit 251b44b424920df9204e88a81fb3f78fa48ddd99 Issue introduced in 5.7 with commit 84597a44a9d86ac949900441cea7da0af0f2f473 and fixed in 7.3 with commit 18d80c77b4c7dd20699e81cedfbbff4e9d198f28
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-99135
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/fc512700f1413fed652dac22fa1c4e837210b9c0 https://git.kernel.org/stable/c/251b44b424920df9204e88a81fb3f78fa48ddd99 https://git.kernel.org/stable/c/18d80c77b4c7dd20699e81cedfbbff4e9d198f28