aboutsummaryrefslogtreecommitdiff
path: root/sys/security/mac_stub
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2002-10-06 02:46:26 +0000
committerRobert Watson <rwatson@FreeBSD.org>2002-10-06 02:46:26 +0000
commite183f80e54905eb37052153422ea11250f357dfd (patch)
tree3fea72f53d4028d0b27b47359673c85f56a3e2f8 /sys/security/mac_stub
parente6e85c5b172d0b47f8976e79dc44fa14d31c540f (diff)
downloadsrc-e183f80e54905eb37052153422ea11250f357dfd.tar.gz
src-e183f80e54905eb37052153422ea11250f357dfd.zip
Sync from MAC tree: break out the single mmap entry point into
seperate entry points for each occasion: mac_check_vnode_mmap() Check at initial mapping mac_check_vnode_mprotect() Check at mapping protection change mac_check_vnode_mmap_downgrade() Determine if a mapping downgrade should take place following subject relabel. Implement mmap() and mprotect() entry points for labeled vnode policies. These entry points are currently not hooked up to the VM system in the base tree. These changes improve the consistency of the access control interface and offer more flexibility regarding limiting access to vnode mmaping. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
Notes
Notes: svn path=/head/; revision=104546
Diffstat (limited to 'sys/security/mac_stub')
-rw-r--r--sys/security/mac_stub/mac_stub.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/sys/security/mac_stub/mac_stub.c b/sys/security/mac_stub/mac_stub.c
index 9bbc1cd7fa8b..6456bf7037d3 100644
--- a/sys/security/mac_stub/mac_stub.c
+++ b/sys/security/mac_stub/mac_stub.c
@@ -689,9 +689,25 @@ static int
mac_none_check_vnode_lookup(struct ucred *cred, struct vnode *dvp,
struct label *dlabel, struct componentname *cnp)
{
-
+
+ return (0);
+}
+
+static int
+mac_none_check_vnode_mmap(struct ucred *cred, struct vnode *vp,
+ struct label *label, int prot)
+{
+
return (0);
-}
+}
+
+static int
+mac_none_check_vnode_mprotect(struct ucred *cred, struct vnode *vp,
+ struct label *label, int prot)
+{
+
+ return (0);
+}
static int
mac_none_check_vnode_open(struct ucred *cred, struct vnode *vp,
@@ -1041,6 +1057,10 @@ static struct mac_policy_op_entry mac_none_ops[] =
(macop_t)mac_none_check_vnode_link },
{ MAC_CHECK_VNODE_LOOKUP,
(macop_t)mac_none_check_vnode_lookup },
+ { MAC_CHECK_VNODE_MMAP,
+ (macop_t)mac_none_check_vnode_mmap },
+ { MAC_CHECK_VNODE_MPROTECT,
+ (macop_t)mac_none_check_vnode_mprotect },
{ MAC_CHECK_VNODE_OPEN,
(macop_t)mac_none_check_vnode_open },
{ MAC_CHECK_VNODE_POLL,