CVE-2025-21887: ovl: fix UAF in ovl_dentry_update_reval by moving dput() in ovl_link_up
In the Linux kernel, the following vulnerability has been resolved:
ovl: fix UAF in ovl_dentry_update_reval by moving dput() in ovl_link_up
The issue was caused by dput(upper) being called before
ovl_dentry_update_reval(), while upper->d_flags was still
accessed in ovl_dentry_remote().
Move dput(upper) after its last use to prevent use-after-free.
BUG: KASAN: slab-use-after-free in ovl_dentry_remote fs/overlayfs/util.c:162 [inline]
BUG: KASAN: slab-use-after-free in ovl_dentry_update_reval+0xd2/0xf0 fs/overlayfs/util.c:167
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
ovl_dentry_remote fs/overlayfs/util.c:162 [inline]
ovl_dentry_update_reval+0xd2/0xf0 fs/overlayfs/util.c:167
ovl_link_up fs/overlayfs/copy_up.c:610 [inline]
ovl_copy_up_one+0x2105/0x3490 fs/overlayfs/copy_up.c:1170
ovl_copy_up_flags+0x18d/0x200 fs/overlayfs/copy_up.c:1223
ovl_rename+0x39e/0x18c0 fs/overlayfs/dir.c:1136
vfs_rename+0xf84/0x20a0 fs/namei.c:4893
...
</TASK>
Security readout for executives and security teams
Plain-English summary
CVE-2025-21887 is a Linux kernel overlayfs memory-safety flaw. A local user could potentially trigger a use-after-free condition, with high confidentiality, integrity, and availability impact per CVSS. It is important for servers, container hosts, and appliances that run affected Linux kernels.
Executive priority
Treat as a high-priority local privilege and stability risk, especially for shared Linux infrastructure and container platforms. Patch through normal emergency kernel channels, but do not classify as internet-wormable based on the provided evidence.
Technical view
The bug is in overlayfs: ovl_link_up called dput(upper) before ovl_dentry_update_reval, while ovl_dentry_remote still accessed upper->d_flags. Kernel KASAN reported slab-use-after-free in fs/overlayfs/util.c. The listed fix moves dput(upper) after the final use.
Likely exposure
Exposure is most likely on Linux systems running affected kernel branches with overlayfs available. Container hosts may warrant closer review because overlayfs is commonly used there. The source bundle lists Linux as affected and includes Debian LTS and Siemens advisories, but does not prove every downstream product is vulnerable.
Exploitation context
The CVE is not listed as KEV in the provided bundle, and no cited source states active exploitation. The CVSS vector is local, low complexity, low privileges, no user interaction, with high impact across confidentiality, integrity, and availability.
Researcher notes
Focus analysis on overlayfs copy-up and rename paths leading to ovl_link_up and ovl_dentry_update_reval. Evidence shows a KASAN-confirmed use-after-free and stable kernel commits. The provided sources do not include exploit availability or complete downstream product coverage.
Mitigation direction
Apply kernel updates containing the referenced stable fixes from your distribution or vendor.
Prioritize container hosts, multi-user Linux systems, and exposed appliance fleets.
Review Debian LTS and Siemens guidance where those environments apply.
If updates are unavailable, check vendor guidance for supported compensating controls.
Avoid inventing local workarounds without vendor confirmation.
Validation and detection
Inventory Linux kernel versions across servers, endpoints, containers hosts, and appliances.
Compare versions against the affected and fixed ranges in vendor advisories.
Confirm whether overlayfs is enabled or operationally used on each system.
Verify patched systems report vendor-fixed kernel builds after reboot.
Track exceptions where appliances depend on Siemens or other OEM firmware guidance.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-416: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
3ADP providers
10Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-416 · source CWE mapping
Use After Free
Use After Free represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.