CVE-2026-99424 in Linuxinfo

Summary

by MITRE • 11/19/2026

In the Linux kernel, the following vulnerability has been resolved:

ovl: set OVL_WHITEOUTS before publishing the upper dir

Listing a directory while it is copied up causes a use-after-free of the readdir cache.

A merge directory must never be iterated as a real upper directory: that mode frees the cache in OVL_I(inode)->cache without looking at its refcount, while files opened in merged mode still use it. ovl_copy_up_workdir() publishes the upper dentry before it sets OVL_WHITEOUTS, and ovl_dir_open() samples both without a lock, so an open between the two stores finds the upper directory and takes it for a real one.

With a delay between the two stores, an unprivileged process that listed a directory during its copy-up saw only "." and "..", and its next getdents freed the readdir cache of another descriptor.

Fix this by setting OVL_WHITEOUTS before ovl_inode_update(), so that ovl_dir_reset() agrees with ovl_dir_open(), and by testing OVL_TYPE_MERGE() of the path type in ovl_dir_open(), so that an open that observes the upper dentry never iterates a merge dir as a real dir, regardless of the order in which it observes the flag.

[amir: test OVL_TYPE_MERGE() instead of smp_rmb() in ovl_dir_open()]

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 11/19/2026

The Linux kernel overlay filesystem driver contains a race condition vulnerability related to directory listing during copy-up operations, specifically involving the use-after-free of the readdir cache. This issue arises from an improper sequencing of flag updates and state checks within the ovl_copy_up_workdir function. When a directory is being copied up from the lower layer to the upper writable layer, the kernel must ensure that concurrent access does not interpret intermediate states incorrectly. The vulnerability occurs because the code publishes the upper dentry before setting the OVL_WHITEOUTS flag on the overlay inode structure. This ordering creates a critical window where an unprivileged process can open and list the directory while it is in this transitional state.

The core technical flaw lies in how ovl_dir_open handles the determination of whether a directory should be treated as a real upper directory or a merged one. The function samples both the presence of the upper dentry and the OVL_WHITEOUTS flag without holding a lock that guarantees atomicity between these checks. If an open operation occurs after the upper dentry is published but before the OVL_WHITEOUTS flag is set, ovl_dir_open incorrectly identifies the directory as a real upper directory rather than a merge directory. This misclassification leads to a dangerous operational consequence because merging directories are never intended to be iterated directly as real upper directories in this manner.

When the readdir cache for such a mistakenly identified directory is freed via OVL_I(inode)->cache, it does not properly account for reference counts if accessed through merged mode logic that expects different lifecycle management. Consequently, subsequent getdents system calls by other file descriptors operating on the same directory attempt to access memory that has already been freed. This results in a use-after-free condition which can lead to kernel crashes, data corruption, or potentially arbitrary code execution depending on how the freed memory is reused by the allocator subsystem. The immediate observable symptom for an unprivileged user listing such a directory during copy-up is seeing only dot and double-dot entries followed by a crash when attempting further enumeration operations like getdents.

This vulnerability maps to CWE-416, Use After Free, as it involves accessing memory after it has been made available for reuse without proper synchronization or reference counting safeguards. From an ATT&CK perspective, this aligns with techniques involving exploitation of software vulnerabilities during system initialization or state transitions, specifically leveraging race conditions in kernel subsystems to escalate privileges or cause denial of service through resource corruption. The lack of atomicity between publishing the dentry and setting internal flags allows attackers to exploit timing windows that are difficult to predict but easy to trigger repeatedly under load.

To mitigate this vulnerability, the fix involves reordering operations within ovl_copy_up_workdir so that OVL_WHITEOUTS is set before calling ovl_inode_update. This ensures consistency between what ovl_dir_reset expects and what ovl_dir_open observes during directory opening sequences. Additionally, the patch introduces a check for OVL_TYPE_MERGE in ovl_dir_open to verify if the path type indicates a merge scenario regardless of flag ordering. By testing this condition explicitly rather than relying solely on memory barriers like smp_rmb, the kernel prevents any open operation from iterating a merge directory as a real one even if it observes the upper dentry prematurely. This structural change eliminates the race window by enforcing correct semantic interpretation of the directory state before allowing iteration operations that could trigger cache invalidation issues.

Responsible

Linux

Reservation

09/25/2026

Disclosure

11/19/2026

Moderation

accepted

CPE

ready

EPSS

0.00210

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!