HomeFreeBSD

kern: fail getgroup and setgroup with negative int

Description

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

(cherry picked from commit 4bc2174a1b489c36195ccc8cfc15e0775b817c69)

Details

Provenance
gh_moritzbuhl.deAuthored on Jul 9 2019, 3:03 PM
impCommitted on Jul 7 2021, 8:09 PM
Differential Revision
D30617: kern: fail getgroup and setgroup with negative int
Parents
rG9e06b34bb5d3: Add deprecation notice for WITH_PROFILE option
Branches
Unknown
Tags
Unknown