# CVE-2025-39840: audit: fix out-of-bounds read in audit\_compare\_dname\_path()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.1
- **CVSS:** 7.1 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- **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
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.21% (percentile 7, 2026-11-26)
- **CWE:** CWE-125
- **Published:** 2025-09-19T15:26:15.596Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= e92eebb0d6116f942ab25dfb1a41905aa59472a8, \< 9735a9dcc307427e7d6336c54171682f1bac9789; \>= e92eebb0d6116f942ab25dfb1a41905aa59472a8, \< 4540f1d23e7f387880ce46d11b5cd3f27248bf8d
- Anyone running Linux 6.14

## 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

- Linux: \>= e92eebb0d6116f942ab25dfb1a41905aa59472a8, \< 9735a9dcc307427e7d6336c54171682f1bac9789; \>= e92eebb0d6116f942ab25dfb1a41905aa59472a8, \< 4540f1d23e7f387880ce46d11b5cd3f27248bf8d (cvelist)
- Linux: 6.14 (cvelist)

## Mitigation

- Upgrade Linux to 4540f1d23e7f387880ce46d11b5cd3f27248bf8d or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
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.
```

## 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.

## References

- patch: <https://git.kernel.org/stable/c/9735a9dcc307427e7d6336c54171682f1bac9789>
- patch: <https://git.kernel.org/stable/c/4540f1d23e7f387880ce46d11b5cd3f27248bf8d>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-39840>

HTML: <https://flawdb.com/CVE-2025-39840> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-39840>
