Re: RFC: Dynamic group limit

Fred Reimer (fwr@ga.prestige.net)
Wed, 28 Jul 1999 20:52:06 -0400


On Tue, 27 Jul 1999, Mattias.Gronlund wrote:
> Hi,
>
> The current kernel has a compile-time limit for the maximum number
> of groups that a user can be a member of. According to the glibc-
> manual NGROUPS_MAX is "The value of this macro is actually a lower
> bound for the maximum".
>
> The proposal is to add a sysctl parameter kernel/ngroups_max that
> is used as the maximum number of groups that a user can be member
> of at once. The ngroup variable and group array are removed from
> the task_struct and a pointer to a new groups_struct is added.

If you are talking about dynamic sizing of the number of maximum groups
per user what do you do if you resize it smaller but there are already
structures that contain more than your new size? IOW, say the existing
ngroups_max is 64 and you have a couple of users logged in that have
50, 10, and 27 groups in their groups_struct. What would happen if you
resized ngroups_max to 32?

>
> The group struct looks like:
> struct groups_struct {
> atomic_t count;
> int ngroups;
> gid_t groups[0];
> };
>
> It contains a reference-counter the number of secondary groups
> that is stored in the struct and a array of gid_t:s. This struct
> is dynamicly allocated from sys_setgroup which then gets an extra
> error code ENOMEM.
>
> The reference count is needed as the struct is "reused" for child
> processes. This will often mean one groups_struct per user and
> login.
>
> What do you think, is this a feature that is desirable for for the
> kernel?
>
> Please CC all comments directly to me as I am not subscribed to
> this list.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/