# CVE-2022-50379: btrfs: fix race between quota enable and quota rescan ioctl

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

- **Severity:** MEDIUM 4.7
- **CVSS:** 4.7 (v3.1, CNA) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; 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.15% (percentile 2, 2026-11-26)
- **CWE:** CWE-362
- **Published:** 2025-09-18T13:33:01.502Z
- **Modified:** 2026-06-17T05:23:22.983Z

## Who should check

- Anyone running Linux \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< c97f6d528c3f1c83a6b792a8a7928c236c80b8fe; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 26b7c0ac49a3eea15559c9d84863736a6d1164b4; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 47b5ffe86332af95f0f52be0a63d4da7c2b37b55; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 4b996a3014ef014af8f97b60c35f5289210a4720; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 0efd9dfc00d677a1d0929319a6103cb2dfc41c22; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 6c22f86dd221eba0c7af645b1af73dcbc04ee27b; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 331cd9461412e103d07595a10289de90004ac890
- Anyone running Linux 4.17

## Description

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

btrfs: fix race between quota enable and quota rescan ioctl

When enabling quotas, at btrfs\_quota\_enable(), after committing the
transaction, we change fs\_info-\>quota\_root to point to the quota root we
created and set BTRFS\_FS\_QUOTA\_ENABLED at fs\_info-\>flags. Then we try
to start the qgroup rescan worker, first by initializing it with a call
to qgroup\_rescan\_init() - however if that fails we end up freeing the
quota root but we leave fs\_info-\>quota\_root still pointing to it, this
can later result in a use-after-free somewhere else.

We have previously set the flags BTRFS\_FS\_QUOTA\_ENABLED and
BTRFS\_QGROUP\_STATUS\_FLAG\_ON, so we can only fail with -EINPROGRESS at
btrfs\_quota\_enable(), which is possible if someone already called the
quota rescan ioctl, and therefore started the rescan worker.

So fix this by ignoring an -EINPROGRESS and asserting we can't get any
other error.

## Affected and fixed versions

- Linux: \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< c97f6d528c3f1c83a6b792a8a7928c236c80b8fe; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 26b7c0ac49a3eea15559c9d84863736a6d1164b4; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 47b5ffe86332af95f0f52be0a63d4da7c2b37b55; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 4b996a3014ef014af8f97b60c35f5289210a4720; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 0efd9dfc00d677a1d0929319a6103cb2dfc41c22; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 6c22f86dd221eba0c7af645b1af73dcbc04ee27b; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 331cd9461412e103d07595a10289de90004ac890 (cvelist)
- Linux: 4.17 (cvelist)

## Mitigation

- Upgrade Linux to 331cd9461412e103d07595a10289de90004ac890 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-50379. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-50379.md
Affected: Linux >= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, < c97f6d528c3f1c83a6b792a8a7928c236c80b8fe; >= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, < 26b7c0ac49a3eea15559c9d84863736a6d1164b4; >= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, < 47b5ffe86332af95f0f52be0a63d4da7c2b37b55; >= 5d23515be66904fa3b1b5d6…
Fixed in: Linux 26b7c0ac49a3eea15559c9d84863736a6d1164b4, Linux 47b5ffe86332af95f0f52be0a63d4da7c2b37b55, Linux 4b996a3014ef014af8f97b60c35f5289210a4720, Linux 0efd9dfc00d677a1d0929319a6103cb2dfc41c22, Linux 6c22f86dd221eba0c7af645b1af73dcbc04ee27b, Linux 331cd9461412e103d07595a10289de90004ac890

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

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

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

Medium: CVSS 4.7 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

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

Linux \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< c97f6d528c3f1c83a6b792a8a7928c236c80b8fe; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 26b7c0ac49a3eea15559c9d84863736a6d1164b4; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 47b5ffe86332af95f0f52be0a63d4da7c2b37b55; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 4b996a3014ef014af8f97b60c35f5289210a4720; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 0efd9dfc00d677a1d0929319a6103cb2dfc41c22; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 6c22f86dd221eba0c7af645b1af73dcbc04ee27b; \>= 5d23515be66904fa3b1b5d6bd72d2199cd2447ab, \< 331cd9461412e103d07595a10289de90004ac890; Linux 4.17.

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

Yes. Fixed in Linux 26b7c0ac49a3eea15559c9d84863736a6d1164b4, Linux 47b5ffe86332af95f0f52be0a63d4da7c2b37b55, Linux 4b996a3014ef014af8f97b60c35f5289210a4720, Linux 0efd9dfc00d677a1d0929319a6103cb2dfc41c22, Linux 6c22f86dd221eba0c7af645b1af73dcbc04ee27b, Linux 331cd9461412e103d07595a10289de90004ac890. Upgrade Linux to 331cd9461412e103d07595a10289de90004ac890 or later.

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

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/c97f6d528c3f1c83a6b792a8a7928c236c80b8fe>
- patch: <https://git.kernel.org/stable/c/26b7c0ac49a3eea15559c9d84863736a6d1164b4>
- patch: <https://git.kernel.org/stable/c/47b5ffe86332af95f0f52be0a63d4da7c2b37b55>
- patch: <https://git.kernel.org/stable/c/4b996a3014ef014af8f97b60c35f5289210a4720>
- patch: <https://git.kernel.org/stable/c/0efd9dfc00d677a1d0929319a6103cb2dfc41c22>
- patch: <https://git.kernel.org/stable/c/6c22f86dd221eba0c7af645b1af73dcbc04ee27b>
- patch: <https://git.kernel.org/stable/c/331cd9461412e103d07595a10289de90004ac890>

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

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