[2.6 patch] kernel/auditsc.c: fix an off-by-one

From: Adrian Bunk
Date: Mon Jul 23 2007 - 04:04:40 EST


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

Signed-off-by: Adrian Bunk <bunk@xxxxxxxxx>

---
--- linux-2.6.22-rc6-mm1/kernel/auditsc.c.old 2007-07-23 02:08:09.000000000 +0200
+++ linux-2.6.22-rc6-mm1/kernel/auditsc.c 2007-07-23 02:08:32.000000000 +0200
@@ -2069,7 +2069,7 @@ int __audit_signal_info(int sig, struct
axp->d.next = ctx->aux_pids;
ctx->aux_pids = (void *)axp;
}
- BUG_ON(axp->pid_count > AUDIT_AUX_PIDS);
+ BUG_ON(axp->pid_count >= AUDIT_AUX_PIDS);

axp->target_pid[axp->pid_count] = t->tgid;
selinux_get_task_sid(t, &axp->target_sid[axp->pid_count]);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/