Page MenuHomeFreeBSD

cred: kern_setgroups(): Internally use int as number of groups' type
ClosedPublic

Authored by olce on Oct 4 2024, 8:07 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 19, 12:51 PM
Unknown Object (File)
Fri, Jan 17, 9:37 PM
Unknown Object (File)
Fri, Jan 10, 10:16 AM
Unknown Object (File)
Dec 24 2024, 9:17 PM
Unknown Object (File)
Dec 23 2024, 7:25 PM
Unknown Object (File)
Dec 23 2024, 12:29 PM
Unknown Object (File)
Dec 23 2024, 10:07 AM
Unknown Object (File)
Dec 9 2024, 12:57 AM
Subscribers

Details

Summary

sys_setgroups() (and sys_getgroups()) was changed in commit "kern: fail
getgroup and setgroup with negative int" (4bc2174a1b48) to take the
number of groups as an 'int' (for sys_getgroups(), this is a mandatory
requirement to be POSIX-compliant; for sys_setgroups(), it's arguably
for consistency).

All our internal APIs related to groups on 'struct ucred', as well as
related members on the latter, treat that number as an 'int' as well
(and not a 'u_int').

Consequently, to avoid surprises, change kern_setgroups() to behave the
same, and fix audit_arg_groupset() accordingly. With that change,
everything is handled with signed integers internally.

Update sanity checks accordingly.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

olce requested review of this revision.Oct 4 2024, 8:07 AM
mhorne added inline comments.
sys/kern/kern_prot.c
823
This revision is now accepted and ready to land.Oct 28 2024, 5:30 PM
olce marked an inline comment as done.Oct 29 2024, 4:39 PM
olce added inline comments.
sys/kern/kern_prot.c
823

Done in my repository.

This revision was automatically updated to reflect the committed changes.
olce marked an inline comment as done.