summaryrefslogtreecommitdiffstats
path: root/sys/security/mac/mac_vfs.c
diff options
context:
space:
mode:
authorcsjp <csjp@FreeBSD.org>2005-04-14 16:03:30 +0000
committercsjp <csjp@FreeBSD.org>2005-04-14 16:03:30 +0000
commite89e83d7fe58cc228e95e5dea896e841c5a94fc8 (patch)
treea937e6876873279cfd5117a2a8a0ee95fe63505b /sys/security/mac/mac_vfs.c
parent4b37bbd4869afe14bdd327fff059627a656722c0 (diff)
downloadFreeBSD-src-e89e83d7fe58cc228e95e5dea896e841c5a94fc8.zip
FreeBSD-src-e89e83d7fe58cc228e95e5dea896e841c5a94fc8.tar.gz
Move MAC check_vnode_mmap entry point out from being exclusive to
MAP_SHARED so that the entry point gets executed un-conditionally. This may be useful for security policies which want to perform access control checks around run-time linking. -add the mmap(2) flags argument to the check_vnode_mmap entry point so that we can make access control decisions based on the type of mapped object. -update any dependent API around this parameter addition such as function prototype modifications, entry point parameter additions and the inclusion of sys/mman.h header file. -Change the MLS, BIBA and LOMAC security policies so that subject domination routines are not executed unless the type of mapping is shared. This is done to maintain compatibility between the old vm_mmap_vnode(9) and these policies. Reviewed by: rwatson MFC after: 1 month
Diffstat (limited to 'sys/security/mac/mac_vfs.c')
-rw-r--r--sys/security/mac/mac_vfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/security/mac/mac_vfs.c b/sys/security/mac/mac_vfs.c
index 6bb9518..acf21a5 100644
--- a/sys/security/mac/mac_vfs.c
+++ b/sys/security/mac/mac_vfs.c
@@ -598,7 +598,8 @@ mac_check_vnode_lookup(struct ucred *cred, struct vnode *dvp,
}
int
-mac_check_vnode_mmap(struct ucred *cred, struct vnode *vp, int prot)
+mac_check_vnode_mmap(struct ucred *cred, struct vnode *vp,
+ int prot, int flags)
{
int error;
@@ -607,7 +608,7 @@ mac_check_vnode_mmap(struct ucred *cred, struct vnode *vp, int prot)
if (!mac_enforce_fs || !mac_enforce_vm)
return (0);
- MAC_CHECK(check_vnode_mmap, cred, vp, vp->v_label, prot);
+ MAC_CHECK(check_vnode_mmap, cred, vp, vp->v_label, prot, flags);
return (error);
}
OpenPOWER on IntegriCloud