Page MenuHomeFreeBSD

cred: 'struct ucred': Move 'cr_ngroups' out of the bcopied area
Needs ReviewPublic

Authored by olce on Fri, Oct 4, 8:07 AM.

Details

Reviewers
mhorne
mjg
emaste
Summary

crcopy() has always called crsetgroups() after copying fields between
'cr_startcopy' and 'cr_endcopy', which sets 'cr_ngroups' properly.
There is thus no need to copy the previous number of groups.

Consequently, move 'cr_ngroups' out of the copied area, and close to
'cr_groups' and 'cr_agroups', these fields being accessed together.
This creates two 32-bit holes, which have been placed in such way to
avoid splitting related fields. To avoid growing the structure's size,
one spare pointer has been removed to compensate.

With this change, pre-setting 'cr_ngroups' to avoid tripping over
crextend()'s assertion becomes unnecessary.

MFC after: Never

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59727
Build 56613: arc lint + arc unit