# CVE-2022-48901: btrfs: do not start relocation until in progress drops are done

> 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, NVD) `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.30% (percentile 16, 2026-11-26)
- **Published:** 2024-08-22T01:30:15.942Z
- **Modified:** 2026-06-17T05:16:33.880Z

## Who should check

- Anyone running Linux \>= 9d1a2a3ad59f7ae810bf04a5a05995bf2d79300c, \< 6599d5e8bd758d897fd2ef4dc388ae50278b1f7e; \>= 9d1a2a3ad59f7ae810bf04a5a05995bf2d79300c, \< 5e70bc827b563caf22e1203428cc3719643de5aa; \>= 9d1a2a3ad59f7ae810bf04a5a05995bf2d79300c, \< b4be6aefa73c9a6899ef3ba9c5faaa8a66e333ef
- Anyone running Linux 3.10

## Description

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

btrfs: do not start relocation until in progress drops are done

We hit a bug with a recovering relocation on mount for one of our file
systems in production.  I reproduced this locally by injecting errors
into snapshot delete with balance running at the same time.  This
presented as an error while looking up an extent item

  WARNING: CPU: 5 PID: 1501 at fs/btrfs/extent-tree.c:866 lookup\_inline\_extent\_backref+0x647/0x680
  CPU: 5 PID: 1501 Comm: btrfs-balance Not tainted 5.16.0-rc8+ \#8
  RIP: 0010:lookup\_inline\_extent\_backref+0x647/0x680
  RSP: 0018:ffffae0a023ab960 EFLAGS: 00010202
  RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000000
  RDX: 0000000000000000 RSI: 000000000000000c RDI: 0000000000000000
  RBP: ffff943fd2a39b60 R08: 0000000000000000 R09: 0000000000000001
  R10: 0001434088152de0 R11: 0000000000000000 R12: 0000000001d05000
  R13: ffff943fd2a39b60 R14: ffff943fdb96f2a0 R15: ffff9442fc923000
  FS:  0000000000000000(0000) GS:ffff944e9eb40000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 00007f1157b1fca8 CR3: 000000010f092000 CR4: 0000000000350ee0
  Call Trace:
   \<TASK\>
   insert\_inline\_extent\_backref+0x46/0xd0
   \_\_btrfs\_inc\_extent\_ref.isra.0+0x5f/0x200
   ? btrfs\_merge\_delayed\_refs+0x164/0x190
   \_\_btrfs\_run\_delayed\_refs+0x561/0xfa0
   ? btrfs\_search\_slot+0x7b4/0xb30
   ? btrfs\_update\_root+0x1a9/0x2c0
   btrfs\_run\_delayed\_refs+0x73/0x1f0
   ? btrfs\_update\_root+0x1a9/0x2c0
   btrfs\_commit\_transaction+0x50/0xa50
   ? btrfs\_update\_reloc\_root+0x122/0x220
   prepare\_to\_merge+0x29f/0x320
   relocate\_block\_group+0x2b8/0x550
   btrfs\_relocate\_block\_group+0x1a6/0x350
   btrfs\_relocate\_chunk+0x27/0xe0
   btrfs\_balance+0x777/0xe60
   balance\_kthread+0x35/0x50
   ? btrfs\_balance+0xe60/0xe60
   kthread+0x16b/0x190
   ? set\_kthread\_struct+0x40/0x40
   ret\_from\_fork+0x22/0x30
   \</TASK\>

Normally snapshot deletion and relocation are excluded from running at
the same time by the fs\_info-\>cleaner\_mutex.  However if we had a
pending balance waiting to get the -\>cleaner\_mutex, and a snapshot
deletion was running, and then the box crashed, we would come up in a
state where we have a half deleted snapshot.

Again, in the normal case the snapshot deletion needs to complete before
relocation can start, but in this case relocation could very well start
before the snapshot deletion completes, as we simply add the root to the
dead roots list and wait for the next time the cleaner runs to clean up
the snapshot.

Fix this by setting a bit on the fs\_info if we have any DEAD\_ROOT's that
had a pending drop\_progress key.  If they do then we know we were in the
middle of the drop operation and set a flag on the fs\_info.  Then
balance can wait until this flag is cleared to start up again.

If there are DEAD\_ROOT's that don't have a drop\_progress set then we're
safe to start balance right away as we'll be properly protected by the
cleaner\_mutex.

## Affected and fixed versions

- Linux: \>= 9d1a2a3ad59f7ae810bf04a5a05995bf2d79300c, \< 6599d5e8bd758d897fd2ef4dc388ae50278b1f7e; \>= 9d1a2a3ad59f7ae810bf04a5a05995bf2d79300c, \< 5e70bc827b563caf22e1203428cc3719643de5aa; \>= 9d1a2a3ad59f7ae810bf04a5a05995bf2d79300c, \< b4be6aefa73c9a6899ef3ba9c5faaa8a66e333ef (cvelist)
- Linux: 3.10 (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-2022-48901. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-48901.md
Affected: Linux >= 9d1a2a3ad59f7ae810bf04a5a05995bf2d79300c, < 6599d5e8bd758d897fd2ef4dc388ae50278b1f7e; >= 9d1a2a3ad59f7ae810bf04a5a05995bf2d79300c, < 5e70bc827b563caf22e1203428cc3719643de5aa; >= 9d1a2a3ad59f7ae810bf04a5a05995bf2d79300c, < b4be6aefa73c9a6899ef3ba9c5faaa8a66e333ef; Linux 3.10
Fixed in: Linux 6599d5e8bd758d897fd2ef4dc388ae50278b1f7e, Linux 5e70bc827b563caf22e1203428cc3719643de5aa

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-2022-48901 being exploited?

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

### How serious is CVE-2022-48901?

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

### Which versions are affected by CVE-2022-48901?

Linux \>= 9d1a2a3ad59f7ae810bf04a5a05995bf2d79300c, \< 6599d5e8bd758d897fd2ef4dc388ae50278b1f7e; \>= 9d1a2a3ad59f7ae810bf04a5a05995bf2d79300c, \< 5e70bc827b563caf22e1203428cc3719643de5aa; \>= 9d1a2a3ad59f7ae810bf04a5a05995bf2d79300c, \< b4be6aefa73c9a6899ef3ba9c5faaa8a66e333ef; Linux 3.10.

### Is there a fix for CVE-2022-48901?

Yes. Fixed in Linux 6599d5e8bd758d897fd2ef4dc388ae50278b1f7e, Linux 5e70bc827b563caf22e1203428cc3719643de5aa. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2022-48901?

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/6599d5e8bd758d897fd2ef4dc388ae50278b1f7e>
- patch: <https://git.kernel.org/stable/c/5e70bc827b563caf22e1203428cc3719643de5aa>
- patch: <https://git.kernel.org/stable/c/b4be6aefa73c9a6899ef3ba9c5faaa8a66e333ef>

## 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-2022-48901>

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