# CVE-2024-48875: btrfs: don't take dev\_replace rwsem on task already holding it

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; 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.20% (percentile 6, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2025-01-11T12:25:16.981Z
- **Modified:** 2026-06-17T07:58:56.987Z

## Who should check

- Anyone running Linux \>= 10e27980f2ff66ba0c6da55f33b4814d5bc86573, \< a2e99dcd7aafa9d474f7d9b0740b8f93c4e156c2; \>= 10e27980f2ff66ba0c6da55f33b4814d5bc86573, \< 8cca35cb29f81eba3e96ec44dad8696c8a2f9138
- Anyone running Linux 6.7

## Description

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

btrfs: don't take dev\_replace rwsem on task already holding it

Running fstests btrfs/011 with MKFS\_OPTIONS="-O rst" to force the usage of
the RAID stripe-tree, we get the following splat from lockdep:

 BTRFS info (device sdd): dev\_replace from /dev/sdd (devid 1) to /dev/sdb started

 ============================================
 WARNING: possible recursive locking detected
 6.11.0-rc3-btrfs-for-next \#599 Not tainted
 --------------------------------------------
 btrfs/2326 is trying to acquire lock:
 ffff88810f215c98 (&fs\_info-\>dev\_replace.rwsem){++++}-{3:3}, at: btrfs\_map\_block+0x39f/0x2250

 but task is already holding lock:
 ffff88810f215c98 (&fs\_info-\>dev\_replace.rwsem){++++}-{3:3}, at: btrfs\_map\_block+0x39f/0x2250

 other info that might help us debug this:
  Possible unsafe locking scenario:

        CPU0
        ----
   lock(&fs\_info-\>dev\_replace.rwsem);
   lock(&fs\_info-\>dev\_replace.rwsem);

  \*\*\* DEADLOCK \*\*\*

  May be due to missing lock nesting notation

 1 lock held by btrfs/2326:
  \#0: ffff88810f215c98 (&fs\_info-\>dev\_replace.rwsem){++++}-{3:3}, at: btrfs\_map\_block+0x39f/0x2250

 stack backtrace:
 CPU: 1 UID: 0 PID: 2326 Comm: btrfs Not tainted 6.11.0-rc3-btrfs-for-next \#599
 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
 Call Trace:
  \<TASK\>
  dump\_stack\_lvl+0x5b/0x80
  \_\_lock\_acquire+0x2798/0x69d0
  ? \_\_pfx\_\_\_lock\_acquire+0x10/0x10
  ? \_\_pfx\_\_\_lock\_acquire+0x10/0x10
  lock\_acquire+0x19d/0x4a0
  ? btrfs\_map\_block+0x39f/0x2250
  ? \_\_pfx\_lock\_acquire+0x10/0x10
  ? find\_held\_lock+0x2d/0x110
  ? lock\_is\_held\_type+0x8f/0x100
  down\_read+0x8e/0x440
  ? btrfs\_map\_block+0x39f/0x2250
  ? \_\_pfx\_down\_read+0x10/0x10
  ? do\_raw\_read\_unlock+0x44/0x70
  ? \_raw\_read\_unlock+0x23/0x40
  btrfs\_map\_block+0x39f/0x2250
  ? btrfs\_dev\_replace\_by\_ioctl+0xd69/0x1d00
  ? btrfs\_bio\_counter\_inc\_blocked+0xd9/0x2e0
  ? \_\_kasan\_slab\_alloc+0x6e/0x70
  ? \_\_pfx\_btrfs\_map\_block+0x10/0x10
  ? \_\_pfx\_btrfs\_bio\_counter\_inc\_blocked+0x10/0x10
  ? kmem\_cache\_alloc\_noprof+0x1f2/0x300
  ? mempool\_alloc\_noprof+0xed/0x2b0
  btrfs\_submit\_chunk+0x28d/0x17e0
  ? \_\_pfx\_btrfs\_submit\_chunk+0x10/0x10
  ? bvec\_alloc+0xd7/0x1b0
  ? bio\_add\_folio+0x171/0x270
  ? \_\_pfx\_bio\_add\_folio+0x10/0x10
  ? \_\_kasan\_check\_read+0x20/0x20
  btrfs\_submit\_bio+0x37/0x80
  read\_extent\_buffer\_pages+0x3df/0x6c0
  btrfs\_read\_extent\_buffer+0x13e/0x5f0
  read\_tree\_block+0x81/0xe0
  read\_block\_for\_search+0x4bd/0x7a0
  ? \_\_pfx\_read\_block\_for\_search+0x10/0x10
  btrfs\_search\_slot+0x78d/0x2720
  ? \_\_pfx\_btrfs\_search\_slot+0x10/0x10
  ? lock\_is\_held\_type+0x8f/0x100
  ? kasan\_save\_track+0x14/0x30
  ? \_\_kasan\_slab\_alloc+0x6e/0x70
  ? kmem\_cache\_alloc\_noprof+0x1f2/0x300
  btrfs\_get\_raid\_extent\_offset+0x181/0x820
  ? \_\_pfx\_lock\_acquire+0x10/0x10
  ? \_\_pfx\_btrfs\_get\_raid\_extent\_offset+0x10/0x10
  ? down\_read+0x194/0x440
  ? \_\_pfx\_down\_read+0x10/0x10
  ? do\_raw\_read\_unlock+0x44/0x70
  ? \_raw\_read\_unlock+0x23/0x40
  btrfs\_map\_block+0x5b5/0x2250
  ? \_\_pfx\_btrfs\_map\_block+0x10/0x10
  scrub\_submit\_initial\_read+0x8fe/0x11b0
  ? \_\_pfx\_scrub\_submit\_initial\_read+0x10/0x10
  submit\_initial\_group\_read+0x161/0x3a0
  ? lock\_release+0x20e/0x710
  ? \_\_pfx\_submit\_initial\_group\_read+0x10/0x10
  ? \_\_pfx\_lock\_release+0x10/0x10
  scrub\_simple\_mirror.isra.0+0x3eb/0x580
  scrub\_stripe+0xe4d/0x1440
  ? lock\_release+0x20e/0x710
  ? \_\_pfx\_scrub\_stripe+0x10/0x10
  ? \_\_pfx\_lock\_release+0x10/0x10
  ? do\_raw\_read\_unlock+0x44/0x70
  ? \_raw\_read\_unlock+0x23/0x40
  scrub\_chunk+0x257/0x4a0
  scrub\_enumerate\_chunks+0x64c/0xf70
  ? \_\_mutex\_unlock\_slowpath+0x147/0x5f0
  ? \_\_pfx\_scrub\_enumerate\_chunks+0x10/0x10
  ? bit\_wait\_timeout+0xb0/0x170
  ? \_\_up\_read+0x189/0x700
  ? scrub\_workers\_get+0x231/0x300
  ? up\_write+0x490/0x4f0
  btrfs\_scrub\_dev+0x52e/0xcd0
  ? create\_pending\_snapshots+0x230/0x250
  ? \_\_pfx\_btrfs\_scrub\_dev+0x10/0x10
  btrfs\_dev\_replace\_by\_ioctl+0xd69/0x1d00
  ? lock\_acquire+0x19d/0x4a0
  ? \_\_pfx\_btrfs\_dev\_replace\_by\_ioctl+0x10/0x10
  ?
---truncated---

## Affected and fixed versions

- Linux: \>= 10e27980f2ff66ba0c6da55f33b4814d5bc86573, \< a2e99dcd7aafa9d474f7d9b0740b8f93c4e156c2; \>= 10e27980f2ff66ba0c6da55f33b4814d5bc86573, \< 8cca35cb29f81eba3e96ec44dad8696c8a2f9138 (cvelist)
- Linux: 6.7 (cvelist)

## Mitigation

- Upgrade Linux to 8cca35cb29f81eba3e96ec44dad8696c8a2f9138 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-48875.md
Affected: Linux >= 10e27980f2ff66ba0c6da55f33b4814d5bc86573, < a2e99dcd7aafa9d474f7d9b0740b8f93c4e156c2; >= 10e27980f2ff66ba0c6da55f33b4814d5bc86573, < 8cca35cb29f81eba3e96ec44dad8696c8a2f9138; Linux 6.7
Fixed in: Linux 8cca35cb29f81eba3e96ec44dad8696c8a2f9138

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-48875 being exploited?

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

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

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

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

Linux \>= 10e27980f2ff66ba0c6da55f33b4814d5bc86573, \< a2e99dcd7aafa9d474f7d9b0740b8f93c4e156c2; \>= 10e27980f2ff66ba0c6da55f33b4814d5bc86573, \< 8cca35cb29f81eba3e96ec44dad8696c8a2f9138; Linux 6.7.

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

Yes. Fixed in Linux 8cca35cb29f81eba3e96ec44dad8696c8a2f9138. Upgrade Linux to 8cca35cb29f81eba3e96ec44dad8696c8a2f9138 or later.

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

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/a2e99dcd7aafa9d474f7d9b0740b8f93c4e156c2>
- patch: <https://git.kernel.org/stable/c/8cca35cb29f81eba3e96ec44dad8696c8a2f9138>

## 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-48875>

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