summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-09-05 12:35:25 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2025-09-05 12:35:25 -0700
commit730c1451fbc3942d434a4203bd4616ad0b71b23d (patch)
tree898227c831aa4c00841811c9279369e88d3229c1 /kernel
parentc2f3b108c09d1a8e2b20ce691df6a59d30351b7d (diff)
parent4540f1d23e7f387880ce46d11b5cd3f27248bf8d (diff)
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()
Diffstat (limited to 'kernel')
-rw-r--r--kernel/auditfilter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index e3f42018ed46..f7708fe2c457 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -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)