CVE-2026-72108: dm thin metadata: fix metadata snapshot consistency on commit failure
In the Linux kernel, the following vulnerability has been resolved:
dm thin metadata: fix metadata snapshot consistency on commit failure
reservemetadatasnap() and releasemetadatasnap() modify the superblock's heldroot directly in the blockmanager's buffer. If the subsequent metadata commit fails, the heldroot gets flushed to disk through the aborttransaction path, resulting in inconsistent metadata.
Reproducer 1: reservemetadatasnap()
1. Create a 2 MiB metadata device and make the region after the 14th block inaccessible, to trigger metadata commit failure in the subsequent reservemetadatasnap operation. The 14th block will be the shadow destination for the index block.
dmsetup create tmeta --table "0 112 linear /dev/sdc 0 112 3984 error"
2. Create a 16 MiB thin-pool
dmsetup create tdata --table "0 32768 zero" dd if=/dev/zero of=/dev/mapper/tmeta bs=4k count=1 dmsetup create tpool --table "0 32768 thin-pool /dev/mapper/tmeta \ /dev/mapper/tdata 128 0 1 skipblockzeroing"
3. Take a metadata snapshot to trigger metadata commit failure and transaction abort. However, the heldroot is written to disk, breaking metadata consistency.
dmsetup message tpool 0 "reservemetadatasnap"
thincheck v1.2.2 result:
Bad reference count for metadata block 6. Expected 2, but space map contains 1. Bad reference count for metadata block 7. Expected 2, but space map contains 1. Bad reference count for metadata block 13. Expected 1, but space map contains 0.
Reproducer 2: releasemetadatasnap()
1. Create a 2 MiB metadata device and make the region after the 16th block inaccessible, to trigger metadata commit failure in the subsequent releasemetadatasnap operation. The 16th block will be the shadow destination for the index block.
dmsetup create tmeta --table "0 128 linear /dev/sdc 0 128 3968 error"
2. Create a 16 MiB thin-pool
dmsetup create tdata --table "0 32768 zero" dd if=/dev/zero of=/dev/mapper/tmeta bs=4k count=1 dmsetup create tpool --table "0 32768 thin-pool /dev/mapper/tmeta \ /dev/mapper/tdata 128 0 1 skipblockzeroing"
3. Reserve then release the metadata snapshot, to trigger metadata commit failure and transaction abort. The heldroot gets removed from the on-disk superblock, causing inconsistent metadata.
dmsetup message tpool 0 "reservemetadatasnap" dmsetup message tpool 0 "releasemetadatasnap"
thincheck v1.2.2 result:
Bad reference count for metadata block 6. Expected 1, but space map contains 2. Bad reference count for metadata block 7. Expected 1, but space map contains 2. 1 metadata blocks have leaked.
Fix by deferring the heldroot update to commit time.
Additionally, move the existing-snapshot check in reservemetadatasnap before the shadow operation to avoid unnecessary work. In releasemetadatasnap, clear pmd->heldroot before btree deletion so partial failure leaks blocks rather than leaving a stale reference, and unlock the snapshot block before decrementing its refcount.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-72108?
CVE-2026-72108 has a risk score of 34, indicating a moderate severity level.
What vulnerability does CVE-2026-72108 address?
CVE-2026-72108 addresses an issue in the Linux kernel related to metadata snapshot consistency during commit failures.
How do I fix CVE-2026-72108?
To fix CVE-2026-72108, ensure that you update your Linux kernel to the latest version where this vulnerability has been resolved.
What systems are impacted by CVE-2026-72108?
CVE-2026-72108 affects systems running specific versions of the Linux kernel that utilize the dm thin metadata feature.
Is CVE-2026-72108 a critical vulnerability?
CVE-2026-72108 is not considered critical but still requires attention due to its moderate risk rating.