summaryrefslogtreecommitdiffstats
path: root/sys/sys/ucred.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-11-12 03:14:31 +0000
committerrwatson <rwatson@FreeBSD.org>2003-11-12 03:14:31 +0000
commit77ed6e2d1cbbf9a46dd5ae6d089eeb45ab81fbcb (patch)
treea3d104511a2cb91c797ff9c5bcc6f9c70abc63ce /sys/sys/ucred.h
parent9352a05d4022d31faee0a088a5df3456001e11ae (diff)
downloadFreeBSD-src-77ed6e2d1cbbf9a46dd5ae6d089eeb45ab81fbcb.zip
FreeBSD-src-77ed6e2d1cbbf9a46dd5ae6d089eeb45ab81fbcb.tar.gz
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
Diffstat (limited to 'sys/sys/ucred.h')
-rw-r--r--sys/sys/ucred.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h
index 448d5c3..e8f38bf 100644
--- a/sys/sys/ucred.h
+++ b/sys/sys/ucred.h
@@ -44,7 +44,6 @@
* Only the suser() or suser_cred() function should be used for this.
*/
#if defined(_KERNEL) || defined(_WANT_UCRED)
-#include <sys/_label.h>
struct ucred {
u_int cr_ref; /* reference count */
@@ -60,7 +59,7 @@ struct ucred {
struct uidinfo *cr_ruidinfo; /* per ruid resource consumption */
struct prison *cr_prison; /* jail(2) */
#define cr_endcopy cr_label
- struct label cr_label; /* MAC label */
+ struct label *cr_label; /* MAC label */
struct mtx *cr_mtxp; /* protect refcount */
};
#define NOCRED ((struct ucred *)0) /* no credential available */
OpenPOWER on IntegriCloud