]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
kern: fail getgroup and setgroup with negative int
authorMoritz Buhl <gh@moritzbuhl.de>
Tue, 9 Jul 2019 15:03:37 +0000 (17:03 +0200)
committerWarner Losh <imp@FreeBSD.org>
Wed, 2 Jun 2021 19:22:57 +0000 (13:22 -0600)
commit4bc2174a1b489c36195ccc8cfc15e0775b817c69
tree9ef326f5b92586d72d1da04fdc27c3d252e70e8b
parent1976e079544c8ff691f2eec497d68611d8215af5
kern: fail getgroup and setgroup with negative int

Found using
https://github.com/NetBSD/src/blob/trunk/tests/lib/libc/sys/t_getgroups.c

getgroups/setgroups want an int and therefore casting it to u_int
resulted in `getgroups(-1, ...)` not returning -1 / errno = EINVAL.

imp@ updated syscall.master and made changes markj@ suggested

PR: 189941
Tested by: imp@
Reviewed by: markj@
Pull Request: https://github.com/freebsd/freebsd-src/pull/407
Differential Revision: https://reviews.freebsd.org/D30617
sys/kern/kern_prot.c
sys/kern/syscalls.master