freebsd-dev/sys/security
Robert Watson eca8a663d4 Modify the MAC Framework so that instead of embedding a (struct label)
in various kernel objects to represent security data, we embed a
(struct label *) pointer, which now references labels allocated using
a UMA zone (mac_label.c).  This allows the size and shape of struct
label to be varied without changing the size and shape of these kernel
objects, which become part of the frozen ABI with 5-STABLE.  This opens
the door for boot-time selection of the number of label slots, and hence
changes to the bound on the number of simultaneous labeled policies
at boot-time instead of compile-time.  This also makes it easier to
embed label references in new objects as required for locking/caching
with fine-grained network stack locking, such as inpcb structures.

This change also moves us further in the direction of hiding the
structure of kernel objects from MAC policy modules, not to mention
dramatically reducing the number of '&' symbols appearing in both the
MAC Framework and MAC policy modules, and improving readability.

While this results in minimal performance change with MAC enabled, it
will observably shrink the size of a number of critical kernel data
structures for the !MAC case, and should have a small (but measurable)
performance benefit (i.e., struct vnode, struct socket) do to memory
conservation and reduced cost of zeroing memory.

NOTE: Users of MAC must recompile their kernel and all MAC modules as a
result of this change.  Because this is an API change, third party
MAC modules will also need to be updated to make less use of the '&'
symbol.

Suggestions from:	bmilekic
Obtained from:		TrustedBSD Project
Sponsored by:		DARPA, Network Associates Laboratories
2003-11-12 03:14:31 +00:00
..
mac Modify the MAC Framework so that instead of embedding a (struct label) 2003-11-12 03:14:31 +00:00
mac_biba Modify the MAC Framework so that instead of embedding a (struct label) 2003-11-12 03:14:31 +00:00
mac_bsdextended Implementations of mpo_check_vnode_deleteextattr() and 2003-08-21 14:34:54 +00:00
mac_ifoff Remove trailing whitespace. 2003-07-05 01:24:36 +00:00
mac_lomac Modify the MAC Framework so that instead of embedding a (struct label) 2003-11-12 03:14:31 +00:00
mac_mls Modify the MAC Framework so that instead of embedding a (struct label) 2003-11-12 03:14:31 +00:00
mac_none mac_none is now the null policy, not a stub policy, so remove the 2003-08-21 16:19:17 +00:00
mac_partition Modify the MAC Framework so that instead of embedding a (struct label) 2003-11-12 03:14:31 +00:00
mac_portacl Including <sys/stdint.h> is (almost?) universally only to be able to use 2003-03-18 08:45:25 +00:00
mac_seeotheruids Trim "trustedbsd_" from the front of the policy module "short names"; 2003-03-27 19:26:39 +00:00
mac_stub Add stub entries for new MAC framework entry points: 2003-08-21 17:05:36 +00:00
mac_test Modify the MAC Framework so that instead of embedding a (struct label) 2003-11-12 03:14:31 +00:00