Vulnerability · Published Aug 6, 2026 · Assigned by Linux
CVE-2026-64593btrfs: do not trim a device which is not writeable
Unrated
In plain English
A security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 6% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: btrfs: do not trim a device which is not writeable [BUG] There is a bug report that btrfs/242 can randomly fail with the following NULL pointer dereference: run fstests btrfs/242 at 2026-06-01 10:25:08 BTRFS: device fsid d4d7f234-487c-4787-88e4-47a8b68c9874 devid 1 transid 9 /dev/sdc (8:32) scanned by mount (122609) BTRFS info (device sdc): first mount of filesystem d4d7f234-487c-4787-88e4-47a8b68c9874 BTRFS info (device sdc): using crc32c checksum algorithm BTRFS warning (device sdc): devid 2 uuid fbe72d72-3272-482d-80fb-ab88ed398192 is missing BTRFS warning (device sdc): devid 2 uuid fbe72d72-3272-482d-80fb-ab88ed398192 is missing BTRFS info (device sdc): allowing degraded mounts BTRFS info (device sdc): turning on async discard BTRFS info (device sdc): enabling free space tree Unable to handle kernel NULL pointer dereference at virtual address 0000000000000018 user pgtable: 4k pages, 48-bit VAs, pgdp=000000013fd6b000 CPU: 4 UID: 0 PID: 122625 Comm: fstrim Not tainted 7.0.10-2-default #1 PREEMPT(full) openSUSE Tumbleweed e9a5f6b24978fba3bf015a992f865837fdfff3dd Hardware name: QEMU KVM Virtual Machine, BIOS edk2-20250812-19.fc42 08/12/2025 pstate: 01400005 (nzcv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--) pc : btrfs_trim_fs+0x34c/0xa00 [btrfs] lr : btrfs_trim_fs+0x1f0/0xa00 [btrfs] Call trace: btrfs_trim_fs+0x34c/0xa00 [btrfs f02c1d570ceea621c69d302ba75dd61868083840] (P) btrfs_ioctl_fitrim+0xe8/0x178 [btrfs f02c1d570ceea621c69d302ba75dd61868083840] btrfs_ioctl+0xdd4/0x2bd8 [btrfs f02c1d570ceea621c69d302ba75dd61868083840] __arm64_sys_ioctl+0xac/0x108 invoke_syscall.constprop.0+0x5c/0xd0 el0_svc_common.constprop.0+0x40/0xf0 do_el0_svc+0x24/0x40 el0_svc+0x40/0x1d0 el0t_64_sync_handler+0xa0/0xe8 el0t_64_sync+0x1b0/0x1b8 Code: 17ffff83 f94017e0 f9002be0 f9402ea0 (f9400c00) ---[ end trace 0000000000000000 ]--- Also the reporter is very kind to test the following ASSERT() added to btrfs_trim_free_extents_throttle(): ASSERT(device->bdev, "devid=%llu path=%s dev_state=0x%lx\n", device->devid, btrfs_dev_name(device), device->dev_state); And it shows the following output: assertion failed: device->bdev, in extent-tree.c:6630 (devid=2 path=/dev/sdd dev_state=0x82) Which means the device->bdev is NULL, and the dev_state is BTRFS_DEV_STATE_IN_FS_METADATA | BTRFS_DEV_STATE_ITEM_FOUND, without BTRFS_DEV_STATE_WRITEABLE flag set. [CAUSE] The pc points to the following call chain: btrfs_trim_fs() |- btrfs_trim_free_extents() |- btrfs_trim_free_extents_throttle() |- bdev_max_discard_sectors(device->bdev) So the NULL pointer dereference is caused by device->bdev being NULL. This looks impossible by a quick glance, as just before calling btrfs_trim_free_extents_throttle(), we have skipped any device that has BTRFS_DEV_STATE_MISSING flag set. However in this particular case, there is a window where the missing device is later re-scanned, causing btrfs to remove the BTRFS_DEV_STATE_MISSING flag: btrfs_control_ioctl() |- btrfs_scan_one_device() |- device_list_add() |- rcu_assign_pointer(device->name, name); | This updates the missing device's path to the new good path. | |- clear_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state) This removes the BTRFS_DEV_STATE_MISSING flag. This allows the missing device to re-appear and clear the BTRFS_DEV_STATE_MISSING flag. However the device still does not have the BTRFS_DEV_STATE_WRITEABLE flag set, nor is its bdev pointer updated. The bdev pointer remains NULL, triggering the crash later. [FIX] This is a big de-synchronization between BTRFS_DEV_STATE_MISSING and device->bdev pointer, and shows a gap in btrfs's re-appearing-device handling. The proper handling of re-appearing device will need quite some extra work, which is out of the context of this small ---truncated---
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.180-1 | DEBIAN-CVE-2026-64593 |
| Debian:13 | linux | 6.12.96-1 | DEBIAN-CVE-2026-64593 |
| Debian:14 | linux | 7.1.4-1 | DEBIAN-CVE-2026-64593 |
| Debian:12 | linux-6.12 | 6.12.100-1~deb12u1 | DEBIAN-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux | 5.15.0-198.208 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux | 6.8.0-147.147 | UBUNTU-CVE-2026-64593 |
| Ubuntu:26.04:LTS | linux | 7.0.0-31.31 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1117.124 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1067.70 | UBUNTU-CVE-2026-64593 |
| Ubuntu:26.04:LTS | linux-aws | 7.0.0-1012.12 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-aws-6.14 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-aws-6.17 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-aws-7.0 | 7.0.0-1012.12~24.04.1 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1123.132 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1071.79 | UBUNTU-CVE-2026-64593 |
| Ubuntu:26.04:LTS | linux-azure | 7.0.0-1014.14 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-azure-6.14 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-azure-6.17 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-azure-7.0 | 7.0.0-1014.14~24.04.1 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-azure-fde | 5.15.0-1122.131 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-azure-fde | 6.8.0-1069.76 | UBUNTU-CVE-2026-64593 |
| Ubuntu:26.04:LTS | linux-azure-fde | 7.0.0-1013.13 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-azure-fde-6.14 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-azure-fde-6.17 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.8 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-azure-fde-7.0 | 7.0.0-1013.13~24.04.1 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-azure-nvidia | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-azure-nvidia-6.14 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1118.128 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1071.79 | UBUNTU-CVE-2026-64593 |
| Ubuntu:26.04:LTS | linux-gcp | 7.0.0-1011.11 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-gcp-6.14 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-gcp-6.17 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-gcp-7.0 | 7.0.0-1011.11~24.04.1 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1113.119 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1066.74 | UBUNTU-CVE-2026-64593 |
| Ubuntu:26.04:LTS | linux-gke | 7.0.0-1006.7 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1100.108 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1052.56 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-hwe-6.11 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-hwe-6.14 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-hwe-6.17 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-hwe-7.0 | 7.0.0-31.31~24.04.1 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1111.115 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1067.68 | UBUNTU-CVE-2026-64593 |
| Ubuntu:26.04:LTS | linux-ibm | 7.0.0-1013.13 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1112.118 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1109.114 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-195.205 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-147.147.1 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-lowlatency-hwe-6.11 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1112.113 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-nvidia | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:26.04:LTS | linux-nvidia | 7.0.0-1018.18 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-nvidia-6.11 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-nvidia-6.17 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-nvidia-7.0 | 7.0.0-1018.18~24.04.1 | UBUNTU-CVE-2026-64593 |
| Ubuntu:26.04:LTS | linux-nvidia-bos | 7.0.0-2018.18 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | 5.15.0-1070.72 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-nvidia-tegra | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | 5.15.0-1059.59 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-oem-6.14 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-oem-6.17 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:26.04:LTS | linux-oem-7.0 | 7.0.0-1013.13 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1114.120 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1064.67 | UBUNTU-CVE-2026-64593 |
| Ubuntu:26.04:LTS | linux-oracle | 7.0.0-1011.11 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-oracle-6.14 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-oracle-6.17 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-oracle-7.0 | 7.0.0-1011.11~24.04.1 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-raspi | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-raspi | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:26.04:LTS | linux-raspi | 7.0.0-1019.19 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:26.04:LTS | linux-realtime | 7.0.0-31.31.1 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:26.04:LTS | linux-riscv | 7.0.0-31.31.1 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-riscv-6.14 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-riscv-6.17 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-riscv-7.0 | 7.0.0-31.31.1~24.04.1 | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-vmware | 6.8.0-1008.8 | UBUNTU-CVE-2026-64593 |
| Ubuntu:24.04:LTS | linux-xilinx | no fix listed | UBUNTU-CVE-2026-64593 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | 5.15.0-1080.84 | UBUNTU-CVE-2026-64593 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 499f377f49f085ee4aa214c738e948e88626f39b – before f41ae7e6664f3c4361129728f2c4d5f3ed995251499f377f49f085ee4aa214c738e948e88626f39b – before 210af872eafa0cf572a84cb303c0f9d2914c1226499f377f49f085ee4aa214c738e948e88626f39b – before 3d8fa4b828a86b33c60858e58aaab6df273ede05499f377f49f085ee4aa214c738e948e88626f39b – before 9c894159c5b8adc84072e3af0e55b0473a69564e499f377f49f085ee4aa214c738e948e88626f39b – before 02c903fc6fc7e16c5d1f22d18784f1208acf43e3499f377f49f085ee4aa214c738e948e88626f39b – before 7a64521802997257b144e6edfb4e278dbeb972dd499f377f49f085ee4aa214c738e948e88626f39b – before b4af31b898a948e29861cb0bae734058f9a49d9b499f377f49f085ee4aa214c738e948e88626f39b – before 1b1937eb08f51319bf71575484cde2b8c517aedc |
| Linux | Linux | 4.3 |
References
- https://git.kernel.org/stable/c/f41ae7e6664f3c4361129728f2c4d5f3ed995251
- https://git.kernel.org/stable/c/210af872eafa0cf572a84cb303c0f9d2914c1226
- https://git.kernel.org/stable/c/3d8fa4b828a86b33c60858e58aaab6df273ede05
- https://git.kernel.org/stable/c/9c894159c5b8adc84072e3af0e55b0473a69564e
- https://git.kernel.org/stable/c/02c903fc6fc7e16c5d1f22d18784f1208acf43e3
- https://git.kernel.org/stable/c/7a64521802997257b144e6edfb4e278dbeb972dd
- https://git.kernel.org/stable/c/b4af31b898a948e29861cb0bae734058f9a49d9b
- https://git.kernel.org/stable/c/1b1937eb08f51319bf71575484cde2b8c517aedc