summaryrefslogtreecommitdiffstats
path: root/sys/security/mac_stub
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-10-06 02:46:26 +0000
committerrwatson <rwatson@FreeBSD.org>2002-10-06 02:46:26 +0000
commit2ad996a2d39a58404c64c9e7ca9e071ff607c4ce (patch)
tree3fea72f53d4028d0b27b47359673c85f56a3e2f8 /sys/security/mac_stub
parentf2ac31e2ec91340be2682c1750526e12229b45ee (diff)
downloadFreeBSD-src-2ad996a2d39a58404c64c9e7ca9e071ff607c4ce.zip
FreeBSD-src-2ad996a2d39a58404c64c9e7ca9e071ff607c4ce.tar.gz
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
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 9bbc1cd..6456bf7 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,
OpenPOWER on IntegriCloud