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