summaryrefslogtreecommitdiffstats
path: root/sys/security/mac_test
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2008-10-17 15:11:12 +0000
committerbz <bz@FreeBSD.org>2008-10-17 15:11:12 +0000
commitdef7b5012b9e97fc0afd28665bac7195bc3c151c (patch)
treee36de3f0025fae6733ec800ba092329a7347db0b /sys/security/mac_test
parent7d341cf135006831850a3a4ac06fdc4742920a83 (diff)
downloadFreeBSD-src-def7b5012b9e97fc0afd28665bac7195bc3c151c.zip
FreeBSD-src-def7b5012b9e97fc0afd28665bac7195bc3c151c.tar.gz
Add a mac_inpcb_check_visible implementation to all MAC policies
that handle mac_socket_check_visible. Reviewed by: rwatson MFC after: 3 months (set timer; decide then)
Diffstat (limited to 'sys/security/mac_test')
-rw-r--r--sys/security/mac_test/mac_test.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/security/mac_test/mac_test.c b/sys/security/mac_test/mac_test.c
index b02e242..cc2a78c 100644
--- a/sys/security/mac_test/mac_test.c
+++ b/sys/security/mac_test/mac_test.c
@@ -494,6 +494,19 @@ test_inpcb_check_deliver(struct inpcb *inp, struct label *inplabel,
return (0);
}
+COUNTER_DECL(inpcb_check_visible);
+static int
+test_inpcb_check_visible(struct ucred *cred, struct inpcb *inp,
+ struct label *inplabel)
+{
+
+ LABEL_CHECK(cred->cr_label, MAGIC_CRED);
+ LABEL_CHECK(inplabel, MAGIC_INPCB);
+ COUNTER_INC(inpcb_check_visible);
+
+ return (0);
+}
+
COUNTER_DECL(inpcb_create);
static void
test_inpcb_create(struct socket *so, struct label *solabel,
@@ -2840,6 +2853,7 @@ static struct mac_policy_ops test_ops =
.mpo_sysvshm_init_label = test_sysvshm_init_label,
.mpo_inpcb_check_deliver = test_inpcb_check_deliver,
+ .mpo_inpcb_check_visible = test_inpcb_check_visible,
.mpo_inpcb_create = test_inpcb_create,
.mpo_inpcb_create_mbuf = test_inpcb_create_mbuf,
.mpo_inpcb_destroy_label = test_inpcb_destroy_label,
OpenPOWER on IntegriCloud