CVE-2026-143013: dm-integrity: don't recalculate with HMAC because of a dirty bitmap
In the Linux kernel, the following vulnerability has been resolved:
dm-integrity: don't recalculate with HMAC because of a dirty bitmap
Commit 5c02406428d5 ("dm integrity: conditionally disable "recalculate" feature") refuses a superblock with SBFLAGRECALCULATING if a keyed hash is used without "legacyrecalculate". Otherwise someone who can write to the device, but does not know the key, could modify data and have the kernel compute valid tags for it.
dmintegrityresume() can still start the same recalculation in J or D mode: if SBFLAGDIRTYBITMAP is set and the bitmap is not clear, or log2blocksperbitmapbit does not match, it sets SBFLAGRECALCULATING and recalcsector = 0. The superblock is not authenticated unless fixhmac and journalmac are both used, so the flag can be set offline. Resume also runs on the first activation.
Apply the constructor's policy there. If recalculation is not allowed, log an error and keep the existing tags, so modified blocks fail verification. This also avoids queueing recalcwork on a NULL recalcwq when internalhash is not used.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch 5c02406428d5
Event History
Frequently Asked Questions
Who is exposed to this issue?
Systems using dm-integrity with a keyed hash are exposed if an attacker can write to the protected device without knowing the integrity key. The issue is relevant when resume or initial activation can trigger recalculation because of a dirty bitmap or a bitmap geometry mismatch.
What does an attacker need to exploit it?
The attacker needs offline or other write access to the device, sufficient to modify data and set the unauthenticated superblock state that causes recalculation. They do not need to know the keyed-hash key, because the vulnerable kernel can generate valid tags for their modified data.
Are default dm-integrity configurations affected?
The described attack depends on using a keyed hash and on the superblock not being authenticated. The superblock is authenticated only when both fix_hmac and journal_mac are used; configurations with those protections do not have an unauthenticated superblock flag that can be set offline as described.
What happens after the fix when recalculation is not permitted?
The kernel logs an error and preserves the existing tags instead of recalculating them. Modified blocks then fail integrity verification rather than receiving valid replacement tags.