Vulnerability · Published Apr 3, 2024 · Assigned by Linux
CVE-2024-26727btrfs: do not ASSERT() if the newly created subvolume already got read
Medium 5.5
In plain English
A medium-severity 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 14% 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 ASSERT() if the newly created subvolume already got read [BUG] There is a syzbot crash, triggered by the ASSERT() during subvolume creation: assertion failed: !anon_dev, in fs/btrfs/disk-io.c:1319 ------------[ cut here ]------------ kernel BUG at fs/btrfs/disk-io.c:1319! invalid opcode: 0000 [#1] PREEMPT SMP KASAN RIP: 0010:btrfs_get_root_ref.part.0+0x9aa/0xa60 <TASK> btrfs_get_new_fs_root+0xd3/0xf0 create_subvol+0xd02/0x1650 btrfs_mksubvol+0xe95/0x12b0 __btrfs_ioctl_snap_create+0x2f9/0x4f0 btrfs_ioctl_snap_create+0x16b/0x200 btrfs_ioctl+0x35f0/0x5cf0 __x64_sys_ioctl+0x19d/0x210 do_syscall_64+0x3f/0xe0 entry_SYSCALL_64_after_hwframe+0x63/0x6b ---[ end trace 0000000000000000 ]--- [CAUSE] During create_subvol(), after inserting root item for the newly created subvolume, we would trigger btrfs_get_new_fs_root() to get the btrfs_root of that subvolume. The idea here is, we have preallocated an anonymous device number for the subvolume, thus we can assign it to the new subvolume. But there is really nothing preventing things like backref walk to read the new subvolume. If that happens before we call btrfs_get_new_fs_root(), the subvolume would be read out, with a new anonymous device number assigned already. In that case, we would trigger ASSERT(), as we really expect no one to read out that subvolume (which is not yet accessible from the fs). But things like backref walk is still possible to trigger the read on the subvolume. Thus our assumption on the ASSERT() is not correct in the first place. [FIX] Fix it by removing the ASSERT(), and just free the @anon_dev, reset it to 0, and continue. If the subvolume tree is read out by something else, it should have already get a new anon_dev assigned thus we only need to free the preallocated one.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.82-1 | DEBIAN-CVE-2024-26727 |
| Debian:13 | linux | 6.7.7-1 | DEBIAN-CVE-2024-26727 |
| Debian:14 | linux | 6.7.7-1 | DEBIAN-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux | 5.15.0-102.112 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1057.63 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1060.69 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-azure-fde | 5.15.0-1060.69.1 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1055.63 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1054.59 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1040.46 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1050.53 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1052.58 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1054.59 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-102.112 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1048.48 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | 6.5.0-1014.14 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | 5.15.0-1025.25 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | 5.15.0-1012.12 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1055.61 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-raspi | 5.15.0-1050.53 | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2024-26727 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | 5.15.0-1030.34 | UBUNTU-CVE-2024-26727 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788 – before 3f5d47eb163bceb1b9e613c9003bae5fefc0046f2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788 – before e31546b0f34af21738c4ceac47d662c00ee6382f2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788 – before 66b317a2fc45b2ef66527ee3f8fa08fb5beab88d2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788 – before 833775656d447c545133a744a0ed1e189ce614302dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788 – before 5a172344bfdabb46458e03708735d7b1a918c4682dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788 – before e03ee2fe873eb68c1f9ba5112fee70303ebf9dfb917d608fe375041eb7f29befa6a6d7fd3cf32dde5.8.3 – before 5.9 |
| Linux | Linux | 5.9 |
References
- https://git.kernel.org/stable/c/3f5d47eb163bceb1b9e613c9003bae5fefc0046f
- https://git.kernel.org/stable/c/e31546b0f34af21738c4ceac47d662c00ee6382f
- https://git.kernel.org/stable/c/66b317a2fc45b2ef66527ee3f8fa08fb5beab88d
- https://git.kernel.org/stable/c/833775656d447c545133a744a0ed1e189ce61430
- https://git.kernel.org/stable/c/5a172344bfdabb46458e03708735d7b1a918c468
- https://git.kernel.org/stable/c/e03ee2fe873eb68c1f9ba5112fee70303ebf9dfb
- https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html x_transferred