CVE-2025-38066 dm cache: prevent BUG_ON by blocking retries on failed device resumes
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: partial
- Technology
- Linux KernelUbuntuDebian
Description
In the Linux kernel, the following vulnerability has been resolved:
dm cache: prevent BUG_ON by blocking retries on failed device resumes
A cache device failing to resume due to mapping errors should not be
retried, as the failure leaves a partially initialized policy object.
Repeating the resume operation risks triggering BUG_ON when reloading
cache mappings into the incomplete policy object.
Reproduce steps:
- create a cache metadata consisting of 512 or more cache blocks,
with some mappings stored in the first array block of the mapping
array. Here we use cache_restore v1.0 to build the metadata.
cat <<EOF >> cmeta.xml
<superblock uuid="" block_size="128" nr_cache_blocks="512"
policy="smq" hint_width="4">
<mappings>
<mapping cache_block="0" origin_block="0" dirty="false"/>
</mappings>
</superblock>
EOF
dmsetup create cmeta --table "0 8192 linear /dev/sdc 0"
cache_restore -i cmeta.xml -o /dev/mapper/cmeta --metadata-version=2
dmsetup remove cmeta
- wipe the second array block of the mapping array to simulate
data degradations.
mapping_root=$(dd if=/dev/sdc bs=1c count=8 skip=192
2>/dev/null | hexdump -e '1/8 "%u\n"')
ablock=$(dd if=/dev/sdc bs=1c count=8 skip=$((4096*mapping_root+2056))
2>/dev/null | hexdump -e '1/8 "%u\n"')
dd if=/dev/zero of=/dev/sdc bs=4k count=1 seek=$ablock
- try bringing up the cache device. The resume is expected to fail
due to the broken array block.
dmsetup create cmeta --table "0 8192 linear /dev/sdc 0"
dmsetup create cdata --table "0 65536 linear /dev/sdc 8192"
dmsetup create corig --table "0 524288 linear /dev/sdc 262144"
dmsetup create cache --notable
dmsetup load cache --table "0 524288 cache /dev/mapper/cmeta
/dev/mapper/cdata /dev/mapper/corig 128 2 metadata2 writethrough smq 0"
dmsetup resume cache
- try resuming the cache again. An unexpected BUG_ON is triggered
while loading cache mappings.
dmsetup resume cache
Kernel logs:
(snip)
------------[ cut here ]------------
kernel BUG at drivers/md/dm-cache-policy-smq.c:752!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 332 Comm: dmsetup Not tainted 6.13.4 #3
RIP: 0010:smq_load_mapping+0x3e5/0x570
Fix by disallowing resume operations for devices that failed the
initial attempt.
Upgrade path
11 packages: 10 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| azure linux kernel(Azure Linux 3.0) | < 6.6.96.1-1 | 6.6.96.1-1 | Fixed |
| debian/linux(Debian 12) | < 6.1.147-1; = 6.1.27-1; = 6.1.37-1; = 6.1.38-1 +38 more | 6.1.147-1 | Fixed |
| debian/linux(Debian 13) | < 6.12.32-1 | 6.12.32-1 | Fixed |
| debian/linux(Debian 14) | < 6.12.32-1 | 6.12.32-1 | Fixed |
| Linux kernel | < 5.4.294; < 5.10.238; < 5.15.185; < 6.1.141 +19 more | 5.4.294, 5.10.238, 5.15.185, 5da692e2262b8f81993baa9592f57d12c2703dea, 6.1.141, 6.6.93, 6.12.31, 6.14.9, 6.15, 025c8f477625eb39006ded650e7d027bcfb20e79, 00586b78eeb7c626a14ca13453a1631f88a7cf36, 3986ef4a9b6a0d9c28bc325d8713beba5e67586f, c5356a5e80442131e2714d0d26bb110590e4e568, c614584c2a66b538f469089ac089457a34590c14, cc80a5cc520939d0a7d071cc4ae4b3c55ef171d0, f3128e3074e8af565cc6a66fe3384a56df87f803 | Fixed |
| ubuntu/linux(Ubuntu 22.04) | < 5.15.0-152.162 | 5.15.0-152.162 | Fixed |
| ubuntu/linux(Ubuntu 24.04) | < 6.8.0-100.100 | 6.8.0-100.100 | Fixed |
| ubuntu/linux-kvm(Ubuntu 22.04) | < 5.15.0-1086.91 | 5.15.0-1086.91 | Fixed |
| ubuntu/linux-raspi(Ubuntu 22.04) | < 5.15.0-1084.87 | 5.15.0-1084.87 | Fixed |
| ubuntu/linux-raspi(Ubuntu 24.04) | < 6.8.0-1047.51 | 6.8.0-1047.51 | Fixed |
| debian linux | = 11.0 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| azure linux kernel(Azure Linux:3.0) | < 6.6.96.1-1 | 6.6.96.1-1 |
| debian/linux(Debian:12) | < 6.1.147-1 | 6.1.147-1 |
| debian/linux(Debian:12) | = 6.1.106-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.106-2 | No fix listed |
| debian/linux(Debian:12) | = 6.1.106-3 | No fix listed |
| debian/linux(Debian:12) | = 6.1.112-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.115-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.119-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.123-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.124-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.128-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.129-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.133-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.135-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.137-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.139-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.140-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.27-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.37-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-2 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-2~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-3 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-4 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-4~bpo11+1 | No fix listed |
Show 49 more
| Product | Affected versions | Fixed in |
|---|---|---|
| debian/linux(Debian:12) | = 6.1.52-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.55-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.55-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.64-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.66-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.67-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.69-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.69-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.76-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.76-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.82-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.85-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.90-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.90-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.94-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.94-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.98-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.99-1 | No fix listed |
| debian/linux(Debian:13) | < 6.12.32-1 | 6.12.32-1 |
| debian/linux(Debian:14) | < 6.12.32-1 | 6.12.32-1 |
| Linux kernel | >= 66a636356647a9be8885c2ce2948de126577698a, < c614584c2a66b538f469089ac089457a34590c14 | c614584c2a66b538f469089ac089457a34590c14 |
| Linux kernel | >= 66a636356647a9be8885c2ce2948de126577698a, < c5356a5e80442131e2714d0d26bb110590e4e568 | c5356a5e80442131e2714d0d26bb110590e4e568 |
| Linux kernel | >= 66a636356647a9be8885c2ce2948de126577698a, < 025c8f477625eb39006ded650e7d027bcfb20e79 | 025c8f477625eb39006ded650e7d027bcfb20e79 |
| Linux kernel | >= 66a636356647a9be8885c2ce2948de126577698a, < 00586b78eeb7c626a14ca13453a1631f88a7cf36 | 00586b78eeb7c626a14ca13453a1631f88a7cf36 |
| Linux kernel | >= 66a636356647a9be8885c2ce2948de126577698a, < 3986ef4a9b6a0d9c28bc325d8713beba5e67586f | 3986ef4a9b6a0d9c28bc325d8713beba5e67586f |
| Linux kernel | >= 66a636356647a9be8885c2ce2948de126577698a, < cc80a5cc520939d0a7d071cc4ae4b3c55ef171d0 | cc80a5cc520939d0a7d071cc4ae4b3c55ef171d0 |
| Linux kernel | >= 66a636356647a9be8885c2ce2948de126577698a, < f3128e3074e8af565cc6a66fe3384a56df87f803 | f3128e3074e8af565cc6a66fe3384a56df87f803 |
| Linux kernel | >= 66a636356647a9be8885c2ce2948de126577698a, < 5da692e2262b8f81993baa9592f57d12c2703dea | 5da692e2262b8f81993baa9592f57d12c2703dea |
| Linux kernel | = 4.2 | No fix listed |
| Linux kernel | < 5.4.294 | 5.4.294 |
| Linux kernel | < 5.10.238 | 5.10.238 |
| Linux kernel | < 5.15.185 | 5.15.185 |
| Linux kernel | < 6.1.141 | 6.1.141 |
| Linux kernel | < 6.6.93 | 6.6.93 |
| Linux kernel | < 6.12.31 | 6.12.31 |
| Linux kernel | < 6.14.9 | 6.14.9 |
| Linux kernel | < 6.15 | 6.15 |
| ubuntu/linux(Ubuntu:22.04) | < 5.15.0-152.162 | 5.15.0-152.162 |
| ubuntu/linux-kvm(Ubuntu:22.04) | < 5.15.0-1086.91 | 5.15.0-1086.91 |
| ubuntu/linux-raspi(Ubuntu:22.04) | < 5.15.0-1084.87 | 5.15.0-1084.87 |
| ubuntu/linux(Ubuntu:24.04) | < 6.8.0-100.100 | 6.8.0-100.100 |
| ubuntu/linux-raspi(Ubuntu:24.04) | < 6.8.0-1047.51 | 6.8.0-1047.51 |
| Linux kernel | >= 5.5, < 5.10.238 | 5.10.238 |
| Linux kernel | >= 5.11, < 5.15.185 | 5.15.185 |
| Linux kernel | >= 5.16, < 6.1.141 | 6.1.141 |
| Linux kernel | >= 6.2, < 6.6.93 | 6.6.93 |
| Linux kernel | >= 6.7, < 6.12.31 | 6.12.31 |
| Linux kernel | >= 6.13, < 6.14.9 | 6.14.9 |
| debian linux | = 11.0 | No fix listed |
References
- MSRC Security Update Guide vendor-advisory
- CBL-Mariner Releases vendor-advisory
- Debian Security Tracker CVE-2025-38066 vendor-advisory
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- lists.debian.org third-party-advisory
- lists.debian.org third-party-advisory
- Ubuntu CVE tracker vendor-advisory
- USN-7704-1 vendor-advisory
- USN-7704-2 vendor-advisory
- USN-7704-3 vendor-advisory
- USN-7704-4 vendor-advisory
- USN-7711-1 vendor-advisory
- USN-7712-1 vendor-advisory
- USN-7704-5 vendor-advisory
- USN-7712-2 vendor-advisory
- USN-7769-1 vendor-advisory
- USN-7770-1 vendor-advisory
- USN-7771-1 vendor-advisory
- USN-7769-2 vendor-advisory
- USN-7769-3 vendor-advisory
- USN-7789-1 vendor-advisory
- USN-7789-2 vendor-advisory
- USN-8028-1 vendor-advisory
- USN-8028-2 vendor-advisory
- USN-8031-1 vendor-advisory
- USN-8028-3 vendor-advisory
- USN-8028-4 vendor-advisory
- USN-8028-5 vendor-advisory
- USN-8031-2 vendor-advisory
- USN-8028-6 vendor-advisory
- USN-8031-3 vendor-advisory
- USN-8052-1 vendor-advisory
- USN-8028-7 vendor-advisory
- USN-8028-8 vendor-advisory
- USN-8052-2 vendor-advisory
- USN-8074-1 vendor-advisory
- USN-8074-2 vendor-advisory
- USN-8126-1 vendor-advisory
- www.cve.org
- ENISA EUVD EUVD-2025-18587 third-party-advisory