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