7.8high
vfs: Don't leak disconnected dentries on umount
- Severity
- 7.8high CVSS:3.1 by Linux
- Exploit likelihood
- 0.18% (higher than 7% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: vfs: Don't leak disconnected dentries on umount When user calls open_by_handle_at() on some inode that is not cached, we will create disconnected dentry for it. If such dentry is a directory, exportfs_decode_fh_raw() will then try to connect this dentry to the dentry tree through reconnect_path(). It may happen for various reasons (such as corrupted fs or race with rename) that the call to lookup_one_unlocked() in reconnect_one() will fail to find the dentry we are trying to reconnect and instead create a new dentry under the parent. Now this dentry will not be marked as disconnected although the parent still may well be disconnected (at least in case this inconsistency happened because the fs is corrupted and .. doesn't point to the real parent directory). This creates inconsistency in disconnected flags but AFAICS it was mostly harmless. At least until commit f1ee616214cb ("VFS: don't keep disconnected dentries on d_anon") which removed adding of most disconnected dentries to sb->s_anon list. Thus after this commit cleanup of disconnected dentries implicitely relies on the fact that dput() will immediately reclaim such dentries. However when some leaf dentry isn't marked as disconnected, as in the scenario described above, the reclaim doesn't happen and the dentries are "leaked". Memory reclaim can eventually reclaim them but otherwise they stay in memory and if umount comes first, we hit infamous "Busy inodes after unmount" bug. Make sure all dentries created under a disconnected parent are marked as disconnected as well.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from f1ee616214cb22410e939d963bbb2349c2570f02 before b5abafd0aa8d7bcb935c8f91e4cfc2f2820759e4, from f1ee616214cb22410e939d963bbb2349c2570f02 before 20863bb7fbb016379f8227122edfabc5c799bc79, from f1ee616214cb22410e939d963bbb2349c2570f02 before 8004d4b8cbf1bd68a23c160d57287e177c82cc69, from f1ee616214cb22410e939d963bbb2349c2570f02 before 7e0c8aaf4e28918abded547a5147c7d52c4af7d2, from f1ee616214cb22410e939d963bbb2349c2570f02 before cebfbf40056a4d858b2a3ca59a69936d599bd209, from f1ee616214cb22410e939d963bbb2349c2570f02 before 620f3b0ede9c5cb4976cd0457d0b04ad551e5d6b, from f1ee616214cb22410e939d963bbb2349c2570f02 before eadc49999fa994d6fbd70c332bd5d5051cc42261, from f1ee616214cb22410e939d963bbb2349c2570f02 before 56094ad3eaa21e6621396cc33811d8f72847a834 and 1 more Not affected: before 4.16, from 5.4.301 up to 5.4.*, from 5.10.246 up to 5.10.*, from 5.15.196 up to 5.15.*, from 6.1.158 up to 6.1.*, from 6.6.114 up to 6.6.* | CVE List |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: vfs: Don't leak disconnected dentries on umount When user calls open_by_handle_at() on some inode that is not cached, we will create disconnected dentry for it. If such dentry is a directory, exportfs_decode_fh_raw() will then try to connect this dentry to the dentry tree through reconnect_path(). It may happen for various reasons (such as corrupted fs or race with rename) that the call to lookup_one_unlocked() in reconnect_one() will fail to find the dentry we are trying to reconnect and instead create a new dentry under the parent. Now this dentry will not be marked as disconnected although the parent still may well be disconnected (at least in case this inconsistency happened because the fs is corrupted and .. doesn't point to the real parent directory). This creates inconsistency in disconnected flags but AFAICS it was mostly harmless. At least until commit f1ee616214cb ("VFS: don't keep disconnected dentries on d_anon") which removed adding of most disconnected dentries to sb->s_anon list. Thus after this commit cleanup of disconnected dentries implicitely relies on the fact that dput() will immediately reclaim such dentries. However when some leaf dentry isn't marked as disconnected, as in the scenario described above, the reclaim doesn't happen and the dentries are "leaked". Memory reclaim can eventually reclaim them but otherwise they stay in memory and if umount comes first, we hit infamous "Busy inodes after unmount" bug. Make sure all dentries created under a disconnected parent are marked as disconnected as well.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: vfs: No fugar dentries desconectados al desmontar Cuando el usuario llama a open_by_handle_at() en algún inodo que no está en caché, crearemos un dentry desconectado para él. Si dicho dentry es un directorio, exportfs_decode_fh_raw() intentará entonces conectar este dentry al árbol de dentries a través de reconnect_path(). Puede ocurrir por varias razones (como un sistema de archivos corrupto o una condición de carrera con renombrar) que la llamada a lookup_one_unlocked() en reconnect_one() falle en encontrar el dentry que estamos intentando reconectar y en su lugar cree un nuevo dentry bajo el padre. Ahora este dentry no será marcado como desconectado aunque el padre aún podría estar desconectado (al menos en caso de que esta inconsistencia ocurriera porque el sistema de archivos está corrupto y .. no apunta al directorio padre real). Esto crea inconsistencia en las banderas de desconexión pero hasta donde puedo ver era mayormente inofensivo. Al menos hasta el commit f1ee616214cb ('VFS: no mantener dentries desconectados en d_anon') que eliminó la adición de la mayoría de los dentries desconectados a la lista sb->s_anon. Así, después de este commit, la limpieza de los dentries desconectados se basa implícitamente en el hecho de que dput() reclamará inmediatamente dichos dentries. Sin embargo, cuando algún dentry hoja no está marcado como desconectado, como en el escenario descrito anteriormente, la recuperación no ocurre y los dentries se 'fugan'. La recuperación de memoria puede eventualmente reclamarlos, pero de lo contrario permanecen en memoria y si el desmontaje ocurre primero, nos encontramos con el infame error 'Inodos ocupados después del desmontaje'. Asegúrese de que todos los dentries creados bajo un padre desconectado también estén marcados como desconectados.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-40105 changed 2026-11-10 | CVE Terms of Use |
| NVD | CVE-2025-40105 changed 2026-11-10 | Public domain |