CVE-2025-39840 Details
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]
A vulnerability in the Linux kernel's audit subsystem can lead to an out-of-bounds read in the function audit_compare_dname_path(). This issue arises when a watch is placed on the root directory (dir=/) and an fsnotify event is triggered for a single-character name directly under the root, such as creating a file named '/a'. The vulnerability occurs because the helper function parent_len() returns 1 for the root directory. When this value equals the full path length, the code improperly adjusts the path pointer and length, allowing the subsequent loop to dereference memory outside of the intended bounds. This out-of-bounds read can be exploited under specific conditions, creating a potential security risk.
Users can upgrade to the latest version of the Linux kernel where this vulnerability has been patched. The specific commit addressing this issue is available in the Linux kernel stable tree.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jan 14, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://git.kernel.org/stable/c/4540f1d23e7f387880ce46d11b5cd3f27248bf8d | kernel.org | Patch |
| https://git.kernel.org/stable/c/9735a9dcc307427e7d6336c54171682f1bac9789 | kernel.org | Patch |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-125 | Out-of-bounds Read | [email protected] |
| CWE-125 | Out-of-bounds Read | CISA-ADP |
Affected Products
| Product | Versions |
|---|---|
| linux linux kernel | >= 6.14, < 6.16.6 6.17 rc1 6.17 rc2 6.17 rc3 6.17 rc4 |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | kernel.org |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jan 14, 2026 | CVE Modified | CISA-ADP |
| Dec 12, 2025 | Initial Analysis | [email protected] |
| Sep 19, 2025 | New CVE Received | kernel.org |