CVE-2026-99639 in Linux
Summary
by MITRE • 11/20/2026
In the Linux kernel, the following vulnerability has been resolved:
ovl: fix whiteout creation in casefolded directories
unlink and rmdir fail with EINVAL on an overlay with casefolded (case-insensitive) layers, if the name exists in a lower layer. Casefolded layers need CONFIG_UNICODE. Root can mount such an overlay, and so can an unprivileged user in a user namespace, with tmpfs layers.
Overlayfs does not change a lower layer. To remove a name that exists there, it hides the name with a marker file, a whiteout. It creates the whiteout in the work directory, a scratch directory on the upper filesystem, and renames it over the name in the upper directory:
- ovl_whiteout() creates the whiteout with mknod, or as a hard link to an earlier whiteout. - ovl_cleanup_and_whiteout() then prepares the rename with start_renaming_two_dentries(), which returns -EINVAL if the source or the target dentry is unhashed, that is, not in the dentry hash table.
With casefolded directories, both dentries can be unhashed:
- The target. Lookup in a casefolded directory leaves a negative dentry unhashed, so the rename target is unhashed if the name does not exist in the upper directory. - The source, which is the new whiteout. tmpfs hashes a dentry when mknod or link makes it positive, but ext4 does not, so on ext4 the source is unhashed as well.
The cleanup after the failure also refuses an unhashed dentry, so on ext4 the whiteout is left behind in the work directory.
Reproduced with rm and rmdir on casefolded tmpfs and ext4 layers, also as uid 1000 in a user namespace.
Fix this by creating the whiteout with ovl_create_temp(), which repeats the lookup if the new dentry is unhashed. Prepare the rename with start_renaming_dentry(), which looks up the target name with the directories locked. The caller looked the name up without a lock, so return -ESTALE if the name now refers to a different inode.
[amir: pass the name used for lookup instead of taking a name snapshot]
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/21/2026
The vulnerability described involves a logic error in the Linux kernel's overlayfs implementation when handling file removal operations within casefolded directories, specifically affecting systems where CONFIG_UNICODE is enabled to support case-insensitive filesystems. Overlayfs operates by layering multiple filesystems, allowing modifications on an upper writable layer while keeping lower read-only layers intact. When a user attempts to delete or rename a file that exists in a lower layer but not in the upper layer, overlayfs must create a whiteout marker in the work directory and then rename it over the location of the target file in the upper directory. This process effectively hides the underlying file from subsequent lookups without altering the immutable lower layers. The flaw arises because the original implementation failed to properly handle dentry hashing states during this creation and renaming sequence, leading to operation failures under specific conditions involving casefolded directories on certain filesystem types like ext4 or tmpfs.
The technical root cause lies in how overlayfs manages directory entry (dentry) objects during the whiteout creation process. The function ovl_whiteout() attempts to create a marker file using mknod or by creating a hard link, while ovl_cleanup_and_whiteout() prepares for the rename operation via start_renaming_two_dentries(). This preparation step requires both the source dentry (the new whiteout) and the target dentry (where the whiteout will be placed) to be hashed, meaning they must exist in the kernel's internal dentry hash table. However, with casefolded directories, lookups often result in negative dentries that remain unhashed if the name does not already exist in the upper directory. Consequently, the target dentry is frequently unhashed. Furthermore, depending on the underlying filesystem implementation of the work directory, such as ext4 versus tmpfs, the newly created whiteout source dentry may also fail to be hashed immediately after creation. When start_renaming_two_dentries() encounters these unhashed dentries, it returns an EINVAL error code, causing the unlink or rmdir operation to fail abruptly rather than proceeding with the intended file hiding mechanism.
This failure results in a denial of service for legitimate administrative and user operations involving case-insensitive filesystems. Users attempting standard removal commands like rm or rmdir on files present only in lower layers will encounter permission-like errors despite having appropriate privileges, as evidenced by reproduction within unprivileged user namespaces with tmpfs layers. Additionally, the error handling logic subsequent to this failure is flawed; it refuses to clean up an unhashed dentry, which means that if the operation fails due to the hashing issue on filesystems like ext4, a stale whiteout file is left behind in the work directory. This accumulation of orphaned marker files can lead to resource exhaustion and further operational instability over time, degrading system performance and potentially causing subsequent operations to fail as well.
From a security classification perspective, this vulnerability aligns with CWE-754: Improper Check for Unusual or Exceptional Conditions, as the code fails to adequately handle edge cases regarding dentry states in casefolded environments. It also relates to CWE-832: Unlock of a Resource that is not Locked, given the improper cleanup logic that leaves resources dangling after failure. In terms of MITRE ATT&CK mapping, this could be associated with T1496: Resource Hijacking if an attacker were able to exploit the accumulation of whiteout files to consume disk space or inode limits on the upper layer, although primarily it represents a reliability and availability issue rather than a direct privilege escalation vector. The vulnerability is particularly relevant in containerized environments where overlayfs is commonly used for storage drivers, potentially affecting unprivileged users who rely on user namespaces for isolation.
To mitigate this risk, kernel maintainers have implemented fixes that alter the dentry handling logic during whiteout creation. Instead of relying solely on standard mknod or link calls which may leave dentries unhashed in casefolded contexts, the updated code utilizes ovl_create_temp() to ensure proper lookup and hashing behavior even if initial attempts result in negative entries. The rename preparation is also revised to use start_renaming_dentry(), which performs lookups with directory locks held, ensuring consistency between the source and target states. Furthermore, the fix introduces a check for stale references by returning -ESTALE if the name now refers to a different inode after locking, preventing race conditions that could lead to incorrect file operations. System administrators should ensure their kernels are updated to versions containing this patch, particularly those deploying casefolded filesystems in container runtimes or virtualized environments where overlayfs is active. Regular auditing of work directories for orphaned whiteout files can also help identify systems still running vulnerable kernel versions before an update is applied.