summaryrefslogtreecommitdiffstats
path: root/sys/security/mac_test
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-04-18 13:36:57 +0000
committerrwatson <rwatson@FreeBSD.org>2005-04-18 13:36:57 +0000
commit75030e30f64232f9490b244e2925b347d7bf669c (patch)
treeedb79f235bf4b33075b9d7e39ce462e142125e48 /sys/security/mac_test
parent8694c5f46241d5fb117c7feed17f9896b6f9e730 (diff)
downloadFreeBSD-src-75030e30f64232f9490b244e2925b347d7bf669c.zip
FreeBSD-src-75030e30f64232f9490b244e2925b347d7bf669c.tar.gz
Introduce p_canwait() and MAC Framework and MAC Policy entry points
mac_check_proc_wait(), which control the ability to wait4() specific processes. This permits MAC policies to limit information flow from children that have changed label, although has to be handled carefully due to common programming expectations regarding the behavior of wait4(). The cr_seeotheruids() check in p_canwait() is #if 0'd for this reason. The mac_stub and mac_test policies are updated to reflect these new entry points. Sponsored by: SPAWAR, SPARTA Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/security/mac_test')
-rw-r--r--sys/security/mac_test/mac_test.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/security/mac_test/mac_test.c b/sys/security/mac_test/mac_test.c
index 1ce97a3..b2fa853 100644
--- a/sys/security/mac_test/mac_test.c
+++ b/sys/security/mac_test/mac_test.c
@@ -1791,6 +1791,16 @@ mac_test_check_proc_setresgid(struct ucred *cred, gid_t rgid, gid_t egid,
}
static int
+mac_test_check_proc_wait(struct ucred *cred, struct proc *proc)
+{
+
+ ASSERT_CRED_LABEL(cred->cr_label);
+ ASSERT_CRED_LABEL(proc->p_ucred->cr_label);
+
+ return (0);
+}
+
+static int
mac_test_check_socket_accept(struct ucred *cred, struct socket *socket,
struct label *socketlabel)
{
@@ -2506,6 +2516,7 @@ static struct mac_policy_ops mac_test_ops =
.mpo_check_proc_setresuid = mac_test_check_proc_setresuid,
.mpo_check_proc_setresgid = mac_test_check_proc_setresgid,
.mpo_check_proc_signal = mac_test_check_proc_signal,
+ .mpo_check_proc_wait = mac_test_check_proc_wait,
.mpo_check_socket_accept = mac_test_check_socket_accept,
.mpo_check_socket_bind = mac_test_check_socket_bind,
.mpo_check_socket_connect = mac_test_check_socket_connect,
OpenPOWER on IntegriCloud