{"id":"CVE-2026-143019","summary":"dm snapshot: fix discard writing into the next COW chunk","details":"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-\u003ebi_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' \u003e 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 \u003e /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  \u003c- chunk 2 was zeroed although it was not discarded\nAfter:  aa aa  \u003c- 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.","modified":"2026-12-03T11:00:50.188949445Z","published":"2026-12-03T09:17:54.070Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143019.json"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/0c661d80fdbeea980d3e03b528ecb51e38f0d85e"},{"type":"WEB","url":"https://git.kernel.org/stable/c/19ff998f1d27e1417b286ae0ec88fc19842d4f2f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/1fa8f3def9b79052ed510aa85eefbdb2d7b0ead1"},{"type":"WEB","url":"https://git.kernel.org/stable/c/4a02cc97d87a3c2eb7c37ac6ea7e8ef8e8fc0344"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6a227764d4e9ffdbe9ab4e59e9b24e21fa0e91bd"},{"type":"WEB","url":"https://git.kernel.org/stable/c/73174b4bb6fcd0e6cf973c9402a0fae2e567ad9f"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143019.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-143019"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"2e6023850e177dbaca21498ada04c5a5ac93f812"},{"fixed":"1fa8f3def9b79052ed510aa85eefbdb2d7b0ead1"},{"fixed":"6a227764d4e9ffdbe9ab4e59e9b24e21fa0e91bd"},{"fixed":"4a02cc97d87a3c2eb7c37ac6ea7e8ef8e8fc0344"},{"fixed":"19ff998f1d27e1417b286ae0ec88fc19842d4f2f"},{"fixed":"0c661d80fdbeea980d3e03b528ecb51e38f0d85e"},{"fixed":"73174b4bb6fcd0e6cf973c9402a0fae2e567ad9f"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143019.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.3.0"},{"fixed":"5.10.276"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.227"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.12.120"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.66"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.7"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143019.json"}}],"schema_version":"1.9.2"}