CVE-2025-39927
kernel: ceph: fix race condition validating r_parent before applying state
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · October 1, 2025
Updated · October 30, 2026
Description
In the Linux kernel, the following vulnerability has been resolved:
ceph: fix race condition validating r_parent before applying state
Add validation to ensure the cached parent directory inode matches the directory info in MDS replies. This prevents client-side race conditions where concurrent operations (e.g. rename) cause r_parent to become stale between request initiation and reply processing, which could lead to applying state changes to incorrect directory inodes.
[ idryomov: folded a kerneldoc fixup and a follow-up fix from Alex to move CEPH_CAP_PIN reference when r_parent is updated:
When the parent directory lock is not held, req->r_parent can become stale and is updated to point to the correct inode. However, the associated CEPH_CAP_PIN reference was not being adjusted. The CEPH_CAP_PIN is a reference on an inode that is tracked for accounting purposes. Moving this pin is important to keep the accounting balanced. When the pin was not moved from the old parent to the new one, it created two problems: The reference on the old, stale parent was never released, causing a reference leak. A reference for the new parent was never acquired, creating the risk of a reference underflow later in ceph_mdsc_release_request(). This patch corrects the logic by releasing the pin from the old parent and acquiring it for the new parent when r_parent is switched. This ensures reference accounting stays balanced. ]
Statement
This vulnerability is rated as having a Moderate impact because triggering the race condition requires local access to an active Ceph file system mount and precise synchronization of concurrent namespace modifications. In Red Hat Enterprise Linux, the Ceph filesystem kernel module is not loaded by default and is only engaged when CephFS shares are mounted. Systems that do not use CephFS or do not permit unprivileged users to execute concurrent directory operations on Ceph shares are not exposed to this issue.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 6.4CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H
CWE-364 · Signal Handler Race Condition