AZL-117953: CVE-2026-143021 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
dm snapshot: fix discardgranularity unit in snapshotiohints
snapshotiohints() copies the snapshot store's chunksize, which is in 512-byte sectors, into queuelimits.discardgranularity, which, like all other members of struct queuelimits, is in bytes.
For snapshots with a chunk size smaller than 512 sectors, e.g. the 16 KiB (32-sector) chunks created by the syzkaller reproducer, the resulting granularity is smaller than a single sector. When dmcalculatequeuelimits() then stacks the target limits into the table limits:
blkstacklimits(limits, &tilimits, 0)
queuelimitdiscardalignment() truncates that granularity to zero sectors and sectordiv() divides by zero:
Oops: divide error: 0000 [#1] SMP KASAN NOPTI RIP: 0010:queuelimitdiscardalignment block/blk-settings.c:645 [inline] RIP: 0010:blkstacklimits+0x1105/0x2d00 block/blk-settings.c:916 Call Trace: dmcalculatequeuelimits+0x70c/0x1510 drivers/md/dm-table.c:1823 dmsetupmdqueue+0x199/0x4f0 drivers/md/dm.c:2618 tableload+0x4fd/0x8a0 drivers/md/dm-ioctl.c:1661
The divide fault itself only became reachable when commit e924da7d6622 ("block: Drop granularity check in queuelimitdiscardalignment()") removed the check for a sub-sector granularity in v6.13. Kernels before that returned a zero discard alignment instead of faulting, but they still advertised a granularity 512 times too small.
Use the same chunksize << SECTORSHIFT conversion that iooverlapschunk() already applies to turn chunksize into bytes.
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to the divide-by-zero fault?
Systems using device-mapper snapshots with a snapshot-store chunk size smaller than 512 sectors are exposed. The description gives 16 KiB, or 32-sector, chunks as an example.
What action triggers the failure?
The fault can occur when device-mapper calculates and stacks queue limits while loading the device-mapper table. A sub-sector discard granularity is truncated to zero sectors, causing a division by zero in queue_limit_discard_alignment().
What can be done if the update cannot be applied immediately?
Avoid creating or loading device-mapper snapshot configurations whose snapshot-store chunk size is below 512 sectors. This prevents the described invalid discard-granularity calculation.
How can an administrator identify potentially affected configurations?
Review device-mapper snapshot configurations and their snapshot-store chunk sizes. Configurations using fewer than 512 sectors per chunk, including 32-sector chunks, match the condition described for the fault.