Description
In the Linux kernel, the following vulnerability has been resolved:
btrfs: check folio mapping after unlock in relocate_one_folio()
When we call btrfs_read_folio() to bring a folio uptodate, we unlock the
folio. The result of that is that a different thread can modify the
mapping (like remove it with invalidate) before we call folio_lock().
This results in an invalid page and we need to try again.
In particular, if we are relocating concurrently with aborting a
transaction, this can result in a crash like the following:
BUG: kernel NULL pointer dereference, address: 0000000000000000
PGD 0 P4D 0
Oops: 0000 [#1] SMP
CPU: 76 PID: 1411631 Comm: kworker/u322:5
Workqueue: events_unbound btrfs_reclaim_bgs_work
RIP: 0010:set_page_extent_mapped+0x20/0xb0
RSP: 0018:ffffc900516a7be8 EFLAGS: 00010246
RAX: ffffea009e851d08 RBX: ffffea009e0b1880 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffc900516a7b90 RDI: ffffea009e0b1880
RBP: 0000000003573000 R08: 0000000000000001 R09: ffff88c07fd2f3f0
R10: 0000000000000000 R11: 0000194754b575be R12: 0000000003572000
R13: 0000000003572fff R14: 0000000000100cca R15: 0000000005582fff
FS: 0000000000000000(0000) GS:ffff88c07fd00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000407d00f002 CR4: 00000000007706f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
<TASK>
? __die+0x78/0xc0
? page_fault_oops+0x2a8/0x3a0
? __switch_to+0x133/0x530
? wq_worker_running+0xa/0x40
? exc_page_fault+0x63/0x130
? asm_exc_page_fault+0x22/0x30
? set_page_extent_mapped+0x20/0xb0
relocate_file_extent_cluster+0x1a7/0x940
relocate_data_extent+0xaf/0x120
relocate_block_group+0x20f/0x480
btrfs_relocate_block_group+0x152/0x320
btrfs_relocate_chunk+0x3d/0x120
btrfs_reclaim_bgs_work+0x2ae/0x4e0
process_scheduled_works+0x184/0x370
worker_thread+0xc6/0x3e0
? blk_add_timer+0xb0/0xb0
kthread+0xae/0xe0
? flush_tlb_kernel_range+0x90/0x90
ret_from_fork+0x2f/0x40
? flush_tlb_kernel_range+0x90/0x90
ret_from_fork_asm+0x11/0x20
</TASK>
This occurs because cleanup_one_transaction() calls
destroy_delalloc_inodes() which calls invalidate_inode_pages2() which
takes the folio_lock before setting mapping to NULL. We fail to check
this, and subsequently call set_extent_mapping(), which assumes that
mapping != NULL (in fact it asserts that in debug mode)
Note that the "fixes" patch here is not the one that introduced the
race (the very first iteration of this code from 2009) but a more recent
change that made this particular crash happen in practice.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Linux | Linux | 6.1.54 – < 6.1.141, 6.5.4 – < 6.6, 6.6 | 6.1.141 |
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.12.8-1 | — |
| Debian 13 | linux | 6.12.8-1 | — |
| Debian 12 | linux | 6.1.147-1 | DSA-5973-1 |
| Debian 11 | linux-6.1 | 6.1.153-1~deb11u1 | DLA-4328-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 24.04 LTS | linux | 6.8.0-60.63 | USN-7513-1 |
| Ubuntu 24.04 LTS | linux-aws | 6.8.0-1029.31 | USN-7513-1 |
| Ubuntu 24.04 LTS | linux-azure | 6.8.0-1029.34 | USN-7513-3 |
| Ubuntu 24.04 LTS | linux-azure-6.11 | 6.11.0-1012.12~24.04.1 | — |
| Ubuntu 24.04 LTS | linux-azure-nvidia | 6.8.0-1016.17 | USN-7522-1 |
| Ubuntu 24.04 LTS | linux-gcp | 6.8.0-1030.32 | USN-7515-2 |
| Ubuntu 24.04 LTS | linux-gcp-6.11 | 6.11.0-1011.11~24.04.1 | — |
| Ubuntu 24.04 LTS | linux-gke | 6.8.0-1025.29 | USN-7515-1 |
| Ubuntu 24.04 LTS | linux-gkeop | 6.8.0-1012.14 | USN-7515-2 |
| Ubuntu 24.04 LTS | linux-hwe-6.11 | 6.11.0-21.21~24.04.1 | USN-7379-1 |
| Ubuntu 24.04 LTS | linux-ibm | 6.8.0-1026.26 | USN-7513-1 |
| Ubuntu 24.04 LTS | linux-lowlatency-hwe-6.11 | 6.11.0-1011.12~24.04.1 | USN-7381-1 |
| Ubuntu 24.04 LTS | linux-nvidia | 6.8.0-1028.31 | USN-7514-1 |
| Ubuntu 24.04 LTS | linux-nvidia-6.11 | 6.11.0-1007.7 | — |
| Ubuntu 24.04 LTS | linux-nvidia-lowlatency | 6.8.0-1028.31.1 | USN-7514-1 |
| Ubuntu 24.04 LTS | linux-nvidia-tegra | 6.8.0-1008.8 | — |
| Ubuntu 24.04 LTS | linux-oem-6.11 | 6.11.0-1017.17 | USN-7382-1 |
| Ubuntu 24.04 LTS | linux-oem-6.8 | 6.8.0-1028.28 | USN-7513-3 |
| Ubuntu 24.04 LTS | linux-oracle | 6.8.0-1026.27 | USN-7513-1 |
| Ubuntu 24.04 LTS | linux-raspi | 6.8.0-1028.32 | USN-7524-1 |
| Ubuntu 24.04 LTS | linux-realtime +1 | No fix yet | — |
| Ubuntu 24.04 LTS | linux-riscv +1 | 6.8.0-60.63.1 | USN-7513-1 |
| Ubuntu 24.04 LTS | linux-xilinx | 6.8.0-1017.18 | — |
| Ubuntu 22.04 LTS | linux-aws-6.8 | 6.8.0-1029.31~22.04.1 | USN-7513-1 |
| Ubuntu 22.04 LTS | linux-azure-6.8 | 6.8.0-1029.34~22.04.1 | USN-7513-3 |
| Ubuntu 22.04 LTS | linux-gcp-6.8 | 6.8.0-1030.32~22.04.1 | USN-7515-2 |
| Ubuntu 22.04 LTS | linux-hwe-6.8 | 6.8.0-60.63~22.04.1 | USN-7513-4 |
| Ubuntu 22.04 LTS | linux-ibm-6.8 | 6.8.0-1026.26~22.04.1 | — |
| Ubuntu 22.04 LTS | linux-lowlatency-hwe-6.8 | 6.8.0-60.63.1~22.04.1 | USN-7513-1 |
| Ubuntu 22.04 LTS | linux-nvidia-6.8 | 6.8.0-1028.31~22.04.1 | USN-7514-1 |
| Ubuntu 22.04 LTS | linux-oracle-6.8 | 6.8.0-1026.27~22.04.1 | USN-7513-5 |
| Ubuntu 22.04 LTS | linux-riscv +32 | No fix yet | — |
| Ubuntu 22.04 LTS | linux-riscv-6.8 | 6.8.0-62.65~22.04.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 3 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-2023.24 | USN-7523-1 |
| Ubuntu Pro Realtime 24.04 LTS | linux-realtime | 6.8.1-1022.23 | USN-7513-2 |
| Ubuntu Pro Realtime 22.04 LTS | linux-realtime-6.8 | 6.8.1-1022.23~22.04.1 | — |
| Ubuntu Pro FIPS-updates 24.04 LTS | linux-fips | 6.8.0-78.78+fips1 | — |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP7 | kernel-64kb +6 | 6.4.0-150700.53.3.1 | SUSE-SU-2025:01951-1 |
| SLES 15 SP7 | kernel-azure +2 | 6.4.0-150700.20.3.1 | SUSE-SU-2025:01967-1 |
| SLES 15 SP7 | kernel-default-base | 6.4.0-150700.53.3.1.150700.17.2.1 | SUSE-SU-2025:01951-1 |
| SLES 15 SP6 | kernel-64kb +3 | 6.4.0-150600.23.47.2 | SUSE-SU-2025:1180-1 |
| SLES 15 SP6 | kernel-azure +1 | 6.4.0-150600.8.34.2 | SUSE-SU-2025:1177-1 |
| SLES 15 SP6 | kernel-coco +3 | 6.4.0-15061.21.coco15sp6.1 | SUSE-SU-2025:01919-1 |
| SLES 15 SP6 | kernel-default-base | 6.4.0-150600.23.47.2.150600.12.20.2 | SUSE-SU-2025:1180-1 |
| SLES 15 SP6 | kernel-docs +2 | 6.4.0-150600.23.47.1 | SUSE-SU-2025:1180-1 |
| SLES 15 SP6 | kernel-syms-azure | 6.4.0-150600.8.34.1 | SUSE-SU-2025:1177-1 |
Show 5 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLE Micro 6.1 | kernel-default-base | 6.4.0-28.1.21.6 | SUSE-SU-2025:20270-1 |
| SLE Micro 6.1 | kernel-livepatch-MICRO-6-0_Update_6 +1 | 1-3.1 | SUSE-SU-2025:20270-1, SUSE-SU-2025:20260-1 |
| SLE Micro 6.1 | kernel-rt +4 | 6.4.0-28.1 | SUSE-SU-2025:20270-1, SUSE-SU-2025:20260-1 |
| SLE Micro 6.0 | kernel-default-base | 6.4.0-28.1.21.6 | SUSE-SU-2025:20192-1 |
| SLE Micro 6.0 | kernel-livepatch-MICRO-6-0_Update_6 +1 | 1-3.1 | SUSE-SU-2025:20192-1, SUSE-SU-2025:20190-1 |
| SLE Micro 6.0 | kernel-rt +4 | 6.4.0-28.1 | SUSE-SU-2025:20192-1, SUSE-SU-2025:20190-1 |
| SLE Live Patching 15 SP7 | kernel-default | 6.4.0-150700.53.3.1 | SUSE-SU-2025:01951-1 |
| SLE Live Patching 15 SP7 | kernel-livepatch-SLE15-SP7_Update_1 | 1-150700.15.3.1 | SUSE-SU-2025:01951-1 |
| SLE Live Patching 15 SP6 | kernel-default | 6.4.0-150600.23.47.2 | SUSE-SU-2025:1180-1 |
| SLE Live Patching 15 SP6 | kernel-livepatch-SLE15-SP6-RT_Update_10 | 1-150600.1.5.1 | SUSE-SU-2025:1178-1 |
| SLE Live Patching 15 SP6 | kernel-livepatch-SLE15-SP6_Update_10 | 1-150600.13.5.1 | SUSE-SU-2025:1180-1 |
| SUSE Real Time Module 15 SP6 | kernel-rt +3 | 6.4.0-150600.10.34.1 | SUSE-SU-2025:1178-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Leap 15.6 | dtb-aarch64 +4 | 6.4.0-150600.23.47.1 | SUSE-SU-2025:1180-1 |
| openSUSE Leap 15.6 | kernel-64kb +5 | 6.4.0-150600.23.47.2 | SUSE-SU-2025:1180-1 |
| openSUSE Leap 15.6 | kernel-azure +1 | 6.4.0-150600.8.34.2 | SUSE-SU-2025:1177-1 |
| openSUSE Leap 15.6 | kernel-default-base | 6.4.0-150600.23.47.2.150600.12.20.2 | SUSE-SU-2025:1180-1 |
| openSUSE Leap 15.6 | kernel-rt +3 | 6.4.0-150600.10.34.1 | SUSE-SU-2025:1178-1 |
| openSUSE Leap 15.6 | kernel-syms-azure | 6.4.0-150600.8.34.1 | SUSE-SU-2025:1177-1 |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | kernel-livepatch-6.1.141-155.222 | 1.0-0.amzn2023 | ALAS2023-2025-1037 |
| Amazon Linux 2023 | perf +14 | 6.1.141-155.222.amzn2023 | ALAS2023-2025-1037 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | kernel | 6.6.96.1-1 | — |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 9 | kernel-uek +34 | 6.12.0-101.33.4.3.el10uek | ELSA-2025-20530, ELSA-2025-20480 |
Advisories 31
- WID-SEC-2025-0016 Linux Kernel: Mehrere Schwachstellen ermöglichen Denial of Service BSI CERT-Bund (WID) · Nov 9, 2026
- USN-7524-1 linux-raspi vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-7523-1 linux-raspi-realtime vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-7522-1 linux-azure-nvidia vulnerabilities Ubuntu Security Notices (USN) · Oct 30, 2026
- USN-7513-1 linux, linux-aws, linux-aws-6.8, linux-ibm, linux-lowlatency, linux-lowlatency-hwe-6.8, linux-oracle vulnerabilities Ubuntu Security Notices (USN) · Oct 30, 2026
- USN-7513-2 linux-realtime vulnerabilities Ubuntu Security Notices (USN) · Oct 30, 2026
- USN-7513-3 linux-azure, linux-azure-6.8, linux-oem-6.8 vulnerabilities Ubuntu Security Notices (USN) · Oct 30, 2026
- USN-7515-2 linux-gcp, linux-gcp-6.8, linux-gkeop vulnerabilities Ubuntu Security Notices (USN) · Oct 30, 2026
- USN-7514-1 linux-nvidia, linux-nvidia-6.8, linux-nvidia-lowlatency vulnerabilities Ubuntu Security Notices (USN) · Oct 30, 2026
- USN-7513-4 linux-hwe-6.8 vulnerabilities Ubuntu Security Notices (USN) · Oct 30, 2026
- USN-7513-5 linux-oracle-6.8 vulnerabilities Ubuntu Security Notices (USN) · Oct 30, 2026
- USN-7515-1 linux-gke vulnerabilities Ubuntu Security Notices (USN) · Oct 30, 2026
- USN-7379-1 linux, linux-aws, linux-azure, linux-gcp, linux-hwe-6.11, linux-oracle, linux-realtime vulnerabilities Ubuntu Security Notices (USN) · Oct 29, 2026
- USN-7382-1 linux-oem-6.11 vulnerabilities Ubuntu Security Notices (USN) · Oct 29, 2026
- WID-SEC-2025-1439 Dell Secure Connect Gateway: Mehrere Schwachstellen ermöglichen nicht spezifizierten Angriff BSI CERT-Bund (WID) · Oct 11, 2026
- USN-7381-1 linux-lowlatency-hwe-6.11 vulnerabilities Ubuntu Security Notices (USN) · Jun 3, 2026
- SUSE-SU-2025:20270-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:20192-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:20260-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:20190-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- DLA-4328-1 linux-6.1 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DSA-5973-1 linux - security update Debian Security (DSA / DLA) · Mar 9, 2026
- SUSE-SU-2025:01967-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2025:01919-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2025:01951-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2025:1177-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2025:1180-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2025:1178-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
- ALAS2023-2025-1037 Important: kernel security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Aug 26, 2025
- ELSA-2025-20530 Important: Unbreakable Enterprise kernel security update (Oracle Linux 9) Oracle Linux Security Advisories (ELSA) · Aug 18, 2025
- ELSA-2025-20480 Important: Unbreakable Enterprise kernel security update (Oracle Linux 9) Oracle Linux Security Advisories (ELSA) · Jul 17, 2025