xref: /freebsd/sys/security/mac_stub/mac_stub.c (revision d4eeb02986980bf33dd56c41ceb9fc5f180c0d47)
1 /*-
2  * Copyright (c) 1999-2002, 2007-2011 Robert N. M. Watson
3  * Copyright (c) 2001-2005 McAfee, Inc.
4  * Copyright (c) 2005-2006 SPARTA, Inc.
5  * Copyright (c) 2008 Apple Inc.
6  * All rights reserved.
7  *
8  * This software was developed by Robert Watson for the TrustedBSD Project.
9  *
10  * This software was developed for the FreeBSD Project in part by McAfee
11  * Research, the Security Research Division of McAfee, Inc. under
12  * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA
13  * CHATS research program.
14  *
15  * This software was enhanced by SPARTA ISSO under SPAWAR contract
16  * N66001-04-C-6019 ("SEFOS").
17  *
18  * This software was developed at the University of Cambridge Computer
19  * Laboratory with support from a grant from Google, Inc.
20  *
21  * Redistribution and use in source and binary forms, with or without
22  * modification, are permitted provided that the following conditions
23  * are met:
24  * 1. Redistributions of source code must retain the above copyright
25  *    notice, this list of conditions and the following disclaimer.
26  * 2. Redistributions in binary form must reproduce the above copyright
27  *    notice, this list of conditions and the following disclaimer in the
28  *    documentation and/or other materials provided with the distribution.
29  *
30  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
31  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
34  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40  * SUCH DAMAGE.
41  *
42  * $FreeBSD$
43  */
44 
45 /*
46  * Developed by the TrustedBSD Project.
47  *
48  * Stub module that implements a NOOP for most (if not all) MAC Framework
49  * policy entry points.
50  */
51 
52 #include <sys/types.h>
53 #include <sys/param.h>
54 #include <sys/acl.h>
55 #include <sys/conf.h>
56 #include <sys/extattr.h>
57 #include <sys/kdb.h>
58 #include <sys/kernel.h>
59 #include <sys/ksem.h>
60 #include <sys/mount.h>
61 #include <sys/proc.h>
62 #include <sys/systm.h>
63 #include <sys/sysproto.h>
64 #include <sys/sysent.h>
65 #include <sys/vnode.h>
66 #include <sys/file.h>
67 #include <sys/socket.h>
68 #include <sys/socketvar.h>
69 #include <sys/pipe.h>
70 #include <sys/sx.h>
71 #include <sys/sysctl.h>
72 #include <sys/msg.h>
73 #include <sys/sem.h>
74 #include <sys/shm.h>
75 
76 #include <ddb/ddb.h>
77 
78 #include <fs/devfs/devfs.h>
79 
80 #include <net/bpfdesc.h>
81 #include <net/if.h>
82 #include <net/if_types.h>
83 #include <net/if_var.h>
84 
85 #include <netinet/in.h>
86 #include <netinet/in_pcb.h>
87 #include <netinet/ip_var.h>
88 
89 #include <vm/vm.h>
90 
91 #include <security/mac/mac_policy.h>
92 
93 SYSCTL_DECL(_security_mac);
94 
95 static SYSCTL_NODE(_security_mac, OID_AUTO, stub,
96     CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
97     "TrustedBSD mac_stub policy controls");
98 
99 static int	stub_enabled = 1;
100 SYSCTL_INT(_security_mac_stub, OID_AUTO, enabled, CTLFLAG_RW,
101     &stub_enabled, 0, "Enforce mac_stub policy");
102 
103 /*
104  * Policy module operations.
105  */
106 static void
107 stub_destroy(struct mac_policy_conf *conf)
108 {
109 
110 }
111 
112 static void
113 stub_init(struct mac_policy_conf *conf)
114 {
115 
116 }
117 
118 static int
119 stub_syscall(struct thread *td, int call, void *arg)
120 {
121 
122 	return (0);
123 }
124 
125 /*
126  * Label operations.
127  */
128 static void
129 stub_init_label(struct label *label)
130 {
131 
132 }
133 
134 static int
135 stub_init_label_waitcheck(struct label *label, int flag)
136 {
137 
138 	return (0);
139 }
140 
141 static void
142 stub_destroy_label(struct label *label)
143 {
144 
145 }
146 
147 static void
148 stub_copy_label(struct label *src, struct label *dest)
149 {
150 
151 }
152 
153 static int
154 stub_externalize_label(struct label *label, char *element_name,
155     struct sbuf *sb, int *claimed)
156 {
157 
158 	return (0);
159 }
160 
161 static int
162 stub_internalize_label(struct label *label, char *element_name,
163     char *element_data, int *claimed)
164 {
165 
166 	return (0);
167 }
168 
169 /*
170  * Object-specific entry point imeplementations are sorted alphabetically by
171  * object type name and then by operation.
172  */
173 static int
174 stub_bpfdesc_check_receive(struct bpf_d *d, struct label *dlabel,
175     struct ifnet *ifp, struct label *ifplabel)
176 {
177 
178         return (0);
179 }
180 
181 static void
182 stub_bpfdesc_create(struct ucred *cred, struct bpf_d *d,
183     struct label *dlabel)
184 {
185 
186 }
187 
188 static void
189 stub_bpfdesc_create_mbuf(struct bpf_d *d, struct label *dlabel,
190     struct mbuf *m, struct label *mlabel)
191 {
192 
193 }
194 
195 static void
196 stub_cred_associate_nfsd(struct ucred *cred)
197 {
198 
199 }
200 
201 static int
202 stub_cred_check_relabel(struct ucred *cred, struct label *newlabel)
203 {
204 
205 	return (0);
206 }
207 
208 static int
209 stub_cred_check_setaudit(struct ucred *cred, struct auditinfo *ai)
210 {
211 
212 	return (0);
213 }
214 
215 static int
216 stub_cred_check_setaudit_addr(struct ucred *cred, struct auditinfo_addr *aia)
217 {
218 
219 	return (0);
220 }
221 
222 static int
223 stub_cred_check_setauid(struct ucred *cred, uid_t auid)
224 {
225 
226 	return (0);
227 }
228 
229 static int
230 stub_cred_check_setegid(struct ucred *cred, gid_t egid)
231 {
232 
233 	return (0);
234 }
235 
236 static int
237 stub_cred_check_seteuid(struct ucred *cred, uid_t euid)
238 {
239 
240 	return (0);
241 }
242 
243 static int
244 stub_cred_check_setgid(struct ucred *cred, gid_t gid)
245 {
246 
247 	return (0);
248 }
249 
250 static int
251 stub_cred_check_setgroups(struct ucred *cred, int ngroups,
252 	gid_t *gidset)
253 {
254 
255 	return (0);
256 }
257 
258 static int
259 stub_cred_check_setregid(struct ucred *cred, gid_t rgid, gid_t egid)
260 {
261 
262 	return (0);
263 }
264 
265 static int
266 stub_cred_check_setresgid(struct ucred *cred, gid_t rgid, gid_t egid,
267 	gid_t sgid)
268 {
269 
270 	return (0);
271 }
272 
273 static int
274 stub_cred_check_setresuid(struct ucred *cred, uid_t ruid, uid_t euid,
275 	uid_t suid)
276 {
277 
278 	return (0);
279 }
280 
281 static int
282 stub_cred_check_setreuid(struct ucred *cred, uid_t ruid, uid_t euid)
283 {
284 
285 	return (0);
286 }
287 
288 static int
289 stub_cred_check_setuid(struct ucred *cred, uid_t uid)
290 {
291 
292 	return (0);
293 }
294 
295 static int
296 stub_cred_check_visible(struct ucred *cr1, struct ucred *cr2)
297 {
298 
299 	return (0);
300 }
301 
302 static void
303 stub_cred_create_init(struct ucred *cred)
304 {
305 
306 }
307 
308 static void
309 stub_cred_create_swapper(struct ucred *cred)
310 {
311 
312 }
313 
314 static void
315 stub_cred_relabel(struct ucred *cred, struct label *newlabel)
316 {
317 
318 }
319 
320 static int
321 stub_ddb_command_exec(struct db_command *cmd, db_expr_t addr, bool have_addr,
322     db_expr_t count, char *modif)
323 {
324 
325 	return (0);
326 }
327 
328 static int
329 stub_ddb_command_register(struct db_command_table *table,
330     struct db_command *cmd)
331 {
332 
333 	return (0);
334 }
335 
336 static void
337 stub_devfs_create_device(struct ucred *cred, struct mount *mp,
338     struct cdev *dev, struct devfs_dirent *de, struct label *delabel)
339 {
340 
341 }
342 
343 static void
344 stub_devfs_create_directory(struct mount *mp, char *dirname,
345     int dirnamelen, struct devfs_dirent *de, struct label *delabel)
346 {
347 
348 }
349 
350 static void
351 stub_devfs_create_symlink(struct ucred *cred, struct mount *mp,
352     struct devfs_dirent *dd, struct label *ddlabel, struct devfs_dirent *de,
353     struct label *delabel)
354 {
355 
356 }
357 
358 static void
359 stub_devfs_update(struct mount *mp, struct devfs_dirent *de,
360     struct label *delabel, struct vnode *vp, struct label *vplabel)
361 {
362 
363 }
364 
365 static void
366 stub_devfs_vnode_associate(struct mount *mp, struct label *mplabel,
367     struct devfs_dirent *de, struct label *delabel, struct vnode *vp,
368     struct label *vplabel)
369 {
370 
371 }
372 
373 static int
374 stub_ifnet_check_relabel(struct ucred *cred, struct ifnet *ifp,
375     struct label *ifplabel, struct label *newlabel)
376 {
377 
378 	return (0);
379 }
380 
381 static int
382 stub_ifnet_check_transmit(struct ifnet *ifp, struct label *ifplabel,
383     struct mbuf *m, struct label *mlabel)
384 {
385 
386 	return (0);
387 }
388 
389 static void
390 stub_ifnet_create(struct ifnet *ifp, struct label *ifplabel)
391 {
392 
393 }
394 
395 static void
396 stub_ifnet_create_mbuf(struct ifnet *ifp, struct label *ifplabel,
397     struct mbuf *m, struct label *mlabel)
398 {
399 
400 }
401 
402 static void
403 stub_ifnet_relabel(struct ucred *cred, struct ifnet *ifp,
404     struct label *ifplabel, struct label *newlabel)
405 {
406 
407 }
408 
409 static int
410 stub_inpcb_check_deliver(struct inpcb *inp, struct label *inplabel,
411     struct mbuf *m, struct label *mlabel)
412 {
413 
414 	return (0);
415 }
416 
417 static void
418 stub_inpcb_create(struct socket *so, struct label *solabel,
419     struct inpcb *inp, struct label *inplabel)
420 {
421 
422 }
423 
424 static void
425 stub_inpcb_create_mbuf(struct inpcb *inp, struct label *inplabel,
426     struct mbuf *m, struct label *mlabel)
427 {
428 
429 }
430 
431 static void
432 stub_inpcb_sosetlabel(struct socket *so, struct label *solabel,
433     struct inpcb *inp, struct label *inplabel)
434 {
435 
436 	SOCK_LOCK_ASSERT(so);
437 
438 }
439 
440 static void
441 stub_ip6q_create(struct mbuf *m, struct label *mlabel, struct ip6q *q6,
442     struct label *q6label)
443 {
444 
445 }
446 
447 static int
448 stub_ip6q_match(struct mbuf *m, struct label *mlabel, struct ip6q *q6,
449     struct label *q6label)
450 {
451 
452 	return (1);
453 }
454 
455 static void
456 stub_ip6q_reassemble(struct ip6q *q6, struct label *q6label, struct mbuf *m,
457     struct label *mlabel)
458 {
459 
460 }
461 
462 static void
463 stub_ip6q_update(struct mbuf *m, struct label *mlabel, struct ip6q *q6,
464     struct label *q6label)
465 {
466 
467 }
468 
469 static void
470 stub_ipq_create(struct mbuf *m, struct label *mlabel, struct ipq *q,
471     struct label *qlabel)
472 {
473 
474 }
475 
476 static int
477 stub_ipq_match(struct mbuf *m, struct label *mlabel, struct ipq *q,
478     struct label *qlabel)
479 {
480 
481 	return (1);
482 }
483 
484 static void
485 stub_ipq_reassemble(struct ipq *q, struct label *qlabel, struct mbuf *m,
486     struct label *mlabel)
487 {
488 
489 }
490 
491 static void
492 stub_ipq_update(struct mbuf *m, struct label *mlabel, struct ipq *q,
493     struct label *qlabel)
494 {
495 
496 }
497 
498 static int
499 stub_kdb_check_backend(struct kdb_dbbe *be)
500 {
501 
502 	return (0);
503 }
504 
505 static int
506 stub_kenv_check_dump(struct ucred *cred)
507 {
508 
509 	return (0);
510 }
511 
512 static int
513 stub_kenv_check_get(struct ucred *cred, char *name)
514 {
515 
516 	return (0);
517 }
518 
519 static int
520 stub_kenv_check_set(struct ucred *cred, char *name, char *value)
521 {
522 
523 	return (0);
524 }
525 
526 static int
527 stub_kenv_check_unset(struct ucred *cred, char *name)
528 {
529 
530 	return (0);
531 }
532 
533 static int
534 stub_kld_check_load(struct ucred *cred, struct vnode *vp,
535     struct label *vplabel)
536 {
537 
538 	return (0);
539 }
540 
541 static int
542 stub_kld_check_stat(struct ucred *cred)
543 {
544 
545 	return (0);
546 }
547 
548 static int
549 stub_mount_check_stat(struct ucred *cred, struct mount *mp,
550     struct label *mplabel)
551 {
552 
553 	return (0);
554 }
555 
556 static void
557 stub_mount_create(struct ucred *cred, struct mount *mp,
558     struct label *mplabel)
559 {
560 
561 }
562 
563 static void
564 stub_netinet_arp_send(struct ifnet *ifp, struct label *iflpabel,
565     struct mbuf *m, struct label *mlabel)
566 {
567 
568 }
569 
570 static void
571 stub_netinet_firewall_reply(struct mbuf *mrecv, struct label *mrecvlabel,
572     struct mbuf *msend, struct label *msendlabel)
573 {
574 
575 }
576 
577 static void
578 stub_netinet_firewall_send(struct mbuf *m, struct label *mlabel)
579 {
580 
581 }
582 
583 static void
584 stub_netinet_fragment(struct mbuf *m, struct label *mlabel, struct mbuf *frag,
585     struct label *fraglabel)
586 {
587 
588 }
589 
590 static void
591 stub_netinet_icmp_reply(struct mbuf *mrecv, struct label *mrecvlabel,
592     struct mbuf *msend, struct label *msendlabel)
593 {
594 
595 }
596 
597 static void
598 stub_netinet_icmp_replyinplace(struct mbuf *m, struct label *mlabel)
599 {
600 
601 }
602 
603 static void
604 stub_netinet_igmp_send(struct ifnet *ifp, struct label *iflpabel,
605     struct mbuf *m, struct label *mlabel)
606 {
607 
608 }
609 
610 static void
611 stub_netinet_tcp_reply(struct mbuf *m, struct label *mlabel)
612 {
613 
614 }
615 
616 static void
617 stub_netinet6_nd6_send(struct ifnet *ifp, struct label *iflpabel,
618     struct mbuf *m, struct label *mlabel)
619 {
620 
621 }
622 
623 static int
624 stub_pipe_check_ioctl(struct ucred *cred, struct pipepair *pp,
625     struct label *pplabel, unsigned long cmd, void /* caddr_t */ *data)
626 {
627 
628 	return (0);
629 }
630 
631 static int
632 stub_pipe_check_poll(struct ucred *cred, struct pipepair *pp,
633     struct label *pplabel)
634 {
635 
636 	return (0);
637 }
638 
639 static int
640 stub_pipe_check_read(struct ucred *cred, struct pipepair *pp,
641     struct label *pplabel)
642 {
643 
644 	return (0);
645 }
646 
647 static int
648 stub_pipe_check_relabel(struct ucred *cred, struct pipepair *pp,
649     struct label *pplabel, struct label *newlabel)
650 {
651 
652 	return (0);
653 }
654 
655 static int
656 stub_pipe_check_stat(struct ucred *cred, struct pipepair *pp,
657     struct label *pplabel)
658 {
659 
660 	return (0);
661 }
662 
663 static int
664 stub_pipe_check_write(struct ucred *cred, struct pipepair *pp,
665     struct label *pplabel)
666 {
667 
668 	return (0);
669 }
670 
671 static void
672 stub_pipe_create(struct ucred *cred, struct pipepair *pp,
673     struct label *pplabel)
674 {
675 
676 }
677 
678 static void
679 stub_pipe_relabel(struct ucred *cred, struct pipepair *pp,
680     struct label *pplabel, struct label *newlabel)
681 {
682 
683 }
684 
685 static int
686 stub_posixsem_check_getvalue(struct ucred *active_cred, struct ucred *file_cred,
687     struct ksem *ks, struct label *kslabel)
688 {
689 
690 	return (0);
691 }
692 
693 static int
694 stub_posixsem_check_open(struct ucred *cred, struct ksem *ks,
695     struct label *kslabel)
696 {
697 
698 	return (0);
699 }
700 
701 static int
702 stub_posixsem_check_post(struct ucred *active_cred, struct ucred *file_cred,
703     struct ksem *ks, struct label *kslabel)
704 {
705 
706 	return (0);
707 }
708 
709 static int
710 stub_posixsem_check_setmode(struct ucred *cred, struct ksem *ks,
711     struct label *kslabel, mode_t mode)
712 {
713 
714 	return (0);
715 }
716 
717 static int
718 stub_posixsem_check_setowner(struct ucred *cred, struct ksem *ks,
719     struct label *kslabel, uid_t uid, gid_t gid)
720 {
721 
722 	return (0);
723 }
724 
725 static int
726 stub_posixsem_check_stat(struct ucred *active_cred, struct ucred *file_cred,
727     struct ksem *ks, struct label *kslabel)
728 {
729 
730 	return (0);
731 }
732 
733 static int
734 stub_posixsem_check_unlink(struct ucred *cred, struct ksem *ks,
735     struct label *kslabel)
736 {
737 
738 	return (0);
739 }
740 
741 static int
742 stub_posixsem_check_wait(struct ucred *active_cred, struct ucred *file_cred,
743     struct ksem *ks, struct label *kslabel)
744 {
745 
746 	return (0);
747 }
748 
749 static void
750 stub_posixsem_create(struct ucred *cred, struct ksem *ks,
751     struct label *kslabel)
752 {
753 
754 }
755 
756 static int
757 stub_posixshm_check_create(struct ucred *cred, const char *path)
758 {
759 
760 	return (0);
761 }
762 
763 static int
764 stub_posixshm_check_mmap(struct ucred *cred, struct shmfd *shmfd,
765     struct label *shmlabel, int prot, int flags)
766 {
767 
768 	return (0);
769 }
770 
771 static int
772 stub_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd,
773     struct label *shmlabel, accmode_t accmode)
774 {
775 
776 	return (0);
777 }
778 
779 static int
780 stub_posixshm_check_read(struct ucred *active_cred, struct ucred *file_cred,
781     struct shmfd *shm, struct label *shmlabel)
782 {
783 
784 	return (0);
785 }
786 
787 static int
788 stub_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd,
789     struct label *shmlabel, mode_t mode)
790 {
791 
792 	return (0);
793 }
794 
795 static int
796 stub_posixshm_check_setowner(struct ucred *cred, struct shmfd *shmfd,
797     struct label *shmlabel, uid_t uid, gid_t gid)
798 {
799 
800 	return (0);
801 }
802 
803 static int
804 stub_posixshm_check_stat(struct ucred *active_cred, struct ucred *file_cred,
805     struct shmfd *shmfd, struct label *shmlabel)
806 {
807 
808 	return (0);
809 }
810 
811 static int
812 stub_posixshm_check_truncate(struct ucred *active_cred,
813     struct ucred *file_cred, struct shmfd *shmfd, struct label *shmlabel)
814 {
815 
816 	return (0);
817 }
818 
819 static int
820 stub_posixshm_check_unlink(struct ucred *cred, struct shmfd *shmfd,
821     struct label *shmlabel)
822 {
823 
824 	return (0);
825 }
826 
827 static int
828 stub_posixshm_check_write(struct ucred *active_cred, struct ucred *file_cred,
829     struct shmfd *shm, struct label *shmlabel)
830 {
831 
832 	return (0);
833 }
834 
835 static void
836 stub_posixshm_create(struct ucred *cred, struct shmfd *shmfd,
837     struct label *shmlabel)
838 {
839 
840 }
841 
842 static int
843 stub_priv_check(struct ucred *cred, int priv)
844 {
845 
846 	return (0);
847 }
848 
849 static int
850 stub_priv_grant(struct ucred *cred, int priv)
851 {
852 
853 	return (EPERM);
854 }
855 
856 static int
857 stub_proc_check_debug(struct ucred *cred, struct proc *p)
858 {
859 
860 	return (0);
861 }
862 
863 static int
864 stub_proc_check_sched(struct ucred *cred, struct proc *p)
865 {
866 
867 	return (0);
868 }
869 
870 static int
871 stub_proc_check_signal(struct ucred *cred, struct proc *p, int signum)
872 {
873 
874 	return (0);
875 }
876 
877 static int
878 stub_proc_check_wait(struct ucred *cred, struct proc *p)
879 {
880 
881 	return (0);
882 }
883 
884 static int
885 stub_socket_check_accept(struct ucred *cred, struct socket *so,
886     struct label *solabel)
887 {
888 
889 #if 0
890 	SOCK_LOCK(so);
891 	SOCK_UNLOCK(so);
892 #endif
893 
894 	return (0);
895 }
896 
897 static int
898 stub_socket_check_bind(struct ucred *cred, struct socket *so,
899     struct label *solabel, struct sockaddr *sa)
900 {
901 
902 #if 0
903 	SOCK_LOCK(so);
904 	SOCK_UNLOCK(so);
905 #endif
906 
907 	return (0);
908 }
909 
910 static int
911 stub_socket_check_connect(struct ucred *cred, struct socket *so,
912     struct label *solabel, struct sockaddr *sa)
913 {
914 
915 #if 0
916 	SOCK_LOCK(so);
917 	SOCK_UNLOCK(so);
918 #endif
919 
920 	return (0);
921 }
922 
923 static int
924 stub_socket_check_create(struct ucred *cred, int domain, int type, int proto)
925 {
926 
927 	return (0);
928 }
929 
930 static int
931 stub_socket_check_deliver(struct socket *so, struct label *solabel,
932     struct mbuf *m, struct label *mlabel)
933 {
934 
935 #if 0
936 	SOCK_LOCK(so);
937 	SOCK_UNLOCK(so);
938 #endif
939 
940 	return (0);
941 }
942 
943 static int
944 stub_socket_check_listen(struct ucred *cred, struct socket *so,
945     struct label *solabel)
946 {
947 
948 #if 0
949 	SOCK_LOCK(so);
950 	SOCK_UNLOCK(so);
951 #endif
952 
953 	return (0);
954 }
955 
956 static int
957 stub_socket_check_poll(struct ucred *cred, struct socket *so,
958     struct label *solabel)
959 {
960 
961 #if 0
962 	SOCK_LOCK(so);
963 	SOCK_UNLOCK(so);
964 #endif
965 
966 	return (0);
967 }
968 
969 static int
970 stub_socket_check_receive(struct ucred *cred, struct socket *so,
971     struct label *solabel)
972 {
973 
974 #if 0
975 	SOCK_LOCK(so);
976 	SOCK_UNLOCK(so);
977 #endif
978 
979 	return (0);
980 }
981 
982 static int
983 stub_socket_check_relabel(struct ucred *cred, struct socket *so,
984     struct label *solabel, struct label *newlabel)
985 {
986 
987 	SOCK_LOCK_ASSERT(so);
988 
989 	return (0);
990 }
991 static int
992 stub_socket_check_send(struct ucred *cred, struct socket *so,
993     struct label *solabel)
994 {
995 
996 #if 0
997 	SOCK_LOCK(so);
998 	SOCK_UNLOCK(so);
999 #endif
1000 
1001 	return (0);
1002 }
1003 
1004 static int
1005 stub_socket_check_stat(struct ucred *cred, struct socket *so,
1006     struct label *solabel)
1007 {
1008 
1009 #if 0
1010 	SOCK_LOCK(so);
1011 	SOCK_UNLOCK(so);
1012 #endif
1013 
1014 	return (0);
1015 }
1016 
1017 static int
1018 stub_inpcb_check_visible(struct ucred *cred, struct inpcb *inp,
1019    struct label *inplabel)
1020 {
1021 
1022 	return (0);
1023 }
1024 
1025 static int
1026 stub_socket_check_visible(struct ucred *cred, struct socket *so,
1027    struct label *solabel)
1028 {
1029 
1030 #if 0
1031 	SOCK_LOCK(so);
1032 	SOCK_UNLOCK(so);
1033 #endif
1034 
1035 	return (0);
1036 }
1037 
1038 static void
1039 stub_socket_create(struct ucred *cred, struct socket *so,
1040     struct label *solabel)
1041 {
1042 
1043 }
1044 
1045 static void
1046 stub_socket_create_mbuf(struct socket *so, struct label *solabel,
1047     struct mbuf *m, struct label *mlabel)
1048 {
1049 
1050 #if 0
1051 	SOCK_LOCK(so);
1052 	SOCK_UNLOCK(so);
1053 #endif
1054 }
1055 
1056 static void
1057 stub_socket_newconn(struct socket *oldso, struct label *oldsolabel,
1058     struct socket *newso, struct label *newsolabel)
1059 {
1060 
1061 #if 0
1062 	SOCK_LOCK(oldso);
1063 	SOCK_UNLOCK(oldso);
1064 #endif
1065 #if 0
1066 	SOCK_LOCK(newso);
1067 	SOCK_UNLOCK(newso);
1068 #endif
1069 }
1070 
1071 static void
1072 stub_socket_relabel(struct ucred *cred, struct socket *so,
1073     struct label *solabel, struct label *newlabel)
1074 {
1075 
1076 	SOCK_LOCK_ASSERT(so);
1077 }
1078 
1079 static void
1080 stub_socketpeer_set_from_mbuf(struct mbuf *m, struct label *mlabel,
1081     struct socket *so, struct label *sopeerlabel)
1082 {
1083 
1084 #if 0
1085 	SOCK_LOCK(so);
1086 	SOCK_UNLOCK(so);
1087 #endif
1088 }
1089 
1090 static void
1091 stub_socketpeer_set_from_socket(struct socket *oldso,
1092     struct label *oldsolabel, struct socket *newso,
1093     struct label *newsopeerlabel)
1094 {
1095 
1096 #if 0
1097 	SOCK_LOCK(oldso);
1098 	SOCK_UNLOCK(oldso);
1099 #endif
1100 #if 0
1101 	SOCK_LOCK(newso);
1102 	SOCK_UNLOCK(newso);
1103 #endif
1104 }
1105 
1106 static void
1107 stub_syncache_create(struct label *label, struct inpcb *inp)
1108 {
1109 
1110 }
1111 
1112 static void
1113 stub_syncache_create_mbuf(struct label *sc_label, struct mbuf *m,
1114     struct label *mlabel)
1115 {
1116 
1117 }
1118 
1119 static int
1120 stub_system_check_acct(struct ucred *cred, struct vnode *vp,
1121     struct label *vplabel)
1122 {
1123 
1124 	return (0);
1125 }
1126 
1127 static int
1128 stub_system_check_audit(struct ucred *cred, void *record, int length)
1129 {
1130 
1131 	return (0);
1132 }
1133 
1134 static int
1135 stub_system_check_auditctl(struct ucred *cred, struct vnode *vp,
1136     struct label *vplabel)
1137 {
1138 
1139 	return (0);
1140 }
1141 
1142 static int
1143 stub_system_check_auditon(struct ucred *cred, int cmd)
1144 {
1145 
1146 	return (0);
1147 }
1148 
1149 static int
1150 stub_system_check_reboot(struct ucred *cred, int how)
1151 {
1152 
1153 	return (0);
1154 }
1155 
1156 static int
1157 stub_system_check_swapoff(struct ucred *cred, struct vnode *vp,
1158     struct label *vplabel)
1159 {
1160 
1161 	return (0);
1162 }
1163 
1164 static int
1165 stub_system_check_swapon(struct ucred *cred, struct vnode *vp,
1166     struct label *vplabel)
1167 {
1168 
1169 	return (0);
1170 }
1171 
1172 static int
1173 stub_system_check_sysctl(struct ucred *cred, struct sysctl_oid *oidp,
1174     void *arg1, int arg2, struct sysctl_req *req)
1175 {
1176 
1177 	return (0);
1178 }
1179 
1180 static void
1181 stub_sysvmsg_cleanup(struct label *msglabel)
1182 {
1183 
1184 }
1185 
1186 static void
1187 stub_sysvmsg_create(struct ucred *cred, struct msqid_kernel *msqkptr,
1188     struct label *msqlabel, struct msg *msgptr, struct label *msglabel)
1189 {
1190 
1191 }
1192 
1193 static int
1194 stub_sysvmsq_check_msgmsq(struct ucred *cred, struct msg *msgptr,
1195     struct label *msglabel, struct msqid_kernel *msqkptr,
1196     struct label *msqklabel)
1197 {
1198 
1199 	return (0);
1200 }
1201 
1202 static int
1203 stub_sysvmsq_check_msgrcv(struct ucred *cred, struct msg *msgptr,
1204     struct label *msglabel)
1205 {
1206 
1207 	return (0);
1208 }
1209 
1210 static int
1211 stub_sysvmsq_check_msgrmid(struct ucred *cred, struct msg *msgptr,
1212     struct label *msglabel)
1213 {
1214 
1215 	return (0);
1216 }
1217 
1218 static int
1219 stub_sysvmsq_check_msqget(struct ucred *cred, struct msqid_kernel *msqkptr,
1220     struct label *msqklabel)
1221 {
1222 
1223 	return (0);
1224 }
1225 
1226 static int
1227 stub_sysvmsq_check_msqsnd(struct ucred *cred, struct msqid_kernel *msqkptr,
1228     struct label *msqklabel)
1229 {
1230 
1231 	return (0);
1232 }
1233 
1234 static int
1235 stub_sysvmsq_check_msqrcv(struct ucred *cred, struct msqid_kernel *msqkptr,
1236     struct label *msqklabel)
1237 {
1238 
1239 	return (0);
1240 }
1241 
1242 static int
1243 stub_sysvmsq_check_msqctl(struct ucred *cred, struct msqid_kernel *msqkptr,
1244     struct label *msqklabel, int cmd)
1245 {
1246 
1247 	return (0);
1248 }
1249 
1250 static void
1251 stub_sysvmsq_cleanup(struct label *msqlabel)
1252 {
1253 
1254 }
1255 
1256 static void
1257 stub_sysvmsq_create(struct ucred *cred, struct msqid_kernel *msqkptr,
1258     struct label *msqlabel)
1259 {
1260 
1261 }
1262 
1263 static int
1264 stub_sysvsem_check_semctl(struct ucred *cred, struct semid_kernel *semakptr,
1265     struct label *semaklabel, int cmd)
1266 {
1267 
1268 	return (0);
1269 }
1270 
1271 static int
1272 stub_sysvsem_check_semget(struct ucred *cred, struct semid_kernel *semakptr,
1273     struct label *semaklabel)
1274 {
1275 
1276 	return (0);
1277 }
1278 
1279 static int
1280 stub_sysvsem_check_semop(struct ucred *cred, struct semid_kernel *semakptr,
1281     struct label *semaklabel, size_t accesstype)
1282 {
1283 
1284 	return (0);
1285 }
1286 
1287 static void
1288 stub_sysvsem_cleanup(struct label *semalabel)
1289 {
1290 
1291 }
1292 
1293 static void
1294 stub_sysvsem_create(struct ucred *cred, struct semid_kernel *semakptr,
1295     struct label *semalabel)
1296 {
1297 
1298 }
1299 
1300 static int
1301 stub_sysvshm_check_shmat(struct ucred *cred, struct shmid_kernel *shmsegptr,
1302     struct label *shmseglabel, int shmflg)
1303 {
1304 
1305 	return (0);
1306 }
1307 
1308 static int
1309 stub_sysvshm_check_shmctl(struct ucred *cred, struct shmid_kernel *shmsegptr,
1310     struct label *shmseglabel, int cmd)
1311 {
1312 
1313 	return (0);
1314 }
1315 
1316 static int
1317 stub_sysvshm_check_shmdt(struct ucred *cred, struct shmid_kernel *shmsegptr,
1318     struct label *shmseglabel)
1319 {
1320 
1321 	return (0);
1322 }
1323 
1324 static int
1325 stub_sysvshm_check_shmget(struct ucred *cred, struct shmid_kernel *shmsegptr,
1326     struct label *shmseglabel, int shmflg)
1327 {
1328 
1329 	return (0);
1330 }
1331 
1332 static void
1333 stub_sysvshm_cleanup(struct label *shmlabel)
1334 {
1335 
1336 }
1337 
1338 static void
1339 stub_sysvshm_create(struct ucred *cred, struct shmid_kernel *shmsegptr,
1340     struct label *shmalabel)
1341 {
1342 
1343 }
1344 
1345 static void
1346 stub_thread_userret(struct thread *td)
1347 {
1348 
1349 }
1350 
1351 static int
1352 stub_vnode_associate_extattr(struct mount *mp, struct label *mplabel,
1353     struct vnode *vp, struct label *vplabel)
1354 {
1355 
1356 	return (0);
1357 }
1358 
1359 static void
1360 stub_vnode_associate_singlelabel(struct mount *mp, struct label *mplabel,
1361     struct vnode *vp, struct label *vplabel)
1362 {
1363 
1364 }
1365 
1366 static int
1367 stub_vnode_check_access(struct ucred *cred, struct vnode *vp,
1368     struct label *vplabel, accmode_t accmode)
1369 {
1370 
1371 	return (0);
1372 }
1373 
1374 static int
1375 stub_vnode_check_chdir(struct ucred *cred, struct vnode *dvp,
1376     struct label *dvplabel)
1377 {
1378 
1379 	return (0);
1380 }
1381 
1382 static int
1383 stub_vnode_check_chroot(struct ucred *cred, struct vnode *dvp,
1384     struct label *dvplabel)
1385 {
1386 
1387 	return (0);
1388 }
1389 
1390 static int
1391 stub_vnode_check_create(struct ucred *cred, struct vnode *dvp,
1392     struct label *dvplabel, struct componentname *cnp, struct vattr *vap)
1393 {
1394 
1395 	return (0);
1396 }
1397 
1398 static int
1399 stub_vnode_check_deleteacl(struct ucred *cred, struct vnode *vp,
1400     struct label *vplabel, acl_type_t type)
1401 {
1402 
1403 	return (0);
1404 }
1405 
1406 static int
1407 stub_vnode_check_deleteextattr(struct ucred *cred, struct vnode *vp,
1408     struct label *vplabel, int attrnamespace, const char *name)
1409 {
1410 
1411 	return (0);
1412 }
1413 
1414 static int
1415 stub_vnode_check_exec(struct ucred *cred, struct vnode *vp,
1416     struct label *vplabel, struct image_params *imgp,
1417     struct label *execlabel)
1418 {
1419 
1420 	return (0);
1421 }
1422 
1423 static int
1424 stub_vnode_check_getacl(struct ucred *cred, struct vnode *vp,
1425     struct label *vplabel, acl_type_t type)
1426 {
1427 
1428 	return (0);
1429 }
1430 
1431 static int
1432 stub_vnode_check_getextattr(struct ucred *cred, struct vnode *vp,
1433     struct label *vplabel, int attrnamespace, const char *name)
1434 {
1435 
1436 	return (0);
1437 }
1438 
1439 static int
1440 stub_vnode_check_link(struct ucred *cred, struct vnode *dvp,
1441     struct label *dvplabel, struct vnode *vp, struct label *vplabel,
1442     struct componentname *cnp)
1443 {
1444 
1445 	return (0);
1446 }
1447 
1448 static int
1449 stub_vnode_check_listextattr(struct ucred *cred, struct vnode *vp,
1450     struct label *vplabel, int attrnamespace)
1451 {
1452 
1453 	return (0);
1454 }
1455 
1456 static int
1457 stub_vnode_check_lookup(struct ucred *cred, struct vnode *dvp,
1458     struct label *dvplabel, struct componentname *cnp)
1459 {
1460 
1461 	return (0);
1462 }
1463 
1464 static int
1465 stub_vnode_check_mmap(struct ucred *cred, struct vnode *vp,
1466     struct label *vplabel, int prot, int flags)
1467 {
1468 
1469 	return (0);
1470 }
1471 
1472 static void
1473 stub_vnode_check_mmap_downgrade(struct ucred *cred, struct vnode *vp,
1474     struct label *vplabel, int *prot)
1475 {
1476 
1477 }
1478 
1479 static int
1480 stub_vnode_check_mprotect(struct ucred *cred, struct vnode *vp,
1481     struct label *vplabel, int prot)
1482 {
1483 
1484 	return (0);
1485 }
1486 
1487 static int
1488 stub_vnode_check_open(struct ucred *cred, struct vnode *vp,
1489     struct label *vplabel, accmode_t accmode)
1490 {
1491 
1492 	return (0);
1493 }
1494 
1495 static int
1496 stub_vnode_check_poll(struct ucred *active_cred, struct ucred *file_cred,
1497     struct vnode *vp, struct label *vplabel)
1498 {
1499 
1500 	return (0);
1501 }
1502 
1503 static int
1504 stub_vnode_check_read(struct ucred *active_cred, struct ucred *file_cred,
1505     struct vnode *vp, struct label *vplabel)
1506 {
1507 
1508 	return (0);
1509 }
1510 
1511 static int
1512 stub_vnode_check_readdir(struct ucred *cred, struct vnode *vp,
1513     struct label *dvplabel)
1514 {
1515 
1516 	return (0);
1517 }
1518 
1519 static int
1520 stub_vnode_check_readlink(struct ucred *cred, struct vnode *vp,
1521     struct label *vplabel)
1522 {
1523 
1524 	return (0);
1525 }
1526 
1527 static int
1528 stub_vnode_check_relabel(struct ucred *cred, struct vnode *vp,
1529     struct label *vplabel, struct label *newlabel)
1530 {
1531 
1532 	return (0);
1533 }
1534 
1535 static int
1536 stub_vnode_check_rename_from(struct ucred *cred, struct vnode *dvp,
1537     struct label *dvplabel, struct vnode *vp, struct label *vplabel,
1538     struct componentname *cnp)
1539 {
1540 
1541 	return (0);
1542 }
1543 
1544 static int
1545 stub_vnode_check_rename_to(struct ucred *cred, struct vnode *dvp,
1546     struct label *dvplabel, struct vnode *vp, struct label *vplabel,
1547     int samedir, struct componentname *cnp)
1548 {
1549 
1550 	return (0);
1551 }
1552 
1553 static int
1554 stub_vnode_check_revoke(struct ucred *cred, struct vnode *vp,
1555     struct label *vplabel)
1556 {
1557 
1558 	return (0);
1559 }
1560 
1561 static int
1562 stub_vnode_check_setacl(struct ucred *cred, struct vnode *vp,
1563     struct label *vplabel, acl_type_t type, struct acl *acl)
1564 {
1565 
1566 	return (0);
1567 }
1568 
1569 static int
1570 stub_vnode_check_setextattr(struct ucred *cred, struct vnode *vp,
1571     struct label *vplabel, int attrnamespace, const char *name)
1572 {
1573 
1574 	return (0);
1575 }
1576 
1577 static int
1578 stub_vnode_check_setflags(struct ucred *cred, struct vnode *vp,
1579     struct label *vplabel, u_long flags)
1580 {
1581 
1582 	return (0);
1583 }
1584 
1585 static int
1586 stub_vnode_check_setmode(struct ucred *cred, struct vnode *vp,
1587     struct label *vplabel, mode_t mode)
1588 {
1589 
1590 	return (0);
1591 }
1592 
1593 static int
1594 stub_vnode_check_setowner(struct ucred *cred, struct vnode *vp,
1595     struct label *vplabel, uid_t uid, gid_t gid)
1596 {
1597 
1598 	return (0);
1599 }
1600 
1601 static int
1602 stub_vnode_check_setutimes(struct ucred *cred, struct vnode *vp,
1603     struct label *vplabel, struct timespec atime, struct timespec mtime)
1604 {
1605 
1606 	return (0);
1607 }
1608 
1609 static int
1610 stub_vnode_check_stat(struct ucred *active_cred, struct ucred *file_cred,
1611     struct vnode *vp, struct label *vplabel)
1612 {
1613 
1614 	return (0);
1615 }
1616 
1617 static int
1618 stub_vnode_check_unlink(struct ucred *cred, struct vnode *dvp,
1619     struct label *dvplabel, struct vnode *vp, struct label *vplabel,
1620     struct componentname *cnp)
1621 {
1622 
1623 	return (0);
1624 }
1625 
1626 static int
1627 stub_vnode_check_write(struct ucred *active_cred, struct ucred *file_cred,
1628     struct vnode *vp, struct label *vplabel)
1629 {
1630 
1631 	return (0);
1632 }
1633 
1634 static int
1635 stub_vnode_create_extattr(struct ucred *cred, struct mount *mp,
1636     struct label *mntlabel, struct vnode *dvp, struct label *dvplabel,
1637     struct vnode *vp, struct label *vplabel, struct componentname *cnp)
1638 {
1639 
1640 	return (0);
1641 }
1642 
1643 static void
1644 stub_vnode_execve_transition(struct ucred *old, struct ucred *new,
1645     struct vnode *vp, struct label *vplabel, struct label *interpvplabel,
1646     struct image_params *imgp, struct label *execlabel)
1647 {
1648 
1649 }
1650 
1651 static int
1652 stub_vnode_execve_will_transition(struct ucred *old, struct vnode *vp,
1653     struct label *vplabel, struct label *interpvplabel,
1654     struct image_params *imgp, struct label *execlabel)
1655 {
1656 
1657 	return (0);
1658 }
1659 
1660 static void
1661 stub_vnode_relabel(struct ucred *cred, struct vnode *vp,
1662     struct label *vplabel, struct label *label)
1663 {
1664 
1665 }
1666 
1667 static int
1668 stub_vnode_setlabel_extattr(struct ucred *cred, struct vnode *vp,
1669     struct label *vplabel, struct label *intlabel)
1670 {
1671 
1672 	return (0);
1673 }
1674 
1675 /*
1676  * Register functions with MAC Framework policy entry points.
1677  */
1678 static struct mac_policy_ops stub_ops =
1679 {
1680 	.mpo_destroy = stub_destroy,
1681 	.mpo_init = stub_init,
1682 	.mpo_syscall = stub_syscall,
1683 
1684 	.mpo_bpfdesc_check_receive = stub_bpfdesc_check_receive,
1685 	.mpo_bpfdesc_create = stub_bpfdesc_create,
1686 	.mpo_bpfdesc_create_mbuf = stub_bpfdesc_create_mbuf,
1687 	.mpo_bpfdesc_destroy_label = stub_destroy_label,
1688 	.mpo_bpfdesc_init_label = stub_init_label,
1689 
1690 	.mpo_cred_associate_nfsd = stub_cred_associate_nfsd,
1691 	.mpo_cred_check_relabel = stub_cred_check_relabel,
1692 	.mpo_cred_check_setaudit = stub_cred_check_setaudit,
1693 	.mpo_cred_check_setaudit_addr = stub_cred_check_setaudit_addr,
1694 	.mpo_cred_check_setauid = stub_cred_check_setauid,
1695 	.mpo_cred_check_setegid = stub_cred_check_setegid,
1696 	.mpo_cred_check_seteuid = stub_cred_check_seteuid,
1697 	.mpo_cred_check_setgid = stub_cred_check_setgid,
1698 	.mpo_cred_check_setgroups = stub_cred_check_setgroups,
1699 	.mpo_cred_check_setregid = stub_cred_check_setregid,
1700 	.mpo_cred_check_setresgid = stub_cred_check_setresgid,
1701 	.mpo_cred_check_setresuid = stub_cred_check_setresuid,
1702 	.mpo_cred_check_setreuid = stub_cred_check_setreuid,
1703 	.mpo_cred_check_setuid = stub_cred_check_setuid,
1704 	.mpo_cred_check_visible = stub_cred_check_visible,
1705 	.mpo_cred_copy_label = stub_copy_label,
1706 	.mpo_cred_create_init = stub_cred_create_init,
1707 	.mpo_cred_create_swapper = stub_cred_create_swapper,
1708 	.mpo_cred_destroy_label = stub_destroy_label,
1709 	.mpo_cred_externalize_label = stub_externalize_label,
1710 	.mpo_cred_init_label = stub_init_label,
1711 	.mpo_cred_internalize_label = stub_internalize_label,
1712 	.mpo_cred_relabel= stub_cred_relabel,
1713 
1714 	.mpo_ddb_command_exec = stub_ddb_command_exec,
1715 	.mpo_ddb_command_register = stub_ddb_command_register,
1716 
1717 	.mpo_devfs_create_device = stub_devfs_create_device,
1718 	.mpo_devfs_create_directory = stub_devfs_create_directory,
1719 	.mpo_devfs_create_symlink = stub_devfs_create_symlink,
1720 	.mpo_devfs_destroy_label = stub_destroy_label,
1721 	.mpo_devfs_init_label = stub_init_label,
1722 	.mpo_devfs_update = stub_devfs_update,
1723 	.mpo_devfs_vnode_associate = stub_devfs_vnode_associate,
1724 
1725 	.mpo_ifnet_check_relabel = stub_ifnet_check_relabel,
1726 	.mpo_ifnet_check_transmit = stub_ifnet_check_transmit,
1727 	.mpo_ifnet_copy_label = stub_copy_label,
1728 	.mpo_ifnet_create = stub_ifnet_create,
1729 	.mpo_ifnet_create_mbuf = stub_ifnet_create_mbuf,
1730 	.mpo_ifnet_destroy_label = stub_destroy_label,
1731 	.mpo_ifnet_externalize_label = stub_externalize_label,
1732 	.mpo_ifnet_init_label = stub_init_label,
1733 	.mpo_ifnet_internalize_label = stub_internalize_label,
1734 	.mpo_ifnet_relabel = stub_ifnet_relabel,
1735 
1736 	.mpo_inpcb_check_deliver = stub_inpcb_check_deliver,
1737 	.mpo_inpcb_check_visible = stub_inpcb_check_visible,
1738 	.mpo_inpcb_create = stub_inpcb_create,
1739 	.mpo_inpcb_create_mbuf = stub_inpcb_create_mbuf,
1740 	.mpo_inpcb_destroy_label = stub_destroy_label,
1741 	.mpo_inpcb_init_label = stub_init_label_waitcheck,
1742 	.mpo_inpcb_sosetlabel = stub_inpcb_sosetlabel,
1743 
1744 	.mpo_ip6q_create = stub_ip6q_create,
1745 	.mpo_ip6q_destroy_label = stub_destroy_label,
1746 	.mpo_ip6q_init_label = stub_init_label_waitcheck,
1747 	.mpo_ip6q_match = stub_ip6q_match,
1748 	.mpo_ip6q_update = stub_ip6q_update,
1749 	.mpo_ip6q_reassemble = stub_ip6q_reassemble,
1750 
1751 	.mpo_ipq_create = stub_ipq_create,
1752 	.mpo_ipq_destroy_label = stub_destroy_label,
1753 	.mpo_ipq_init_label = stub_init_label_waitcheck,
1754 	.mpo_ipq_match = stub_ipq_match,
1755 	.mpo_ipq_update = stub_ipq_update,
1756 	.mpo_ipq_reassemble = stub_ipq_reassemble,
1757 
1758 	.mpo_kdb_check_backend = stub_kdb_check_backend,
1759 
1760 	.mpo_kenv_check_dump = stub_kenv_check_dump,
1761 	.mpo_kenv_check_get = stub_kenv_check_get,
1762 	.mpo_kenv_check_set = stub_kenv_check_set,
1763 	.mpo_kenv_check_unset = stub_kenv_check_unset,
1764 
1765 	.mpo_kld_check_load = stub_kld_check_load,
1766 	.mpo_kld_check_stat = stub_kld_check_stat,
1767 
1768 	.mpo_mbuf_copy_label = stub_copy_label,
1769 	.mpo_mbuf_destroy_label = stub_destroy_label,
1770 	.mpo_mbuf_init_label = stub_init_label_waitcheck,
1771 
1772 	.mpo_mount_check_stat = stub_mount_check_stat,
1773 	.mpo_mount_create = stub_mount_create,
1774 	.mpo_mount_destroy_label = stub_destroy_label,
1775 	.mpo_mount_init_label = stub_init_label,
1776 
1777 	.mpo_netinet_arp_send = stub_netinet_arp_send,
1778 	.mpo_netinet_firewall_reply = stub_netinet_firewall_reply,
1779 	.mpo_netinet_firewall_send = stub_netinet_firewall_send,
1780 	.mpo_netinet_fragment = stub_netinet_fragment,
1781 	.mpo_netinet_icmp_reply = stub_netinet_icmp_reply,
1782 	.mpo_netinet_icmp_replyinplace = stub_netinet_icmp_replyinplace,
1783 	.mpo_netinet_tcp_reply = stub_netinet_tcp_reply,
1784 	.mpo_netinet_igmp_send = stub_netinet_igmp_send,
1785 
1786 	.mpo_netinet6_nd6_send = stub_netinet6_nd6_send,
1787 
1788 	.mpo_pipe_check_ioctl = stub_pipe_check_ioctl,
1789 	.mpo_pipe_check_poll = stub_pipe_check_poll,
1790 	.mpo_pipe_check_read = stub_pipe_check_read,
1791 	.mpo_pipe_check_relabel = stub_pipe_check_relabel,
1792 	.mpo_pipe_check_stat = stub_pipe_check_stat,
1793 	.mpo_pipe_check_write = stub_pipe_check_write,
1794 	.mpo_pipe_copy_label = stub_copy_label,
1795 	.mpo_pipe_create = stub_pipe_create,
1796 	.mpo_pipe_destroy_label = stub_destroy_label,
1797 	.mpo_pipe_externalize_label = stub_externalize_label,
1798 	.mpo_pipe_init_label = stub_init_label,
1799 	.mpo_pipe_internalize_label = stub_internalize_label,
1800 	.mpo_pipe_relabel = stub_pipe_relabel,
1801 
1802 	.mpo_posixsem_check_getvalue = stub_posixsem_check_getvalue,
1803 	.mpo_posixsem_check_open = stub_posixsem_check_open,
1804 	.mpo_posixsem_check_post = stub_posixsem_check_post,
1805 	.mpo_posixsem_check_setmode = stub_posixsem_check_setmode,
1806 	.mpo_posixsem_check_setowner = stub_posixsem_check_setowner,
1807 	.mpo_posixsem_check_stat = stub_posixsem_check_stat,
1808 	.mpo_posixsem_check_unlink = stub_posixsem_check_unlink,
1809 	.mpo_posixsem_check_wait = stub_posixsem_check_wait,
1810 	.mpo_posixsem_create = stub_posixsem_create,
1811 	.mpo_posixsem_destroy_label = stub_destroy_label,
1812 	.mpo_posixsem_init_label = stub_init_label,
1813 
1814 	.mpo_posixshm_check_create = stub_posixshm_check_create,
1815 	.mpo_posixshm_check_mmap = stub_posixshm_check_mmap,
1816 	.mpo_posixshm_check_open = stub_posixshm_check_open,
1817 	.mpo_posixshm_check_read = stub_posixshm_check_read,
1818 	.mpo_posixshm_check_setmode = stub_posixshm_check_setmode,
1819 	.mpo_posixshm_check_setowner = stub_posixshm_check_setowner,
1820 	.mpo_posixshm_check_stat = stub_posixshm_check_stat,
1821 	.mpo_posixshm_check_truncate = stub_posixshm_check_truncate,
1822 	.mpo_posixshm_check_unlink = stub_posixshm_check_unlink,
1823 	.mpo_posixshm_check_write = stub_posixshm_check_write,
1824 	.mpo_posixshm_create = stub_posixshm_create,
1825 	.mpo_posixshm_destroy_label = stub_destroy_label,
1826 	.mpo_posixshm_init_label = stub_init_label,
1827 
1828 	.mpo_priv_check = stub_priv_check,
1829 	.mpo_priv_grant = stub_priv_grant,
1830 
1831 	.mpo_proc_check_debug = stub_proc_check_debug,
1832 	.mpo_proc_check_sched = stub_proc_check_sched,
1833 	.mpo_proc_check_signal = stub_proc_check_signal,
1834 	.mpo_proc_check_wait = stub_proc_check_wait,
1835 
1836 	.mpo_socket_check_accept = stub_socket_check_accept,
1837 	.mpo_socket_check_bind = stub_socket_check_bind,
1838 	.mpo_socket_check_connect = stub_socket_check_connect,
1839 	.mpo_socket_check_create = stub_socket_check_create,
1840 	.mpo_socket_check_deliver = stub_socket_check_deliver,
1841 	.mpo_socket_check_listen = stub_socket_check_listen,
1842 	.mpo_socket_check_poll = stub_socket_check_poll,
1843 	.mpo_socket_check_receive = stub_socket_check_receive,
1844 	.mpo_socket_check_relabel = stub_socket_check_relabel,
1845 	.mpo_socket_check_send = stub_socket_check_send,
1846 	.mpo_socket_check_stat = stub_socket_check_stat,
1847 	.mpo_socket_check_visible = stub_socket_check_visible,
1848 	.mpo_socket_copy_label = stub_copy_label,
1849 	.mpo_socket_create = stub_socket_create,
1850 	.mpo_socket_create_mbuf = stub_socket_create_mbuf,
1851 	.mpo_socket_destroy_label = stub_destroy_label,
1852 	.mpo_socket_externalize_label = stub_externalize_label,
1853 	.mpo_socket_init_label = stub_init_label_waitcheck,
1854 	.mpo_socket_internalize_label = stub_internalize_label,
1855 	.mpo_socket_newconn = stub_socket_newconn,
1856 	.mpo_socket_relabel = stub_socket_relabel,
1857 
1858 	.mpo_socketpeer_destroy_label = stub_destroy_label,
1859 	.mpo_socketpeer_externalize_label = stub_externalize_label,
1860 	.mpo_socketpeer_init_label = stub_init_label_waitcheck,
1861 	.mpo_socketpeer_set_from_mbuf = stub_socketpeer_set_from_mbuf,
1862 	.mpo_socketpeer_set_from_socket = stub_socketpeer_set_from_socket,
1863 
1864 	.mpo_syncache_init_label = stub_init_label_waitcheck,
1865 	.mpo_syncache_destroy_label = stub_destroy_label,
1866 	.mpo_syncache_create = stub_syncache_create,
1867 	.mpo_syncache_create_mbuf= stub_syncache_create_mbuf,
1868 
1869 	.mpo_sysvmsg_cleanup = stub_sysvmsg_cleanup,
1870 	.mpo_sysvmsg_create = stub_sysvmsg_create,
1871 	.mpo_sysvmsg_destroy_label = stub_destroy_label,
1872 	.mpo_sysvmsg_init_label = stub_init_label,
1873 
1874 	.mpo_sysvmsq_check_msgmsq = stub_sysvmsq_check_msgmsq,
1875 	.mpo_sysvmsq_check_msgrcv = stub_sysvmsq_check_msgrcv,
1876 	.mpo_sysvmsq_check_msgrmid = stub_sysvmsq_check_msgrmid,
1877 	.mpo_sysvmsq_check_msqget = stub_sysvmsq_check_msqget,
1878 	.mpo_sysvmsq_check_msqsnd = stub_sysvmsq_check_msqsnd,
1879 	.mpo_sysvmsq_check_msqrcv = stub_sysvmsq_check_msqrcv,
1880 	.mpo_sysvmsq_check_msqctl = stub_sysvmsq_check_msqctl,
1881 	.mpo_sysvmsq_cleanup = stub_sysvmsq_cleanup,
1882 	.mpo_sysvmsq_create = stub_sysvmsq_create,
1883 	.mpo_sysvmsq_destroy_label = stub_destroy_label,
1884 	.mpo_sysvmsq_init_label = stub_init_label,
1885 
1886 	.mpo_sysvsem_check_semctl = stub_sysvsem_check_semctl,
1887 	.mpo_sysvsem_check_semget = stub_sysvsem_check_semget,
1888 	.mpo_sysvsem_check_semop = stub_sysvsem_check_semop,
1889 	.mpo_sysvsem_cleanup = stub_sysvsem_cleanup,
1890 	.mpo_sysvsem_create = stub_sysvsem_create,
1891 	.mpo_sysvsem_destroy_label = stub_destroy_label,
1892 	.mpo_sysvsem_init_label = stub_init_label,
1893 
1894 	.mpo_sysvshm_check_shmat = stub_sysvshm_check_shmat,
1895 	.mpo_sysvshm_check_shmctl = stub_sysvshm_check_shmctl,
1896 	.mpo_sysvshm_check_shmdt = stub_sysvshm_check_shmdt,
1897 	.mpo_sysvshm_check_shmget = stub_sysvshm_check_shmget,
1898 	.mpo_sysvshm_cleanup = stub_sysvshm_cleanup,
1899 	.mpo_sysvshm_create = stub_sysvshm_create,
1900 	.mpo_sysvshm_destroy_label = stub_destroy_label,
1901 	.mpo_sysvshm_init_label = stub_init_label,
1902 
1903 	.mpo_system_check_acct = stub_system_check_acct,
1904 	.mpo_system_check_audit = stub_system_check_audit,
1905 	.mpo_system_check_auditctl = stub_system_check_auditctl,
1906 	.mpo_system_check_auditon = stub_system_check_auditon,
1907 	.mpo_system_check_reboot = stub_system_check_reboot,
1908 	.mpo_system_check_swapoff = stub_system_check_swapoff,
1909 	.mpo_system_check_swapon = stub_system_check_swapon,
1910 	.mpo_system_check_sysctl = stub_system_check_sysctl,
1911 
1912 	.mpo_thread_userret = stub_thread_userret,
1913 
1914 	.mpo_vnode_associate_extattr = stub_vnode_associate_extattr,
1915 	.mpo_vnode_associate_singlelabel = stub_vnode_associate_singlelabel,
1916 	.mpo_vnode_check_access = stub_vnode_check_access,
1917 	.mpo_vnode_check_chdir = stub_vnode_check_chdir,
1918 	.mpo_vnode_check_chroot = stub_vnode_check_chroot,
1919 	.mpo_vnode_check_create = stub_vnode_check_create,
1920 	.mpo_vnode_check_deleteacl = stub_vnode_check_deleteacl,
1921 	.mpo_vnode_check_deleteextattr = stub_vnode_check_deleteextattr,
1922 	.mpo_vnode_check_exec = stub_vnode_check_exec,
1923 	.mpo_vnode_check_getacl = stub_vnode_check_getacl,
1924 	.mpo_vnode_check_getextattr = stub_vnode_check_getextattr,
1925 	.mpo_vnode_check_link = stub_vnode_check_link,
1926 	.mpo_vnode_check_listextattr = stub_vnode_check_listextattr,
1927 	.mpo_vnode_check_lookup = stub_vnode_check_lookup,
1928 	.mpo_vnode_check_mmap = stub_vnode_check_mmap,
1929 	.mpo_vnode_check_mmap_downgrade = stub_vnode_check_mmap_downgrade,
1930 	.mpo_vnode_check_mprotect = stub_vnode_check_mprotect,
1931 	.mpo_vnode_check_open = stub_vnode_check_open,
1932 	.mpo_vnode_check_poll = stub_vnode_check_poll,
1933 	.mpo_vnode_check_read = stub_vnode_check_read,
1934 	.mpo_vnode_check_readdir = stub_vnode_check_readdir,
1935 	.mpo_vnode_check_readlink = stub_vnode_check_readlink,
1936 	.mpo_vnode_check_relabel = stub_vnode_check_relabel,
1937 	.mpo_vnode_check_rename_from = stub_vnode_check_rename_from,
1938 	.mpo_vnode_check_rename_to = stub_vnode_check_rename_to,
1939 	.mpo_vnode_check_revoke = stub_vnode_check_revoke,
1940 	.mpo_vnode_check_setacl = stub_vnode_check_setacl,
1941 	.mpo_vnode_check_setextattr = stub_vnode_check_setextattr,
1942 	.mpo_vnode_check_setflags = stub_vnode_check_setflags,
1943 	.mpo_vnode_check_setmode = stub_vnode_check_setmode,
1944 	.mpo_vnode_check_setowner = stub_vnode_check_setowner,
1945 	.mpo_vnode_check_setutimes = stub_vnode_check_setutimes,
1946 	.mpo_vnode_check_stat = stub_vnode_check_stat,
1947 	.mpo_vnode_check_unlink = stub_vnode_check_unlink,
1948 	.mpo_vnode_check_write = stub_vnode_check_write,
1949 	.mpo_vnode_copy_label = stub_copy_label,
1950 	.mpo_vnode_create_extattr = stub_vnode_create_extattr,
1951 	.mpo_vnode_destroy_label = stub_destroy_label,
1952 	.mpo_vnode_execve_transition = stub_vnode_execve_transition,
1953 	.mpo_vnode_execve_will_transition = stub_vnode_execve_will_transition,
1954 	.mpo_vnode_externalize_label = stub_externalize_label,
1955 	.mpo_vnode_init_label = stub_init_label,
1956 	.mpo_vnode_internalize_label = stub_internalize_label,
1957 	.mpo_vnode_relabel = stub_vnode_relabel,
1958 	.mpo_vnode_setlabel_extattr = stub_vnode_setlabel_extattr,
1959 };
1960 
1961 MAC_POLICY_SET(&stub_ops, mac_stub, "TrustedBSD MAC/Stub",
1962     MPC_LOADTIME_FLAG_UNLOADOK, NULL);
1963