Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kernel/auditsc.c: fix an off-by-one

This patch fixes an off-by-one in a BUG_ON() spotted by the Coverity
checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: Amy Griffis <amy.griffis@hp.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Adrian Bunk and committed by
Linus Torvalds
88ae704c 8e81cc13

+1 -1
+1 -1
kernel/auditsc.c
··· 2023 2023 axp->d.next = ctx->aux_pids; 2024 2024 ctx->aux_pids = (void *)axp; 2025 2025 } 2026 - BUG_ON(axp->pid_count > AUDIT_AUX_PIDS); 2026 + BUG_ON(axp->pid_count >= AUDIT_AUX_PIDS); 2027 2027 2028 2028 axp->target_pid[axp->pid_count] = t->tgid; 2029 2029 selinux_get_task_sid(t, &axp->target_sid[axp->pid_count]);