# CVE-2022-49079: btrfs: zoned: traverse devices under chunk\_mutex in btrfs\_can\_activate\_zone

> 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.21% (percentile 7, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2025-02-26T01:54:40.697Z
- **Modified:** 2026-06-17T05:17:01.360Z

## Who should check

- Anyone running Linux \>= a85f05e59bc15a83ad910dbcb71df5ad8fa77295, \< 09e65ae515af2b24d6dc23af21719a3b41de83e5; \>= a85f05e59bc15a83ad910dbcb71df5ad8fa77295, \< 142f822bd945a7be442a2916ec6167cc102c4183; \>= a85f05e59bc15a83ad910dbcb71df5ad8fa77295, \< 0b9e66762aa0cda2a9c2d5542d64e04dac528fa6
- Anyone running Linux 5.16

## Description

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

btrfs: zoned: traverse devices under chunk\_mutex in btrfs\_can\_activate\_zone

btrfs\_can\_activate\_zone() can be called with the device\_list\_mutex already
held, which will lead to a deadlock:

insert\_dev\_extents() // Takes device\_list\_mutex
\`-\> insert\_dev\_extent()
 \`-\> btrfs\_insert\_empty\_item()
  \`-\> btrfs\_insert\_empty\_items()
   \`-\> btrfs\_search\_slot()
    \`-\> btrfs\_cow\_block()
     \`-\> \_\_btrfs\_cow\_block()
      \`-\> btrfs\_alloc\_tree\_block()
       \`-\> btrfs\_reserve\_extent()
        \`-\> find\_free\_extent()
         \`-\> find\_free\_extent\_update\_loop()
          \`-\> can\_allocate\_chunk()
           \`-\> btrfs\_can\_activate\_zone() // Takes device\_list\_mutex again

Instead of using the RCU on fs\_devices-\>device\_list we
can use fs\_devices-\>alloc\_list, protected by the chunk\_mutex to traverse
the list of active devices.

We are in the chunk allocation thread. The newer chunk allocation
happens from the devices in the fs\_device-\>alloc\_list protected by the
chunk\_mutex.

  btrfs\_create\_chunk()
    lockdep\_assert\_held(&info-\>chunk\_mutex);
    gather\_device\_info
      list\_for\_each\_entry(device, &fs\_devices-\>alloc\_list, dev\_alloc\_list)

Also, a device that reappears after the mount won't join the alloc\_list
yet and, it will be in the dev\_list, which we don't want to consider in
the context of the chunk alloc.

  \[15.166572\] WARNING: possible recursive locking detected
  \[15.167117\] 5.17.0-rc6-dennis \#79 Not tainted
  \[15.167487\] --------------------------------------------
  \[15.167733\] kworker/u8:3/146 is trying to acquire lock:
  \[15.167733\] ffff888102962ee0 (&fs\_devs-\>device\_list\_mutex){+.+.}-{3:3}, at: find\_free\_extent+0x15a/0x14f0 \[btrfs\]
  \[15.167733\]
  \[15.167733\] but task is already holding lock:
  \[15.167733\] ffff888102962ee0 (&fs\_devs-\>device\_list\_mutex){+.+.}-{3:3}, at: btrfs\_create\_pending\_block\_groups+0x20a/0x560 \[btrfs\]
  \[15.167733\]
  \[15.167733\] other info that might help us debug this:
  \[15.167733\]  Possible unsafe locking scenario:
  \[15.167733\]
  \[15.171834\]        CPU0
  \[15.171834\]        ----
  \[15.171834\]   lock(&fs\_devs-\>device\_list\_mutex);
  \[15.171834\]   lock(&fs\_devs-\>device\_list\_mutex);
  \[15.171834\]
  \[15.171834\]  \*\*\* DEADLOCK \*\*\*
  \[15.171834\]
  \[15.171834\]  May be due to missing lock nesting notation
  \[15.171834\]
  \[15.171834\] 5 locks held by kworker/u8:3/146:
  \[15.171834\]  \#0: ffff888100050938 ((wq\_completion)events\_unbound){+.+.}-{0:0}, at: process\_one\_work+0x1c3/0x5a0
  \[15.171834\]  \#1: ffffc9000067be80 ((work\_completion)(&fs\_info-\>async\_data\_reclaim\_work)){+.+.}-{0:0}, at: process\_one\_work+0x1c3/0x5a0
  \[15.176244\]  \#2: ffff88810521e620 (sb\_internal){.+.+}-{0:0}, at: flush\_space+0x335/0x600 \[btrfs\]
  \[15.176244\]  \#3: ffff888102962ee0 (&fs\_devs-\>device\_list\_mutex){+.+.}-{3:3}, at: btrfs\_create\_pending\_block\_groups+0x20a/0x560 \[btrfs\]
  \[15.176244\]  \#4: ffff8881152e4b78 (btrfs-dev-00){++++}-{3:3}, at: \_\_btrfs\_tree\_lock+0x27/0x130 \[btrfs\]
  \[15.179641\]
  \[15.179641\] stack backtrace:
  \[15.179641\] CPU: 1 PID: 146 Comm: kworker/u8:3 Not tainted 5.17.0-rc6-dennis \#79
  \[15.179641\] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1.fc35 04/01/2014
  \[15.179641\] Workqueue: events\_unbound btrfs\_async\_reclaim\_data\_space \[btrfs\]
  \[15.179641\] Call Trace:
  \[15.179641\]  \<TASK\>
  \[15.179641\]  dump\_stack\_lvl+0x45/0x59
  \[15.179641\]  \_\_lock\_acquire.cold+0x217/0x2b2
  \[15.179641\]  lock\_acquire+0xbf/0x2b0
  \[15.183838\]  ? find\_free\_extent+0x15a/0x14f0 \[btrfs\]
  \[15.183838\]  \_\_mutex\_lock+0x8e/0x970
  \[15.183838\]  ? find\_free\_extent+0x15a/0x14f0 \[btrfs\]
  \[15.183838\]  ? find\_free\_extent+0x15a/0x14f0 \[btrfs\]
  \[15.183838\]  ? lock\_is\_held\_type+0xd7/0x130
  \[15.183838\]  ? find\_free\_extent+0x15a/0x14f0 \[btrfs\]
  \[15.183838\]  find\_free\_extent+0x15a/0x14f0 \[btrfs\]
  \[15.183838\]  ? \_raw\_spin\_unlock+0x24/0x40
  \[15.183838\]  ? btrfs\_get\_alloc\_profile+0x106/0x230 \[btrfs\]
  \[15.187601\]  btrfs\_reserve\_extent+0x131/0x260 \[btrfs\]
  \[15.
---truncated---

## Affected and fixed versions

- Linux: \>= a85f05e59bc15a83ad910dbcb71df5ad8fa77295, \< 09e65ae515af2b24d6dc23af21719a3b41de83e5; \>= a85f05e59bc15a83ad910dbcb71df5ad8fa77295, \< 142f822bd945a7be442a2916ec6167cc102c4183; \>= a85f05e59bc15a83ad910dbcb71df5ad8fa77295, \< 0b9e66762aa0cda2a9c2d5542d64e04dac528fa6 (cvelist)
- Linux: 5.16 (cvelist)

## Mitigation

- Upgrade Linux to 0b9e66762aa0cda2a9c2d5542d64e04dac528fa6 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2022-49079.md
Affected: Linux >= a85f05e59bc15a83ad910dbcb71df5ad8fa77295, < 09e65ae515af2b24d6dc23af21719a3b41de83e5; >= a85f05e59bc15a83ad910dbcb71df5ad8fa77295, < 142f822bd945a7be442a2916ec6167cc102c4183; >= a85f05e59bc15a83ad910dbcb71df5ad8fa77295, < 0b9e66762aa0cda2a9c2d5542d64e04dac528fa6; Linux 5.16
Fixed in: Linux 09e65ae515af2b24d6dc23af21719a3b41de83e5, Linux 142f822bd945a7be442a2916ec6167cc102c4183, Linux 0b9e66762aa0cda2a9c2d5542d64e04dac528fa6

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

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

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

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

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

Linux \>= a85f05e59bc15a83ad910dbcb71df5ad8fa77295, \< 09e65ae515af2b24d6dc23af21719a3b41de83e5; \>= a85f05e59bc15a83ad910dbcb71df5ad8fa77295, \< 142f822bd945a7be442a2916ec6167cc102c4183; \>= a85f05e59bc15a83ad910dbcb71df5ad8fa77295, \< 0b9e66762aa0cda2a9c2d5542d64e04dac528fa6; Linux 5.16.

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

Yes. Fixed in Linux 09e65ae515af2b24d6dc23af21719a3b41de83e5, Linux 142f822bd945a7be442a2916ec6167cc102c4183, Linux 0b9e66762aa0cda2a9c2d5542d64e04dac528fa6. Upgrade Linux to 0b9e66762aa0cda2a9c2d5542d64e04dac528fa6 or later.

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

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/09e65ae515af2b24d6dc23af21719a3b41de83e5>
- patch: <https://git.kernel.org/stable/c/142f822bd945a7be442a2916ec6167cc102c4183>
- patch: <https://git.kernel.org/stable/c/0b9e66762aa0cda2a9c2d5542d64e04dac528fa6>

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

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