5.5medium
btrfs: log new dentries when logging parent dir of a conflicting inode
- Severity
- 5.5medium CVSS:3.1 by NVD
- 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: btrfs: log new dentries when logging parent dir of a conflicting inode If we log the parent directory of a conflicting inode, we are not logging the new dentries of the directory, so when we finish we have the parent directory's inode marked as logged but we did not log its new dentries. As a consequence if the parent directory is explicitly fsynced later and it does not have any new changes since we logged it, the fsync is a no-op and after a power failure the new dentries are missing. Example scenario: $ mkdir foo $ sync $rmdir foo $ mkdir dir1 $ mkdir dir2 # A file with the same name and parent as the directory we just deleted # and was persisted in a past transaction. So the deleted directory's # inode is a conflicting inode of this new file's inode. $ touch foo $ ln foo dir2/link # The fsync on dir2 will log the parent directory (".") because the # conflicting inode (deleted directory) does not exists anymore, but it # it does not log its new dentries (dir1). $ xfs_io -c "fsync" dir2 # This fsync on the parent directory is no-op, since the previous fsync # logged it (but without logging its new dentries). $ xfs_io -c "fsync" . <power failure> # After log replay dir1 is missing. Fix this by ensuring we log new dir dentries whenever we log the parent directory of a no longer existing conflicting inode. A test case for fstests will follow soon.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from a3baaf0d786e22fc86295fda9c58ba0dee07599f before 6c23595c54cfeb878e3fbbb8eb08bc5061d0c2d4, from a3baaf0d786e22fc86295fda9c58ba0dee07599f before 56e72c8b02d982be775d9df025357c152383ee84, from a3baaf0d786e22fc86295fda9c58ba0dee07599f before f556b1e09d054e31f464c0fd37280c2b5a393fee, from a3baaf0d786e22fc86295fda9c58ba0dee07599f before 1cf30c73602c69d750c9345c47f2c0e9d0cfb578, from a3baaf0d786e22fc86295fda9c58ba0dee07599f before 6f5a51969b1deb79aefd2194b48fe7e78e72ff7e, from a3baaf0d786e22fc86295fda9c58ba0dee07599f before 9573a365ff9ff45da9222d3fe63695ce562beb24, 5.1 Not affected: before 5.1, from 6.1.191 up to 6.1.*, from 6.6.130 up to 6.6.*, from 6.12.78 up to 6.12.*, from 6.18.20 up to 6.18.*, from 6.19.10 up to 6.19.* | CVE List |
| linux linux_kernel | from 5.1 before 6.6.130, from 6.7 before 6.12.78, from 6.13 before 6.18.20, from 6.19 before 6.19.10, 7.0 | NVD |
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: btrfs: log new dentries when logging parent dir of a conflicting inode If we log the parent directory of a conflicting inode, we are not logging the new dentries of the directory, so when we finish we have the parent directory's inode marked as logged but we did not log its new dentries. As a consequence if the parent directory is explicitly fsynced later and it does not have any new changes since we logged it, the fsync is a no-op and after a power failure the new dentries are missing. Example scenario: $ mkdir foo $ sync $rmdir foo $ mkdir dir1 $ mkdir dir2 # A file with the same name and parent as the directory we just deleted # and was persisted in a past transaction. So the deleted directory's # inode is a conflicting inode of this new file's inode. $ touch foo $ ln foo dir2/link # The fsync on dir2 will log the parent directory (".") because the # conflicting inode (deleted directory) does not exists anymore, but it # it does not log its new dentries (dir1). $ xfs_io -c "fsync" dir2 # This fsync on the parent directory is no-op, since the previous fsync # logged it (but without logging its new dentries). $ xfs_io -c "fsync" . <power failure> # After log replay dir1 is missing. Fix this by ensuring we log new dir dentries whenever we log the parent directory of a no longer existing conflicting inode. A test case for fstests will follow soon.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: btrfs: registrar nuevas entradas de directorio (dentries) al registrar el directorio padre de un inodo en conflicto Si registramos el directorio padre de un inodo en conflicto, no estamos registrando las nuevas entradas de directorio (dentries) del directorio, así que cuando terminamos tenemos el inodo del directorio padre marcado como registrado pero no registramos sus nuevas entradas de directorio (dentries). Como consecuencia, si el directorio padre se sincroniza explícitamente (fsynced) más tarde y no tiene ningún cambio nuevo desde que lo registramos, el fsync es una operación nula (no-op) y después de un fallo de alimentación las nuevas entradas de directorio (dentries) faltan. Escenario de ejemplo: $ mkdir foo $ sync $rmdir foo $ mkdir dir1 $ mkdir dir2 # Un archivo con el mismo nombre y padre que el directorio que acabamos de eliminar # y fue persistido en una transacción anterior. Así que el inodo del directorio eliminado # es un inodo en conflicto del inodo de este nuevo archivo. $ touch foo $ ln foo dir2/link # El fsync en dir2 registrará el directorio padre ('.') porque el # inodo en conflicto (directorio eliminado) ya no existe, pero # no registra sus nuevas entradas de directorio (dentries) (dir1). $ xfs_io -c 'fsync' dir2 # Este fsync en el directorio padre es una operación nula (no-op), ya que el fsync anterior # lo registró (pero sin registrar sus nuevas entradas de directorio (dentries)). $ xfs_io -c 'fsync' . <fallo de alimentación> # Después de la reproducción del registro, dir1 falta. Solucione esto asegurando que registramos nuevas entradas de directorio (dentries) cada vez que registramos el directorio padre de un inodo en conflicto que ya no existe. Un caso de prueba para fstests seguirá pronto.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-23465 changed 2026-10-30 | CVE Terms of Use |
| NVD | CVE-2026-23465 changed 2026-10-30 | Public domain |