Page MenuHomeFreeBSD

kern: fail getgroup and setgroup with negative int
ClosedPublic

Authored by imp on Jun 2 2021, 6:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 18, 1:55 AM
Unknown Object (File)
Mon, Apr 14, 7:41 AM
Unknown Object (File)
Mon, Apr 14, 4:02 AM
Unknown Object (File)
Sun, Apr 13, 11:14 PM
Unknown Object (File)
Sun, Apr 13, 9:19 PM
Unknown Object (File)
Mar 16 2025, 5:19 AM
Unknown Object (File)
Mar 15 2025, 4:04 AM
Unknown Object (File)
Mar 14 2025, 8:13 AM
Subscribers
None

Details

Summary

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, without which this change would be a nop.

PR: 189941
Tested by: imp@

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 39670
Build 36559: arc lint + arc unit

Event Timeline

imp requested review of this revision.Jun 2 2021, 6:14 PM

Not in this review: fixing t_getgroups.c and the regenerated system calls headers.

markj added inline comments.
sys/kern/kern_prot.c
300

I would squash these into one line.

805

Same here.

This revision is now accepted and ready to land.Jun 2 2021, 6:19 PM
This revision was automatically updated to reflect the committed changes.