summaryrefslogtreecommitdiffstats
path: root/sys/security/mac_mls
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-08-21 14:34:54 +0000
committerrwatson <rwatson@FreeBSD.org>2003-08-21 14:34:54 +0000
commit15931b828562c66c2854a8381c3e03b9a5c609b2 (patch)
tree22a58e2b67918a8a00405af6adc906a4312d0bdf /sys/security/mac_mls
parentd11ff12dc05a90cc3492b6384c85f94f3d4fced1 (diff)
downloadFreeBSD-src-15931b828562c66c2854a8381c3e03b9a5c609b2.zip
FreeBSD-src-15931b828562c66c2854a8381c3e03b9a5c609b2.tar.gz
Implementations of mpo_check_vnode_deleteextattr() and
mpo_check_vnode_listextattr() for Biba, MLS, and BSD Extended. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys/security/mac_mls')
-rw-r--r--sys/security/mac_mls/mac_mls.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/sys/security/mac_mls/mac_mls.c b/sys/security/mac_mls/mac_mls.c
index 008a0da..eb3c320 100644
--- a/sys/security/mac_mls/mac_mls.c
+++ b/sys/security/mac_mls/mac_mls.c
@@ -1840,6 +1840,24 @@ mac_mls_check_vnode_deleteacl(struct ucred *cred, struct vnode *vp,
}
static int
+mac_mls_check_vnode_deleteextattr(struct ucred *cred, struct vnode *vp,
+ struct label *label, int attrnamespace, const char *name)
+{
+ struct mac_mls *subj, *obj;
+
+ if (!mac_mls_enabled)
+ return (0);
+
+ subj = SLOT(&cred->cr_label);
+ obj = SLOT(label);
+
+ if (!mac_mls_dominate_single(obj, subj))
+ return (EACCES);
+
+ return (0);
+}
+
+static int
mac_mls_check_vnode_exec(struct ucred *cred, struct vnode *vp,
struct label *label, struct image_params *imgp,
struct label *execlabel)
@@ -1931,6 +1949,25 @@ mac_mls_check_vnode_link(struct ucred *cred, struct vnode *dvp,
}
static int
+mac_mls_check_vnode_listextattr(struct ucred *cred, struct vnode *vp,
+ struct label *label, int attrnamespace)
+{
+
+ struct mac_mls *subj, *obj;
+
+ if (!mac_mls_enabled)
+ return (0);
+
+ subj = SLOT(&cred->cr_label);
+ obj = SLOT(label);
+
+ if (!mac_mls_dominate_single(subj, obj))
+ return (EACCES);
+
+ return (0);
+}
+
+static int
mac_mls_check_vnode_lookup(struct ucred *cred, struct vnode *dvp,
struct label *dlabel, struct componentname *cnp)
{
@@ -2445,10 +2482,12 @@ static struct mac_policy_ops mac_mls_ops =
.mpo_check_vnode_create = mac_mls_check_vnode_create,
.mpo_check_vnode_delete = mac_mls_check_vnode_delete,
.mpo_check_vnode_deleteacl = mac_mls_check_vnode_deleteacl,
+ .mpo_check_vnode_deleteextattr = mac_mls_check_vnode_deleteextattr,
.mpo_check_vnode_exec = mac_mls_check_vnode_exec,
.mpo_check_vnode_getacl = mac_mls_check_vnode_getacl,
.mpo_check_vnode_getextattr = mac_mls_check_vnode_getextattr,
.mpo_check_vnode_link = mac_mls_check_vnode_link,
+ .mpo_check_vnode_listextattr = mac_mls_check_vnode_listextattr,
.mpo_check_vnode_lookup = mac_mls_check_vnode_lookup,
.mpo_check_vnode_mmap = mac_mls_check_vnode_mmap,
.mpo_check_vnode_mprotect = mac_mls_check_vnode_mmap,
OpenPOWER on IntegriCloud