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
F168882873: D30617.diff
Sun, Aug 30, 2:38 PM
F168850750: D30617.id90338.diff
Sun, Aug 30, 11:04 AM
F168799436: D30617.id90336.diff
Sun, Aug 30, 5:30 AM
F168796373: D30617.id.diff
Sun, Aug 30, 5:05 AM
Unknown Object (File)
Sat, Aug 29, 7:10 AM
Unknown Object (File)
Fri, Aug 28, 2:41 PM
Unknown Object (File)
Fri, Aug 28, 11:02 AM
Unknown Object (File)
Fri, Aug 28, 10:32 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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
299

I would squash these into one line.

803

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.