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
F102088439: D46912.id.diff
Thu, Nov 7, 11:39 AM
Unknown Object (File)
Sat, Nov 2, 10:14 PM
Unknown Object (File)
Wed, Oct 30, 11:52 AM
Unknown Object (File)
Mon, Oct 28, 10:13 PM
Unknown Object (File)
Mon, Oct 28, 1:18 AM
Unknown Object (File)
Fri, Oct 11, 12:07 PM
Unknown Object (File)
Oct 8 2024, 9:38 AM
Unknown Object (File)
Oct 8 2024, 12:27 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