Questions with 'MPASS(ngrp <= ngroups_max)' assertion in kern_setgroups()

Mateusz Guzik mjguzik at gmail.com
Sun Oct 26 14:26:10 UTC 2014


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>


More information about the freebsd-hackers mailing list