Cloudanix VulnDB

CVE-2025-21658

Medium · 5.5

CVSS

5.5

EPSS

0.2%

Published

Jan 21, 2025

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A bug in Linux storage software can make the whole computer crash when it tries to check a damaged hard drive or disk image.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Moderate
Impact
Denial Of Service
Component
OS kernel
Class
Memory Corruption
Remediation
Patch
Effort
Medium
Patch risk
Low

What it actually does

NULL pointer dereference in btrfs scrub_find_fill_first_stripe when extent_root is absent due to corrupted extent tree on a rescue-mounted filesystem.

Why it matters to the business

Kernel crash during routine filesystem maintenance on Linux systems using btrfs, leading to denial of service and potential data unavailability on affected servers or containers.

How an attack unfolds

An attacker supplies a crafted btrfs image lacking a valid extent root, mounts it using rescue options, then invokes the scrub ioctl to trigger the vulnerable path in find_first_extent_item causing the dereference.

How to fix it

Apply the upstream fix in commit 24b85a8b0310e0144da9ab30be42e87e6476638a or later kernel versions; for kernels older than 6.6 perform manual backport of the extent root validation check.

How to confirm the fix worked

Confirm presence of the extent-root validity check at the start of scrub_find_fill_first_stripe in the running kernel source or binary; test scrub on a rescue-mounted corrupted image and verify no NULL dereference occurs.

Typical attack path

  1. Obtain or craft a btrfs filesystem image with corrupted or missing extent tree root
  2. Mount the image using rescue=all,ro mount options
  3. Invoke btrfs scrub via ioctl or userspace tool on the mounted device
  4. scrub_find_fill_first_stripe dereferences the NULL extent root leading to kernel oops

How to detect it

Inspect kernel logs and dmesg for Oops entries referencing find_first_extent_item, scrub_find_fill_first_stripe, and NULL pointer dereference during btrfs scrub; correlate with mount options containing rescue and prior btrfs corruption warnings.

What your security team should do

  • Prioritize kernel updates containing commit 24b85a8b0310 on all btrfs-using systems
  • Disable automatic or scheduled scrub on potentially corrupted volumes until patched
  • Monitor kernel logs for btrfs-related NULL pointer oops during scrub operations

The record

In the Linux kernel, the following vulnerability has been resolved: btrfs: avoid NULL pointer dereference if no valid extent tree [BUG] Syzbot reported a crash with the following call trace: BTRFS info (device loop0): scrub: started on devid 1 BUG: kernel NULL pointer dereference, address: 0000000000000208 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 106e70067 P4D 106e70067 PUD 107143067 PMD 0 Oops: Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 1 UID: 0 PID: 689 Comm: repro Kdump: loaded Tainted: G O 6.13.0-rc4-custom+ #206 Tainted: [O]=OOT_MODULE Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS unknown 02/02/2022 RIP: 0010:find_first_extent_item+0x26/0x1f0 [btrfs] Call Trace: <TASK> scrub_find_fill_first_stripe+0x13d/0x3b0 [btrfs] scrub_simple_mirror+0x175/0x260 [btrfs] scrub_stripe+0x5d4/0x6c0 [btrfs] scrub_chunk+0xbb/0x170 [btrfs] scrub_enumerate_chunks+0x2f4/0x5f0 [btrfs] btrfs_scrub_dev+0x240/0x600 [btrfs] btrfs_ioctl+0x1dc8/0x2fa0 [btrfs] ? do_sys_openat2+0xa5/0xf0 __x64_sys_ioctl+0x97/0xc0 do_syscall_64+0x4f/0x120 entry_SYSCALL_64_after_hwframe+0x76/0x7e </TASK> [CAUSE] The reproducer is using a corrupted image where extent tree root is corrupted, thus forcing to use "rescue=all,ro" mount option to mount the image. Then it triggered a scrub, but since scrub relies on extent tree to find where the data/metadata extents are, scrub_find_fill_first_stripe() relies on an non-empty extent root. But unfortunately scrub_find_fill_first_stripe() doesn't really expect an NULL pointer for extent root, it use extent_root to grab fs_info and triggered a NULL pointer dereference. [FIX] Add an extra check for a valid extent root at the beginning of scrub_find_fill_first_stripe(). The new error path is introduced by 42437a6386ff ("btrfs: introduce mount option rescue=ignorebadroots"), but that's pretty old, and later commit b979547513ff ("btrfs: scrub: introduce helper to find and fill sector info for a scrub_stripe") changed how we do scrub. So for kernels older than 6.6, the fix will need manual backport.

Affected packages

