CVE-2025-39759
HighIn 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.
CVSS 3.1 score
7.0
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Weakness type
CWE-362CVE-2025-39759 is a Race Condition vulnerability
What is Race Condition?
The product contains a code sequence that can run concurrently with other code, creating unexpected states. Learn more on MITRE CWE
Affected versions
Linux kernel versions
3.12
and later are affected. Fixed in
6.1.149,
6.6.103,
6.12.44,
6.15.11,
6.16.2,
6.17
and their respective stable series.
References
The following references provide additional information about CVE-2025-39759 including vendor advisories, patch commits, exploit details, and third-party analysis. Links are sourced from the NIST NVD database.
-
Mailing List Third Party Advisory
-
-
PatchKernel patch commithttps://git.kernel.org/stable/c/2fd0f5ceb997f90f4332ccbab6c7e907e6b2d0eb
-
PatchKernel patch commithttps://git.kernel.org/stable/c/7cda0fdde5d9890976861421d207870500f9aace
-
PatchKernel patch commithttps://git.kernel.org/stable/c/b172535ccba12f0cf7d23b3b840989de47fc104d
Frequently asked questions
-
What is CVE-2025-39759?
CVE-2025-39759 is a High severity Linux kernel vulnerability with a CVSS score of 7.0 out of 10 , classified as a Race Condition flaw (CWE-362) . It affects Linux kernel versions from 3.12 onward and has been patched in 6.1.149, 6.6.103, 6.12.44 and others. CVE-2025-39759 has not been confirmed as actively exploited and is not listed in the CISA KEV catalog.
-
What is the CVSS score for CVE-2025-39759?
CVE-2025-39759 has a CVSS score of 7.0 out of 10, rated High severity (CVSS 3.1). The vector string is
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H. -
Is there a patch available for CVE-2025-39759?
Yes — CVE-2025-39759 has been patched. Fixed versions include 6.1.149, 6.6.103, 6.12.44 and others. If you are running Linux kernel 3.12 or later up to the fix versions, apply the relevant patch for your kernel branch.
-
Is CVE-2025-39759 actively exploited?
No — CVE-2025-39759 has not been confirmed as actively exploited. It is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.
-
What is Race Condition (CWE-362)?
The product contains a code sequence that can run concurrently with other code, creating unexpected states. View CWE-362 on MITRE CWE →