Vulnerability · Published Sep 18, 2024 · Assigned by Linux
CVE-2024-46733btrfs: fix qgroup reserve leaks in cow_file_range
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 7% 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: fix qgroup reserve leaks in cow_file_range In the buffered write path, the dirty page owns the qgroup reserve until it creates an ordered_extent. Therefore, any errors that occur before the ordered_extent is created must free that reservation, or else the space is leaked. The fstest generic/475 exercises various IO error paths, and is able to trigger errors in cow_file_range where we fail to get to allocating the ordered extent. Note that because we *do* clear delalloc, we are likely to remove the inode from the delalloc list, so the inodes/pages to not have invalidate/launder called on them in the commit abort path. This results in failures at the unmount stage of the test that look like: BTRFS: error (device dm-8 state EA) in cleanup_transaction:2018: errno=-5 IO failure BTRFS: error (device dm-8 state EA) in btrfs_replace_file_extents:2416: errno=-5 IO failure BTRFS warning (device dm-8 state EA): qgroup 0/5 has unreleased space, type 0 rsv 28672 ------------[ cut here ]------------ WARNING: CPU: 3 PID: 22588 at fs/btrfs/disk-io.c:4333 close_ctree+0x222/0x4d0 [btrfs] Modules linked in: btrfs blake2b_generic libcrc32c xor zstd_compress raid6_pq CPU: 3 PID: 22588 Comm: umount Kdump: loaded Tainted: G W 6.10.0-rc7-gab56fde445b8 #21 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Arch Linux 1.16.3-1-1 04/01/2014 RIP: 0010:close_ctree+0x222/0x4d0 [btrfs] RSP: 0018:ffffb4465283be00 EFLAGS: 00010202 RAX: 0000000000000001 RBX: ffffa1a1818e1000 RCX: 0000000000000001 RDX: 0000000000000000 RSI: ffffb4465283bbe0 RDI: ffffa1a19374fcb8 RBP: ffffa1a1818e13c0 R08: 0000000100028b16 R09: 0000000000000000 R10: 0000000000000003 R11: 0000000000000003 R12: ffffa1a18ad7972c R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 00007f9168312b80(0000) GS:ffffa1a4afcc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f91683c9140 CR3: 000000010acaa000 CR4: 00000000000006f0 Call Trace: <TASK> ? close_ctree+0x222/0x4d0 [btrfs] ? __warn.cold+0x8e/0xea ? close_ctree+0x222/0x4d0 [btrfs] ? report_bug+0xff/0x140 ? handle_bug+0x3b/0x70 ? exc_invalid_op+0x17/0x70 ? asm_exc_invalid_op+0x1a/0x20 ? close_ctree+0x222/0x4d0 [btrfs] generic_shutdown_super+0x70/0x160 kill_anon_super+0x11/0x40 btrfs_kill_super+0x11/0x20 [btrfs] deactivate_locked_super+0x2e/0xa0 cleanup_mnt+0xb5/0x150 task_work_run+0x57/0x80 syscall_exit_to_user_mode+0x121/0x130 do_syscall_64+0xab/0x1a0 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f916847a887 ---[ end trace 0000000000000000 ]--- BTRFS error (device dm-8 state EA): qgroup reserved space leaked Cases 2 and 3 in the out_reserve path both pertain to this type of leak and must free the reserved qgroup data. Because it is already an error path, I opted not to handle the possible errors in btrfs_free_qgroup_data.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.135-1 | DEBIAN-CVE-2024-46733 |
| Debian:12 | linux | 6.1.135-1 | DSA-5907-1 |
| Debian:13 | linux | 6.10.9-1 | DEBIAN-CVE-2024-46733 |
| Debian:14 | linux | 6.10.9-1 | DEBIAN-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux | 6.8.0-50.51 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-aws | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1020.22 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1020.22~22.04.1 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-azure | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1020.23 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1020.23~22.04.1 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-azure-fde | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-gcp | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1019.21 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1019.21~22.04.1 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-gke | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1015.19 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-gkeop | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1002.4 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-50.51~22.04.1 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-ibm | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1017.17 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 6.8.0-1017.17~22.04.1 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-intel-iotg | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-kvm | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-lowlatency | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-50.51.1 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-50.51.1~22.04.1 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-nvidia | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1019.21 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1019.21~22.04.1 | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1019.21.1 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1018.18 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-oracle | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1017.18 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1017.18~22.04.1 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-raspi | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1016.18 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux-riscv | 6.8.0-50.51.1 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 6.8.0-50.51.1~22.04.1 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2024-46733 |
| Ubuntu:24.04:LTS | linux-xilinx | 6.8.0-1017.18 | UBUNTU-CVE-2024-46733 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | no fix listed | UBUNTU-CVE-2024-46733 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5 – before 159f0f61b283ea71e827dd0c18c5dce197de1fa27dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5 – before 84464db2ec2a55b9313d5f264da196a37ec809947dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5 – before e42ef22bc10f0309c0c65d8d6ca8b4127a674b7f7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5 – before 30479f31d44d47ed00ae0c7453d9b253537005b2 |
| Linux | Linux | 5.9 |
References
- https://git.kernel.org/stable/c/159f0f61b283ea71e827dd0c18c5dce197de1fa2
- https://git.kernel.org/stable/c/84464db2ec2a55b9313d5f264da196a37ec80994
- https://git.kernel.org/stable/c/e42ef22bc10f0309c0c65d8d6ca8b4127a674b7f
- https://git.kernel.org/stable/c/30479f31d44d47ed00ae0c7453d9b253537005b2
- https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html