CVE-2025-39927
JSON

7.8high

ceph: fix race condition validating r_parent before applying state

Severity
7.8high CVSS:3.1 by Linux
Exploit likelihood
0.16% (higher than 5% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

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. ]

Affected

Product or packageVersionsReported by
Linux Linuxfrom 9030aaf9bf0a1eee47a154c316c789e959638b0f before dc5aad078abc416dd3d555c50f5308c16ba918a7, from 9030aaf9bf0a1eee47a154c316c789e959638b0f before db378e6f83ec705c6091c65d482d555edc2b0a72, from 9030aaf9bf0a1eee47a154c316c789e959638b0f before 2bfe45987eb346e299d9f763f9cd05f77011519f, from 9030aaf9bf0a1eee47a154c316c789e959638b0f before 15f519e9f883b316d86e2bb6b767a023aafd9d83, 2.6.34
Not affected: before 2.6.34, from 6.6.160 up to 6.6.*, from 6.12.48 up to 6.12.*, from 6.16.8 up to 6.16.*, from 6.17 up to *
CVE List
linux linux_kernelfrom 2.6.35 before 6.12.48, from 6.13 before 6.16.8, 2.6.34, 6.17NVD

All scores

Linux7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CISA-ADP4.7medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
NVD4.7medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-362

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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. ]

NVD (es)

En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: ceph: corregir condición de carrera al validar r_parent antes de aplicar el estado Añadir validación para asegurar que el inodo del directorio padre en caché coincide con la información del directorio en las respuestas de MDS. Esto previene condiciones de carrera del lado del cliente donde operaciones concurrentes (p. ej., renombrar) hacen que r_parent quede obsoleto entre el inicio de la solicitud y el procesamiento de la respuesta, lo que podría llevar a aplicar cambios de estado a inodos de directorio incorrectos. [ idryomov: incorporó una corrección de kerneldoc y una corrección de seguimiento de Alex para mover la referencia CEPH_CAP_PIN cuando r_parent se actualiza: Cuando el bloqueo del directorio padre no está retenido, req->r_parent puede quedar obsoleto y se actualiza para apuntar al inodo correcto. Sin embargo, la referencia CEPH_CAP_PIN asociada no se estaba ajustando. El CEPH_CAP_PIN es una referencia en un inodo que se rastrea con fines contables. Mover este pin es importante para mantener la contabilidad equilibrada. Cuando el pin no se movía del padre antiguo al nuevo, creaba dos problemas: La referencia en el padre antiguo y obsoleto nunca se liberaba, causando una fuga de referencias. Nunca se adquiría una referencia para el nuevo padre, creando el riesgo de un desbordamiento negativo de referencias más tarde en ceph_mdsc_release_request(). Este parche corrige la lógica liberando el pin del padre antiguo y adquiriéndolo para el nuevo padre cuando se cambia r_parent. Esto asegura que la contabilidad de referencias se mantenga equilibrada. ]

References

Sources

SourceRecordLicence
CVE ListCVE-2025-39927 changed 2026-10-21CVE Terms of Use
NVDCVE-2025-39927 changed 2026-10-21Public domain