diff options
author | rwatson <rwatson@FreeBSD.org> | 2002-10-06 02:46:26 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2002-10-06 02:46:26 +0000 |
commit | 2ad996a2d39a58404c64c9e7ca9e071ff607c4ce (patch) | |
tree | 3fea72f53d4028d0b27b47359673c85f56a3e2f8 /sys/security/mac_test/mac_test.c | |
parent | f2ac31e2ec91340be2682c1750526e12229b45ee (diff) | |
download | FreeBSD-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_test/mac_test.c')
-rw-r--r-- | sys/security/mac_test/mac_test.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/sys/security/mac_test/mac_test.c b/sys/security/mac_test/mac_test.c index c1caa44..9b93071 100644 --- a/sys/security/mac_test/mac_test.c +++ b/sys/security/mac_test/mac_test.c @@ -1067,9 +1067,25 @@ static int mac_test_check_vnode_lookup(struct ucred *cred, struct vnode *dvp, struct label *dlabel, struct componentname *cnp) { - + + return (0); +} + +static int +mac_test_check_vnode_mmap(struct ucred *cred, struct vnode *vp, + struct label *label, int prot) +{ + return (0); -} +} + +static int +mac_test_check_vnode_mprotect(struct ucred *cred, struct vnode *vp, + struct label *label, int prot) +{ + + return (0); +} static int mac_test_check_vnode_open(struct ucred *cred, struct vnode *vp, @@ -1417,6 +1433,10 @@ static struct mac_policy_op_entry mac_test_ops[] = (macop_t)mac_test_check_vnode_link }, { MAC_CHECK_VNODE_LOOKUP, (macop_t)mac_test_check_vnode_lookup }, + { MAC_CHECK_VNODE_MMAP, + (macop_t)mac_test_check_vnode_mmap }, + { MAC_CHECK_VNODE_MPROTECT, + (macop_t)mac_test_check_vnode_mprotect }, { MAC_CHECK_VNODE_OPEN, (macop_t)mac_test_check_vnode_open }, { MAC_CHECK_VNODE_POLL, |