Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Oct 2014 15:26:04 +0100
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        Tiwei Bie <btw@mail.ustc.edu.cn>
Cc:        freebsd-hackers@freebsd.org, mjg@freebsd.org
Subject:   Re: Questions with 'MPASS(ngrp <= ngroups_max)' assertion in kern_setgroups()
Message-ID:  <20141026142604.GA30512@dft-labs.eu>
In-Reply-To: <1414331221-29048-1-git-send-email-btw@mail.ustc.edu.cn>
References:  <1414331221-29048-1-git-send-email-btw@mail.ustc.edu.cn>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Oct 26, 2014 at 09:47:01PM +0800, Tiwei Bie wrote:
> Hello, Mateusz!
> 
> The check in kern_setgroups's callers is:
> 
> 	if (gidsetsize > ngroups_max + 1)
> 		return (EINVAL);
> 
> So, gidsetsize could be (ngroups_max + 1). And under this condition, the assertion
> 
> 	MPASS(ngrp <= ngroups_max);
> 
> in kern_setgroups() will fail. One of them should be fixed.
> 
> 

Indeed, thanks.

Fixed in r273691.

-- 
Mateusz Guzik <mjguzik gmail.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141026142604.GA30512>