Description
In the Linux kernel, the following vulnerability has been resolved:
btrfs: set_page_extent_mapped after read_folio in btrfs_cont_expand
While trying to get the subpage blocksize tests running, I hit the
following panic on generic/476
assertion failed: PagePrivate(page) && page->private, in fs/btrfs/subpage.c:229
kernel BUG at fs/btrfs/subpage.c:229!
Internal error: Oops - BUG: 00000000f2000800 [#1] SMP
CPU: 1 PID: 1453 Comm: fsstress Not tainted 6.4.0-rc7+ #12
Hardware name: QEMU KVM Virtual Machine, BIOS edk2-20230301gitf80f052277c8-26.fc38 03/01/2023
pstate: 61400005 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
pc : btrfs_subpage_assert+0xbc/0xf0
lr : btrfs_subpage_assert+0xbc/0xf0
Call trace:
btrfs_subpage_assert+0xbc/0xf0
btrfs_subpage_clear_checked+0x38/0xc0
btrfs_page_clear_checked+0x48/0x98
btrfs_truncate_block+0x5d0/0x6a8
btrfs_cont_expand+0x5c/0x528
btrfs_write_check.isra.0+0xf8/0x150
btrfs_buffered_write+0xb4/0x760
btrfs_do_write_iter+0x2f8/0x4b0
btrfs_file_write_iter+0x1c/0x30
do_iter_readv_writev+0xc8/0x158
do_iter_write+0x9c/0x210
vfs_iter_write+0x24/0x40
iter_file_splice_write+0x224/0x390
direct_splice_actor+0x38/0x68
splice_direct_to_actor+0x12c/0x260
do_splice_direct+0x90/0xe8
generic_copy_file_range+0x50/0x90
vfs_copy_file_range+0x29c/0x470
__arm64_sys_copy_file_range+0xcc/0x498
invoke_syscall.constprop.0+0x80/0xd8
do_el0_svc+0x6c/0x168
el0_svc+0x50/0x1b0
el0t_64_sync_handler+0x114/0x120
el0t_64_sync+0x194/0x198
This happens because during btrfs_cont_expand we'll get a page, set it
as mapped, and if it's not Uptodate we'll read it. However between the
read and re-locking the page we could have called release_folio() on the
page, but left the page in the file mapping. release_folio() can clear
the page private, and thus further down we blow up when we go to modify
the subpage bits.
Fix this by putting the set_page_extent_mapped() after the read. This
is safe because read_folio() will call set_page_extent_mapped() before
it does the read, and then if we clear page private but leave it on the
mapping we're completely safe re-setting set_page_extent_mapped(). With
this patch I can now run generic/476 without panicing.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Linux | Linux | 5.12 | 6.1.42 |
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.4.11-1 | — |
| Debian 13 | linux | 6.4.11-1 | — |
| Debian 12 | linux | 6.1.52-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Nvidia-BlueField 22.04 LTS | linux-bluefield | No fix yet | — |
| Ubuntu 24.04 LTS | linux-intel +9 | No fix yet | — |
| Ubuntu 22.04 LTS | linux +49 | No fix yet | — |
| Ubuntu 20.04 LTS | linux-gke +28 | No fix yet | — |
| Ubuntu 18.04 LTS | linux-gcp +14 | No fix yet | — |
Show 5 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | linux-hwe-edge | No fix yet | — |
| Ubuntu Pro Realtime 22.04 LTS | linux-realtime +1 | No fix yet | — |
| Ubuntu Pro FIPS-updates 22.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS-preview 22.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro 20.04 LTS | linux-aws-5.15 +10 | No fix yet | — |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP7 | kernel-64kb +6 | 6.4.0-150700.53.22.1 | SUSE-SU-2025:4057-1 |
| SLES 15 SP7 | kernel-azure +2 | 6.4.0-150700.20.18.1 | SUSE-SU-2025:4132-1 |
| SLES 15 SP7 | kernel-default-base | 6.4.0-150700.53.22.1.150700.17.15.1 | SUSE-SU-2025:4057-1 |
| SLES 15 SP6 | kernel-64kb +6 | 6.4.0-150600.23.73.1 | SUSE-SU-2025:03600-1 |
| SLES 15 SP6 | kernel-azure +2 | 6.4.0-150600.8.52.1 | SUSE-SU-2025:03634-1 |
| SLES 15 SP6 | kernel-default-base | 6.4.0-150600.23.73.1.150600.12.32.1 | SUSE-SU-2025:03600-1 |
Show 6 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLE Micro 6.1 | kernel-default-base | 6.4.0-35.1.21.12 | SUSE-SU-2025:20861-1 |
| SLE Micro 6.1 | kernel-rt +1 | 6.4.0-37.1 | SUSE-SU-2025:20898-1 |
| SLE Micro 6.1 | kernel-source +2 | 6.4.0-35.1 | SUSE-SU-2025:20861-1 |
| SLE Micro 6.0 | kernel-default-base | 6.4.0-35.1.21.12 | SUSE-SU-2025:20851-1 |
| SLE Micro 6.0 | kernel-rt +1 | 6.4.0-37.1 | SUSE-SU-2025:20870-1 |
| SLE Micro 6.0 | kernel-source +2 | 6.4.0-35.1 | SUSE-SU-2025:20851-1 |
| SLE Live Patching 15 SP7 | kernel-default | 6.4.0-150700.53.22.1 | SUSE-SU-2025:4057-1 |
| SLE Live Patching 15 SP7 | kernel-livepatch-SLE15-SP7-RT_Update_6 | 1-150700.1.3.1 | SUSE-SU-2025:4141-1 |
| SLE Live Patching 15 SP7 | kernel-livepatch-SLE15-SP7_Update_6 | 1-150700.15.3.1 | SUSE-SU-2025:4057-1 |
| SLE Live Patching 15 SP6 | kernel-default | 6.4.0-150600.23.73.1 | SUSE-SU-2025:03600-1 |
| SLE Live Patching 15 SP6 | kernel-livepatch-SLE15-SP6-RT_Update_16 | 1-150600.1.3.1 | SUSE-SU-2025:3751-1 |
| SLE Live Patching 15 SP6 | kernel-livepatch-SLE15-SP6_Update_16 | 1-150600.13.3.1 | SUSE-SU-2025:03600-1 |
| SUSE Real Time Module 15 SP7 | kernel-rt +2 | 6.4.0-150700.7.22.1 | SUSE-SU-2025:4141-1 |
| SUSE Real Time Module 15 SP6 | kernel-rt +3 | 6.4.0-150600.10.55.1 | SUSE-SU-2025:3751-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Leap 15.6 | dtb-aarch64 +10 | 6.4.0-150600.23.73.1 | SUSE-SU-2025:03600-1 |
| openSUSE Leap 15.6 | kernel-azure +2 | 6.4.0-150600.8.52.1 | SUSE-SU-2025:03634-1 |
| openSUSE Leap 15.6 | kernel-default-base | 6.4.0-150600.23.73.1.150600.12.32.1 | SUSE-SU-2025:03600-1 |
| openSUSE Leap 15.6 | kernel-rt +3 | 6.4.0-150600.10.55.1 | SUSE-SU-2025:3751-1 |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | kernel-livepatch-6.1.49-69.116 | 1.0-0.amzn2023 | ALAS2023-2023-330 |
| Amazon Linux 2023 | perf +12 | 6.1.49-69.116.amzn2023 | ALAS2023-2023-330 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 2 (CBL-Mariner) | kernel | No fix yet | — |
Advisories 12
- WID-SEC-2025-2053 Linux Kernel: Mehrere Schwachstellen BSI CERT-Bund (WID) · Nov 9, 2026
- SUSE-SU-2025:20851-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:03634-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:4141-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:20861-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:20870-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:03600-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:20898-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- ALAS2023-2023-330 Important: kernel security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Feb 11, 2026
- SUSE-SU-2025:3751-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2025:4132-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2025:4057-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026