CVE-2025-39759
btrfs: qgroup: fix race between quota disable and quota rescan ioctl
Mitigation
- No fix listed yet: follow the vendor advisory.
Who should check
- Anyone running Linux >= e685da14af6b31e4b336a110cb1bae1afc268be8, < 7cda0fdde5d9890976861421d207870500f9aace; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < b172535ccba12f0cf7d23b3b840989de47fc104d; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < dd0b28d877b293b1d7f8727a7de08ae36b6b9ef0; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < c38028ce0d0045ca600b6a8345a0ff92bfb47b66; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < 2fd0f5ceb997f90f4332ccbab6c7e907e6b2d0eb; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < e1249667750399a48cafcf5945761d39fa584edf
- Anyone running Linux 3.12
Vulnerability facts
- Affected
- Linux >= e685da14af6b31e4b336a110cb1bae1afc268be8, < 7cda0fdde5d9890976861421d207870500f9aace; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < b172535ccba12f0cf7d23b3b840989de47fc104d; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < dd0b28d877b293b1d7f8727a7de08ae36b6b9ef0; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < c38028ce0d0045ca600b6a8345a0ff92bfb47b66; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < 2fd0f5ceb997f90f4332ccbab6c7e907e6b2d0eb; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < e1249667750399a48cafcf5945761d39fa584edf; Linux 3.12
- Fixed in
- Linux 7cda0fdde5d9890976861421d207870500f9aace, Linux 2fd0f5ceb997f90f4332ccbab6c7e907e6b2d0eb
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 7.0 (v3.1, NVD)CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: High
- Privileges required: Low
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 0.16% chance of exploitation in 30 days (percentile 3, 2026-11-26)
- CWE
- CWE-362
- Modified
Description
In the Linux kernel, the following vulnerability has been resolved: btrfs: qgroup: fix race between quota disable and quota rescan ioctl There's a race between a task disabling quotas and another running the rescan ioctl that can result in a use-after-free of qgroup records from the fs_info->qgroup_tree rbtree. This happens as follows: 1) Task A enters btrfs_ioctl_quota_rescan() -> btrfs_qgroup_rescan(); 2) Task B enters btrfs_quota_disable() and calls btrfs_qgroup_wait_for_completion(), which does nothing because at that point fs_info->qgroup_rescan_running is false (it wasn't set yet by task A); 3) Task B calls btrfs_free_qgroup_config() which starts freeing qgroups from fs_info->qgroup_tree without taking the lock fs_info->qgroup_lock; 4) Task A enters qgroup_rescan_zero_tracking() which starts iterating the fs_info->qgroup_tree tree while holding fs_info->qgroup_lock, but task B is freeing qgroup records from that tree without holding the lock, resulting in a use-after-free. Fix this by taking fs_info->qgroup_lock at btrfs_free_qgroup_config(). Also at btrfs_qgroup_rescan() don't start the rescan worker if quotas were already disabled.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Linux | >= e685da14af6b31e4b336a110cb1bae1afc268be8, < 7cda0fdde5d9890976861421d207870500f9aace; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < b172535ccba12f0cf7d23b3b840989de47fc104d; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < dd0b28d877b293b1d7f8727a7de08ae36b6b9ef0; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < c38028ce0d0045ca600b6a8345a0ff92bfb47b66; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < 2fd0f5ceb997f90f4332ccbab6c7e907e6b2d0eb; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < e1249667750399a48cafcf5945761d39fa584edf | — | cvelist |
| Linux | 3.12 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2025-39759. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2025-39759.md Affected: Linux >= e685da14af6b31e4b336a110cb1bae1afc268be8, < 7cda0fdde5d9890976861421d207870500f9aace; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < b172535ccba12f0cf7d23b3b840989de47fc104d; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < dd0b28d877b293b1d7f8727a7de08ae36b6b9ef0; >= e685da14af6b31e4b336a11… Fixed in: Linux 7cda0fdde5d9890976861421d207870500f9aace, Linux 2fd0f5ceb997f90f4332ccbab6c7e907e6b2d0eb 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.
References
Patches
- https://git.kernel.org/stable/c/7cda0fdde5d9890976861421d207870500f9aace
- https://git.kernel.org/stable/c/b172535ccba12f0cf7d23b3b840989de47fc104d
- https://git.kernel.org/stable/c/dd0b28d877b293b1d7f8727a7de08ae36b6b9ef0
- https://git.kernel.org/stable/c/c38028ce0d0045ca600b6a8345a0ff92bfb47b66
- https://git.kernel.org/stable/c/2fd0f5ceb997f90f4332ccbab6c7e907e6b2d0eb
- https://git.kernel.org/stable/c/e1249667750399a48cafcf5945761d39fa584edf
FAQ
Is CVE-2025-39759 being exploited?
There is no confirmed exploitation: CVE-2025-39759 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.16% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2025-39759?
High: CVSS 7.0 (v3.1, scored by NVD). 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-2025-39759?
Linux >= e685da14af6b31e4b336a110cb1bae1afc268be8, < 7cda0fdde5d9890976861421d207870500f9aace; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < b172535ccba12f0cf7d23b3b840989de47fc104d; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < dd0b28d877b293b1d7f8727a7de08ae36b6b9ef0; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < c38028ce0d0045ca600b6a8345a0ff92bfb47b66; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < 2fd0f5ceb997f90f4332ccbab6c7e907e6b2d0eb; >= e685da14af6b31e4b336a110cb1bae1afc268be8, < e1249667750399a48cafcf5945761d39fa584edf; Linux 3.12.
Is there a fix for CVE-2025-39759?
Yes. Fixed in Linux 7cda0fdde5d9890976861421d207870500f9aace, Linux 2fd0f5ceb997f90f4332ccbab6c7e907e6b2d0eb. No fix listed yet: follow the vendor advisory.
How do I check if I'm affected by CVE-2025-39759?
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.