xref: /freebsd/sys/security/mac_stub/mac_stub.c (revision 31c2728185d1705634ff84c93936a4c91a651b22)
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 void
stub_netinet_arp_send(struct ifnet * ifp,struct label * iflpabel,struct mbuf * m,struct label * mlabel)578 stub_netinet_arp_send(struct ifnet *ifp, struct label *iflpabel,
579     struct mbuf *m, struct label *mlabel)
580 {
581 
582 }
583 
584 static void
stub_netinet_firewall_reply(struct mbuf * mrecv,struct label * mrecvlabel,struct mbuf * msend,struct label * msendlabel)585 stub_netinet_firewall_reply(struct mbuf *mrecv, struct label *mrecvlabel,
586     struct mbuf *msend, struct label *msendlabel)
587 {
588 
589 }
590 
591 static void
stub_netinet_firewall_send(struct mbuf * m,struct label * mlabel)592 stub_netinet_firewall_send(struct mbuf *m, struct label *mlabel)
593 {
594 
595 }
596 
597 static void
stub_netinet_fragment(struct mbuf * m,struct label * mlabel,struct mbuf * frag,struct label * fraglabel)598 stub_netinet_fragment(struct mbuf *m, struct label *mlabel, struct mbuf *frag,
599     struct label *fraglabel)
600 {
601 
602 }
603 
604 static void
stub_netinet_icmp_reply(struct mbuf * mrecv,struct label * mrecvlabel,struct mbuf * msend,struct label * msendlabel)605 stub_netinet_icmp_reply(struct mbuf *mrecv, struct label *mrecvlabel,
606     struct mbuf *msend, struct label *msendlabel)
607 {
608 
609 }
610 
611 static void
stub_netinet_icmp_replyinplace(struct mbuf * m,struct label * mlabel)612 stub_netinet_icmp_replyinplace(struct mbuf *m, struct label *mlabel)
613 {
614 
615 }
616 
617 static void
stub_netinet_igmp_send(struct ifnet * ifp,struct label * iflpabel,struct mbuf * m,struct label * mlabel)618 stub_netinet_igmp_send(struct ifnet *ifp, struct label *iflpabel,
619     struct mbuf *m, struct label *mlabel)
620 {
621 
622 }
623 
624 static void
stub_netinet_tcp_reply(struct mbuf * m,struct label * mlabel)625 stub_netinet_tcp_reply(struct mbuf *m, struct label *mlabel)
626 {
627 
628 }
629 
630 static void
stub_netinet6_nd6_send(struct ifnet * ifp,struct label * iflpabel,struct mbuf * m,struct label * mlabel)631 stub_netinet6_nd6_send(struct ifnet *ifp, struct label *iflpabel,
632     struct mbuf *m, struct label *mlabel)
633 {
634 
635 }
636 
637 static int
stub_pipe_check_ioctl(struct ucred * cred,struct pipepair * pp,struct label * pplabel,unsigned long cmd,void * data)638 stub_pipe_check_ioctl(struct ucred *cred, struct pipepair *pp,
639     struct label *pplabel, unsigned long cmd, void /* caddr_t */ *data)
640 {
641 
642 	return (0);
643 }
644 
645 static int
stub_pipe_check_poll(struct ucred * cred,struct pipepair * pp,struct label * pplabel)646 stub_pipe_check_poll(struct ucred *cred, struct pipepair *pp,
647     struct label *pplabel)
648 {
649 
650 	return (0);
651 }
652 
653 static int
stub_pipe_check_read(struct ucred * cred,struct pipepair * pp,struct label * pplabel)654 stub_pipe_check_read(struct ucred *cred, struct pipepair *pp,
655     struct label *pplabel)
656 {
657 
658 	return (0);
659 }
660 
661 static int
stub_pipe_check_relabel(struct ucred * cred,struct pipepair * pp,struct label * pplabel,struct label * newlabel)662 stub_pipe_check_relabel(struct ucred *cred, struct pipepair *pp,
663     struct label *pplabel, struct label *newlabel)
664 {
665 
666 	return (0);
667 }
668 
669 static int
stub_pipe_check_stat(struct ucred * cred,struct pipepair * pp,struct label * pplabel)670 stub_pipe_check_stat(struct ucred *cred, struct pipepair *pp,
671     struct label *pplabel)
672 {
673 
674 	return (0);
675 }
676 
677 static int
stub_pipe_check_write(struct ucred * cred,struct pipepair * pp,struct label * pplabel)678 stub_pipe_check_write(struct ucred *cred, struct pipepair *pp,
679     struct label *pplabel)
680 {
681 
682 	return (0);
683 }
684 
685 static void
stub_pipe_create(struct ucred * cred,struct pipepair * pp,struct label * pplabel)686 stub_pipe_create(struct ucred *cred, struct pipepair *pp,
687     struct label *pplabel)
688 {
689 
690 }
691 
692 static void
stub_pipe_relabel(struct ucred * cred,struct pipepair * pp,struct label * pplabel,struct label * newlabel)693 stub_pipe_relabel(struct ucred *cred, struct pipepair *pp,
694     struct label *pplabel, struct label *newlabel)
695 {
696 
697 }
698 
699 static int
stub_posixsem_check_getvalue(struct ucred * active_cred,struct ucred * file_cred,struct ksem * ks,struct label * kslabel)700 stub_posixsem_check_getvalue(struct ucred *active_cred, struct ucred *file_cred,
701     struct ksem *ks, struct label *kslabel)
702 {
703 
704 	return (0);
705 }
706 
707 static int
stub_posixsem_check_open(struct ucred * cred,struct ksem * ks,struct label * kslabel)708 stub_posixsem_check_open(struct ucred *cred, struct ksem *ks,
709     struct label *kslabel)
710 {
711 
712 	return (0);
713 }
714 
715 static int
stub_posixsem_check_post(struct ucred * active_cred,struct ucred * file_cred,struct ksem * ks,struct label * kslabel)716 stub_posixsem_check_post(struct ucred *active_cred, struct ucred *file_cred,
717     struct ksem *ks, struct label *kslabel)
718 {
719 
720 	return (0);
721 }
722 
723 static int
stub_posixsem_check_setmode(struct ucred * cred,struct ksem * ks,struct label * kslabel,mode_t mode)724 stub_posixsem_check_setmode(struct ucred *cred, struct ksem *ks,
725     struct label *kslabel, mode_t mode)
726 {
727 
728 	return (0);
729 }
730 
731 static int
stub_posixsem_check_setowner(struct ucred * cred,struct ksem * ks,struct label * kslabel,uid_t uid,gid_t gid)732 stub_posixsem_check_setowner(struct ucred *cred, struct ksem *ks,
733     struct label *kslabel, uid_t uid, gid_t gid)
734 {
735 
736 	return (0);
737 }
738 
739 static int
stub_posixsem_check_stat(struct ucred * active_cred,struct ucred * file_cred,struct ksem * ks,struct label * kslabel)740 stub_posixsem_check_stat(struct ucred *active_cred, struct ucred *file_cred,
741     struct ksem *ks, struct label *kslabel)
742 {
743 
744 	return (0);
745 }
746 
747 static int
stub_posixsem_check_unlink(struct ucred * cred,struct ksem * ks,struct label * kslabel)748 stub_posixsem_check_unlink(struct ucred *cred, struct ksem *ks,
749     struct label *kslabel)
750 {
751 
752 	return (0);
753 }
754 
755 static int
stub_posixsem_check_wait(struct ucred * active_cred,struct ucred * file_cred,struct ksem * ks,struct label * kslabel)756 stub_posixsem_check_wait(struct ucred *active_cred, struct ucred *file_cred,
757     struct ksem *ks, struct label *kslabel)
758 {
759 
760 	return (0);
761 }
762 
763 static void
stub_posixsem_create(struct ucred * cred,struct ksem * ks,struct label * kslabel)764 stub_posixsem_create(struct ucred *cred, struct ksem *ks,
765     struct label *kslabel)
766 {
767 
768 }
769 
770 static int
stub_posixshm_check_create(struct ucred * cred,const char * path)771 stub_posixshm_check_create(struct ucred *cred, const char *path)
772 {
773 
774 	return (0);
775 }
776 
777 static int
stub_posixshm_check_mmap(struct ucred * cred,struct shmfd * shmfd,struct label * shmlabel,int prot,int flags)778 stub_posixshm_check_mmap(struct ucred *cred, struct shmfd *shmfd,
779     struct label *shmlabel, int prot, int flags)
780 {
781 
782 	return (0);
783 }
784 
785 static int
stub_posixshm_check_open(struct ucred * cred,struct shmfd * shmfd,struct label * shmlabel,accmode_t accmode)786 stub_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd,
787     struct label *shmlabel, accmode_t accmode)
788 {
789 
790 	return (0);
791 }
792 
793 static int
stub_posixshm_check_read(struct ucred * active_cred,struct ucred * file_cred,struct shmfd * shm,struct label * shmlabel)794 stub_posixshm_check_read(struct ucred *active_cred, struct ucred *file_cred,
795     struct shmfd *shm, struct label *shmlabel)
796 {
797 
798 	return (0);
799 }
800 
801 static int
stub_posixshm_check_setmode(struct ucred * cred,struct shmfd * shmfd,struct label * shmlabel,mode_t mode)802 stub_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd,
803     struct label *shmlabel, mode_t mode)
804 {
805 
806 	return (0);
807 }
808 
809 static int
stub_posixshm_check_setowner(struct ucred * cred,struct shmfd * shmfd,struct label * shmlabel,uid_t uid,gid_t gid)810 stub_posixshm_check_setowner(struct ucred *cred, struct shmfd *shmfd,
811     struct label *shmlabel, uid_t uid, gid_t gid)
812 {
813 
814 	return (0);
815 }
816 
817 static int
stub_posixshm_check_stat(struct ucred * active_cred,struct ucred * file_cred,struct shmfd * shmfd,struct label * shmlabel)818 stub_posixshm_check_stat(struct ucred *active_cred, struct ucred *file_cred,
819     struct shmfd *shmfd, struct label *shmlabel)
820 {
821 
822 	return (0);
823 }
824 
825 static int
stub_posixshm_check_truncate(struct ucred * active_cred,struct ucred * file_cred,struct shmfd * shmfd,struct label * shmlabel)826 stub_posixshm_check_truncate(struct ucred *active_cred,
827     struct ucred *file_cred, struct shmfd *shmfd, struct label *shmlabel)
828 {
829 
830 	return (0);
831 }
832 
833 static int
stub_posixshm_check_unlink(struct ucred * cred,struct shmfd * shmfd,struct label * shmlabel)834 stub_posixshm_check_unlink(struct ucred *cred, struct shmfd *shmfd,
835     struct label *shmlabel)
836 {
837 
838 	return (0);
839 }
840 
841 static int
stub_posixshm_check_write(struct ucred * active_cred,struct ucred * file_cred,struct shmfd * shm,struct label * shmlabel)842 stub_posixshm_check_write(struct ucred *active_cred, struct ucred *file_cred,
843     struct shmfd *shm, struct label *shmlabel)
844 {
845 
846 	return (0);
847 }
848 
849 static void
stub_posixshm_create(struct ucred * cred,struct shmfd * shmfd,struct label * shmlabel)850 stub_posixshm_create(struct ucred *cred, struct shmfd *shmfd,
851     struct label *shmlabel)
852 {
853 
854 }
855 
856 static void
stub_prison_relabel(struct ucred * cred,struct prison * pr,struct label * prlabel,struct label * newlabel)857 stub_prison_relabel(struct ucred *cred, struct prison *pr,
858     struct label *prlabel, struct label *newlabel)
859 {
860 
861 }
862 
863 static int
stub_prison_check_relabel(struct ucred * cred,struct prison * pr,struct label * prlabel,struct label * newlabel)864 stub_prison_check_relabel(struct ucred *cred, struct prison *pr,
865     struct label *prlabel, struct label *newlabel)
866 {
867 
868 	return (0);
869 }
870 
871 static int
stub_prison_check_attach(struct ucred * cred,struct prison * pr,struct label * prlabel)872 stub_prison_check_attach(struct ucred *cred, struct prison *pr,
873     struct label *prlabel)
874 {
875 
876 	return (0);
877 }
878 
879 static int
stub_prison_check_create(struct ucred * cred,struct vfsoptlist * opts,int flags)880 stub_prison_check_create(struct ucred *cred, struct vfsoptlist *opts, int flags)
881 {
882 
883 	return (0);
884 }
885 
886 static int
stub_prison_check_get(struct ucred * cred,struct prison * pr,struct label * prlabel,struct vfsoptlist * opts,int flags)887 stub_prison_check_get(struct ucred *cred, struct prison *pr,
888     struct label *prlabel, struct vfsoptlist *opts, int flags)
889 {
890 
891 	return (0);
892 }
893 
894 static int
stub_prison_check_set(struct ucred * cred,struct prison * pr,struct label * prlabel,struct vfsoptlist * opts,int flags)895 stub_prison_check_set(struct ucred *cred, struct prison *pr,
896     struct label *prlabel, struct vfsoptlist *opts, int flags)
897 {
898 
899 	return (0);
900 }
901 
902 static int
stub_prison_check_remove(struct ucred * cred,struct prison * pr,struct label * prlabel)903 stub_prison_check_remove(struct ucred *cred, struct prison *pr,
904     struct label *prlabel)
905 {
906 
907 	return (0);
908 }
909 
910 static void
stub_prison_created(struct ucred * cred,struct prison * pr,struct label * prlabel)911 stub_prison_created(struct ucred *cred, struct prison *pr,
912     struct label *prlabel)
913 {
914 
915 }
916 
917 static void
stub_prison_attached(struct ucred * cred,struct prison * pr,struct label * prlabel,struct proc * p,struct label * proclabel)918 stub_prison_attached(struct ucred *cred, struct prison *pr,
919     struct label *prlabel, struct proc *p, struct label *proclabel)
920 {
921 
922 }
923 
924 static int
stub_priv_check(struct ucred * cred,int priv)925 stub_priv_check(struct ucred *cred, int priv)
926 {
927 
928 	return (0);
929 }
930 
931 static int
stub_priv_grant(struct ucred * cred,int priv)932 stub_priv_grant(struct ucred *cred, int priv)
933 {
934 
935 	return (EPERM);
936 }
937 
938 static int
stub_proc_check_debug(struct ucred * cred,struct proc * p)939 stub_proc_check_debug(struct ucred *cred, struct proc *p)
940 {
941 
942 	return (0);
943 }
944 
945 static int
stub_proc_check_sched(struct ucred * cred,struct proc * p)946 stub_proc_check_sched(struct ucred *cred, struct proc *p)
947 {
948 
949 	return (0);
950 }
951 
952 static int
stub_proc_check_signal(struct ucred * cred,struct proc * p,int signum)953 stub_proc_check_signal(struct ucred *cred, struct proc *p, int signum)
954 {
955 
956 	return (0);
957 }
958 
959 static int
stub_proc_check_wait(struct ucred * cred,struct proc * p)960 stub_proc_check_wait(struct ucred *cred, struct proc *p)
961 {
962 
963 	return (0);
964 }
965 
966 static int
stub_socket_check_accept(struct ucred * cred,struct socket * so,struct label * solabel)967 stub_socket_check_accept(struct ucred *cred, struct socket *so,
968     struct label *solabel)
969 {
970 
971 #if 0
972 	SOCK_LOCK(so);
973 	SOCK_UNLOCK(so);
974 #endif
975 
976 	return (0);
977 }
978 
979 static int
stub_socket_check_bind(struct ucred * cred,struct socket * so,struct label * solabel,struct sockaddr * sa)980 stub_socket_check_bind(struct ucred *cred, struct socket *so,
981     struct label *solabel, struct sockaddr *sa)
982 {
983 
984 #if 0
985 	SOCK_LOCK(so);
986 	SOCK_UNLOCK(so);
987 #endif
988 
989 	return (0);
990 }
991 
992 static int
stub_socket_check_connect(struct ucred * cred,struct socket * so,struct label * solabel,struct sockaddr * sa)993 stub_socket_check_connect(struct ucred *cred, struct socket *so,
994     struct label *solabel, struct sockaddr *sa)
995 {
996 
997 #if 0
998 	SOCK_LOCK(so);
999 	SOCK_UNLOCK(so);
1000 #endif
1001 
1002 	return (0);
1003 }
1004 
1005 static int
stub_socket_check_create(struct ucred * cred,int domain,int type,int proto)1006 stub_socket_check_create(struct ucred *cred, int domain, int type, int proto)
1007 {
1008 
1009 	return (0);
1010 }
1011 
1012 static int
stub_socket_check_deliver(struct socket * so,struct label * solabel,struct mbuf * m,struct label * mlabel)1013 stub_socket_check_deliver(struct socket *so, struct label *solabel,
1014     struct mbuf *m, struct label *mlabel)
1015 {
1016 
1017 #if 0
1018 	SOCK_LOCK(so);
1019 	SOCK_UNLOCK(so);
1020 #endif
1021 
1022 	return (0);
1023 }
1024 
1025 static int
stub_socket_check_listen(struct ucred * cred,struct socket * so,struct label * solabel)1026 stub_socket_check_listen(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 int
stub_socket_check_poll(struct ucred * cred,struct socket * so,struct label * solabel)1039 stub_socket_check_poll(struct ucred *cred, struct socket *so,
1040     struct label *solabel)
1041 {
1042 
1043 #if 0
1044 	SOCK_LOCK(so);
1045 	SOCK_UNLOCK(so);
1046 #endif
1047 
1048 	return (0);
1049 }
1050 
1051 static int
stub_socket_check_receive(struct ucred * cred,struct socket * so,struct label * solabel)1052 stub_socket_check_receive(struct ucred *cred, struct socket *so,
1053     struct label *solabel)
1054 {
1055 
1056 #if 0
1057 	SOCK_LOCK(so);
1058 	SOCK_UNLOCK(so);
1059 #endif
1060 
1061 	return (0);
1062 }
1063 
1064 static int
stub_socket_check_relabel(struct ucred * cred,struct socket * so,struct label * solabel,struct label * newlabel)1065 stub_socket_check_relabel(struct ucred *cred, struct socket *so,
1066     struct label *solabel, struct label *newlabel)
1067 {
1068 
1069 	SOCK_LOCK_ASSERT(so);
1070 
1071 	return (0);
1072 }
1073 static int
stub_socket_check_send(struct ucred * cred,struct socket * so,struct label * solabel)1074 stub_socket_check_send(struct ucred *cred, struct socket *so,
1075     struct label *solabel)
1076 {
1077 
1078 #if 0
1079 	SOCK_LOCK(so);
1080 	SOCK_UNLOCK(so);
1081 #endif
1082 
1083 	return (0);
1084 }
1085 
1086 static int
stub_socket_check_stat(struct ucred * cred,struct socket * so,struct label * solabel)1087 stub_socket_check_stat(struct ucred *cred, struct socket *so,
1088     struct label *solabel)
1089 {
1090 
1091 #if 0
1092 	SOCK_LOCK(so);
1093 	SOCK_UNLOCK(so);
1094 #endif
1095 
1096 	return (0);
1097 }
1098 
1099 static int
stub_inpcb_check_visible(struct ucred * cred,struct inpcb * inp,struct label * inplabel)1100 stub_inpcb_check_visible(struct ucred *cred, struct inpcb *inp,
1101    struct label *inplabel)
1102 {
1103 
1104 	return (0);
1105 }
1106 
1107 static int
stub_socket_check_visible(struct ucred * cred,struct socket * so,struct label * solabel)1108 stub_socket_check_visible(struct ucred *cred, struct socket *so,
1109    struct label *solabel)
1110 {
1111 
1112 #if 0
1113 	SOCK_LOCK(so);
1114 	SOCK_UNLOCK(so);
1115 #endif
1116 
1117 	return (0);
1118 }
1119 
1120 static void
stub_socket_create(struct ucred * cred,struct socket * so,struct label * solabel)1121 stub_socket_create(struct ucred *cred, struct socket *so,
1122     struct label *solabel)
1123 {
1124 
1125 }
1126 
1127 static void
stub_socket_create_mbuf(struct socket * so,struct label * solabel,struct mbuf * m,struct label * mlabel)1128 stub_socket_create_mbuf(struct socket *so, struct label *solabel,
1129     struct mbuf *m, struct label *mlabel)
1130 {
1131 
1132 #if 0
1133 	SOCK_LOCK(so);
1134 	SOCK_UNLOCK(so);
1135 #endif
1136 }
1137 
1138 static void
stub_socket_newconn(struct socket * oldso,struct label * oldsolabel,struct socket * newso,struct label * newsolabel)1139 stub_socket_newconn(struct socket *oldso, struct label *oldsolabel,
1140     struct socket *newso, struct label *newsolabel)
1141 {
1142 
1143 #if 0
1144 	SOCK_LOCK(oldso);
1145 	SOCK_UNLOCK(oldso);
1146 #endif
1147 #if 0
1148 	SOCK_LOCK(newso);
1149 	SOCK_UNLOCK(newso);
1150 #endif
1151 }
1152 
1153 static void
stub_socket_relabel(struct ucred * cred,struct socket * so,struct label * solabel,struct label * newlabel)1154 stub_socket_relabel(struct ucred *cred, struct socket *so,
1155     struct label *solabel, struct label *newlabel)
1156 {
1157 
1158 	SOCK_LOCK_ASSERT(so);
1159 }
1160 
1161 static void
stub_socketpeer_set_from_mbuf(struct mbuf * m,struct label * mlabel,struct socket * so,struct label * sopeerlabel)1162 stub_socketpeer_set_from_mbuf(struct mbuf *m, struct label *mlabel,
1163     struct socket *so, struct label *sopeerlabel)
1164 {
1165 
1166 #if 0
1167 	SOCK_LOCK(so);
1168 	SOCK_UNLOCK(so);
1169 #endif
1170 }
1171 
1172 static void
stub_socketpeer_set_from_socket(struct socket * oldso,struct label * oldsolabel,struct socket * newso,struct label * newsopeerlabel)1173 stub_socketpeer_set_from_socket(struct socket *oldso,
1174     struct label *oldsolabel, struct socket *newso,
1175     struct label *newsopeerlabel)
1176 {
1177 
1178 #if 0
1179 	SOCK_LOCK(oldso);
1180 	SOCK_UNLOCK(oldso);
1181 #endif
1182 #if 0
1183 	SOCK_LOCK(newso);
1184 	SOCK_UNLOCK(newso);
1185 #endif
1186 }
1187 
1188 static void
stub_syncache_create(struct label * label,struct inpcb * inp)1189 stub_syncache_create(struct label *label, struct inpcb *inp)
1190 {
1191 
1192 }
1193 
1194 static void
stub_syncache_create_mbuf(struct label * sc_label,struct mbuf * m,struct label * mlabel)1195 stub_syncache_create_mbuf(struct label *sc_label, struct mbuf *m,
1196     struct label *mlabel)
1197 {
1198 
1199 }
1200 
1201 static int
stub_system_check_acct(struct ucred * cred,struct vnode * vp,struct label * vplabel)1202 stub_system_check_acct(struct ucred *cred, struct vnode *vp,
1203     struct label *vplabel)
1204 {
1205 
1206 	return (0);
1207 }
1208 
1209 static int
stub_system_check_audit(struct ucred * cred,void * record,int length)1210 stub_system_check_audit(struct ucred *cred, void *record, int length)
1211 {
1212 
1213 	return (0);
1214 }
1215 
1216 static int
stub_system_check_auditctl(struct ucred * cred,struct vnode * vp,struct label * vplabel)1217 stub_system_check_auditctl(struct ucred *cred, struct vnode *vp,
1218     struct label *vplabel)
1219 {
1220 
1221 	return (0);
1222 }
1223 
1224 static int
stub_system_check_auditon(struct ucred * cred,int cmd)1225 stub_system_check_auditon(struct ucred *cred, int cmd)
1226 {
1227 
1228 	return (0);
1229 }
1230 
1231 static int
stub_system_check_reboot(struct ucred * cred,int how)1232 stub_system_check_reboot(struct ucred *cred, int how)
1233 {
1234 
1235 	return (0);
1236 }
1237 
1238 static int
stub_system_check_swapoff(struct ucred * cred,struct vnode * vp,struct label * vplabel)1239 stub_system_check_swapoff(struct ucred *cred, struct vnode *vp,
1240     struct label *vplabel)
1241 {
1242 
1243 	return (0);
1244 }
1245 
1246 static int
stub_system_check_swapon(struct ucred * cred,struct vnode * vp,struct label * vplabel)1247 stub_system_check_swapon(struct ucred *cred, struct vnode *vp,
1248     struct label *vplabel)
1249 {
1250 
1251 	return (0);
1252 }
1253 
1254 static int
stub_system_check_sysctl(struct ucred * cred,struct sysctl_oid * oidp,void * arg1,int arg2,struct sysctl_req * req)1255 stub_system_check_sysctl(struct ucred *cred, struct sysctl_oid *oidp,
1256     void *arg1, int arg2, struct sysctl_req *req)
1257 {
1258 
1259 	return (0);
1260 }
1261 
1262 static void
stub_sysvmsg_cleanup(struct label * msglabel)1263 stub_sysvmsg_cleanup(struct label *msglabel)
1264 {
1265 
1266 }
1267 
1268 static void
stub_sysvmsg_create(struct ucred * cred,struct msqid_kernel * msqkptr,struct label * msqlabel,struct msg * msgptr,struct label * msglabel)1269 stub_sysvmsg_create(struct ucred *cred, struct msqid_kernel *msqkptr,
1270     struct label *msqlabel, struct msg *msgptr, struct label *msglabel)
1271 {
1272 
1273 }
1274 
1275 static int
stub_sysvmsq_check_msgmsq(struct ucred * cred,struct msg * msgptr,struct label * msglabel,struct msqid_kernel * msqkptr,struct label * msqklabel)1276 stub_sysvmsq_check_msgmsq(struct ucred *cred, struct msg *msgptr,
1277     struct label *msglabel, struct msqid_kernel *msqkptr,
1278     struct label *msqklabel)
1279 {
1280 
1281 	return (0);
1282 }
1283 
1284 static int
stub_sysvmsq_check_msgrcv(struct ucred * cred,struct msg * msgptr,struct label * msglabel)1285 stub_sysvmsq_check_msgrcv(struct ucred *cred, struct msg *msgptr,
1286     struct label *msglabel)
1287 {
1288 
1289 	return (0);
1290 }
1291 
1292 static int
stub_sysvmsq_check_msgrmid(struct ucred * cred,struct msg * msgptr,struct label * msglabel)1293 stub_sysvmsq_check_msgrmid(struct ucred *cred, struct msg *msgptr,
1294     struct label *msglabel)
1295 {
1296 
1297 	return (0);
1298 }
1299 
1300 static int
stub_sysvmsq_check_msqget(struct ucred * cred,struct msqid_kernel * msqkptr,struct label * msqklabel)1301 stub_sysvmsq_check_msqget(struct ucred *cred, struct msqid_kernel *msqkptr,
1302     struct label *msqklabel)
1303 {
1304 
1305 	return (0);
1306 }
1307 
1308 static int
stub_sysvmsq_check_msqsnd(struct ucred * cred,struct msqid_kernel * msqkptr,struct label * msqklabel)1309 stub_sysvmsq_check_msqsnd(struct ucred *cred, struct msqid_kernel *msqkptr,
1310     struct label *msqklabel)
1311 {
1312 
1313 	return (0);
1314 }
1315 
1316 static int
stub_sysvmsq_check_msqrcv(struct ucred * cred,struct msqid_kernel * msqkptr,struct label * msqklabel)1317 stub_sysvmsq_check_msqrcv(struct ucred *cred, struct msqid_kernel *msqkptr,
1318     struct label *msqklabel)
1319 {
1320 
1321 	return (0);
1322 }
1323 
1324 static int
stub_sysvmsq_check_msqctl(struct ucred * cred,struct msqid_kernel * msqkptr,struct label * msqklabel,int cmd)1325 stub_sysvmsq_check_msqctl(struct ucred *cred, struct msqid_kernel *msqkptr,
1326     struct label *msqklabel, int cmd)
1327 {
1328 
1329 	return (0);
1330 }
1331 
1332 static void
stub_sysvmsq_cleanup(struct label * msqlabel)1333 stub_sysvmsq_cleanup(struct label *msqlabel)
1334 {
1335 
1336 }
1337 
1338 static void
stub_sysvmsq_create(struct ucred * cred,struct msqid_kernel * msqkptr,struct label * msqlabel)1339 stub_sysvmsq_create(struct ucred *cred, struct msqid_kernel *msqkptr,
1340     struct label *msqlabel)
1341 {
1342 
1343 }
1344 
1345 static int
stub_sysvsem_check_semctl(struct ucred * cred,struct semid_kernel * semakptr,struct label * semaklabel,int cmd)1346 stub_sysvsem_check_semctl(struct ucred *cred, struct semid_kernel *semakptr,
1347     struct label *semaklabel, int cmd)
1348 {
1349 
1350 	return (0);
1351 }
1352 
1353 static int
stub_sysvsem_check_semget(struct ucred * cred,struct semid_kernel * semakptr,struct label * semaklabel)1354 stub_sysvsem_check_semget(struct ucred *cred, struct semid_kernel *semakptr,
1355     struct label *semaklabel)
1356 {
1357 
1358 	return (0);
1359 }
1360 
1361 static int
stub_sysvsem_check_semop(struct ucred * cred,struct semid_kernel * semakptr,struct label * semaklabel,size_t accesstype)1362 stub_sysvsem_check_semop(struct ucred *cred, struct semid_kernel *semakptr,
1363     struct label *semaklabel, size_t accesstype)
1364 {
1365 
1366 	return (0);
1367 }
1368 
1369 static void
stub_sysvsem_cleanup(struct label * semalabel)1370 stub_sysvsem_cleanup(struct label *semalabel)
1371 {
1372 
1373 }
1374 
1375 static void
stub_sysvsem_create(struct ucred * cred,struct semid_kernel * semakptr,struct label * semalabel)1376 stub_sysvsem_create(struct ucred *cred, struct semid_kernel *semakptr,
1377     struct label *semalabel)
1378 {
1379 
1380 }
1381 
1382 static int
stub_sysvshm_check_shmat(struct ucred * cred,struct shmid_kernel * shmsegptr,struct label * shmseglabel,int shmflg)1383 stub_sysvshm_check_shmat(struct ucred *cred, struct shmid_kernel *shmsegptr,
1384     struct label *shmseglabel, int shmflg)
1385 {
1386 
1387 	return (0);
1388 }
1389 
1390 static int
stub_sysvshm_check_shmctl(struct ucred * cred,struct shmid_kernel * shmsegptr,struct label * shmseglabel,int cmd)1391 stub_sysvshm_check_shmctl(struct ucred *cred, struct shmid_kernel *shmsegptr,
1392     struct label *shmseglabel, int cmd)
1393 {
1394 
1395 	return (0);
1396 }
1397 
1398 static int
stub_sysvshm_check_shmdt(struct ucred * cred,struct shmid_kernel * shmsegptr,struct label * shmseglabel)1399 stub_sysvshm_check_shmdt(struct ucred *cred, struct shmid_kernel *shmsegptr,
1400     struct label *shmseglabel)
1401 {
1402 
1403 	return (0);
1404 }
1405 
1406 static int
stub_sysvshm_check_shmget(struct ucred * cred,struct shmid_kernel * shmsegptr,struct label * shmseglabel,int shmflg)1407 stub_sysvshm_check_shmget(struct ucred *cred, struct shmid_kernel *shmsegptr,
1408     struct label *shmseglabel, int shmflg)
1409 {
1410 
1411 	return (0);
1412 }
1413 
1414 static void
stub_sysvshm_cleanup(struct label * shmlabel)1415 stub_sysvshm_cleanup(struct label *shmlabel)
1416 {
1417 
1418 }
1419 
1420 static void
stub_sysvshm_create(struct ucred * cred,struct shmid_kernel * shmsegptr,struct label * shmalabel)1421 stub_sysvshm_create(struct ucred *cred, struct shmid_kernel *shmsegptr,
1422     struct label *shmalabel)
1423 {
1424 
1425 }
1426 
1427 static void
stub_thread_userret(struct thread * td)1428 stub_thread_userret(struct thread *td)
1429 {
1430 
1431 }
1432 
1433 static int
stub_vnode_associate_extattr(struct mount * mp,struct label * mplabel,struct vnode * vp,struct label * vplabel)1434 stub_vnode_associate_extattr(struct mount *mp, struct label *mplabel,
1435     struct vnode *vp, struct label *vplabel)
1436 {
1437 
1438 	return (0);
1439 }
1440 
1441 static void
stub_vnode_associate_singlelabel(struct mount * mp,struct label * mplabel,struct vnode * vp,struct label * vplabel)1442 stub_vnode_associate_singlelabel(struct mount *mp, struct label *mplabel,
1443     struct vnode *vp, struct label *vplabel)
1444 {
1445 
1446 }
1447 
1448 static int
stub_vnode_check_access(struct ucred * cred,struct vnode * vp,struct label * vplabel,accmode_t accmode)1449 stub_vnode_check_access(struct ucred *cred, struct vnode *vp,
1450     struct label *vplabel, accmode_t accmode)
1451 {
1452 
1453 	return (0);
1454 }
1455 
1456 static int
stub_vnode_check_chdir(struct ucred * cred,struct vnode * dvp,struct label * dvplabel)1457 stub_vnode_check_chdir(struct ucred *cred, struct vnode *dvp,
1458     struct label *dvplabel)
1459 {
1460 
1461 	return (0);
1462 }
1463 
1464 static int
stub_vnode_check_chroot(struct ucred * cred,struct vnode * dvp,struct label * dvplabel)1465 stub_vnode_check_chroot(struct ucred *cred, struct vnode *dvp,
1466     struct label *dvplabel)
1467 {
1468 
1469 	return (0);
1470 }
1471 
1472 static int
stub_vnode_check_create(struct ucred * cred,struct vnode * dvp,struct label * dvplabel,struct componentname * cnp,struct vattr * vap)1473 stub_vnode_check_create(struct ucred *cred, struct vnode *dvp,
1474     struct label *dvplabel, struct componentname *cnp, struct vattr *vap)
1475 {
1476 
1477 	return (0);
1478 }
1479 
1480 static int
stub_vnode_check_deleteacl(struct ucred * cred,struct vnode * vp,struct label * vplabel,acl_type_t type)1481 stub_vnode_check_deleteacl(struct ucred *cred, struct vnode *vp,
1482     struct label *vplabel, acl_type_t type)
1483 {
1484 
1485 	return (0);
1486 }
1487 
1488 static int
stub_vnode_check_deleteextattr(struct ucred * cred,struct vnode * vp,struct label * vplabel,int attrnamespace,const char * name)1489 stub_vnode_check_deleteextattr(struct ucred *cred, struct vnode *vp,
1490     struct label *vplabel, int attrnamespace, const char *name)
1491 {
1492 
1493 	return (0);
1494 }
1495 
1496 static int
stub_vnode_check_exec(struct ucred * cred,struct vnode * vp,struct label * vplabel,struct image_params * imgp,struct label * execlabel)1497 stub_vnode_check_exec(struct ucred *cred, struct vnode *vp,
1498     struct label *vplabel, struct image_params *imgp,
1499     struct label *execlabel)
1500 {
1501 
1502 	return (0);
1503 }
1504 
1505 static int
stub_vnode_check_getacl(struct ucred * cred,struct vnode * vp,struct label * vplabel,acl_type_t type)1506 stub_vnode_check_getacl(struct ucred *cred, struct vnode *vp,
1507     struct label *vplabel, acl_type_t type)
1508 {
1509 
1510 	return (0);
1511 }
1512 
1513 static int
stub_vnode_check_getextattr(struct ucred * cred,struct vnode * vp,struct label * vplabel,int attrnamespace,const char * name)1514 stub_vnode_check_getextattr(struct ucred *cred, struct vnode *vp,
1515     struct label *vplabel, int attrnamespace, const char *name)
1516 {
1517 
1518 	return (0);
1519 }
1520 
1521 static int
stub_vnode_check_link(struct ucred * cred,struct vnode * dvp,struct label * dvplabel,struct vnode * vp,struct label * vplabel,struct componentname * cnp)1522 stub_vnode_check_link(struct ucred *cred, struct vnode *dvp,
1523     struct label *dvplabel, struct vnode *vp, struct label *vplabel,
1524     struct componentname *cnp)
1525 {
1526 
1527 	return (0);
1528 }
1529 
1530 static int
stub_vnode_check_listextattr(struct ucred * cred,struct vnode * vp,struct label * vplabel,int attrnamespace)1531 stub_vnode_check_listextattr(struct ucred *cred, struct vnode *vp,
1532     struct label *vplabel, int attrnamespace)
1533 {
1534 
1535 	return (0);
1536 }
1537 
1538 static int
stub_vnode_check_lookup(struct ucred * cred,struct vnode * dvp,struct label * dvplabel,struct componentname * cnp)1539 stub_vnode_check_lookup(struct ucred *cred, struct vnode *dvp,
1540     struct label *dvplabel, struct componentname *cnp)
1541 {
1542 
1543 	return (0);
1544 }
1545 
1546 static int
stub_vnode_check_mmap(struct ucred * cred,struct vnode * vp,struct label * vplabel,int prot,int flags)1547 stub_vnode_check_mmap(struct ucred *cred, struct vnode *vp,
1548     struct label *vplabel, int prot, int flags)
1549 {
1550 
1551 	return (0);
1552 }
1553 
1554 static void
stub_vnode_check_mmap_downgrade(struct ucred * cred,struct vnode * vp,struct label * vplabel,int * prot)1555 stub_vnode_check_mmap_downgrade(struct ucred *cred, struct vnode *vp,
1556     struct label *vplabel, int *prot)
1557 {
1558 
1559 }
1560 
1561 static int
stub_vnode_check_mprotect(struct ucred * cred,struct vnode * vp,struct label * vplabel,int prot)1562 stub_vnode_check_mprotect(struct ucred *cred, struct vnode *vp,
1563     struct label *vplabel, int prot)
1564 {
1565 
1566 	return (0);
1567 }
1568 
1569 static int
stub_vnode_check_open(struct ucred * cred,struct vnode * vp,struct label * vplabel,accmode_t accmode)1570 stub_vnode_check_open(struct ucred *cred, struct vnode *vp,
1571     struct label *vplabel, accmode_t accmode)
1572 {
1573 
1574 	return (0);
1575 }
1576 
1577 static int
stub_vnode_check_poll(struct ucred * active_cred,struct ucred * file_cred,struct vnode * vp,struct label * vplabel)1578 stub_vnode_check_poll(struct ucred *active_cred, struct ucred *file_cred,
1579     struct vnode *vp, struct label *vplabel)
1580 {
1581 
1582 	return (0);
1583 }
1584 
1585 static int
stub_vnode_check_read(struct ucred * active_cred,struct ucred * file_cred,struct vnode * vp,struct label * vplabel)1586 stub_vnode_check_read(struct ucred *active_cred, struct ucred *file_cred,
1587     struct vnode *vp, struct label *vplabel)
1588 {
1589 
1590 	return (0);
1591 }
1592 
1593 static int
stub_vnode_check_readdir(struct ucred * cred,struct vnode * vp,struct label * dvplabel)1594 stub_vnode_check_readdir(struct ucred *cred, struct vnode *vp,
1595     struct label *dvplabel)
1596 {
1597 
1598 	return (0);
1599 }
1600 
1601 static int
stub_vnode_check_readlink(struct ucred * cred,struct vnode * vp,struct label * vplabel)1602 stub_vnode_check_readlink(struct ucred *cred, struct vnode *vp,
1603     struct label *vplabel)
1604 {
1605 
1606 	return (0);
1607 }
1608 
1609 static int
stub_vnode_check_relabel(struct ucred * cred,struct vnode * vp,struct label * vplabel,struct label * newlabel)1610 stub_vnode_check_relabel(struct ucred *cred, struct vnode *vp,
1611     struct label *vplabel, struct label *newlabel)
1612 {
1613 
1614 	return (0);
1615 }
1616 
1617 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)1618 stub_vnode_check_rename_from(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
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)1627 stub_vnode_check_rename_to(struct ucred *cred, struct vnode *dvp,
1628     struct label *dvplabel, struct vnode *vp, struct label *vplabel,
1629     int samedir, struct componentname *cnp)
1630 {
1631 
1632 	return (0);
1633 }
1634 
1635 static int
stub_vnode_check_revoke(struct ucred * cred,struct vnode * vp,struct label * vplabel)1636 stub_vnode_check_revoke(struct ucred *cred, struct vnode *vp,
1637     struct label *vplabel)
1638 {
1639 
1640 	return (0);
1641 }
1642 
1643 static int
stub_vnode_check_setacl(struct ucred * cred,struct vnode * vp,struct label * vplabel,acl_type_t type,struct acl * acl)1644 stub_vnode_check_setacl(struct ucred *cred, struct vnode *vp,
1645     struct label *vplabel, acl_type_t type, struct acl *acl)
1646 {
1647 
1648 	return (0);
1649 }
1650 
1651 static int
stub_vnode_check_setextattr(struct ucred * cred,struct vnode * vp,struct label * vplabel,int attrnamespace,const char * name)1652 stub_vnode_check_setextattr(struct ucred *cred, struct vnode *vp,
1653     struct label *vplabel, int attrnamespace, const char *name)
1654 {
1655 
1656 	return (0);
1657 }
1658 
1659 static int
stub_vnode_check_setflags(struct ucred * cred,struct vnode * vp,struct label * vplabel,u_long flags)1660 stub_vnode_check_setflags(struct ucred *cred, struct vnode *vp,
1661     struct label *vplabel, u_long flags)
1662 {
1663 
1664 	return (0);
1665 }
1666 
1667 static int
stub_vnode_check_setmode(struct ucred * cred,struct vnode * vp,struct label * vplabel,mode_t mode)1668 stub_vnode_check_setmode(struct ucred *cred, struct vnode *vp,
1669     struct label *vplabel, mode_t mode)
1670 {
1671 
1672 	return (0);
1673 }
1674 
1675 static int
stub_vnode_check_setowner(struct ucred * cred,struct vnode * vp,struct label * vplabel,uid_t uid,gid_t gid)1676 stub_vnode_check_setowner(struct ucred *cred, struct vnode *vp,
1677     struct label *vplabel, uid_t uid, gid_t gid)
1678 {
1679 
1680 	return (0);
1681 }
1682 
1683 static int
stub_vnode_check_setutimes(struct ucred * cred,struct vnode * vp,struct label * vplabel,struct timespec atime,struct timespec mtime)1684 stub_vnode_check_setutimes(struct ucred *cred, struct vnode *vp,
1685     struct label *vplabel, struct timespec atime, struct timespec mtime)
1686 {
1687 
1688 	return (0);
1689 }
1690 
1691 static int
stub_vnode_check_stat(struct ucred * active_cred,struct ucred * file_cred,struct vnode * vp,struct label * vplabel)1692 stub_vnode_check_stat(struct ucred *active_cred, struct ucred *file_cred,
1693     struct vnode *vp, struct label *vplabel)
1694 {
1695 
1696 	return (0);
1697 }
1698 
1699 static int
stub_vnode_check_unlink(struct ucred * cred,struct vnode * dvp,struct label * dvplabel,struct vnode * vp,struct label * vplabel,struct componentname * cnp)1700 stub_vnode_check_unlink(struct ucred *cred, struct vnode *dvp,
1701     struct label *dvplabel, struct vnode *vp, struct label *vplabel,
1702     struct componentname *cnp)
1703 {
1704 
1705 	return (0);
1706 }
1707 
1708 static int
stub_vnode_check_write(struct ucred * active_cred,struct ucred * file_cred,struct vnode * vp,struct label * vplabel)1709 stub_vnode_check_write(struct ucred *active_cred, struct ucred *file_cred,
1710     struct vnode *vp, struct label *vplabel)
1711 {
1712 
1713 	return (0);
1714 }
1715 
1716 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)1717 stub_vnode_create_extattr(struct ucred *cred, struct mount *mp,
1718     struct label *mntlabel, struct vnode *dvp, struct label *dvplabel,
1719     struct vnode *vp, struct label *vplabel, struct componentname *cnp)
1720 {
1721 
1722 	return (0);
1723 }
1724 
1725 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)1726 stub_vnode_execve_transition(struct ucred *old, struct ucred *new,
1727     struct vnode *vp, struct label *vplabel, struct label *interpvplabel,
1728     struct image_params *imgp, struct label *execlabel)
1729 {
1730 
1731 }
1732 
1733 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)1734 stub_vnode_execve_will_transition(struct ucred *old, struct vnode *vp,
1735     struct label *vplabel, struct label *interpvplabel,
1736     struct image_params *imgp, struct label *execlabel)
1737 {
1738 
1739 	return (0);
1740 }
1741 
1742 static void
stub_vnode_relabel(struct ucred * cred,struct vnode * vp,struct label * vplabel,struct label * label)1743 stub_vnode_relabel(struct ucred *cred, struct vnode *vp,
1744     struct label *vplabel, struct label *label)
1745 {
1746 
1747 }
1748 
1749 static int
stub_vnode_setlabel_extattr(struct ucred * cred,struct vnode * vp,struct label * vplabel,struct label * intlabel)1750 stub_vnode_setlabel_extattr(struct ucred *cred, struct vnode *vp,
1751     struct label *vplabel, struct label *intlabel)
1752 {
1753 
1754 	return (0);
1755 }
1756 
1757 /*
1758  * Register functions with MAC Framework policy entry points.
1759  */
1760 static struct mac_policy_ops stub_ops =
1761 {
1762 	.mpo_destroy = stub_destroy,
1763 	.mpo_init = stub_init,
1764 	.mpo_syscall = stub_syscall,
1765 
1766 	.mpo_bpfdesc_check_receive = stub_bpfdesc_check_receive,
1767 	.mpo_bpfdesc_create = stub_bpfdesc_create,
1768 	.mpo_bpfdesc_create_mbuf = stub_bpfdesc_create_mbuf,
1769 	.mpo_bpfdesc_destroy_label = stub_destroy_label,
1770 	.mpo_bpfdesc_init_label = stub_init_label,
1771 
1772 	.mpo_cred_associate_nfsd = stub_cred_associate_nfsd,
1773 	.mpo_cred_check_relabel = stub_cred_check_relabel,
1774 	.mpo_cred_check_setaudit = stub_cred_check_setaudit,
1775 	.mpo_cred_check_setaudit_addr = stub_cred_check_setaudit_addr,
1776 	.mpo_cred_check_setauid = stub_cred_check_setauid,
1777 	.mpo_cred_setcred_enter = stub_cred_setcred_enter,
1778 	.mpo_cred_check_setcred = stub_cred_check_setcred,
1779 	.mpo_cred_setcred_exit = stub_cred_setcred_exit,
1780 	.mpo_cred_check_setegid = stub_cred_check_setegid,
1781 	.mpo_cred_check_seteuid = stub_cred_check_seteuid,
1782 	.mpo_cred_check_setgid = stub_cred_check_setgid,
1783 	.mpo_cred_check_setgroups = stub_cred_check_setgroups,
1784 	.mpo_cred_check_setregid = stub_cred_check_setregid,
1785 	.mpo_cred_check_setresgid = stub_cred_check_setresgid,
1786 	.mpo_cred_check_setresuid = stub_cred_check_setresuid,
1787 	.mpo_cred_check_setreuid = stub_cred_check_setreuid,
1788 	.mpo_cred_check_setuid = stub_cred_check_setuid,
1789 	.mpo_cred_check_visible = stub_cred_check_visible,
1790 	.mpo_cred_copy_label = stub_copy_label,
1791 	.mpo_cred_create_init = stub_cred_create_init,
1792 	.mpo_cred_create_kproc0 = stub_cred_create_kproc0,
1793 	.mpo_cred_destroy_label = stub_destroy_label,
1794 	.mpo_cred_externalize_label = stub_externalize_label,
1795 	.mpo_cred_init_label = stub_init_label,
1796 	.mpo_cred_internalize_label = stub_internalize_label,
1797 	.mpo_cred_relabel= stub_cred_relabel,
1798 
1799 	.mpo_ddb_command_exec = stub_ddb_command_exec,
1800 	.mpo_ddb_command_register = stub_ddb_command_register,
1801 
1802 	.mpo_devfs_create_device = stub_devfs_create_device,
1803 	.mpo_devfs_create_directory = stub_devfs_create_directory,
1804 	.mpo_devfs_create_symlink = stub_devfs_create_symlink,
1805 	.mpo_devfs_destroy_label = stub_destroy_label,
1806 	.mpo_devfs_init_label = stub_init_label,
1807 	.mpo_devfs_update = stub_devfs_update,
1808 	.mpo_devfs_vnode_associate = stub_devfs_vnode_associate,
1809 
1810 	.mpo_ifnet_check_relabel = stub_ifnet_check_relabel,
1811 	.mpo_ifnet_check_transmit = stub_ifnet_check_transmit,
1812 	.mpo_ifnet_copy_label = stub_copy_label,
1813 	.mpo_ifnet_create = stub_ifnet_create,
1814 	.mpo_ifnet_create_mbuf = stub_ifnet_create_mbuf,
1815 	.mpo_ifnet_destroy_label = stub_destroy_label,
1816 	.mpo_ifnet_externalize_label = stub_externalize_label,
1817 	.mpo_ifnet_init_label = stub_init_label,
1818 	.mpo_ifnet_internalize_label = stub_internalize_label,
1819 	.mpo_ifnet_relabel = stub_ifnet_relabel,
1820 
1821 	.mpo_inpcb_check_deliver = stub_inpcb_check_deliver,
1822 	.mpo_inpcb_check_visible = stub_inpcb_check_visible,
1823 	.mpo_inpcb_create = stub_inpcb_create,
1824 	.mpo_inpcb_create_mbuf = stub_inpcb_create_mbuf,
1825 	.mpo_inpcb_destroy_label = stub_destroy_label,
1826 	.mpo_inpcb_init_label = stub_init_label_waitcheck,
1827 	.mpo_inpcb_sosetlabel = stub_inpcb_sosetlabel,
1828 
1829 	.mpo_ip6q_create = stub_ip6q_create,
1830 	.mpo_ip6q_destroy_label = stub_destroy_label,
1831 	.mpo_ip6q_init_label = stub_init_label_waitcheck,
1832 	.mpo_ip6q_match = stub_ip6q_match,
1833 	.mpo_ip6q_update = stub_ip6q_update,
1834 	.mpo_ip6q_reassemble = stub_ip6q_reassemble,
1835 
1836 	.mpo_ipq_create = stub_ipq_create,
1837 	.mpo_ipq_destroy_label = stub_destroy_label,
1838 	.mpo_ipq_init_label = stub_init_label_waitcheck,
1839 	.mpo_ipq_match = stub_ipq_match,
1840 	.mpo_ipq_update = stub_ipq_update,
1841 	.mpo_ipq_reassemble = stub_ipq_reassemble,
1842 
1843 	.mpo_kdb_check_backend = stub_kdb_check_backend,
1844 
1845 	.mpo_kenv_check_dump = stub_kenv_check_dump,
1846 	.mpo_kenv_check_get = stub_kenv_check_get,
1847 	.mpo_kenv_check_set = stub_kenv_check_set,
1848 	.mpo_kenv_check_unset = stub_kenv_check_unset,
1849 
1850 	.mpo_kld_check_load = stub_kld_check_load,
1851 	.mpo_kld_check_stat = stub_kld_check_stat,
1852 
1853 	.mpo_mbuf_copy_label = stub_copy_label,
1854 	.mpo_mbuf_destroy_label = stub_destroy_label,
1855 	.mpo_mbuf_init_label = stub_init_label_waitcheck,
1856 
1857 	.mpo_mount_check_stat = stub_mount_check_stat,
1858 	.mpo_mount_create = stub_mount_create,
1859 	.mpo_mount_destroy_label = stub_destroy_label,
1860 	.mpo_mount_init_label = stub_init_label,
1861 
1862 	.mpo_netinet_arp_send = stub_netinet_arp_send,
1863 	.mpo_netinet_firewall_reply = stub_netinet_firewall_reply,
1864 	.mpo_netinet_firewall_send = stub_netinet_firewall_send,
1865 	.mpo_netinet_fragment = stub_netinet_fragment,
1866 	.mpo_netinet_icmp_reply = stub_netinet_icmp_reply,
1867 	.mpo_netinet_icmp_replyinplace = stub_netinet_icmp_replyinplace,
1868 	.mpo_netinet_tcp_reply = stub_netinet_tcp_reply,
1869 	.mpo_netinet_igmp_send = stub_netinet_igmp_send,
1870 
1871 	.mpo_netinet6_nd6_send = stub_netinet6_nd6_send,
1872 
1873 	.mpo_pipe_check_ioctl = stub_pipe_check_ioctl,
1874 	.mpo_pipe_check_poll = stub_pipe_check_poll,
1875 	.mpo_pipe_check_read = stub_pipe_check_read,
1876 	.mpo_pipe_check_relabel = stub_pipe_check_relabel,
1877 	.mpo_pipe_check_stat = stub_pipe_check_stat,
1878 	.mpo_pipe_check_write = stub_pipe_check_write,
1879 	.mpo_pipe_copy_label = stub_copy_label,
1880 	.mpo_pipe_create = stub_pipe_create,
1881 	.mpo_pipe_destroy_label = stub_destroy_label,
1882 	.mpo_pipe_externalize_label = stub_externalize_label,
1883 	.mpo_pipe_init_label = stub_init_label,
1884 	.mpo_pipe_internalize_label = stub_internalize_label,
1885 	.mpo_pipe_relabel = stub_pipe_relabel,
1886 
1887 	.mpo_posixsem_check_getvalue = stub_posixsem_check_getvalue,
1888 	.mpo_posixsem_check_open = stub_posixsem_check_open,
1889 	.mpo_posixsem_check_post = stub_posixsem_check_post,
1890 	.mpo_posixsem_check_setmode = stub_posixsem_check_setmode,
1891 	.mpo_posixsem_check_setowner = stub_posixsem_check_setowner,
1892 	.mpo_posixsem_check_stat = stub_posixsem_check_stat,
1893 	.mpo_posixsem_check_unlink = stub_posixsem_check_unlink,
1894 	.mpo_posixsem_check_wait = stub_posixsem_check_wait,
1895 	.mpo_posixsem_create = stub_posixsem_create,
1896 	.mpo_posixsem_destroy_label = stub_destroy_label,
1897 	.mpo_posixsem_init_label = stub_init_label,
1898 
1899 	.mpo_posixshm_check_create = stub_posixshm_check_create,
1900 	.mpo_posixshm_check_mmap = stub_posixshm_check_mmap,
1901 	.mpo_posixshm_check_open = stub_posixshm_check_open,
1902 	.mpo_posixshm_check_read = stub_posixshm_check_read,
1903 	.mpo_posixshm_check_setmode = stub_posixshm_check_setmode,
1904 	.mpo_posixshm_check_setowner = stub_posixshm_check_setowner,
1905 	.mpo_posixshm_check_stat = stub_posixshm_check_stat,
1906 	.mpo_posixshm_check_truncate = stub_posixshm_check_truncate,
1907 	.mpo_posixshm_check_unlink = stub_posixshm_check_unlink,
1908 	.mpo_posixshm_check_write = stub_posixshm_check_write,
1909 	.mpo_posixshm_create = stub_posixshm_create,
1910 	.mpo_posixshm_destroy_label = stub_destroy_label,
1911 	.mpo_posixshm_init_label = stub_init_label,
1912 
1913 	.mpo_prison_init_label = stub_init_label_waitcheck,
1914 	.mpo_prison_destroy_label = stub_destroy_label,
1915 	.mpo_prison_copy_label = stub_copy_label,
1916 	.mpo_prison_externalize_label = stub_externalize_label,
1917 	.mpo_prison_internalize_label = stub_internalize_label,
1918 	.mpo_prison_relabel = stub_prison_relabel,
1919 	.mpo_prison_check_relabel = stub_prison_check_relabel,
1920 	.mpo_prison_check_attach = stub_prison_check_attach,
1921 	.mpo_prison_check_create = stub_prison_check_create,
1922 	.mpo_prison_check_get = stub_prison_check_get,
1923 	.mpo_prison_check_set = stub_prison_check_set,
1924 	.mpo_prison_check_remove = stub_prison_check_remove,
1925 	.mpo_prison_created = stub_prison_created,
1926 	.mpo_prison_attached = stub_prison_attached,
1927 
1928 	.mpo_priv_check = stub_priv_check,
1929 	.mpo_priv_grant = stub_priv_grant,
1930 
1931 	.mpo_proc_check_debug = stub_proc_check_debug,
1932 	.mpo_proc_check_sched = stub_proc_check_sched,
1933 	.mpo_proc_check_signal = stub_proc_check_signal,
1934 	.mpo_proc_check_wait = stub_proc_check_wait,
1935 
1936 	.mpo_socket_check_accept = stub_socket_check_accept,
1937 	.mpo_socket_check_bind = stub_socket_check_bind,
1938 	.mpo_socket_check_connect = stub_socket_check_connect,
1939 	.mpo_socket_check_create = stub_socket_check_create,
1940 	.mpo_socket_check_deliver = stub_socket_check_deliver,
1941 	.mpo_socket_check_listen = stub_socket_check_listen,
1942 	.mpo_socket_check_poll = stub_socket_check_poll,
1943 	.mpo_socket_check_receive = stub_socket_check_receive,
1944 	.mpo_socket_check_relabel = stub_socket_check_relabel,
1945 	.mpo_socket_check_send = stub_socket_check_send,
1946 	.mpo_socket_check_stat = stub_socket_check_stat,
1947 	.mpo_socket_check_visible = stub_socket_check_visible,
1948 	.mpo_socket_copy_label = stub_copy_label,
1949 	.mpo_socket_create = stub_socket_create,
1950 	.mpo_socket_create_mbuf = stub_socket_create_mbuf,
1951 	.mpo_socket_destroy_label = stub_destroy_label,
1952 	.mpo_socket_externalize_label = stub_externalize_label,
1953 	.mpo_socket_init_label = stub_init_label_waitcheck,
1954 	.mpo_socket_internalize_label = stub_internalize_label,
1955 	.mpo_socket_newconn = stub_socket_newconn,
1956 	.mpo_socket_relabel = stub_socket_relabel,
1957 
1958 	.mpo_socketpeer_destroy_label = stub_destroy_label,
1959 	.mpo_socketpeer_externalize_label = stub_externalize_label,
1960 	.mpo_socketpeer_init_label = stub_init_label_waitcheck,
1961 	.mpo_socketpeer_set_from_mbuf = stub_socketpeer_set_from_mbuf,
1962 	.mpo_socketpeer_set_from_socket = stub_socketpeer_set_from_socket,
1963 
1964 	.mpo_syncache_init_label = stub_init_label_waitcheck,
1965 	.mpo_syncache_destroy_label = stub_destroy_label,
1966 	.mpo_syncache_create = stub_syncache_create,
1967 	.mpo_syncache_create_mbuf= stub_syncache_create_mbuf,
1968 
1969 	.mpo_sysvmsg_cleanup = stub_sysvmsg_cleanup,
1970 	.mpo_sysvmsg_create = stub_sysvmsg_create,
1971 	.mpo_sysvmsg_destroy_label = stub_destroy_label,
1972 	.mpo_sysvmsg_init_label = stub_init_label,
1973 
1974 	.mpo_sysvmsq_check_msgmsq = stub_sysvmsq_check_msgmsq,
1975 	.mpo_sysvmsq_check_msgrcv = stub_sysvmsq_check_msgrcv,
1976 	.mpo_sysvmsq_check_msgrmid = stub_sysvmsq_check_msgrmid,
1977 	.mpo_sysvmsq_check_msqget = stub_sysvmsq_check_msqget,
1978 	.mpo_sysvmsq_check_msqsnd = stub_sysvmsq_check_msqsnd,
1979 	.mpo_sysvmsq_check_msqrcv = stub_sysvmsq_check_msqrcv,
1980 	.mpo_sysvmsq_check_msqctl = stub_sysvmsq_check_msqctl,
1981 	.mpo_sysvmsq_cleanup = stub_sysvmsq_cleanup,
1982 	.mpo_sysvmsq_create = stub_sysvmsq_create,
1983 	.mpo_sysvmsq_destroy_label = stub_destroy_label,
1984 	.mpo_sysvmsq_init_label = stub_init_label,
1985 
1986 	.mpo_sysvsem_check_semctl = stub_sysvsem_check_semctl,
1987 	.mpo_sysvsem_check_semget = stub_sysvsem_check_semget,
1988 	.mpo_sysvsem_check_semop = stub_sysvsem_check_semop,
1989 	.mpo_sysvsem_cleanup = stub_sysvsem_cleanup,
1990 	.mpo_sysvsem_create = stub_sysvsem_create,
1991 	.mpo_sysvsem_destroy_label = stub_destroy_label,
1992 	.mpo_sysvsem_init_label = stub_init_label,
1993 
1994 	.mpo_sysvshm_check_shmat = stub_sysvshm_check_shmat,
1995 	.mpo_sysvshm_check_shmctl = stub_sysvshm_check_shmctl,
1996 	.mpo_sysvshm_check_shmdt = stub_sysvshm_check_shmdt,
1997 	.mpo_sysvshm_check_shmget = stub_sysvshm_check_shmget,
1998 	.mpo_sysvshm_cleanup = stub_sysvshm_cleanup,
1999 	.mpo_sysvshm_create = stub_sysvshm_create,
2000 	.mpo_sysvshm_destroy_label = stub_destroy_label,
2001 	.mpo_sysvshm_init_label = stub_init_label,
2002 
2003 	.mpo_system_check_acct = stub_system_check_acct,
2004 	.mpo_system_check_audit = stub_system_check_audit,
2005 	.mpo_system_check_auditctl = stub_system_check_auditctl,
2006 	.mpo_system_check_auditon = stub_system_check_auditon,
2007 	.mpo_system_check_reboot = stub_system_check_reboot,
2008 	.mpo_system_check_swapoff = stub_system_check_swapoff,
2009 	.mpo_system_check_swapon = stub_system_check_swapon,
2010 	.mpo_system_check_sysctl = stub_system_check_sysctl,
2011 
2012 	.mpo_thread_userret = stub_thread_userret,
2013 
2014 	.mpo_vnode_associate_extattr = stub_vnode_associate_extattr,
2015 	.mpo_vnode_associate_singlelabel = stub_vnode_associate_singlelabel,
2016 	.mpo_vnode_check_access = stub_vnode_check_access,
2017 	.mpo_vnode_check_chdir = stub_vnode_check_chdir,
2018 	.mpo_vnode_check_chroot = stub_vnode_check_chroot,
2019 	.mpo_vnode_check_create = stub_vnode_check_create,
2020 	.mpo_vnode_check_deleteacl = stub_vnode_check_deleteacl,
2021 	.mpo_vnode_check_deleteextattr = stub_vnode_check_deleteextattr,
2022 	.mpo_vnode_check_exec = stub_vnode_check_exec,
2023 	.mpo_vnode_check_getacl = stub_vnode_check_getacl,
2024 	.mpo_vnode_check_getextattr = stub_vnode_check_getextattr,
2025 	.mpo_vnode_check_link = stub_vnode_check_link,
2026 	.mpo_vnode_check_listextattr = stub_vnode_check_listextattr,
2027 	.mpo_vnode_check_lookup = stub_vnode_check_lookup,
2028 	.mpo_vnode_check_mmap = stub_vnode_check_mmap,
2029 	.mpo_vnode_check_mmap_downgrade = stub_vnode_check_mmap_downgrade,
2030 	.mpo_vnode_check_mprotect = stub_vnode_check_mprotect,
2031 	.mpo_vnode_check_open = stub_vnode_check_open,
2032 	.mpo_vnode_check_poll = stub_vnode_check_poll,
2033 	.mpo_vnode_check_read = stub_vnode_check_read,
2034 	.mpo_vnode_check_readdir = stub_vnode_check_readdir,
2035 	.mpo_vnode_check_readlink = stub_vnode_check_readlink,
2036 	.mpo_vnode_check_relabel = stub_vnode_check_relabel,
2037 	.mpo_vnode_check_rename_from = stub_vnode_check_rename_from,
2038 	.mpo_vnode_check_rename_to = stub_vnode_check_rename_to,
2039 	.mpo_vnode_check_revoke = stub_vnode_check_revoke,
2040 	.mpo_vnode_check_setacl = stub_vnode_check_setacl,
2041 	.mpo_vnode_check_setextattr = stub_vnode_check_setextattr,
2042 	.mpo_vnode_check_setflags = stub_vnode_check_setflags,
2043 	.mpo_vnode_check_setmode = stub_vnode_check_setmode,
2044 	.mpo_vnode_check_setowner = stub_vnode_check_setowner,
2045 	.mpo_vnode_check_setutimes = stub_vnode_check_setutimes,
2046 	.mpo_vnode_check_stat = stub_vnode_check_stat,
2047 	.mpo_vnode_check_unlink = stub_vnode_check_unlink,
2048 	.mpo_vnode_check_write = stub_vnode_check_write,
2049 	.mpo_vnode_copy_label = stub_copy_label,
2050 	.mpo_vnode_create_extattr = stub_vnode_create_extattr,
2051 	.mpo_vnode_destroy_label = stub_destroy_label,
2052 	.mpo_vnode_execve_transition = stub_vnode_execve_transition,
2053 	.mpo_vnode_execve_will_transition = stub_vnode_execve_will_transition,
2054 	.mpo_vnode_externalize_label = stub_externalize_label,
2055 	.mpo_vnode_init_label = stub_init_label,
2056 	.mpo_vnode_internalize_label = stub_internalize_label,
2057 	.mpo_vnode_relabel = stub_vnode_relabel,
2058 	.mpo_vnode_setlabel_extattr = stub_vnode_setlabel_extattr,
2059 };
2060 
2061 MAC_POLICY_SET(&stub_ops, mac_stub, "TrustedBSD MAC/Stub",
2062     MPC_LOADTIME_FLAG_UNLOADOK, NULL);
2063