HomeFreeBSD

nfsuserd: Fix OOB access on membership of too many groups

Description

nfsuserd: Fix OOB access on membership of too many groups

getgrouplist() sets the variable containing the allocated length in
input to the full effective group list length, not the number of slots
that were actually filled in case the passed array is too small to
contain it.

While here, on this condition, improve the error message by outputting
the corresponding user name.

MFC after: 1 hour
Fixes: e6c623c86ab4 ("Add support for the "-manage-gids" option to the nfsuserd daemon.")
Sponsored by: The FreeBSD Foundation

Details

Provenance
olceAuthored on Oct 9 2025, 9:19 AM
Parents
rGf5544556754e: getgrouplist.3: Insist on the value returned in 'ngroups'; Minor changes
Branches
Unknown
Tags
Unknown