MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mls_vnode_check_exec

Function mls_vnode_check_exec

freebsd/security/mac_mls/mac_mls.c:2596–2626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2594}
2595
2596static int
2597mls_vnode_check_exec(struct ucred *cred, struct vnode *vp,
2598 struct label *vplabel, struct image_params *imgp,
2599 struct label *execlabel)
2600{
2601 struct mac_mls *subj, *obj, *exec;
2602 int error;
2603
2604 if (execlabel != NULL) {
2605 /*
2606 * We currently don't permit labels to be changed at
2607 * exec-time as part of MLS, so disallow non-NULL MLS label
2608 * elements in the execlabel.
2609 */
2610 exec = SLOT(execlabel);
2611 error = mls_atmostflags(exec, 0);
2612 if (error)
2613 return (error);
2614 }
2615
2616 if (!mls_enabled)
2617 return (0);
2618
2619 subj = SLOT(cred->cr_label);
2620 obj = SLOT(vplabel);
2621
2622 if (!mls_dominate_effective(subj, obj))
2623 return (EACCES);
2624
2625 return (0);
2626}
2627
2628static int
2629mls_vnode_check_getacl(struct ucred *cred, struct vnode *vp,

Callers

nothing calls this directly

Calls 2

mls_atmostflagsFunction · 0.85
mls_dominate_effectiveFunction · 0.85

Tested by

no test coverage detected