2 * Copyright (c) 1999-2002, 2007 Robert N. M. Watson
3 * Copyright (c) 2001-2005 Networks Associates Technology, Inc.
4 * Copyright (c) 2005 Tom Rhodes
5 * Copyright (c) 2006 SPARTA, Inc.
8 * This software was developed by Robert Watson for the TrustedBSD Project.
9 * It was later enhanced by Tom Rhodes for the TrustedBSD Project.
11 * This software was developed for the FreeBSD Project in part by Network
12 * Associates Laboratories, the Security Research Division of Network
13 * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"),
14 * as part of the DARPA CHATS research program.
16 * This software was enhanced by SPARTA ISSO under SPAWAR contract
17 * N66001-04-C-6019 ("SEFOS").
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions
22 * 1. Redistributions of source code must retain the above copyright
23 * notice, this list of conditions and the following disclaimer.
24 * 2. Redistributions in binary form must reproduce the above copyright
25 * notice, this list of conditions and the following disclaimer in the
26 * documentation and/or other materials provided with the distribution.
28 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
29 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
32 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
44 * Developed by the TrustedBSD Project.
46 * "BSD Extended" MAC policy, allowing the administrator to impose mandatory
47 * firewall-like rules regarding users and file system objects.
50 #include <sys/param.h>
52 #include <sys/kernel.h>
55 #include <sys/malloc.h>
56 #include <sys/module.h>
57 #include <sys/mount.h>
58 #include <sys/mutex.h>
60 #include <sys/systm.h>
61 #include <sys/vnode.h>
62 #include <sys/sysctl.h>
63 #include <sys/syslog.h>
66 #include <security/mac/mac_policy.h>
67 #include <security/mac_bsdextended/mac_bsdextended.h>
69 static struct mtx ugidfw_mtx;
71 SYSCTL_DECL(_security_mac);
73 SYSCTL_NODE(_security_mac, OID_AUTO, bsdextended, CTLFLAG_RW, 0,
74 "TrustedBSD extended BSD MAC policy controls");
76 static int ugidfw_enabled = 1;
77 SYSCTL_INT(_security_mac_bsdextended, OID_AUTO, enabled, CTLFLAG_RW,
78 &ugidfw_enabled, 0, "Enforce extended BSD policy");
79 TUNABLE_INT("security.mac.bsdextended.enabled", &ugidfw_enabled);
81 MALLOC_DEFINE(M_MACBSDEXTENDED, "mac_bsdextended", "BSD Extended MAC rule");
83 #define MAC_BSDEXTENDED_MAXRULES 250
84 static struct mac_bsdextended_rule *rules[MAC_BSDEXTENDED_MAXRULES];
85 static int rule_count = 0;
86 static int rule_slots = 0;
87 static int rule_version = MB_VERSION;
89 SYSCTL_INT(_security_mac_bsdextended, OID_AUTO, rule_count, CTLFLAG_RD,
90 &rule_count, 0, "Number of defined rules\n");
91 SYSCTL_INT(_security_mac_bsdextended, OID_AUTO, rule_slots, CTLFLAG_RD,
92 &rule_slots, 0, "Number of used rule slots\n");
93 SYSCTL_INT(_security_mac_bsdextended, OID_AUTO, rule_version, CTLFLAG_RD,
94 &rule_version, 0, "Version number for API\n");
97 * This is just used for logging purposes, eventually we would like to log
98 * much more then failed requests.
100 static int ugidfw_logging;
101 SYSCTL_INT(_security_mac_bsdextended, OID_AUTO, logging, CTLFLAG_RW,
102 &ugidfw_logging, 0, "Log failed authorization requests");
105 * This tunable is here for compatibility. It will allow the user to switch
106 * between the new mode (first rule matches) and the old functionality (all
109 static int ugidfw_firstmatch_enabled;
110 SYSCTL_INT(_security_mac_bsdextended, OID_AUTO, firstmatch_enabled,
111 CTLFLAG_RW, &ugidfw_firstmatch_enabled, 1,
112 "Disable/enable match first rule functionality");
115 ugidfw_rule_valid(struct mac_bsdextended_rule *rule)
118 if ((rule->mbr_subject.mbs_flags | MBS_ALL_FLAGS) != MBS_ALL_FLAGS)
120 if ((rule->mbr_subject.mbs_neg | MBS_ALL_FLAGS) != MBS_ALL_FLAGS)
122 if ((rule->mbr_object.mbo_flags | MBO_ALL_FLAGS) != MBO_ALL_FLAGS)
124 if ((rule->mbr_object.mbo_neg | MBO_ALL_FLAGS) != MBO_ALL_FLAGS)
126 if ((rule->mbr_object.mbo_neg | MBO_TYPE_DEFINED) &&
127 (rule->mbr_object.mbo_type | MBO_ALL_TYPE) != MBO_ALL_TYPE)
129 if ((rule->mbr_mode | MBI_ALLPERM) != MBI_ALLPERM)
135 sysctl_rule(SYSCTL_HANDLER_ARGS)
137 struct mac_bsdextended_rule temprule, *ruleptr;
139 int error, index, *name;
147 if (index >= MAC_BSDEXTENDED_MAXRULES)
151 if (req->newptr && req->newlen != 0) {
152 error = SYSCTL_IN(req, &temprule, sizeof(temprule));
155 MALLOC(ruleptr, struct mac_bsdextended_rule *,
156 sizeof(*ruleptr), M_MACBSDEXTENDED, M_WAITOK | M_ZERO);
159 mtx_lock(&ugidfw_mtx);
161 if (index < 0 || index > rule_slots + 1) {
165 if (rules[index] == NULL) {
169 temprule = *rules[index];
171 if (req->newptr && req->newlen == 0) {
172 KASSERT(ruleptr == NULL, ("sysctl_rule: ruleptr != NULL"));
173 ruleptr = rules[index];
174 if (ruleptr == NULL) {
180 } else if (req->newptr) {
181 error = ugidfw_rule_valid(&temprule);
184 if (rules[index] == NULL) {
186 rules[index] = ruleptr;
188 if (index + 1 > rule_slots)
189 rule_slots = index + 1;
192 *rules[index] = temprule;
195 mtx_unlock(&ugidfw_mtx);
197 FREE(ruleptr, M_MACBSDEXTENDED);
198 if (req->oldptr && error == 0)
199 error = SYSCTL_OUT(req, &temprule, sizeof(temprule));
203 SYSCTL_NODE(_security_mac_bsdextended, OID_AUTO, rules, CTLFLAG_RW,
204 sysctl_rule, "BSD extended MAC rules");
207 ugidfw_init(struct mac_policy_conf *mpc)
210 mtx_init(&ugidfw_mtx, "mac_bsdextended lock", NULL, MTX_DEF);
214 ugidfw_destroy(struct mac_policy_conf *mpc)
217 mtx_destroy(&ugidfw_mtx);
221 ugidfw_rulecheck(struct mac_bsdextended_rule *rule,
222 struct ucred *cred, struct vnode *vp, struct vattr *vap, int acc_mode)
224 int mac_granted, match, priv_granted;
228 * Is there a subject match?
230 mtx_assert(&ugidfw_mtx, MA_OWNED);
231 if (rule->mbr_subject.mbs_flags & MBS_UID_DEFINED) {
232 match = ((cred->cr_uid <= rule->mbr_subject.mbs_uid_max &&
233 cred->cr_uid >= rule->mbr_subject.mbs_uid_min) ||
234 (cred->cr_ruid <= rule->mbr_subject.mbs_uid_max &&
235 cred->cr_ruid >= rule->mbr_subject.mbs_uid_min) ||
236 (cred->cr_svuid <= rule->mbr_subject.mbs_uid_max &&
237 cred->cr_svuid >= rule->mbr_subject.mbs_uid_min));
238 if (rule->mbr_subject.mbs_neg & MBS_UID_DEFINED)
244 if (rule->mbr_subject.mbs_flags & MBS_GID_DEFINED) {
245 match = ((cred->cr_rgid <= rule->mbr_subject.mbs_gid_max &&
246 cred->cr_rgid >= rule->mbr_subject.mbs_gid_min) ||
247 (cred->cr_svgid <= rule->mbr_subject.mbs_gid_max &&
248 cred->cr_svgid >= rule->mbr_subject.mbs_gid_min));
250 for (i = 0; i < cred->cr_ngroups; i++) {
251 if (cred->cr_groups[i]
252 <= rule->mbr_subject.mbs_gid_max &&
254 >= rule->mbr_subject.mbs_gid_min) {
260 if (rule->mbr_subject.mbs_neg & MBS_GID_DEFINED)
266 if (rule->mbr_subject.mbs_flags & MBS_PRISON_DEFINED) {
267 match = (cred->cr_prison != NULL &&
268 cred->cr_prison->pr_id == rule->mbr_subject.mbs_prison);
269 if (rule->mbr_subject.mbs_neg & MBS_PRISON_DEFINED)
276 * Is there an object match?
278 if (rule->mbr_object.mbo_flags & MBO_UID_DEFINED) {
279 match = (vap->va_uid <= rule->mbr_object.mbo_uid_max &&
280 vap->va_uid >= rule->mbr_object.mbo_uid_min);
281 if (rule->mbr_object.mbo_neg & MBO_UID_DEFINED)
287 if (rule->mbr_object.mbo_flags & MBO_GID_DEFINED) {
288 match = (vap->va_gid <= rule->mbr_object.mbo_gid_max &&
289 vap->va_gid >= rule->mbr_object.mbo_gid_min);
290 if (rule->mbr_object.mbo_neg & MBO_GID_DEFINED)
296 if (rule->mbr_object.mbo_flags & MBO_FSID_DEFINED) {
297 match = (bcmp(&(vp->v_mount->mnt_stat.f_fsid),
298 &(rule->mbr_object.mbo_fsid),
299 sizeof(rule->mbr_object.mbo_fsid)) == 0);
300 if (rule->mbr_object.mbo_neg & MBO_FSID_DEFINED)
306 if (rule->mbr_object.mbo_flags & MBO_SUID) {
307 match = (vap->va_mode & S_ISUID);
308 if (rule->mbr_object.mbo_neg & MBO_SUID)
314 if (rule->mbr_object.mbo_flags & MBO_SGID) {
315 match = (vap->va_mode & S_ISGID);
316 if (rule->mbr_object.mbo_neg & MBO_SGID)
322 if (rule->mbr_object.mbo_flags & MBO_UID_SUBJECT) {
323 match = (vap->va_uid == cred->cr_uid ||
324 vap->va_uid == cred->cr_ruid ||
325 vap->va_uid == cred->cr_svuid);
326 if (rule->mbr_object.mbo_neg & MBO_UID_SUBJECT)
332 if (rule->mbr_object.mbo_flags & MBO_GID_SUBJECT) {
333 match = (groupmember(vap->va_gid, cred) ||
334 vap->va_gid == cred->cr_rgid ||
335 vap->va_gid == cred->cr_svgid);
336 if (rule->mbr_object.mbo_neg & MBO_GID_SUBJECT)
342 if (rule->mbr_object.mbo_flags & MBO_TYPE_DEFINED) {
343 switch (vap->va_type) {
345 match = (rule->mbr_object.mbo_type & MBO_TYPE_REG);
348 match = (rule->mbr_object.mbo_type & MBO_TYPE_DIR);
351 match = (rule->mbr_object.mbo_type & MBO_TYPE_BLK);
354 match = (rule->mbr_object.mbo_type & MBO_TYPE_CHR);
357 match = (rule->mbr_object.mbo_type & MBO_TYPE_LNK);
360 match = (rule->mbr_object.mbo_type & MBO_TYPE_SOCK);
363 match = (rule->mbr_object.mbo_type & MBO_TYPE_FIFO);
368 if (rule->mbr_object.mbo_neg & MBO_TYPE_DEFINED)
375 * MBI_APPEND should not be here as it should get converted to
379 mac_granted = rule->mbr_mode;
380 if ((acc_mode & MBI_ADMIN) && (mac_granted & MBI_ADMIN) == 0 &&
381 priv_check_cred(cred, PRIV_VFS_ADMIN, 0) == 0)
382 priv_granted |= MBI_ADMIN;
383 if ((acc_mode & MBI_EXEC) && (mac_granted & MBI_EXEC) == 0 &&
384 priv_check_cred(cred, (vap->va_type == VDIR) ? PRIV_VFS_LOOKUP :
385 PRIV_VFS_EXEC, 0) == 0)
386 priv_granted |= MBI_EXEC;
387 if ((acc_mode & MBI_READ) && (mac_granted & MBI_READ) == 0 &&
388 priv_check_cred(cred, PRIV_VFS_READ, 0) == 0)
389 priv_granted |= MBI_READ;
390 if ((acc_mode & MBI_STAT) && (mac_granted & MBI_STAT) == 0 &&
391 priv_check_cred(cred, PRIV_VFS_STAT, 0) == 0)
392 priv_granted |= MBI_STAT;
393 if ((acc_mode & MBI_WRITE) && (mac_granted & MBI_WRITE) == 0 &&
394 priv_check_cred(cred, PRIV_VFS_WRITE, 0) == 0)
395 priv_granted |= MBI_WRITE;
397 * Is the access permitted?
399 if (((mac_granted | priv_granted) & acc_mode) != acc_mode) {
401 log(LOG_AUTHPRIV, "mac_bsdextended: %d:%d request %d"
402 " on %d:%d failed. \n", cred->cr_ruid,
403 cred->cr_rgid, acc_mode, vap->va_uid,
409 * If the rule matched, permits access, and first match is enabled,
412 if (ugidfw_firstmatch_enabled)
413 return (EJUSTRETURN);
419 ugidfw_check(struct ucred *cred, struct vnode *vp, struct vattr *vap,
425 * Since we do not separately handle append, map append to write.
427 if (acc_mode & MBI_APPEND) {
428 acc_mode &= ~MBI_APPEND;
429 acc_mode |= MBI_WRITE;
431 mtx_lock(&ugidfw_mtx);
432 for (i = 0; i < rule_slots; i++) {
433 if (rules[i] == NULL)
435 error = ugidfw_rulecheck(rules[i], cred,
437 if (error == EJUSTRETURN)
440 mtx_unlock(&ugidfw_mtx);
444 mtx_unlock(&ugidfw_mtx);
449 ugidfw_check_vp(struct ucred *cred, struct vnode *vp, int acc_mode)
456 error = VOP_GETATTR(vp, &vap, cred);
459 return (ugidfw_check(cred, vp, &vap, acc_mode));
463 * Object-specific entry point implementations are sorted alphabetically by
464 * object type and then by operation.
467 ugidfw_system_check_acct(struct ucred *cred, struct vnode *vp,
468 struct label *vplabel)
472 return (ugidfw_check_vp(cred, vp, MBI_WRITE));
478 ugidfw_system_check_auditctl(struct ucred *cred, struct vnode *vp,
479 struct label *vplabel)
483 return (ugidfw_check_vp(cred, vp, MBI_WRITE));
489 ugidfw_system_check_swapon(struct ucred *cred, struct vnode *vp,
490 struct label *vplabel)
493 return (ugidfw_check_vp(cred, vp, MBI_WRITE));
497 ugidfw_vnode_check_access(struct ucred *cred, struct vnode *vp,
498 struct label *vplabel, int acc_mode)
501 return (ugidfw_check_vp(cred, vp, acc_mode));
505 ugidfw_vnode_check_chdir(struct ucred *cred, struct vnode *dvp,
506 struct label *dvplabel)
509 return (ugidfw_check_vp(cred, dvp, MBI_EXEC));
513 ugidfw_vnode_check_chroot(struct ucred *cred, struct vnode *dvp,
514 struct label *dvplabel)
517 return (ugidfw_check_vp(cred, dvp, MBI_EXEC));
521 ugidfw_check_create_vnode(struct ucred *cred, struct vnode *dvp,
522 struct label *dvplabel, struct componentname *cnp, struct vattr *vap)
525 return (ugidfw_check_vp(cred, dvp, MBI_WRITE));
529 ugidfw_vnode_check_deleteacl(struct ucred *cred, struct vnode *vp,
530 struct label *vplabel, acl_type_t type)
533 return (ugidfw_check_vp(cred, vp, MBI_ADMIN));
537 ugidfw_vnode_check_deleteextattr(struct ucred *cred, struct vnode *vp,
538 struct label *vplabel, int attrnamespace, const char *name)
541 return (ugidfw_check_vp(cred, vp, MBI_WRITE));
545 ugidfw_vnode_check_exec(struct ucred *cred, struct vnode *vp,
546 struct label *vplabel, struct image_params *imgp,
547 struct label *execlabel)
550 return (ugidfw_check_vp(cred, vp, MBI_READ|MBI_EXEC));
554 ugidfw_vnode_check_getacl(struct ucred *cred, struct vnode *vp,
555 struct label *vplabel, acl_type_t type)
558 return (ugidfw_check_vp(cred, vp, MBI_STAT));
562 ugidfw_vnode_check_getextattr(struct ucred *cred, struct vnode *vp,
563 struct label *vplabel, int attrnamespace, const char *name,
567 return (ugidfw_check_vp(cred, vp, MBI_READ));
571 ugidfw_vnode_check_link(struct ucred *cred, struct vnode *dvp,
572 struct label *dvplabel, struct vnode *vp, struct label *label,
573 struct componentname *cnp)
577 error = ugidfw_check_vp(cred, dvp, MBI_WRITE);
580 error = ugidfw_check_vp(cred, vp, MBI_WRITE);
587 ugidfw_vnode_check_listextattr(struct ucred *cred, struct vnode *vp,
588 struct label *vplabel, int attrnamespace)
591 return (ugidfw_check_vp(cred, vp, MBI_READ));
595 ugidfw_vnode_check_lookup(struct ucred *cred, struct vnode *dvp,
596 struct label *dvplabel, struct componentname *cnp)
599 return (ugidfw_check_vp(cred, dvp, MBI_EXEC));
603 ugidfw_vnode_check_open(struct ucred *cred, struct vnode *vp,
604 struct label *vplabel, int acc_mode)
607 return (ugidfw_check_vp(cred, vp, acc_mode));
611 ugidfw_vnode_check_readdir(struct ucred *cred, struct vnode *dvp,
612 struct label *dvplabel)
615 return (ugidfw_check_vp(cred, dvp, MBI_READ));
619 ugidfw_vnode_check_readdlink(struct ucred *cred, struct vnode *vp,
620 struct label *vplabel)
623 return (ugidfw_check_vp(cred, vp, MBI_READ));
627 ugidfw_vnode_check_rename_from(struct ucred *cred, struct vnode *dvp,
628 struct label *dvplabel, struct vnode *vp, struct label *vplabel,
629 struct componentname *cnp)
633 error = ugidfw_check_vp(cred, dvp, MBI_WRITE);
636 return (ugidfw_check_vp(cred, vp, MBI_WRITE));
640 ugidfw_vnode_check_rename_to(struct ucred *cred, struct vnode *dvp,
641 struct label *dvplabel, struct vnode *vp, struct label *vplabel,
642 int samedir, struct componentname *cnp)
646 error = ugidfw_check_vp(cred, dvp, MBI_WRITE);
650 error = ugidfw_check_vp(cred, vp, MBI_WRITE);
655 ugidfw_vnode_check_revoke(struct ucred *cred, struct vnode *vp,
656 struct label *vplabel)
659 return (ugidfw_check_vp(cred, vp, MBI_ADMIN));
663 ugidfw_check_setacl_vnode(struct ucred *cred, struct vnode *vp,
664 struct label *vplabel, acl_type_t type, struct acl *acl)
667 return (ugidfw_check_vp(cred, vp, MBI_ADMIN));
671 ugidfw_vnode_check_setextattr(struct ucred *cred, struct vnode *vp,
672 struct label *vplabel, int attrnamespace, const char *name,
676 return (ugidfw_check_vp(cred, vp, MBI_WRITE));
680 ugidfw_vnode_check_setflags(struct ucred *cred, struct vnode *vp,
681 struct label *vplabel, u_long flags)
684 return (ugidfw_check_vp(cred, vp, MBI_ADMIN));
688 ugidfw_vnode_check_setmode(struct ucred *cred, struct vnode *vp,
689 struct label *vplabel, mode_t mode)
692 return (ugidfw_check_vp(cred, vp, MBI_ADMIN));
696 ugidfw_vnode_check_setowner(struct ucred *cred, struct vnode *vp,
697 struct label *vplabel, uid_t uid, gid_t gid)
700 return (ugidfw_check_vp(cred, vp, MBI_ADMIN));
704 ugidfw_vnode_check_setutimes(struct ucred *cred, struct vnode *vp,
705 struct label *vplabel, struct timespec atime, struct timespec utime)
708 return (ugidfw_check_vp(cred, vp, MBI_ADMIN));
712 ugidfw_vnode_check_stat(struct ucred *active_cred,
713 struct ucred *file_cred, struct vnode *vp, struct label *vplabel)
716 return (ugidfw_check_vp(active_cred, vp, MBI_STAT));
720 ugidfw_vnode_check_unlink(struct ucred *cred, struct vnode *dvp,
721 struct label *dvplabel, struct vnode *vp, struct label *vplabel,
722 struct componentname *cnp)
726 error = ugidfw_check_vp(cred, dvp, MBI_WRITE);
729 return (ugidfw_check_vp(cred, vp, MBI_WRITE));
732 static struct mac_policy_ops ugidfw_ops =
734 .mpo_destroy = ugidfw_destroy,
735 .mpo_init = ugidfw_init,
736 .mpo_system_check_acct = ugidfw_system_check_acct,
737 .mpo_system_check_auditctl = ugidfw_system_check_auditctl,
738 .mpo_system_check_swapon = ugidfw_system_check_swapon,
739 .mpo_vnode_check_access = ugidfw_vnode_check_access,
740 .mpo_vnode_check_chdir = ugidfw_vnode_check_chdir,
741 .mpo_vnode_check_chroot = ugidfw_vnode_check_chroot,
742 .mpo_vnode_check_create = ugidfw_check_create_vnode,
743 .mpo_vnode_check_deleteacl = ugidfw_vnode_check_deleteacl,
744 .mpo_vnode_check_deleteextattr = ugidfw_vnode_check_deleteextattr,
745 .mpo_vnode_check_exec = ugidfw_vnode_check_exec,
746 .mpo_vnode_check_getacl = ugidfw_vnode_check_getacl,
747 .mpo_vnode_check_getextattr = ugidfw_vnode_check_getextattr,
748 .mpo_vnode_check_link = ugidfw_vnode_check_link,
749 .mpo_vnode_check_listextattr = ugidfw_vnode_check_listextattr,
750 .mpo_vnode_check_lookup = ugidfw_vnode_check_lookup,
751 .mpo_vnode_check_open = ugidfw_vnode_check_open,
752 .mpo_vnode_check_readdir = ugidfw_vnode_check_readdir,
753 .mpo_vnode_check_readlink = ugidfw_vnode_check_readdlink,
754 .mpo_vnode_check_rename_from = ugidfw_vnode_check_rename_from,
755 .mpo_vnode_check_rename_to = ugidfw_vnode_check_rename_to,
756 .mpo_vnode_check_revoke = ugidfw_vnode_check_revoke,
757 .mpo_vnode_check_setacl = ugidfw_check_setacl_vnode,
758 .mpo_vnode_check_setextattr = ugidfw_vnode_check_setextattr,
759 .mpo_vnode_check_setflags = ugidfw_vnode_check_setflags,
760 .mpo_vnode_check_setmode = ugidfw_vnode_check_setmode,
761 .mpo_vnode_check_setowner = ugidfw_vnode_check_setowner,
762 .mpo_vnode_check_setutimes = ugidfw_vnode_check_setutimes,
763 .mpo_vnode_check_stat = ugidfw_vnode_check_stat,
764 .mpo_vnode_check_unlink = ugidfw_vnode_check_unlink,
767 MAC_POLICY_SET(&ugidfw_ops, mac_bsdextended, "TrustedBSD MAC/BSD Extended",
768 MPC_LOADTIME_FLAG_UNLOADOK, NULL, 0);