aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/proc.h
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2003-11-12 03:14:31 +0000
committerRobert Watson <rwatson@FreeBSD.org>2003-11-12 03:14:31 +0000
commiteca8a663d442468f64e21ed869817b9048ab5a7b (patch)
treea3d104511a2cb91c797ff9c5bcc6f9c70abc63ce /sys/sys/proc.h
parent5c957adbf1741a33bb35cf087f7ee81de42e6ac2 (diff)
downloadsrc-eca8a663d442468f64e21ed869817b9048ab5a7b.tar.gz
src-eca8a663d442468f64e21ed869817b9048ab5a7b.zip
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
Notes
Notes: svn path=/head/; revision=122524
Diffstat (limited to 'sys/sys/proc.h')
-rw-r--r--sys/sys/proc.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 70632f8906ee..792abba82fed 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -55,7 +55,6 @@
#include <sys/runq.h>
#include <sys/sigio.h>
#include <sys/signal.h>
-#include <sys/_label.h>
#ifndef _KERNEL
#include <sys/time.h> /* For structs itimerval, timeval. */
#else
@@ -616,7 +615,7 @@ struct proc {
struct proc *p_peers; /* (r) */
struct proc *p_leader; /* (b) */
void *p_emuldata; /* (c) Emulator state data. */
- struct label p_label; /* (*) Process (not subject) MAC label */
+ struct label *p_label; /* (*) Proc (not subject) MAC label. */
struct p_sched *p_sched; /* (*) Scheduler-specific data. */
};