Description
In the Linux kernel, the following vulnerability has been resolved:
btrfs: don't drop extent_map for free space inode on write error
While running the CI for an unrelated change I hit the following panic
with generic/648 on btrfs_holes_spacecache.
assertion failed: block_start != EXTENT_MAP_HOLE, in fs/btrfs/extent_io.c:1385
------------[ cut here ]------------
kernel BUG at fs/btrfs/extent_io.c:1385!
invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
CPU: 1 PID: 2695096 Comm: fsstress Kdump: loaded Tainted: G W 6.8.0-rc2+ #1
RIP: 0010:__extent_writepage_io.constprop.0+0x4c1/0x5c0
Call Trace:
<TASK>
extent_write_cache_pages+0x2ac/0x8f0
extent_writepages+0x87/0x110
do_writepages+0xd5/0x1f0
filemap_fdatawrite_wbc+0x63/0x90
__filemap_fdatawrite_range+0x5c/0x80
btrfs_fdatawrite_range+0x1f/0x50
btrfs_write_out_cache+0x507/0x560
btrfs_write_dirty_block_groups+0x32a/0x420
commit_cowonly_roots+0x21b/0x290
btrfs_commit_transaction+0x813/0x1360
btrfs_sync_file+0x51a/0x640
__x64_sys_fdatasync+0x52/0x90
do_syscall_64+0x9c/0x190
entry_SYSCALL_64_after_hwframe+0x6e/0x76
This happens because we fail to write out the free space cache in one
instance, come back around and attempt to write it again. However on
the second pass through we go to call btrfs_get_extent() on the inode to
get the extent mapping. Because this is a new block group, and with the
free space inode we always search the commit root to avoid deadlocking
with the tree, we find nothing and return a EXTENT_MAP_HOLE for the
requested range.
This happens because the first time we try to write the space cache out
we hit an error, and on an error we drop the extent mapping. This is
normal for normal files, but the free space cache inode is special. We
always expect the extent map to be correct. Thus the second time
through we end up with a bogus extent map.
Since we're deprecating this feature, the most straightforward way to
fix this is to simply skip dropping the extent map range for this failed
range.
I shortened the test by using error injection to stress the area to make
it easier to reproduce. With this patch in place we no longer panic
with my error injection test.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Linux | Linux | 3.12 | 5.15.187 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | linux | 6.7.7-1 | — |
| Debian 13 | linux | 6.7.7-1 | — |
| Debian 12 | linux | 6.1.82-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Nvidia-BlueField 22.04 LTS | linux-bluefield | 5.15.0-1076.78 | — |
| Ubuntu 22.04 LTS | linux +1 | 5.15.0-156.166 | USN-7774-1 |
| Ubuntu 22.04 LTS | linux-aws | 5.15.0-1092.99 | USN-7774-1 |
| Ubuntu 22.04 LTS | linux-aws-6.5 | 6.5.0-1023.23~22.04.1 | USN-6895-3 |
| Ubuntu 22.04 LTS | linux-azure | 5.15.0-1096.105 | USN-7775-2 |
| Ubuntu 22.04 LTS | linux-azure-6.5 | 6.5.0-1024.25~22.04.1 | USN-6895-2 |
| Ubuntu 22.04 LTS | linux-azure-fde | 5.15.0-1096.105.1 | — |
| Ubuntu 22.04 LTS | linux-gcp | 5.15.0-1092.101 | USN-7774-1 |
| Ubuntu 22.04 LTS | linux-gcp-6.5 | 6.5.0-1024.26~22.04.1 | USN-6895-2 |
| Ubuntu 22.04 LTS | linux-gke | 5.15.0-1089.95 | USN-7774-1 |
| Ubuntu 22.04 LTS | linux-gkeop | 5.15.0-1075.83 | USN-7774-1 |
| Ubuntu 22.04 LTS | linux-hwe-6.5 | 6.5.0-44.44~22.04.1 | USN-6900-1 |
| Ubuntu 22.04 LTS | linux-ibm +1 | 5.15.0-1086.89 | USN-7774-1 |
| Ubuntu 22.04 LTS | linux-intel-iotg | 5.15.0-1087.93 | USN-7774-1 |
| Ubuntu 22.04 LTS | linux-kvm | 5.15.0-1088.93 | USN-7774-4 |
| Ubuntu 22.04 LTS | linux-lowlatency-hwe-6.5 | 6.5.0-44.44.1~22.04.1 | USN-6895-3 |
| Ubuntu 22.04 LTS | linux-nvidia | 5.15.0-1087.88 | USN-7774-1 |
| Ubuntu 22.04 LTS | linux-nvidia-6.5 | 6.5.0-1023.24 | USN-6895-1 |
| Ubuntu 22.04 LTS | linux-nvidia-tegra | 5.15.0-1045.45 | USN-7774-1 |
| Ubuntu 22.04 LTS | linux-nvidia-tegra-igx | 5.15.0-1034.34 | USN-7774-5 |
| Ubuntu 22.04 LTS | linux-oem-6.5 | 6.5.0-1027.28 | USN-6895-4 |
| Ubuntu 22.04 LTS | linux-oracle | 5.15.0-1090.96 | USN-7774-1 |
| Ubuntu 22.04 LTS | linux-oracle-6.5 | 6.5.0-1026.26~22.04.1 | USN-6895-3 |
| Ubuntu 22.04 LTS | linux-riscv +23 | No fix yet | — |
| Ubuntu 22.04 LTS | linux-starfive-6.5 | 6.5.0-1017.18~22.04.1 | USN-6895-3 |
| Ubuntu 22.04 LTS | linux-xilinx-zynqmp | 5.15.0-1056.60 | USN-7774-1 |
| Ubuntu 20.04 LTS | linux-gke +28 | No fix yet | — |
| Ubuntu 18.04 LTS | linux-gcp +14 | No fix yet | — |
| Ubuntu 16.04 LTS | linux-hwe-edge | No fix yet | — |
Show 14 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro Realtime 24.04 LTS | linux-raspi-realtime | 6.8.0-2002.2 | — |
| Ubuntu Pro Realtime 22.04 LTS | linux-intel-iot-realtime | 5.15.0-1085.87 | USN-7774-3 |
| Ubuntu Pro Realtime 22.04 LTS | linux-realtime | 5.15.0-1092.101 | USN-7774-3 |
| Ubuntu Pro FIPS 20.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS 18.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS 16.04 LTS | linux-fips | No fix yet | — |
| Ubuntu Pro FIPS-updates 22.04 LTS | linux-aws-fips | 5.15.0-1092.99+fips1 | USN-7774-2 |
| Ubuntu Pro FIPS-updates 22.04 LTS | linux-azure-fips | 5.15.0-1096.105+fips1 | USN-7775-1 |
| Ubuntu Pro FIPS-updates 22.04 LTS | linux-fips | 5.15.0-156.166+fips1 | USN-7774-2 |
| Ubuntu Pro FIPS-updates 22.04 LTS | linux-gcp-fips | 5.15.0-1092.101+fips1 | USN-7774-2 |
| Ubuntu Pro FIPS-updates 20.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS-updates 18.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS-updates 16.04 LTS | linux-fips | No fix yet | — |
| Ubuntu Pro FIPS-preview 22.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro 20.04 LTS | linux +10 | No fix yet | — |
| Ubuntu Pro 20.04 LTS | linux-aws-5.15 | 5.15.0-1092.99~20.04.1 | USN-7774-1 |
| Ubuntu Pro 20.04 LTS | linux-azure-5.15 | 5.15.0-1096.105~20.04.1 | USN-7775-3 |
| Ubuntu Pro 20.04 LTS | linux-gcp-5.15 | 5.15.0-1092.101~20.04.1 | USN-7774-1 |
| Ubuntu Pro 20.04 LTS | linux-hwe-5.15 +1 | 5.15.0-156.166~20.04.1 | USN-7774-1 |
| Ubuntu Pro 20.04 LTS | linux-ibm-5.15 | 5.15.0-1086.89~20.04.1 | USN-7774-1 |
| Ubuntu Pro 20.04 LTS | linux-intel-iotg-5.15 | 5.15.0-1087.93~20.04.1 | USN-7774-1 |
| Ubuntu Pro 20.04 LTS | linux-nvidia-tegra-5.15 | 5.15.0-1045.45~20.04.1 | USN-7774-1 |
| Ubuntu Pro 20.04 LTS | linux-oracle-5.15 | 5.15.0-1090.96~20.04.1 | USN-7776-1 |
| Ubuntu Pro 20.04 LTS | linux-riscv-5.15 | 5.15.0-1087.91~20.04.1 | — |
| Ubuntu Pro 18.04 LTS | linux +12 | No fix yet | — |
| Ubuntu Pro 16.04 LTS | linux +7 | No fix yet | — |
| Ubuntu Pro 14.04 LTS | linux +3 | No fix yet | — |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP6 | kernel-64kb +3 | 6.4.0-150600.23.7.3 | SUSE-SU-2024:2203-1 |
| SLES 15 SP6 | kernel-azure +1 | 6.4.0-150600.8.5.4 | SUSE-SU-2024:2135-1 |
| SLES 15 SP6 | kernel-default-base | 6.4.0-150600.23.7.3.150600.12.2.7 | SUSE-SU-2024:2203-1 |
| SLES 15 SP6 | kernel-docs | 6.4.0-150600.23.7.4 | SUSE-SU-2024:2203-1 |
| SLES 15 SP6 | kernel-source | 6.4.0-150600.23.7.2 | SUSE-SU-2024:2203-1 |
| SLES 15 SP6 | kernel-syms | 6.4.0-150600.23.7.1 | SUSE-SU-2024:2203-1 |
| SLES 15 SP6 | kernel-syms-azure | 6.4.0-150600.8.5.1 | SUSE-SU-2024:2135-1 |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLE Micro 6.0 | kernel-default-base | 6.4.0-17.1.1.51 | SUSE-SU-2025:20008-1 |
| SLE Micro 6.0 | kernel-rt +1 | 6.4.0-9.1 | SUSE-SU-2025:20028-1 |
| SLE Micro 6.0 | kernel-source +2 | 6.4.0-18.1 | SUSE-SU-2025:20008-1 |
| SLE Live Patching 15 SP6 | kernel-default | 6.4.0-150600.23.7.3 | SUSE-SU-2024:2203-1 |
| SLE Live Patching 15 SP6 | kernel-livepatch-SLE15-SP6-RT_Update_1 | 1-150600.1.5.1 | SUSE-SU-2024:2973-1 |
| SLE Live Patching 15 SP6 | kernel-livepatch-SLE15-SP6_Update_1 | 1-150600.13.3.7 | SUSE-SU-2024:2203-1 |
| SUSE Real Time Module 15 SP6 | kernel-rt +3 | 6.4.0-150600.10.5.1 | SUSE-SU-2024:2973-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Leap 15.6 | dtb-aarch64 +2 | 6.4.0-150600.23.7.1 | SUSE-SU-2024:2203-1 |
| openSUSE Leap 15.6 | kernel-64kb +5 | 6.4.0-150600.23.7.3 | SUSE-SU-2024:2203-1 |
| openSUSE Leap 15.6 | kernel-azure +1 | 6.4.0-150600.8.5.4 | SUSE-SU-2024:2135-1 |
| openSUSE Leap 15.6 | kernel-default-base | 6.4.0-150600.23.7.3.150600.12.2.7 | SUSE-SU-2024:2203-1 |
| openSUSE Leap 15.6 | kernel-docs | 6.4.0-150600.23.7.4 | SUSE-SU-2024:2203-1 |
| openSUSE Leap 15.6 | kernel-rt +3 | 6.4.0-150600.10.5.1 | SUSE-SU-2024:2973-1 |
| openSUSE Leap 15.6 | kernel-source | 6.4.0-150600.23.7.2 | SUSE-SU-2024:2203-1 |
| openSUSE Leap 15.6 | kernel-syms-azure | 6.4.0-150600.8.5.1 | SUSE-SU-2024:2135-1 |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | kernel-livepatch-6.1.79-99.164 | 1.0-0.amzn2023 | ALAS2023-2024-549 |
| Amazon Linux 2023 | perf +14 | 6.1.79-99.164.amzn2023 | ALAS2023-2024-549 |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 8 | bpftool +18 | 5.15.0-312.187.5.el9uek | ELSA-2025-20552 |
Advisories 23
- USN-7774-1 linux, linux-aws, linux-aws-5.15, linux-gcp, linux-gcp-5.15, linux-gke, linux-gkeop, linux-hwe-5.15, linux-ibm, linux-ibm-5.15, linux-intel-iotg, linux-intel-iotg-5.15, linux-lowlatency, linux-lowlatency-hwe-5.15, linux-nvidia, linux-nvidia-tegra, linux-nvidia-tegra-5.15, linux-oracle, linux-raspi, linux-xilinx-zynqmp vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-7774-2 linux-aws-fips, linux-fips, linux-gcp-fips vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-7775-1 linux-azure-fips vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-7775-3 linux-azure-5.15 vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-7774-4 linux-kvm vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-7775-2 linux-azure vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-7774-5 linux-nvidia-tegra-igx vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-7774-3 linux-intel-iot-realtime, linux-realtime vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-7776-1 linux-oracle-5.15 vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- WID-SEC-2024-0773 Linux Kernel: Mehrere Schwachstellen BSI CERT-Bund (WID) · Oct 25, 2026
- USN-6895-3 linux-aws-6.5, linux-lowlatency-hwe-6.5, linux-oracle-6.5, linux-starfive-6.5 vulnerabilities Ubuntu Security Notices (USN) · Oct 23, 2026
- USN-6900-1 linux-hwe-6.5 vulnerabilities Ubuntu Security Notices (USN) · Oct 23, 2026
- USN-6895-2 linux-azure-6.5, linux-gcp-6.5 vulnerabilities Ubuntu Security Notices (USN) · Oct 23, 2026
- USN-6895-1 linux, linux-gcp, linux-nvidia-6.5, linux-raspi vulnerabilities Ubuntu Security Notices (USN) · Oct 23, 2026
- USN-6895-4 linux-oem-6.5 vulnerabilities Ubuntu Security Notices (USN) · Oct 23, 2026
- SUSE-SU-2025:20008-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:20028-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2024:2973-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2024:2135-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
- ELSA-2025-20552 Important: Unbreakable Enterprise kernel security update (Oracle Linux 8) Oracle Linux Security Advisories (ELSA) · Sep 8, 2025
- SUSE-SU-2024:2203-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · May 2, 2025
- WID-SEC-2025-0612 IBM Security Guardium: Mehrere Schwachstellen BSI CERT-Bund (WID) · Mar 20, 2025
- ALAS2023-2024-549 Important: kernel security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Mar 10, 2025
References
- https://git.kernel.org/stable/c/143842584c1237ebc248b2547c29d16bbe400a92
- https://git.kernel.org/stable/c/02f2b95b00bf57d20320ee168b30fb7f3db8e555
- https://git.kernel.org/stable/c/7bddf18f474f166c19f91b2baf67bf7c5eda03f7
- https://git.kernel.org/stable/c/a4b7741c8302e28073bfc6dd1c2e73598e5e535e
- https://git.kernel.org/stable/c/5571e41ec6e56e35f34ae9f5b3a335ef510e0ade