nday
CVE-2025-40271

fs/proc: fix uaf in proc_readdir_de()

Linux / Linux

A public PoC appeared 149 days after disclosure. nday has no fix record for it yet; that does not mean no patch exists. Listed by 1 of 4 PoC sources: exploitdb. Not in CISA KEV.

tags accesslocalno user interaction exploitationExploit-DB productLinux kernel product typeoperating system
why these tags

nday derives these tags by fixed rules from the facts below; NVD, the CNA and other sources do not assign them. Vocabulary and rules: ~/tags.

local
AV:L in CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (CVSS 3.1) from the CNA Linux
no user interaction
UI:N in CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (CVSS 3.1) from the CNA Linux
Exploit-DB
Exploit-DB entries 52550
Linux kernel
affected products in the CVE record: Linux · Linux
operating system
affected products in the CVE record: Linux · Linuxthe product type of Linux kernel in nday's product registry
stage
POC
disclosed
disclosure → PoC
T+149d POC is date-only
cvss
7.8 HIGH v3.1

Lifecycle

x axis UTC; dot = exact minute, wide bar = date only, hollow = unknown or inferred.
time unknown
DISdisclosed
2025-12-06T21:50Z
PATpatch
no record yet
ANAanalysis
no record yet
POCPoC
2026-05-04, date only
ITWexploited
no record yet
KEVKEV
no record yet

Summary

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 rb_erase(), but not set the node to EMPTY, which may result in uaf access. We should use RB_CLEAR_NODE() set the erased node to EMPTY, then pde_subdir_next() will return NULL to avoid uaf access.

We found an uaf issue while using stress-ng testing, need to run testcase getdent and tun in the same time. The steps of the issue is as follows:

1) use getdent to traverse dir /proc/pid/net/dev_snmp6/, and current pde is tun3;

2) in the [time windows] unregister netdevice tun3 and tun2, and erase them from rbtree. erase tun3 first, and then erase tun2. the pde(tun2) will be released to slab;

3) continue to getdent process, then pde_subdir_next() will return pde(tun2) which is released, it will case uaf access.

CPU 0                                      |    CPU 1
-------------------------------------------------------------------------
traverse dir /proc/pid/net/dev_snmp6/      |   unregister_netdevice(tun->dev)   //tun3 tun2
sys_getdents64()                           |
  iterate_dir()                            |
    proc_readdir()                         |
      proc_readdir_de()                    |     snmp6_unregister_dev()
        pde_get(de);                       |       proc_remove()
        read_unlock(&proc_subdir_lock);    |         remove_proc_subtree()
                                           |           write_lock(&proc_subdir_lock);
        [time window]                      |           rb_erase(&root->subdir_node, &parent->subdir);
                                           |           write_unlock(&proc_subdir_lock);
        read_lock(&proc_subdir_lock);      |
        next = pde_subdir_next(de);        |
        pde_put(de);                       |
        de = next;    //UAF                |

rbtree of dev_snmp6 |

  pde(tun3)
   /    \
NULL  pde(tun2)

Original text of the CVE record (cvelist), shown as published.

Exploit conditions

What an attack needs, read from the CVSS vector.
Attack vector AV:L
Local: needs a local or SSH session, or a user tricked into acting on the machine
Attack complexity AC:L
Low: no special conditions; the attacker can expect repeatable success
Privileges required PR:L
Low: ordinary user privileges
User interaction UI:N
None: no action by anyone other than the attacker

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

CVSS 3.1 vector from the CVE record, scored by the CNA Linux.

Event log

+DISdisclosed

CVE record published by Linux. CVSS 7.8, high.

src cvelist · nday , bulk import · raw
{
  "id": 60481,
  "type": "disclosed",
  "source": "cvelist",
  "url": "https://www.cve.org/CVERecord?id=CVE-2025-40271",
  "occurred_at": "2025-12-06T21:50:53.266Z",
  "observed_at": "2026-11-12T17:00:49.411818Z",
  "is_backfill": true,
  "dedupe_key": "",
  "detail": {
    "cvss": {
      "source": "cna",
      "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "version": "3.1",
      "base_score": 7.8,
      "base_severity": "HIGH"
    },
    "ssvc": {
      "timestamp": "2026-06-16T19:37:49.226666Z",
      "automatable": "no",
      "exploitation": "none",
      "technical_impact": "partial"
    },
    "state": "PUBLISHED",
    "date_published": "2025-12-06T21:50:53.266Z",
    "assigner_short_name": "Linux"
  }
}
2026-05-04date only, from source
+POCpublic PoC

Exploit-DB lists public exploit code “Linux Kernel proc_readdir_de() 6.18-rc5 - Local Privilege Escalation” (EDB-52550).

src exploitdb 52550 · nday , bulk import · raw
{
  "id": 24244,
  "type": "poc_published",
  "source": "exploitdb",
  "url": "https://www.exploit-db.com/exploits/52550",
  "occurred_at": "2026-05-04T00:00:00Z",
  "observed_at": "2026-11-12T15:24:40.221206Z",
  "is_backfill": true,
  "dedupe_key": "52550",
  "detail": {
    "url": "https://www.exploit-db.com/exploits/52550",
    "file": "exploits/linux/local/52550.c",
    "kind": "exploit",
    "tags": [],
    "type": "local",
    "title": "Linux Kernel proc_readdir_de() 6.18-rc5 - Local Privilege Escalation",
    "author": "aviralyash27",
    "edb_id": 52550,
    "cve_ids": [
      "CVE-2025-40271"
    ],
    "platform": "linux",
    "verified": false,
    "precision": "day",
    "confidence": "curated",
    "date_added": "2026-05-04",
    "date_updated": "2026-05-04",
    "date_published": "2026-05-04"
  }
}

Report an error

report an error or omission

Something on this page wrong or missing? Tell the editors; if they accept it, this page's revision log says so publicly. Upstream data is not changed.

Researcher discussion

0 researchers mentioned this in the last 7 days

Posts on X by researchers on nday's list that mention this CVE, shown as posted. nday does not check them.

nday has not collected any post on X by listed researchers that mentions this CVE.

Discussion

0 comments

No comments yet.