diff options
author | csjp <csjp@FreeBSD.org> | 2005-04-14 16:03:30 +0000 |
---|---|---|
committer | csjp <csjp@FreeBSD.org> | 2005-04-14 16:03:30 +0000 |
commit | e89e83d7fe58cc228e95e5dea896e841c5a94fc8 (patch) | |
tree | a937e6876873279cfd5117a2a8a0ee95fe63505b /sys/security/mac_biba | |
parent | 4b37bbd4869afe14bdd327fff059627a656722c0 (diff) | |
download | FreeBSD-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_biba')
-rw-r--r-- | sys/security/mac_biba/mac_biba.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/security/mac_biba/mac_biba.c b/sys/security/mac_biba/mac_biba.c index bf32677..1ff1f0f 100644 --- a/sys/security/mac_biba/mac_biba.c +++ b/sys/security/mac_biba/mac_biba.c @@ -47,6 +47,7 @@ #include <sys/kernel.h> #include <sys/mac.h> #include <sys/malloc.h> +#include <sys/mman.h> #include <sys/mount.h> #include <sys/proc.h> #include <sys/sbuf.h> @@ -2607,7 +2608,7 @@ mac_biba_check_vnode_lookup(struct ucred *cred, struct vnode *dvp, static int mac_biba_check_vnode_mmap(struct ucred *cred, struct vnode *vp, - struct label *label, int prot) + struct label *label, int prot, int flags) { struct mac_biba *subj, *obj; @@ -2625,7 +2626,7 @@ mac_biba_check_vnode_mmap(struct ucred *cred, struct vnode *vp, if (!mac_biba_dominate_effective(obj, subj)) return (EACCES); } - if (prot & VM_PROT_WRITE) { + if (((prot & VM_PROT_WRITE) != 0) && ((flags & MAP_SHARED) != 0)) { if (!mac_biba_dominate_effective(subj, obj)) return (EACCES); } |