KernelScan.io

HIGH Introduced in 6.19

overlayfs MkdirDebug UAF

CVE-2026-98921

CVSS 7.8 / 10.0 KernelScan AI

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

01

In the Linux kernel, the following vulnerability has been resolved: ovl: fix UAF in ovl_do_mkdir() debug print ovl_do_mkdir() prints the input dentry with %pd after vfs_mkdir(). Since commit fe497f0759e0 ("VFS: change vfs_mkdir() to unlock on failure."), vfs_mkdir() calls end_creating() on the input dentry on failure and may replace it on success, so the post-call %pd can use-after-free the dentry when CONFIG_OVERLAY_FS_DEBUG is enabled. Print the dentry before the call and only the result afterward.

02

Engine v0.9.0

Risk summary

A local user with write access to an overlayfs mount can trigger a use-after-free in kernel debug printing when CONFIG_OVERLAY_FS_DEBUG is enabled. This allows arbitrary kernel memory read and write, leading to privilege escalation or kernel crash. Container hosts and multi-tenant systems using overlayfs are primarily at risk.

Affectedfs/overlayfs/overlayfs.h (overlayfs)

Vulnerability analysis

The ovl_do_mkdir() function in overlayfs prints a debug message using the input dentry pointer after calling vfs_mkdir(). A prior VFS change made vfs_mkdir() release or replace that dentry on both success and failure paths, so the post-call debug print accesses memory that may have been freed or reassigned. The fix moves the dentry print to before the vfs_mkdir() call and prints only the numeric result afterward. The bug is reachable by any local user who can create directories on an overlayfs mount, but only when the kernel is built with CONFIG_OVERLAY_FS_DEBUG enabled — a debug option not typically set in production kernels.

03

BranchIntroducedFixed inPatch commit
7.26.197.2.9719bd33ab359
mainline6.197.3ae146bc1abde