{"id":"CVE-2025-39840","aliases":["CVE-2025-39840"],"related":[],"kind":"vulnerability","state":"published","title":"audit: fix out-of-bounds read in audit_compare_dname_path()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\naudit: fix out-of-bounds read in audit_compare_dname_path()\n\nWhen a watch on dir=/ is combined with an fsnotify event for a\nsingle-character name directly under / (e.g., creating /a), an\nout-of-bounds read can occur in audit_compare_dname_path().\n\nThe helper parent_len() returns 1 for \"/\". In audit_compare_dname_path(),\nwhen parentlen equals the full path length (1), the code sets p = path + 1\nand pathlen = 1 - 1 = 0. The subsequent loop then dereferences\np[pathlen - 1] (i.e., p[-1]), causing an out-of-bounds read.\n\nFix this by adding a pathlen > 0 check to the while loop condition\nto prevent the out-of-bounds access.\n\n[PM: subject tweak, sign-off email fixes]","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\naudit: fix out-of-bounds read in audit_compare_dname_path()\n\nWhen a watch on dir=/ is combined with an fsnotify event for a\nsingle-character name directly under / (e.g., creating /a), an\nout-of-bounds read can occur in audit_compare_dname_path().\n\nThe helper parent_len() returns 1 for \"/\". In audit_compare_dname_path(),\nwhen parentlen equals the full path length (1), the code sets p = path + 1\nand pathlen = 1 - 1 = 0. The subsequent loop then dereferences\np[pathlen - 1] (i.e., p[-1]), causing an out-of-bounds read.\n\nFix this by adding a pathlen > 0 check to the while loop condition\nto prevent the out-of-bounds access.\n\n[PM: subject tweak, sign-off email fixes]","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\naudit: corregir lectura fuera de límites en audit_compare_dname_path()\n\nCuando una vigilancia en dir=/ se combina con un evento fsnotify para un nombre de un solo carácter directamente bajo / (p. ej., al crear /a), puede ocurrir una lectura fuera de límites en audit_compare_dname_path().\n\nLa función auxiliar parent_len() devuelve 1 para '/'. En audit_compare_dname_path(), cuando parentlen es igual a la longitud completa de la ruta (1), el código establece p = path + 1 y pathlen = 1 - 1 = 0. El bucle subsiguiente entonces desreferencia p[pathlen - 1] (es decir, p[-1]), causando una lectura fuera de límites.\n\nCorregir esto añadiendo una comprobación pathlen > 0 a la condición del bucle while para prevenir el acceso fuera de límites.\n\n[PM: ajuste del asunto, correcciones de correo electrónico de aprobación]","source":"nvd"}],"published":"2025-09-19T15:26:15.596Z","modified":"2026-10-19T21:10:00.160Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"},{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"type":"git","introduced":"e92eebb0d6116f942ab25dfb1a41905aa59472a8","fixed":"9735a9dcc307427e7d6336c54171682f1bac9789","status":"affected"},{"type":"git","introduced":"e92eebb0d6116f942ab25dfb1a41905aa59472a8","fixed":"4540f1d23e7f387880ce46d11b5cd3f27248bf8d","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.14","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.14","status":"unaffected"},{"type":"semver","introduced":"6.16.6","lastAffected":"6.16.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.17","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.14","fixed":"6.16.6"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/9735a9dcc307427e7d6336c54171682f1bac9789","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4540f1d23e7f387880ce46d11b5cd3f27248bf8d","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-01-14T19:20:33.496Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-39840","url":"https://www.cve.org/CVERecord?id=CVE-2025-39840","licence":"CVE Terms of Use","modified":"2026-08-05T12:05:33.644Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-39840","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-39840","licence":"Public domain","modified":"2026-10-19T21:10:00.160Z"}],"updatedAt":"2026-11-25T22:59:04.860Z","epss":{"score":0.00212,"percentile":0.06535,"date":"2026-11-30T12:00:22.000Z"}}