Cloudanix VulnDB

CVE-2025-21754

None

CVSS

—

EPSS

0.2%

Published

Feb 27, 2025

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A flaw in the Linux filesystem code can cause the computer to crash when writing files under certain error conditions.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Moderate
Impact
Denial Of Service
Component
OS kernel
Class
Improper Input Validation
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Assertion failure in btrfs_split_ordered_extent() when BTRFS_ORDERED_IOERR flag is present on an ordered extent during direct IO write after transaction abort, because the flag is outside BTRFS_ORDERED_TYPE_FLAGS.

Why it matters to the business

Kernel crashes or I/O errors on systems using the btrfs filesystem during direct writes if a transaction aborts, leading to service disruption and potential data write failures.

How an attack unfolds

An attacker triggers a transaction abort (via memory pressure or fault injection) during a partial direct IO write on btrfs, then causes btrfs_split_ordered_extent() to be called on an extent carrying the IOERR flag, hitting the assertion and crashing the kernel.

How to fix it

Update the Linux kernel to a version containing the fix that returns an error from btrfs_extract_ordered_extent() when BTRFS_ORDERED_IOERR is set.

How to confirm the fix worked

Confirm kernel version is post-fix; reproduce direct IO writes under transaction abort conditions and verify no assertion failure occurs.

Typical attack path

  1. Trigger transaction abort in btrfs (e.g., via memory allocation failure)
  2. Perform direct IO write that spans only part of an ordered extent
  3. Invoke btrfs_split_ordered_extent() on the errored extent
  4. Hit assertion failure causing kernel panic or oops

How to detect it

Inspect kernel logs for BTRFS error messages mentioning transaction abort followed by assertion failures or ordered extent handling; look for syzbot-style fault injection traces involving btrfs_direct_write or btrfs_split_ordered_extent.

What your security team should do

  • Prioritize kernel updates on all btrfs systems handling direct IO
  • Monitor for transaction abort events in kernel logs
  • Test direct IO workloads after patching to validate stability

The record

