AZL-117947: CVE-2026-143019 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
dm snapshot: fix discard writing into the next COW chunk
zeroexception() zeroes one chunk of the COW device and takes the start sector from bio->biiter.bisector. remapexception() has already set that to the COW chunk start plus the offset inside the chunk. That offset is needed for reads and writes, but for a discard it is wrong: the zeroing window is shifted, so the head of the target chunk keeps its old data and the tail lands in the next COW chunk, which holds a different exception.
iooverlapschunk() should have caught this, but it only compares the length. "maps to entire chunks" in snapshot.rst also means the discard has to start on a chunk boundary.
A discard that is not a full chunk has a second problem: after remapexception() it is sent to the COW device, where it hits a chunk that still backs a live exception. After a discard the contents are undefined, but the exception stays in the table and keeps pointing at that chunk, so a later read returns whatever the discard left instead of the snapshot's data.
Reproducer:
truncate -s 4M o.img c.img o=$(losetup -f --show o.img) c=$(losetup -f --show c.img) dmsetup create snap --table \ "0 8192 snapshot $o $c P 512 1 discardzeroescow"
# write two chunks, this creates two exceptions head -c 256K /dev/zero | tr '\000' '\252' > pat dd if=pat of=/dev/mapper/snap bs=256K seek=1 count=1 conv=notrunc dd if=pat of=/dev/mapper/snap bs=256K seek=2 count=1 conv=notrunc
# shift the snapshot by 8 sectors, so a discard that is aligned on # top is unaligned inside the snapshot dmsetup create top --table "0 8184 linear /dev/mapper/snap 8" blkdiscard -o 262144 -l 262144 /dev/mapper/top sync echo 3 > /proc/sys/vm/dropcaches
# chunk 1 dd if=/dev/mapper/snap bs=512 skip=512 count=8 | od -An -tx1 -N1 # chunk 2 dd if=/dev/mapper/snap bs=512 skip=1024 count=8 | od -An -tx1 -N1
Before: aa 00 <- chunk 2 was zeroed although it was not discarded After: aa aa <- nothing written, a discard is only a hint
Fix it by requiring the discard to start on a chunk boundary in iooverlapschunk(), and by finishing a discard that is not a full chunk with bioendio() instead of passing it down to the COW device.
Affected Software
Event History
Frequently Asked Questions
What configurations are exposed to this issue?
Systems using the device-mapper snapshot target with a copy-on-write (COW) device are exposed when discard operations reach snapshots. The issue concerns discards that are not aligned to, or do not cover, an entire snapshot chunk.
What does an attacker or triggering workload need to do?
The triggering condition is a discard issued against a device-mapper snapshot with an offset within a chunk or a length that is less than a full chunk. Such a discard can zero data at the wrong COW location and affect a chunk backing a different live exception.
What is the potential impact after a triggering discard?
A later read can return data left by the discard rather than the snapshot's expected data. The discard can also overwrite into the next COW chunk, while leaving the beginning of the intended chunk unchanged.
What can be done if an update cannot be applied immediately?
Avoid issuing discards to affected device-mapper snapshots unless they start on a chunk boundary and map entire chunks. This avoids the misaligned and partial-discard cases described for the vulnerability.