Skip to content

Commit 730c145

Browse files
committed
Merge tag 'audit-pr-20250905' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit
Pull audit fix from Paul Moore: "A single small audit patch to fix a potential out-of-bounds read caused by a negative array index when comparing paths" * tag 'audit-pr-20250905' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: fix out-of-bounds read in audit_compare_dname_path()
2 parents c2f3b10 + 4540f1d commit 730c145

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/auditfilter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ int audit_compare_dname_path(const struct qstr *dname, const char *path, int par
13261326

13271327
/* handle trailing slashes */
13281328
pathlen -= parentlen;
1329-
while (p[pathlen - 1] == '/')
1329+
while (pathlen > 0 && p[pathlen - 1] == '/')
13301330
pathlen--;
13311331

13321332
if (pathlen != dlen)

0 commit comments

Comments
 (0)