freebsd-dev/sys/compat/linux
Brooks Davis 838d985825 Rework the credential code to support larger values of NGROUPS and
NGROUPS_MAX, eliminate ABI dependencies on them, and raise the to 1024
and 1023 respectively.  (Previously they were equal, but under a close
reading of POSIX, NGROUPS_MAX was defined to be too large by 1 since it
is the number of supplemental groups, not total number of groups.)

The bulk of the change consists of converting the struct ucred member
cr_groups from a static array to a pointer.  Do the equivalent in
kinfo_proc.

Introduce new interfaces crcopysafe() and crsetgroups() for duplicating
a process credential before modifying it and for setting group lists
respectively.  Both interfaces take care for the details of allocating
groups array. crsetgroups() takes care of truncating the group list
to the current maximum (NGROUPS) if necessary.  In the future,
crsetgroups() may be responsible for insuring invariants such as sorting
the supplemental groups to allow groupmember() to be implemented as a
binary search.

Because we can not change struct xucred without breaking application
ABIs, we leave it alone and introduce a new XU_NGROUPS value which is
always 16 and is to be used or NGRPS as appropriate for things such as
NFS which need to use no more than 16 groups.  When feasible, truncate
the group list rather than generating an error.

Minor changes:
  - Reduce the number of hand rolled versions of groupmember().
  - Do not assign to both cr_gid and cr_groups[0].
  - Modify ipfw to cache ucreds instead of part of their contents since
    they are immutable once referenced by more than one entity.

Submitted by:	Isilon Systems (initial implementation)
X-MFC after:	never
PR:		bin/113398 kern/133867
2009-06-19 17:10:35 +00:00
..
linux_emul.c Remove support for FUTEX_REQUEUE operation. 2009-04-19 13:48:42 +00:00
linux_emul.h Remove support for FUTEX_REQUEUE operation. 2009-04-19 13:48:42 +00:00
linux_file.c Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC 2009-06-05 14:55:22 +00:00
linux_file.h Implement the linux syscalls 2008-04-08 09:45:49 +00:00
linux_futex.c Unlock process lock when return error from getrobustlist call. 2009-06-14 17:53:55 +00:00
linux_futex.h Move extern variable definitions to the header file. 2009-05-02 10:06:49 +00:00
linux_getcwd.c Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC 2009-06-05 14:55:22 +00:00
linux_ioctl.c Add explicit includes for jail.h to the files that need them and 2009-06-17 15:01:01 +00:00
linux_ioctl.h Add TIOCPKT and TIOCSPTLCK to the Linuxolator. 2008-07-23 17:47:44 +00:00
linux_ipc.c Document that all the other commands are either 2008-11-26 16:38:43 +00:00
linux_ipc.h MFP4 (110956): 2006-12-21 13:11:06 +00:00
linux_mib.c Add hierarchical jails. A jail may further virtualize its environment 2009-05-27 14:11:23 +00:00
linux_mib.h Do not export AT_CLKTCK when emulating Linux kernel prior 2009-05-10 18:43:43 +00:00
linux_misc.c Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
linux_misc.h Rework r189362, r191883. 2009-05-10 18:16:07 +00:00
linux_signal.c Correctly fill siginfo for the signals delivered by linux tkill/tgkill. 2008-10-19 10:02:26 +00:00
linux_signal.h Correctly fill siginfo for the signals delivered by linux tkill/tgkill. 2008-10-19 10:02:26 +00:00
linux_socket.c Add forgotten in previous commit flags argument. 2009-06-01 20:54:41 +00:00
linux_socket.h Implement MSG_CMSG_CLOEXEC flag for linux_recvmsg(). 2009-05-18 04:07:46 +00:00
linux_stats.c Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC 2009-06-05 14:55:22 +00:00
linux_sysctl.c Unbreak COMPAT_LINUX32 option support on amd64. 2006-03-19 11:10:33 +00:00
linux_sysproto.h Handle unimplemented syscall by instantly returning ENOSYS instead of sending 2005-03-07 00:18:06 +00:00
linux_time.c MFP4: 109655 2006-12-20 20:17:35 +00:00
linux_uid16.c Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
linux_util.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
linux_util.h Add preliminary KTR(9) support to the linux emulation layer. 2009-05-07 10:01:05 +00:00