# CVE-2024-50225: btrfs: fix error propagation of split bios

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.28% (percentile 13, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2024-11-09T10:14:36.065Z
- **Modified:** 2026-08-05T11:42:37.937Z

## Who should check

- Anyone running Linux \>= 852eee62d31abd695cd43e1b875d664ed292a8ca, \< 22833d89b780ba0f9f66e19c477e7decf638edce; \>= 852eee62d31abd695cd43e1b875d664ed292a8ca, \< d48e1dea3931de64c26717adc2b89743c7ab6594
- Anyone running Linux 6.3

## Description

In the Linux kernel, the following vulnerability has been resolved:

btrfs: fix error propagation of split bios

The purpose of btrfs\_bbio\_propagate\_error() shall be propagating an error
of split bio to its original btrfs\_bio, and tell the error to the upper
layer. However, it's not working well on some cases.

\* Case 1. Immediate (or quick) end\_bio with an error

When btrfs sends btrfs\_bio to mirrored devices, btrfs calls
btrfs\_bio\_end\_io() when all the mirroring bios are completed. If that
btrfs\_bio was split, it is from btrfs\_clone\_bioset and its end\_io function
is btrfs\_orig\_write\_end\_io. For this case, btrfs\_bbio\_propagate\_error()
accesses the orig\_bbio's bio context to increase the error count.

That works well in most cases. However, if the end\_io is called enough
fast, orig\_bbio's (remaining part after split) bio context may not be
properly set at that time. Since the bio context is set when the orig\_bbio
(the last btrfs\_bio) is sent to devices, that might be too late for earlier
split btrfs\_bio's completion.  That will result in NULL pointer
dereference.

That bug is easily reproducible by running btrfs/146 on zoned devices \[1\]
and it shows the following trace.

\[1\] You need raid-stripe-tree feature as it create "-d raid0 -m raid1" FS.

  BUG: kernel NULL pointer dereference, address: 0000000000000020
  \#PF: supervisor read access in kernel mode
  \#PF: error\_code(0x0000) - not-present page
  PGD 0 P4D 0
  Oops: Oops: 0000 \[\#1\] PREEMPT SMP PTI
  CPU: 1 UID: 0 PID: 13 Comm: kworker/u32:1 Not tainted 6.11.0-rc7-BTRFS-ZNS+ \#474
  Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
  Workqueue: writeback wb\_workfn (flush-btrfs-5)
  RIP: 0010:btrfs\_bio\_end\_io+0xae/0xc0 \[btrfs\]
  BTRFS error (device dm-0): bdev /dev/mapper/error-test errs: wr 2, rd 0, flush 0, corrupt 0, gen 0
  RSP: 0018:ffffc9000006f248 EFLAGS: 00010246
  RAX: 0000000000000000 RBX: ffff888005a7f080 RCX: ffffc9000006f1dc
  RDX: 0000000000000000 RSI: 000000000000000a RDI: ffff888005a7f080
  RBP: ffff888011dfc540 R08: 0000000000000000 R09: 0000000000000001
  R10: ffffffff82e508e0 R11: 0000000000000005 R12: ffff88800ddfbe58
  R13: ffff888005a7f080 R14: ffff888005a7f158 R15: ffff888005a7f158
  FS:  0000000000000000(0000) GS:ffff88803ea80000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 0000000000000020 CR3: 0000000002e22006 CR4: 0000000000370ef0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  Call Trace:
   \<TASK\>
   ? \_\_die\_body.cold+0x19/0x26
   ? page\_fault\_oops+0x13e/0x2b0
   ? \_printk+0x58/0x73
   ? do\_user\_addr\_fault+0x5f/0x750
   ? exc\_page\_fault+0x76/0x240
   ? asm\_exc\_page\_fault+0x22/0x30
   ? btrfs\_bio\_end\_io+0xae/0xc0 \[btrfs\]
   ? btrfs\_log\_dev\_io\_error+0x7f/0x90 \[btrfs\]
   btrfs\_orig\_write\_end\_io+0x51/0x90 \[btrfs\]
   dm\_submit\_bio+0x5c2/0xa50 \[dm\_mod\]
   ? find\_held\_lock+0x2b/0x80
   ? blk\_try\_enter\_queue+0x90/0x1e0
   \_\_submit\_bio+0xe0/0x130
   ? ktime\_get+0x10a/0x160
   ? lockdep\_hardirqs\_on+0x74/0x100
   submit\_bio\_noacct\_nocheck+0x199/0x410
   btrfs\_submit\_bio+0x7d/0x150 \[btrfs\]
   btrfs\_submit\_chunk+0x1a1/0x6d0 \[btrfs\]
   ? lockdep\_hardirqs\_on+0x74/0x100
   ? \_\_folio\_start\_writeback+0x10/0x2c0
   btrfs\_submit\_bbio+0x1c/0x40 \[btrfs\]
   submit\_one\_bio+0x44/0x60 \[btrfs\]
   submit\_extent\_folio+0x13f/0x330 \[btrfs\]
   ? btrfs\_set\_range\_writeback+0xa3/0xd0 \[btrfs\]
   extent\_writepage\_io+0x18b/0x360 \[btrfs\]
   extent\_write\_locked\_range+0x17c/0x340 \[btrfs\]
   ? \_\_pfx\_end\_bbio\_data\_write+0x10/0x10 \[btrfs\]
   run\_delalloc\_cow+0x71/0xd0 \[btrfs\]
   btrfs\_run\_delalloc\_range+0x176/0x500 \[btrfs\]
   ? find\_lock\_delalloc\_range+0x119/0x260 \[btrfs\]
   writepage\_delalloc+0x2ab/0x480 \[btrfs\]
   extent\_write\_cache\_pages+0x236/0x7d0 \[btrfs\]
   btrfs\_writepages+0x72/0x130 \[btrfs\]
   do\_writepages+0xd4/0x240
   ? find\_held\_lock+0x2b/0x80
   ? wbc\_attach\_and\_unlock\_inode+0x12c/0x290
   ? wbc\_attach\_and\_unlock\_inode+0x12c/0x29
---truncated---

## Affected and fixed versions

- Linux: \>= 852eee62d31abd695cd43e1b875d664ed292a8ca, \< 22833d89b780ba0f9f66e19c477e7decf638edce; \>= 852eee62d31abd695cd43e1b875d664ed292a8ca, \< d48e1dea3931de64c26717adc2b89743c7ab6594 (cvelist)
- Linux: 6.3 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-50225. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-50225.md
Affected: Linux >= 852eee62d31abd695cd43e1b875d664ed292a8ca, < 22833d89b780ba0f9f66e19c477e7decf638edce; >= 852eee62d31abd695cd43e1b875d664ed292a8ca, < d48e1dea3931de64c26717adc2b89743c7ab6594; Linux 6.3
Fixed in: Linux 22833d89b780ba0f9f66e19c477e7decf638edce

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-50225 being exploited?

There is no confirmed exploitation: CVE-2024-50225 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.28% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-50225?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-50225?

Linux \>= 852eee62d31abd695cd43e1b875d664ed292a8ca, \< 22833d89b780ba0f9f66e19c477e7decf638edce; \>= 852eee62d31abd695cd43e1b875d664ed292a8ca, \< d48e1dea3931de64c26717adc2b89743c7ab6594; Linux 6.3.

### Is there a fix for CVE-2024-50225?

Yes. Fixed in Linux 22833d89b780ba0f9f66e19c477e7decf638edce. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2024-50225?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/22833d89b780ba0f9f66e19c477e7decf638edce>
- patch: <https://git.kernel.org/stable/c/d48e1dea3931de64c26717adc2b89743c7ab6594>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-50225>

HTML: <https://flawdb.com/CVE-2024-50225> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-50225>
