Linux kernel denial of service in dm-integrity discard handling
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 84597a44a9d86ac949900441cea7da0af0f2f473 · < fc512700f1413fed652dac22fa1c4e837210b9c0| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel's dm-integrity discard handling can enter an infinite loop when the tag size exceeds HASH_MAX_DIGESTSIZE and a buffer allocation fails. Under those conditions, the discard never completes; the input does not specify attacker access or authentication requirements.
Engineers running Linux kernels with dm-integrity should check whether their kernel includes the fix; affected versions are not specified.