In the Linux kernel, the following vulnerability has been resolved: btrfs: fix assertion failure when splitting ordered extent after transaction abort If while we are doing a direct IO write a transaction abort happens, we mark all existing ordered extents with the BTRFS_ORDERED_IOERR flag (done at btrfs_destroy_ordered_extents()), and then after that if we enter btrfs_split_ordered_extent() and the ordered extent has bytes left (meaning we have a bio that doesn't cover the whole ordered extent, see details at btrfs_extract_ordered_extent()), we will fail on the following assertion at btrfs_split_ordered_extent(): ASSERT(!(flags & ~BTRFS_ORDERED_TYPE_FLAGS)); because the BTRFS_ORDERED_IOERR flag is set and the definition of BTRFS_ORDERED_TYPE_FLAGS is just the union of all flags that identify the type of write (regular, nocow, prealloc, compressed, direct IO, encoded). Fix this by returning an error from btrfs_extract_ordered_extent() if we find the BTRFS_ORDERED_IOERR flag in the ordered extent. The error will be the error that resulted in the transaction abort or -EIO if no transaction abort happened. This was recently reported by syzbot with the following trace: FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 CPU: 0 UID: 0 PID: 5321 Comm: syz.0.0 Not tainted 6.13.0-rc5-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 fail_dump lib/fault-inject.c:53 [inline] should_fail_ex+0x3b0/0x4e0 lib/fault-inject.c:154 should_failslab+0xac/0x100 mm/failslab.c:46 slab_pre_alloc_hook mm/slub.c:4072 [inline] slab_alloc_node mm/slub.c:4148 [inline] __do_kmalloc_node mm/slub.c:4297 [inline] __kmalloc_noprof+0xdd/0x4c0 mm/slub.c:4310 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] btrfs_chunk_alloc_add_chunk_item+0x244/0x1100 fs/btrfs/volumes.c:5742 reserve_chunk_space+0x1ca/0x2c0 fs/btrfs/block-group.c:4292 check_system_chunk fs/btrfs/block-group.c:4319 [inline] do_chunk_alloc fs/btrfs/block-group.c:3891 [inline] btrfs_chunk_alloc+0x77b/0xf80 fs/btrfs/block-group.c:4187 find_free_extent_update_loop fs/btrfs/extent-tree.c:4166 [inline] find_free_extent+0x42d1/0x5810 fs/btrfs/extent-tree.c:4579 btrfs_reserve_extent+0x422/0x810 fs/btrfs/extent-tree.c:4672 btrfs_new_extent_direct fs/btrfs/direct-io.c:186 [inline] btrfs_get_blocks_direct_write+0x706/0xfa0 fs/btrfs/direct-io.c:321 btrfs_dio_iomap_begin+0xbb7/0x1180 fs/btrfs/direct-io.c:525 iomap_iter+0x697/0xf60 fs/iomap/iter.c:90 __iomap_dio_rw+0xeb9/0x25b0 fs/iomap/direct-io.c:702 btrfs_dio_write fs/btrfs/direct-io.c:775 [inline] btrfs_direct_write+0x610/0xa30 fs/btrfs/direct-io.c:880 btrfs_do_write_iter+0x2a0/0x760 fs/btrfs/file.c:1397 do_iter_readv_writev+0x600/0x880 vfs_writev+0x376/0xba0 fs/read_write.c:1050 do_pwritev fs/read_write.c:1146 [inline] __do_sys_pwritev2 fs/read_write.c:1204 [inline] __se_sys_pwritev2+0x196/0x2b0 fs/read_write.c:1195 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1281f85d29 RSP: 002b:00007f12819fe038 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 00007f1282176080 RCX: 00007f1281f85d29 RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000005 RBP: 00007f12819fe090 R08: 0000000000000000 R09: 0000000000000003 R10: 0000000000007000 R11: 0000000000000246 R12: 0000000000000002 R13: 0000000000000000 R14: 00007f1282176080 R15: 00007ffcb9e23328 </TASK> BTRFS error (device loop0 state A): Transaction aborted (error -12) BTRFS: error (device loop0 state A ---truncated---

Affected packages

Ecosystem Package Introduced Fixed
Debian:13 linux 0 No fix
Debian:13 linux 0 6.12.15-1
Linux Kernel 6.5.0 6.6.78
SUSE:Linux Enterprise High Availability Extension 15 SP6 kernel-default 0 6.4.0-150600.23.47.2
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-default 0 6.4.0-150600.23.47.2
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-livepatch-SLE15-SP6-RT_Update_10 0 1-150600.1.5.1
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-livepatch-SLE15-SP6_Update_10 0 1-150600.13.5.1
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-64kb 0 6.4.0-150600.23.47.2
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-default 0 6.4.0-150600.23.47.2
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-default-base 0 6.4.0-150600.23.47.2.150600.12.20.2
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-source 0 6.4.0-150600.23.47.2
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-zfcpdump 0 6.4.0-150600.23.47.2
SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 kernel-coco 0 6.4.0-15061.21.coco15sp6.1
SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 kernel-coco_debug 0 6.4.0-15061.21.coco15sp6.1
SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 kernel-source-coco 0 6.4.0-15061.21.coco15sp6.1
SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 kernel-syms-coco 0 6.4.0-15061.21.coco15sp6.1
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-docs 0 6.4.0-150600.23.47.1
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-obs-build 0 6.4.0-150600.23.47.1
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-source 0 6.4.0-150600.23.47.2
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-syms 0 6.4.0-150600.23.47.1
SUSE:Linux Enterprise Module for Legacy 15 SP6 kernel-default 0 6.4.0-150600.23.47.2
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-azure 0 6.4.0-150600.8.31.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-source-azure 0 6.4.0-150600.8.31.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-syms-azure 0 6.4.0-150600.8.31.1
SUSE:Linux Enterprise Workstation Extension 15 SP6 kernel-default 0 6.4.0-150600.23.47.2
SUSE:Real Time Module 15 SP6 kernel-rt 0 6.4.0-150600.10.34.1
SUSE:Real Time Module 15 SP6 kernel-rt_debug 0 6.4.0-150600.10.34.1
SUSE:Real Time Module 15 SP6 kernel-source-rt 0 6.4.0-150600.10.34.1
SUSE:Real Time Module 15 SP6 kernel-syms-rt 0 6.4.0-150600.10.34.1
Ubuntu:24.10 linux-aws 0 6.11.0-1014.15
openSUSE:Leap 15.6 dtb-aarch64 0 6.4.0-150600.23.47.1
openSUSE:Leap 15.6 kernel-64kb 0 6.4.0-150600.23.47.2
openSUSE:Leap 15.6 kernel-azure 0 6.4.0-150600.8.31.1
openSUSE:Leap 15.6 kernel-debug 0 6.4.0-150600.23.47.2
openSUSE:Leap 15.6 kernel-default 0 6.4.0-150600.23.47.2
openSUSE:Leap 15.6 kernel-default-base 0 6.4.0-150600.23.47.2.150600.12.20.2
openSUSE:Leap 15.6 kernel-docs 0 6.4.0-150600.23.47.1
openSUSE:Leap 15.6 kernel-kvmsmall 0 6.4.0-150600.23.47.2
openSUSE:Leap 15.6 kernel-obs-build 0 6.4.0-150600.23.47.1
openSUSE:Leap 15.6 kernel-obs-qa 0 6.4.0-150600.23.47.1
openSUSE:Leap 15.6 kernel-rt 0 6.4.0-150600.10.34.1
openSUSE:Leap 15.6 kernel-rt_debug 0 6.4.0-150600.10.34.1
openSUSE:Leap 15.6 kernel-source 0 6.4.0-150600.23.47.2
openSUSE:Leap 15.6 kernel-source-azure 0 6.4.0-150600.8.31.1
openSUSE:Leap 15.6 kernel-source-rt 0 6.4.0-150600.10.34.1
openSUSE:Leap 15.6 kernel-syms 0 6.4.0-150600.23.47.1
openSUSE:Leap 15.6 kernel-syms-azure 0 6.4.0-150600.8.31.1
openSUSE:Leap 15.6 kernel-syms-rt 0 6.4.0-150600.10.34.1
openSUSE:Leap 15.6 kernel-zfcpdump 0 6.4.0-150600.23.47.2

Related vulnerabilities