Commit 730c1451 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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()
parents c2f3b108 4540f1d2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1326,7 +1326,7 @@ int audit_compare_dname_path(const struct qstr *dname, const char *path, int par

	/* handle trailing slashes */
	pathlen -= parentlen;
	while (p[pathlen - 1] == '/')
	while (pathlen > 0 && p[pathlen - 1] == '/')
		pathlen--;

	if (pathlen != dlen)