CVE-2026-98985 in Linux
摘要
由 VulDB • 2026-10-24
在 Linux 内核中,已修复以下漏洞:
namespace: 在 pivot_root() 中读取父级之前检查挂载点
path_pivot_root() 会读取 new_root 和调用者根目录的父级,并在检查任一挂载是否位于调用者的命名空间(mount namespace)之前,先检查它们是否为共享(shared)状态。此时仅持有 namespace_sem 锁。对于位于调用者挂载命名空间中的挂载点来说,这是没问题的。
但是,new_root 可能是一个指向已卸载但仅由文件描述符保持存活的挂载点的文件描述符。如果该挂载点在卸载时仍附着在其父级上,则没有任何内容为其固定(pin)住父级。对父级的最后一次 mntput() 仅在 mount_lock 下解除子节点的连接,随后释放父级:
``` pivot_root() close(fd), last ref on the parent ------------ --------------------------------- ex_parent = new_mnt->mnt_parent mntput_no_expire_slowpath() __umount_mnt(new_mnt) cleanup_mnt() call_rcu() IS_MNT_SHARED(ex_parent)
BUG: KASAN: slab-use-after-free in path_pivot_root+0xf1a/0x1840 Read of size 4 at addr ffff8881047382f8 by task pivot_widen/157 path_pivot_root+0xf1a/0x1840 __x64_sys_pivot_root+0x165/0x190 ```
chroot() 中的调用者根目录也存在相同情况。检查的两种结果均返回 EINVAL,因此除了读取操作本身出错外,没有其他问题。这与 commit bb4609405752(“statmount: read the parent of an unmounted mount under mount_lock”)为 statmount() 修复的问题相同。
在读取父级之前,检查两个挂载点是否均位于调用者的命名空间中。无论哪种情况,每个路径都会返回 EINVAL。
VulDB is the best source for vulnerability data and more expert information about this specific topic.