CVE-2025-39840
audit: fix out-of-bounds read in audit_compare_dname_path()
Mitigation
- Upgrade Linux to 4540f1d23e7f387880ce46d11b5cd3f27248bf8d or later.
Who should check
- Anyone running Linux >= e92eebb0d6116f942ab25dfb1a41905aa59472a8, < 9735a9dcc307427e7d6336c54171682f1bac9789; >= e92eebb0d6116f942ab25dfb1a41905aa59472a8, < 4540f1d23e7f387880ce46d11b5cd3f27248bf8d
- Anyone running Linux 6.14
Vulnerability facts
- Affected
- Linux >= e92eebb0d6116f942ab25dfb1a41905aa59472a8, < 9735a9dcc307427e7d6336c54171682f1bac9789; >= e92eebb0d6116f942ab25dfb1a41905aa59472a8, < 4540f1d23e7f387880ce46d11b5cd3f27248bf8d; Linux 6.14
- Fixed in
- Linux 9735a9dcc307427e7d6336c54171682f1bac9789, Linux 4540f1d23e7f387880ce46d11b5cd3f27248bf8d
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 7.1 (v3.1, CNA)CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Privileges required: Low
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: None
- Availability impact: High
- EPSS
- 0.21% chance of exploitation in 30 days (percentile 7, 2026-11-26)
- CWE
- CWE-125
- Modified
Description
In the Linux kernel, the following vulnerability has been resolved: audit: fix out-of-bounds read in audit_compare_dname_path() When a watch on dir=/ is combined with an fsnotify event for a single-character name directly under / (e.g., creating /a), an out-of-bounds read can occur in audit_compare_dname_path(). The helper parent_len() returns 1 for "/". In audit_compare_dname_path(), when parentlen equals the full path length (1), the code sets p = path + 1 and pathlen = 1 - 1 = 0. The subsequent loop then dereferences p[pathlen - 1] (i.e., p[-1]), causing an out-of-bounds read. Fix this by adding a pathlen > 0 check to the while loop condition to prevent the out-of-bounds access. [PM: subject tweak, sign-off email fixes]
Affected and fixed versions
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2025-39840. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2025-39840.md Affected: Linux >= e92eebb0d6116f942ab25dfb1a41905aa59472a8, < 9735a9dcc307427e7d6336c54171682f1bac9789; >= e92eebb0d6116f942ab25dfb1a41905aa59472a8, < 4540f1d23e7f387880ce46d11b5cd3f27248bf8d; Linux 6.14 Fixed in: Linux 9735a9dcc307427e7d6336c54171682f1bac9789, Linux 4540f1d23e7f387880ce46d11b5cd3f27248bf8d Steps: 1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
FAQ
Is CVE-2025-39840 being exploited?
There is no confirmed exploitation: CVE-2025-39840 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.21% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2025-39840?
High: CVSS 7.1 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).
Which versions are affected by CVE-2025-39840?
Linux >= e92eebb0d6116f942ab25dfb1a41905aa59472a8, < 9735a9dcc307427e7d6336c54171682f1bac9789; >= e92eebb0d6116f942ab25dfb1a41905aa59472a8, < 4540f1d23e7f387880ce46d11b5cd3f27248bf8d; Linux 6.14.
Is there a fix for CVE-2025-39840?
Yes. Fixed in Linux 9735a9dcc307427e7d6336c54171682f1bac9789, Linux 4540f1d23e7f387880ce46d11b5cd3f27248bf8d. Upgrade Linux to 4540f1d23e7f387880ce46d11b5cd3f27248bf8d or later.
How do I check if I'm affected by CVE-2025-39840?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.