Ecosystem Package Introduced Fixed
Debian:12 linux 0 No fix
Debian:13 linux 0 No fix
Debian:13 linux 0 6.12.10-1
Linux Kernel 5.11.0 6.6.72
Mageia:9 dwarves 0 1.29-1.mga9
Mageia:9 kernel 0 6.6.74-1.mga9
Mageia:9 kernel-linus 0 6.6.74-1.mga9
Mageia:9 kmod-virtualbox 0 7.0.24-64.mga9
Mageia:9 kmod-xtables-addons 0 3.24-70.mga9
SUSE:Linux Enterprise High Availability Extension 15 SP4 kernel-default 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise High Availability Extension 15 SP6 kernel-default 0 6.4.0-150600.23.60.5
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS kernel-64kb 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS kernel-default 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS kernel-default-base 0 5.14.21-150400.24.194.1.150400.24.98.3
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS kernel-docs 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS kernel-obs-build 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS kernel-source 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS kernel-syms 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS kernel-64kb 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS kernel-default 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS kernel-default-base 0 5.14.21-150400.24.194.1.150400.24.98.3
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS kernel-docs 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS kernel-obs-build 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS kernel-source 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS kernel-syms 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Live Patching 15 SP4 kernel-default 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Live Patching 15 SP4 kernel-livepatch-SLE15-SP4_Update_48 0 1-150400.9.7.1
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-default 0 6.4.0-150600.23.60.5
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-livepatch-SLE15-SP6-RT_Update_13 0 1-150600.1.5.1
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-livepatch-SLE15-SP6_Update_13 0 1-150600.13.6.4
SUSE:Linux Enterprise Micro 5.3 kernel-default 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Micro 5.3 kernel-default-base 0 5.14.21-150400.24.194.1.150400.24.98.3
SUSE:Linux Enterprise Micro 5.4 kernel-default 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Micro 5.4 kernel-default-base 0 5.14.21-150400.24.194.1.150400.24.98.3
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-64kb 0 6.4.0-150600.23.60.4
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-default 0 6.4.0-150600.23.60.5
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-default-base 0 6.4.0-150600.23.60.5.150600.12.26.4
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-source 0 6.4.0-150600.23.60.4
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-zfcpdump 0 6.4.0-150600.23.60.4
SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 kernel-coco 0 6.4.0-15061.28.coco15sp6.1
SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 kernel-coco_debug 0 6.4.0-15061.28.coco15sp6.1
SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 kernel-source-coco 0 6.4.0-15061.28.coco15sp6.1
SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 kernel-syms-coco 0 6.4.0-15061.28.coco15sp6.1
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-docs 0 6.4.0-150600.23.60.3
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-obs-build 0 6.4.0-150600.23.60.3
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-source 0 6.4.0-150600.23.60.4
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-syms 0 6.4.0-150600.23.60.4
SUSE:Linux Enterprise Module for Legacy 15 SP6 kernel-default 0 6.4.0-150600.23.60.5
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-azure 0 6.4.0-150600.8.43.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-source-azure 0 6.4.0-150600.8.43.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-syms-azure 0 6.4.0-150600.8.43.1
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-64kb 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-default 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-default-base 0 5.14.21-150400.24.194.1.150400.24.98.3
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-docs 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-obs-build 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-source 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-syms 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-zfcpdump 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 kernel-default 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 kernel-default-base 0 5.14.21-150400.24.194.1.150400.24.98.3
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 kernel-docs 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 kernel-obs-build 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 kernel-source 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 kernel-syms 0 5.14.21-150400.24.194.1
SUSE:Linux Enterprise Workstation Extension 15 SP6 kernel-default 0 6.4.0-150600.23.60.5
SUSE:Real Time Module 15 SP6 kernel-rt 0 6.4.0-150600.10.44.1
SUSE:Real Time Module 15 SP6 kernel-rt_debug 0 6.4.0-150600.10.44.1
SUSE:Real Time Module 15 SP6 kernel-source-rt 0 6.4.0-150600.10.44.1
SUSE:Real Time Module 15 SP6 kernel-syms-rt 0 6.4.0-150600.10.44.1
Ubuntu:16.04:LTS linux-hwe-edge 0 No fix
Ubuntu:18.04:LTS linux-aws-5.0 0 No fix
Ubuntu:18.04:LTS linux-aws-5.3 0 No fix
Ubuntu:18.04:LTS linux-azure 0 No fix
Ubuntu:18.04:LTS linux-azure-5.3 0 No fix
Ubuntu:18.04:LTS linux-azure-edge 0 No fix
Ubuntu:18.04:LTS linux-gcp 0 No fix
Ubuntu:18.04:LTS linux-gcp-5.3 0 No fix
Ubuntu:18.04:LTS linux-gke-4.15 0 No fix
Ubuntu:18.04:LTS linux-gke-5.4 0 No fix
Ubuntu:18.04:LTS linux-gkeop-5.4 0 No fix
Ubuntu:18.04:LTS linux-hwe 0 No fix
Ubuntu:18.04:LTS linux-hwe-edge 0 No fix
Ubuntu:18.04:LTS linux-oem 0 No fix
Ubuntu:18.04:LTS linux-oracle-5.0 0 No fix
Ubuntu:18.04:LTS linux-oracle-5.3 0 No fix
Ubuntu:20.04:LTS linux 0 No fix
Ubuntu:20.04:LTS linux-aws 0 No fix
Ubuntu:20.04:LTS linux-aws-5.11 0 No fix
Ubuntu:20.04:LTS linux-aws-5.13 0 No fix
Ubuntu:20.04:LTS linux-aws-5.15 0 No fix
Ubuntu:20.04:LTS linux-aws-5.8 0 No fix
Ubuntu:20.04:LTS linux-azure 0 No fix
Ubuntu:20.04:LTS linux-azure-5.11 0 No fix
Ubuntu:20.04:LTS linux-azure-5.13 0 No fix
Ubuntu:20.04:LTS linux-azure-5.15 0 No fix
Ubuntu:20.04:LTS linux-azure-5.8 0 No fix
Ubuntu:20.04:LTS linux-azure-fde 0 No fix
Ubuntu:20.04:LTS linux-azure-fde-5.15 0 No fix
Ubuntu:20.04:LTS linux-bluefield 0 No fix
Ubuntu:20.04:LTS linux-gcp 0 No fix
Ubuntu:20.04:LTS linux-gcp-5.11 0 No fix
Ubuntu:20.04:LTS linux-gcp-5.13 0 No fix
Ubuntu:20.04:LTS linux-gcp-5.15 0 No fix
Ubuntu:20.04:LTS linux-gcp-5.8 0 No fix
Ubuntu:20.04:LTS linux-gke 0 No fix
Ubuntu:20.04:LTS linux-gke-5.15 0 No fix
Ubuntu:20.04:LTS linux-gkeop 0 No fix
Ubuntu:20.04:LTS linux-gkeop-5.15 0 No fix
Ubuntu:20.04:LTS linux-hwe-5.11 0 No fix
Ubuntu:20.04:LTS linux-hwe-5.13 0 No fix
Ubuntu:20.04:LTS linux-hwe-5.15 0 No fix
Ubuntu:20.04:LTS linux-hwe-5.8 0 No fix
Ubuntu:20.04:LTS linux-ibm 0 No fix
Ubuntu:20.04:LTS linux-ibm-5.15 0 No fix
Ubuntu:20.04:LTS linux-intel-5.13 0 No fix
Ubuntu:20.04:LTS linux-intel-iotg-5.15 0 No fix
Ubuntu:20.04:LTS linux-iot 0 No fix
Ubuntu:20.04:LTS linux-kvm 0 No fix
Ubuntu:20.04:LTS linux-lowlatency-hwe-5.15 0 No fix
Ubuntu:20.04:LTS linux-oem-5.10 0 No fix
Ubuntu:20.04:LTS linux-oem-5.13 0 No fix
Ubuntu:20.04:LTS linux-oem-5.14 0 No fix
Ubuntu:20.04:LTS linux-oem-5.6 0 No fix
Ubuntu:20.04:LTS linux-oracle 0 No fix
Ubuntu:20.04:LTS linux-oracle-5.11 0 No fix
Ubuntu:20.04:LTS linux-oracle-5.13 0 No fix
Ubuntu:20.04:LTS linux-oracle-5.15 0 No fix
Ubuntu:20.04:LTS linux-oracle-5.8 0 No fix
Ubuntu:20.04:LTS linux-raspi 0 No fix
Ubuntu:20.04:LTS linux-raspi2 0 No fix
Ubuntu:20.04:LTS linux-riscv 0 No fix
Ubuntu:20.04:LTS linux-riscv-5.11 0 No fix
Ubuntu:20.04:LTS linux-riscv-5.15 0 No fix
Ubuntu:20.04:LTS linux-riscv-5.8 0 No fix
Ubuntu:20.04:LTS linux-xilinx-zynqmp 0 No fix
Ubuntu:22.04:LTS linux 0 No fix
Ubuntu:22.04:LTS linux-allwinner-5.19 0 No fix
Ubuntu:22.04:LTS linux-aws 0 No fix
Ubuntu:22.04:LTS linux-aws-5.19 0 No fix
Ubuntu:22.04:LTS linux-aws-6.2 0 No fix
Ubuntu:22.04:LTS linux-aws-6.5 0 No fix
Ubuntu:22.04:LTS linux-aws-6.8 0 No fix
Ubuntu:22.04:LTS linux-aws-6.8 0 6.8.0-1029.31~22.04.1
Ubuntu:22.04:LTS linux-azure 0 No fix
Ubuntu:22.04:LTS linux-azure-5.19 0 No fix
Ubuntu:22.04:LTS linux-azure-6.2 0 No fix
Ubuntu:22.04:LTS linux-azure-6.5 0 No fix
Ubuntu:22.04:LTS linux-azure-6.8 0 No fix
Ubuntu:22.04:LTS linux-azure-6.8 0 6.8.0-1029.34~22.04.1
Ubuntu:22.04:LTS linux-azure-fde 0 No fix
Ubuntu:22.04:LTS linux-azure-fde-5.19 0 No fix
Ubuntu:22.04:LTS linux-azure-fde-6.2 0 No fix
Ubuntu:22.04:LTS linux-gcp 0 No fix
Ubuntu:22.04:LTS linux-gcp-5.19 0 No fix
Ubuntu:22.04:LTS linux-gcp-6.2 0 No fix
Ubuntu:22.04:LTS linux-gcp-6.5 0 No fix
Ubuntu:22.04:LTS linux-gcp-6.8 0 No fix
Ubuntu:22.04:LTS linux-gcp-6.8 0 6.8.0-1030.32~22.04.1
Ubuntu:22.04:LTS linux-gke 0 No fix
Ubuntu:22.04:LTS linux-gkeop 0 No fix
Ubuntu:22.04:LTS linux-hwe-5.19 0 No fix
Ubuntu:22.04:LTS linux-hwe-6.2 0 No fix
Ubuntu:22.04:LTS linux-hwe-6.5 0 No fix
Ubuntu:22.04:LTS linux-hwe-6.8 0 No fix
Ubuntu:22.04:LTS linux-hwe-6.8 0 6.8.0-60.63~22.04.1
Ubuntu:22.04:LTS linux-ibm 0 No fix
Ubuntu:22.04:LTS linux-ibm-6.8 0 6.8.0-1026.26~22.04.1
Ubuntu:22.04:LTS linux-intel-iot-realtime 0 No fix
Ubuntu:22.04:LTS linux-intel-iotg 0 No fix
Ubuntu:22.04:LTS linux-kvm 0 No fix
Ubuntu:22.04:LTS linux-lowlatency 0 No fix
Ubuntu:22.04:LTS linux-lowlatency-hwe-5.19 0 No fix
Ubuntu:22.04:LTS linux-lowlatency-hwe-6.2 0 No fix
Ubuntu:22.04:LTS linux-lowlatency-hwe-6.5 0 No fix
Ubuntu:22.04:LTS linux-lowlatency-hwe-6.8 0 No fix
Ubuntu:22.04:LTS linux-lowlatency-hwe-6.8 0 6.8.0-60.63.1~22.04.1
Ubuntu:22.04:LTS linux-nvidia 0 No fix
Ubuntu:22.04:LTS linux-nvidia-6.2 0 No fix
Ubuntu:22.04:LTS linux-nvidia-6.5 0 No fix
Ubuntu:22.04:LTS linux-nvidia-6.8 0 No fix
Ubuntu:22.04:LTS linux-nvidia-6.8 0 6.8.0-1028.31~22.04.1
Ubuntu:22.04:LTS linux-nvidia-tegra 0 No fix
Ubuntu:22.04:LTS linux-nvidia-tegra-igx 0 No fix
Ubuntu:22.04:LTS linux-oem-5.17 0 No fix
Ubuntu:22.04:LTS linux-oem-6.0 0 No fix
Ubuntu:22.04:LTS linux-oem-6.1 0 No fix
Ubuntu:22.04:LTS linux-oem-6.5 0 No fix
Ubuntu:22.04:LTS linux-oracle 0 No fix
Ubuntu:22.04:LTS linux-oracle-6.5 0 No fix
Ubuntu:22.04:LTS linux-oracle-6.8 0 No fix
Ubuntu:22.04:LTS linux-oracle-6.8 0 6.8.0-1026.27~22.04.1
Ubuntu:22.04:LTS linux-raspi 0 No fix
Ubuntu:22.04:LTS linux-realtime 0 No fix
Ubuntu:22.04:LTS linux-riscv 0 No fix
Ubuntu:22.04:LTS linux-riscv-5.19 0 No fix
Ubuntu:22.04:LTS linux-riscv-6.5 0 No fix
Ubuntu:22.04:LTS linux-riscv-6.8 0 No fix
Ubuntu:22.04:LTS linux-riscv-6.8 0 6.8.0-62.65~22.04.1
Ubuntu:22.04:LTS linux-starfive-5.19 0 No fix

Related vulnerabilities