In the Linux kernel, the following vulnerability has been resolved: fs/proc: fix uaf in proc_readdir_de() Pde is erased from subdir rbtree through… (CVE-2025-40271)
A use-after-free (UAF) vulnerability was identified and resolved in the Linux kernel's proc filesystem code, specifically in the proc_readdir_de() function. The issue occurs because a directory entry node (pde) is erased from a red-black tree but not properly cleared, leading to potential access of freed memory during directory traversal. This can happen when network devices are unregistered concurrently with directory reads under /proc, causing the kernel to access released memory. The vulnerability was discovered through stress testing and involves a race condition between directory iteration and device unregistration.
AI Analysis
Technical Summary
The Linux kernel contained a use-after-free vulnerability in fs/proc, where a directory entry (pde) node is removed from the subdirectory red-black tree via rb_erase() but the node is not cleared with RB_CLEAR_NODE(). This omission allows pde_subdir_next() to return a pointer to a freed node, leading to use-after-free access during proc filesystem directory reads. The issue manifests when concurrent operations traverse /proc/pid/net/dev_snmp6/ while network devices (tun3, tun2) are unregistered and removed from the rbtree. The race condition allows the directory iteration to access a freed pde, causing memory corruption and potential kernel compromise. The vulnerability is tracked as CVE-2025-40271 and has a CVSS 3.1 score indicating high severity.
Potential Impact
Successful exploitation of this vulnerability can lead to use-after-free memory access in the kernel, which may result in arbitrary code execution, system crashes, or privilege escalation due to kernel memory corruption. The CVSS vector indicates local attack vector with low complexity and no user interaction required, with high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Since this is a kernel vulnerability, remediation typically involves applying an official kernel update that includes the fix to clear the erased node properly. Until a patch is applied, avoid running untrusted code that can trigger concurrent directory traversal and device unregistration operations. Monitor vendor advisories for official fixes.
In the Linux kernel, the following vulnerability has been resolved: fs/proc: fix uaf in proc_readdir_de() Pde is erased from subdir rbtree through… (CVE-2025-40271)
Description
A use-after-free (UAF) vulnerability was identified and resolved in the Linux kernel's proc filesystem code, specifically in the proc_readdir_de() function. The issue occurs because a directory entry node (pde) is erased from a red-black tree but not properly cleared, leading to potential access of freed memory during directory traversal. This can happen when network devices are unregistered concurrently with directory reads under /proc, causing the kernel to access released memory. The vulnerability was discovered through stress testing and involves a race condition between directory iteration and device unregistration.
CVSS v3.1
Score 7.8high
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The Linux kernel contained a use-after-free vulnerability in fs/proc, where a directory entry (pde) node is removed from the subdirectory red-black tree via rb_erase() but the node is not cleared with RB_CLEAR_NODE(). This omission allows pde_subdir_next() to return a pointer to a freed node, leading to use-after-free access during proc filesystem directory reads. The issue manifests when concurrent operations traverse /proc/pid/net/dev_snmp6/ while network devices (tun3, tun2) are unregistered and removed from the rbtree. The race condition allows the directory iteration to access a freed pde, causing memory corruption and potential kernel compromise. The vulnerability is tracked as CVE-2025-40271 and has a CVSS 3.1 score indicating high severity.
Potential Impact
Successful exploitation of this vulnerability can lead to use-after-free memory access in the kernel, which may result in arbitrary code execution, system crashes, or privilege escalation due to kernel memory corruption. The CVSS vector indicates local attack vector with low complexity and no user interaction required, with high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Since this is a kernel vulnerability, remediation typically involves applying an official kernel update that includes the fix to clear the erased node properly. Until a patch is applied, avoid running untrusted code that can trigger concurrent directory traversal and device unregistration operations. Monitor vendor advisories for official fixes.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-r37x-wmxh-7hvh
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2025-40271"]
- Ecosystems
- []
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a6b72d59c2644c7f84798f9
Added to database: 07/30/2026, 15:50:45 UTC
Last enriched: 07/30/2026, 17:38:43 UTC
Last updated: 08/24/2026, 10:52:05 UTC
Views: 14
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.