{"id":"CVE-2026-143019","sourceIdentifier":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","published":"2026-12-03T10:17:29.087","lastModified":"2026-12-03T10:17:29.087","vulnStatus":"Received","cveTags":[],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ndm snapshot: fix discard writing into the next COW chunk\n\nzero_exception() zeroes one chunk of the COW device and takes the start\nsector from bio->bi_iter.bi_sector.  remap_exception() has already set\nthat to the COW chunk start plus the offset inside the chunk.  That\noffset is needed for reads and writes, but for a discard it is wrong:\nthe zeroing window is shifted, so the head of the target chunk keeps\nits old data and the tail lands in the next COW chunk, which holds a\ndifferent exception.\n\nio_overlaps_chunk() should have caught this, but it only compares the\nlength.  \"maps to entire chunks\" in snapshot.rst also means the discard\nhas to start on a chunk boundary.\n\nA discard that is not a full chunk has a second problem: after\nremap_exception() it is sent to the COW device, where it hits a chunk\nthat still backs a live exception.  After a discard the contents are\nundefined, but the exception stays in the table and keeps pointing at\nthat chunk, so a later read returns whatever the discard left instead\nof the snapshot's data.\n\nReproducer:\n\n\ttruncate -s 4M o.img c.img\n\to=$(losetup -f --show o.img)\n\tc=$(losetup -f --show c.img)\n\tdmsetup create snap --table \\\n\t\t\"0 8192 snapshot $o $c P 512 1 discard_zeroes_cow\"\n\n\t# write two chunks, this creates two exceptions\n\thead -c 256K /dev/zero | tr '\\000' '\\252' > pat\n\tdd if=pat of=/dev/mapper/snap bs=256K seek=1 count=1 conv=notrunc\n\tdd if=pat of=/dev/mapper/snap bs=256K seek=2 count=1 conv=notrunc\n\n\t# shift the snapshot by 8 sectors, so a discard that is aligned on\n\t# top is unaligned inside the snapshot\n\tdmsetup create top --table \"0 8184 linear /dev/mapper/snap 8\"\n\tblkdiscard -o 262144 -l 262144 /dev/mapper/top\n\tsync\n\techo 3 > /proc/sys/vm/drop_caches\n\n\t# chunk 1\n\tdd if=/dev/mapper/snap bs=512 skip=512 count=8 | od -An -tx1 -N1\n\t# chunk 2\n\tdd if=/dev/mapper/snap bs=512 skip=1024 count=8 | od -An -tx1 -N1\n\nBefore: aa 00  <- chunk 2 was zeroed although it was not discarded\nAfter:  aa aa  <- nothing written, a discard is only a hint\n\nFix it by requiring the discard to start on a chunk boundary in\nio_overlaps_chunk(), and by finishing a discard that is not a full\nchunk with bio_endio() instead of passing it down to the COW device."}],"affected":[{"source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","affectedData":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","programFiles":["drivers/md/dm-snap.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","versions":[{"version":"2e6023850e177dbaca21498ada04c5a5ac93f812","lessThan":"1fa8f3def9b79052ed510aa85eefbdb2d7b0ead1","versionType":"git","status":"affected"},{"version":"2e6023850e177dbaca21498ada04c5a5ac93f812","lessThan":"6a227764d4e9ffdbe9ab4e59e9b24e21fa0e91bd","versionType":"git","status":"affected"},{"version":"2e6023850e177dbaca21498ada04c5a5ac93f812","lessThan":"4a02cc97d87a3c2eb7c37ac6ea7e8ef8e8fc0344","versionType":"git","status":"affected"},{"version":"2e6023850e177dbaca21498ada04c5a5ac93f812","lessThan":"19ff998f1d27e1417b286ae0ec88fc19842d4f2f","versionType":"git","status":"affected"},{"version":"2e6023850e177dbaca21498ada04c5a5ac93f812","lessThan":"0c661d80fdbeea980d3e03b528ecb51e38f0d85e","versionType":"git","status":"affected"},{"version":"2e6023850e177dbaca21498ada04c5a5ac93f812","lessThan":"73174b4bb6fcd0e6cf973c9402a0fae2e567ad9f","versionType":"git","status":"affected"}]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","programFiles":["drivers/md/dm-snap.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","versions":[{"version":"5.3","status":"affected"},{"version":"0","lessThan":"5.3","versionType":"semver","status":"unaffected"},{"version":"5.10.276","lessThanOrEqual":"5.10.*","versionType":"semver","status":"unaffected"},{"version":"5.15.227","lessThanOrEqual":"5.15.*","versionType":"semver","status":"unaffected"},{"version":"6.12.120","lessThanOrEqual":"6.12.*","versionType":"semver","status":"unaffected"},{"version":"6.18.66","lessThanOrEqual":"6.18.*","versionType":"semver","status":"unaffected"},{"version":"7.3.7","lessThanOrEqual":"7.3.*","versionType":"semver","status":"unaffected"},{"version":"7.4-rc3","lessThanOrEqual":"*","versionType":"original_commit_for_fix","status":"unaffected"}]}]}],"metrics":{},"references":[{"url":"https://git.kernel.org/stable/c/0c661d80fdbeea980d3e03b528ecb51e38f0d85e","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/19ff998f1d27e1417b286ae0ec88fc19842d4f2f","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/1fa8f3def9b79052ed510aa85eefbdb2d7b0ead1","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/4a02cc97d87a3c2eb7c37ac6ea7e8ef8e8fc0344","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/6a227764d4e9ffdbe9ab4e59e9b24e21fa0e91bd","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/73174b4bb6fcd0e6cf973c9402a0fae2e567ad9f","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"}]}