From b90638866e17e63e760e6b18e15460b4ec587ca0 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Sun, 26 Oct 2014 14:25:42 +0000 Subject: [PATCH] Fix up an assertion in kern_setgroups, it should compare with ngroups_max + 1 Bug introdued in r273685. Noted by: Tiwei Bie --- sys/kern/kern_prot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 339c5ff056c7..9b2bcd86791c 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -835,7 +835,7 @@ kern_setgroups(struct thread *td, u_int ngrp, gid_t *groups) struct ucred *newcred, *oldcred; int error; - MPASS(ngrp <= ngroups_max); + MPASS(ngrp <= ngroups_max + 1); AUDIT_ARG_GROUPSET(groups, ngrp); newcred = crget(); crextend(newcred, ngrp);