8.8high
landlock: Fix handling of disconnected directories
- Severity
- 8.8high CVSS:3.1 by Linux
- Exploit likelihood
- 0.15% (higher than 4% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: landlock: Fix handling of disconnected directories Disconnected files or directories can appear when they are visible and opened from a bind mount, but have been renamed or moved from the source of the bind mount in a way that makes them inaccessible from the mount point (i.e. out of scope). Previously, access rights tied to files or directories opened through a disconnected directory were collected by walking the related hierarchy down to the root of the filesystem, without taking into account the mount point because it couldn't be found. This could lead to inconsistent access results, potential access right widening, and hard-to-debug renames, especially since such paths cannot be printed. For a sandboxed task to create a disconnected directory, it needs to have write access (i.e. FS_MAKE_REG, FS_REMOVE_FILE, and FS_REFER) to the underlying source of the bind mount, and read access to the related mount point. Because a sandboxed task cannot acquire more access rights than those defined by its Landlock domain, this could lead to inconsistent access rights due to missing permissions that should be inherited from the mount point hierarchy, while inheriting permissions from the filesystem hierarchy hidden by this mount point instead. Landlock now handles files and directories opened from disconnected directories by taking into account the filesystem hierarchy when the mount point is not found in the hierarchy walk, and also always taking into account the mount point from which these disconnected directories were opened. This ensures that a rename is not allowed if it would widen access rights [1]. The rationale is that, even if disconnected hierarchies might not be visible or accessible to a sandboxed task, relying on the collected access rights from them improves the guarantee that access rights will not be widened during a rename because of the access right comparison between the source and the destination (see LANDLOCK_ACCESS_FS_REFER). It may look like this would grant more access on disconnected files and directories, but the security policies are always enforced for all the evaluated hierarchies. This new behavior should be less surprising to users and safer from an access control perspective. Remove a wrong WARN_ON_ONCE() canary in collect_domain_accesses() and fix the related comment. Because opened files have their access rights stored in the related file security properties, there is no impact for disconnected or unlinked files.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from cb2c7d1a1776057c9a1f48ed1250d85e94d4850d before 4f5cdc82a6c7e22cfd9a92d203cec13a52a3f363, from cb2c7d1a1776057c9a1f48ed1250d85e94d4850d before fbf718d5afe21057694a0c0223a18b0c7a5960b6, from cb2c7d1a1776057c9a1f48ed1250d85e94d4850d before 426d5b681b2f3339ff04da39b81d71176dc8c87c, from cb2c7d1a1776057c9a1f48ed1250d85e94d4850d before cadb28f8b3fd6908e3051e86158c65c3a8e1c907, from cb2c7d1a1776057c9a1f48ed1250d85e94d4850d before 49c9e09d961025b22e61ef9ad56aa1c21b6ce2f1, 5.13 Not affected: before 5.13, from 6.1.189 up to 6.1.*, from 6.6.143 up to 6.6.*, from 6.12.80 up to 6.12.*, from 6.18.2 up to 6.18.*, from 6.19 up to * | 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: landlock: Fix handling of disconnected directories Disconnected files or directories can appear when they are visible and opened from a bind mount, but have been renamed or moved from the source of the bind mount in a way that makes them inaccessible from the mount point (i.e. out of scope). Previously, access rights tied to files or directories opened through a disconnected directory were collected by walking the related hierarchy down to the root of the filesystem, without taking into account the mount point because it couldn't be found. This could lead to inconsistent access results, potential access right widening, and hard-to-debug renames, especially since such paths cannot be printed. For a sandboxed task to create a disconnected directory, it needs to have write access (i.e. FS_MAKE_REG, FS_REMOVE_FILE, and FS_REFER) to the underlying source of the bind mount, and read access to the related mount point. Because a sandboxed task cannot acquire more access rights than those defined by its Landlock domain, this could lead to inconsistent access rights due to missing permissions that should be inherited from the mount point hierarchy, while inheriting permissions from the filesystem hierarchy hidden by this mount point instead. Landlock now handles files and directories opened from disconnected directories by taking into account the filesystem hierarchy when the mount point is not found in the hierarchy walk, and also always taking into account the mount point from which these disconnected directories were opened. This ensures that a rename is not allowed if it would widen access rights [1]. The rationale is that, even if disconnected hierarchies might not be visible or accessible to a sandboxed task, relying on the collected access rights from them improves the guarantee that access rights will not be widened during a rename because of the access right comparison between the source and the destination (see LANDLOCK_ACCESS_FS_REFER). It may look like this would grant more access on disconnected files and directories, but the security policies are always enforced for all the evaluated hierarchies. This new behavior should be less surprising to users and safer from an access control perspective. Remove a wrong WARN_ON_ONCE() canary in collect_domain_accesses() and fix the related comment. Because opened files have their access rights stored in the related file security properties, there is no impact for disconnected or unlinked files.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: landlock: Corrección del manejo de directorios desconectados Archivos o directorios desconectados pueden aparecer cuando son visibles y se abren desde un montaje de enlace, pero han sido renombrados o movidos desde el origen del montaje de enlace de una manera que los hace inaccesibles desde el punto de montaje (es decir, fuera de alcance). Anteriormente, los derechos de acceso vinculados a archivos o directorios abiertos a través de un directorio desconectado se recopilaban recorriendo la jerarquía relacionada hasta la raíz del sistema de archivos, sin tener en cuenta el punto de montaje porque no se podía encontrar. Esto podría llevar a resultados de acceso inconsistentes, una posible ampliación de los derechos de acceso y renombramientos difíciles de depurar, especialmente porque tales rutas no pueden imprimirse. Para que una tarea en sandbox cree un directorio desconectado, necesita tener acceso de escritura (es decir, FS_MAKE_REG, FS_REMOVE_FILE y FS_REFER) al origen subyacente del montaje de enlace, y acceso de lectura al punto de montaje relacionado. Debido a que una tarea en sandbox no puede adquirir más derechos de acceso que los definidos por su dominio Landlock, esto podría llevar a derechos de acceso inconsistentes debido a permisos faltantes que deberían heredarse de la jerarquía del punto de montaje, mientras que, en su lugar, hereda permisos de la jerarquía del sistema de archivos oculta por este punto de montaje. Landlock ahora maneja archivos y directorios abiertos desde directorios desconectados teniendo en cuenta la jerarquía del sistema de archivos cuando el punto de montaje no se encuentra en el recorrido de la jerarquía, y también siempre teniendo en cuenta el punto de montaje desde el cual se abrieron estos directorios desconectados. Esto asegura que no se permite un renombramiento si ampliara los derechos de acceso [1]. La razón es que, incluso si las jerarquías desconectadas podrían no ser visibles o accesibles para una tarea en sandbox, confiar en los derechos de acceso recopilados de ellas mejora la garantía de que los derechos de acceso no se ampliarán durante un renombramiento debido a la comparación de derechos de acceso entre el origen y el destino (ver LANDLOCK_ACCESS_FS_REFER). Podría parecer que esto otorgaría más acceso a archivos y directorios desconectados, pero las políticas de seguridad siempre se aplican para todas las jerarquías evaluadas. Este nuevo comportamiento debería ser menos sorprendente para los usuarios y más seguro desde una perspectiva de control de acceso. Eliminar un canary WARN_ON_ONCE() incorrecto en collect_domain_accesses() y corregir el comentario relacionado. Debido a que los archivos abiertos tienen sus derechos de acceso almacenados en las propiedades de seguridad de archivo relacionadas, no hay impacto para archivos desconectados o desvinculados.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-68736 changed 2026-10-16 | CVE Terms of Use |
| NVD | CVE-2025-68736 changed 2026-10-16 | Public domain |