mac_stub.c revision 104546
1/*-
2 * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
3 * Copyright (c) 2001, 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed by Robert Watson for the TrustedBSD Project.
7 *
8 * This software was developed for the FreeBSD Project in part by NAI Labs,
9 * the Security Research Division of Network Associates, Inc. under
10 * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA
11 * CHATS research program.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 *    notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 *    notice, this list of conditions and the following disclaimer in the
20 *    documentation and/or other materials provided with the distribution.
21 * 3. The names of the authors may not be used to endorse or promote
22 *    products derived from this software without specific prior written
23 *    permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * $FreeBSD: head/sys/security/mac_stub/mac_stub.c 104546 2002-10-06 02:46:26Z rwatson $
38 */
39
40/*
41 * Developed by the TrustedBSD Project.
42 * Generic mandatory access module that does nothing.
43 */
44
45#include <sys/types.h>
46#include <sys/param.h>
47#include <sys/acl.h>
48#include <sys/conf.h>
49#include <sys/kernel.h>
50#include <sys/mac.h>
51#include <sys/mount.h>
52#include <sys/proc.h>
53#include <sys/systm.h>
54#include <sys/sysproto.h>
55#include <sys/sysent.h>
56#include <sys/vnode.h>
57#include <sys/file.h>
58#include <sys/socket.h>
59#include <sys/socketvar.h>
60#include <sys/pipe.h>
61#include <sys/sysctl.h>
62
63#include <fs/devfs/devfs.h>
64
65#include <net/bpfdesc.h>
66#include <net/if.h>
67#include <net/if_types.h>
68#include <net/if_var.h>
69
70#include <netinet/in.h>
71#include <netinet/ip_var.h>
72
73#include <vm/vm.h>
74
75#include <sys/mac_policy.h>
76
77SYSCTL_DECL(_security_mac);
78
79SYSCTL_NODE(_security_mac, OID_AUTO, none, CTLFLAG_RW, 0,
80    "TrustedBSD mac_none policy controls");
81
82static int	mac_none_enabled = 0;
83SYSCTL_INT(_security_mac_none, OID_AUTO, enabled, CTLFLAG_RW,
84    &mac_none_enabled, 0, "Enforce none policy");
85
86/*
87 * Policy module operations.
88 */
89static void
90mac_none_destroy(struct mac_policy_conf *conf)
91{
92
93}
94
95static void
96mac_none_init(struct mac_policy_conf *conf)
97{
98
99}
100
101static int
102mac_none_syscall(struct thread *td, int call, void *arg)
103{
104
105	return (0);
106}
107
108/*
109 * Label operations.
110 */
111static void
112mac_none_init_label(struct label *label)
113{
114
115}
116
117static int
118mac_none_init_label_waitcheck(struct label *label, int flag)
119{
120
121	return (0);
122}
123
124static void
125mac_none_destroy_label(struct label *label)
126{
127
128}
129
130static int
131mac_none_externalize(struct label *label, struct mac *extmac)
132{
133
134	return (0);
135}
136
137static int
138mac_none_internalize(struct label *label, struct mac *extmac)
139{
140
141	return (0);
142}
143
144/*
145 * Labeling event operations: file system objects, and things that look
146 * a lot like file system objects.
147 */
148static void
149mac_none_create_devfs_device(dev_t dev, struct devfs_dirent *devfs_dirent,
150    struct label *label)
151{
152
153}
154
155static void
156mac_none_create_devfs_symlink(struct ucred *cred, struct devfs_dirent *dd,
157    struct label *ddlabel, struct devfs_dirent *de, struct label *delabel)
158{
159
160}
161
162static void
163mac_none_create_devfs_directory(char *dirname, int dirnamelen,
164    struct devfs_dirent *devfs_dirent, struct label *label)
165{
166
167}
168
169static void
170mac_none_create_devfs_vnode(struct devfs_dirent *devfs_dirent,
171    struct label *direntlabel, struct vnode *vp, struct label *vnodelabel)
172{
173
174}
175
176static void
177mac_none_create_vnode(struct ucred *cred, struct vnode *parent,
178    struct label *parentlabel, struct vnode *child,
179    struct label *childlabel)
180{
181
182}
183
184static void
185mac_none_create_mount(struct ucred *cred, struct mount *mp,
186    struct label *mntlabel, struct label *fslabel)
187{
188
189}
190
191static void
192mac_none_create_root_mount(struct ucred *cred, struct mount *mp,
193    struct label *mntlabel, struct label *fslabel)
194{
195
196}
197
198static void
199mac_none_relabel_vnode(struct ucred *cred, struct vnode *vp,
200    struct label *vnodelabel, struct label *label)
201{
202
203}
204
205static void
206mac_none_update_devfsdirent(struct devfs_dirent *devfs_dirent,
207    struct label *direntlabel, struct vnode *vp, struct label *vnodelabel)
208{
209
210}
211
212static void
213mac_none_update_procfsvnode(struct vnode *vp, struct label *vnodelabel,
214    struct ucred *cred)
215{
216
217}
218
219static int
220mac_none_update_vnode_from_externalized(struct vnode *vp,
221    struct label *vnodelabel, struct mac *extmac)
222{
223
224	return (0);
225}
226
227static void
228mac_none_update_vnode_from_mount(struct vnode *vp, struct label *vnodelabel,
229    struct mount *mp, struct label *fslabel)
230{
231
232}
233
234/*
235 * Labeling event operations: IPC object.
236 */
237static void
238mac_none_create_mbuf_from_socket(struct socket *so, struct label *socketlabel,
239    struct mbuf *m, struct label *mbuflabel)
240{
241
242}
243
244static void
245mac_none_create_socket(struct ucred *cred, struct socket *socket,
246    struct label *socketlabel)
247{
248
249}
250
251static void
252mac_none_create_pipe(struct ucred *cred, struct pipe *pipe,
253    struct label *pipelabel)
254{
255
256}
257
258static void
259mac_none_create_socket_from_socket(struct socket *oldsocket,
260    struct label *oldsocketlabel, struct socket *newsocket,
261    struct label *newsocketlabel)
262{
263
264}
265
266static void
267mac_none_relabel_socket(struct ucred *cred, struct socket *socket,
268    struct label *socketlabel, struct label *newlabel)
269{
270
271}
272
273static void
274mac_none_relabel_pipe(struct ucred *cred, struct pipe *pipe,
275    struct label *pipelabel, struct label *newlabel)
276{
277
278}
279
280static void
281mac_none_set_socket_peer_from_mbuf(struct mbuf *mbuf, struct label *mbuflabel,
282    struct socket *socket, struct label *socketpeerlabel)
283{
284
285}
286
287static void
288mac_none_set_socket_peer_from_socket(struct socket *oldsocket,
289    struct label *oldsocketlabel, struct socket *newsocket,
290    struct label *newsocketpeerlabel)
291{
292
293}
294
295/*
296 * Labeling event operations: network objects.
297 */
298static void
299mac_none_create_bpfdesc(struct ucred *cred, struct bpf_d *bpf_d,
300    struct label *bpflabel)
301{
302
303}
304
305static void
306mac_none_create_datagram_from_ipq(struct ipq *ipq, struct label *ipqlabel,
307    struct mbuf *datagram, struct label *datagramlabel)
308{
309
310}
311
312static void
313mac_none_create_fragment(struct mbuf *datagram, struct label *datagramlabel,
314    struct mbuf *fragment, struct label *fragmentlabel)
315{
316
317}
318
319static void
320mac_none_create_ifnet(struct ifnet *ifnet, struct label *ifnetlabel)
321{
322
323}
324
325static void
326mac_none_create_ipq(struct mbuf *fragment, struct label *fragmentlabel,
327    struct ipq *ipq, struct label *ipqlabel)
328{
329
330}
331
332static void
333mac_none_create_mbuf_from_mbuf(struct mbuf *oldmbuf,
334    struct label *oldmbuflabel, struct mbuf *newmbuf,
335    struct label *newmbuflabel)
336{
337
338}
339
340static void
341mac_none_create_mbuf_linklayer(struct ifnet *ifnet, struct label *ifnetlabel,
342    struct mbuf *mbuf, struct label *mbuflabel)
343{
344
345}
346
347static void
348mac_none_create_mbuf_from_bpfdesc(struct bpf_d *bpf_d, struct label *bpflabel,
349    struct mbuf *mbuf, struct label *mbuflabel)
350{
351
352}
353
354static void
355mac_none_create_mbuf_from_ifnet(struct ifnet *ifnet, struct label *ifnetlabel,
356    struct mbuf *m, struct label *mbuflabel)
357{
358
359}
360
361static void
362mac_none_create_mbuf_multicast_encap(struct mbuf *oldmbuf,
363    struct label *oldmbuflabel, struct ifnet *ifnet, struct label *ifnetlabel,
364    struct mbuf *newmbuf, struct label *newmbuflabel)
365{
366
367}
368
369static void
370mac_none_create_mbuf_netlayer(struct mbuf *oldmbuf,
371    struct label *oldmbuflabel, struct mbuf *newmbuf, struct label *newmbuflabel)
372{
373
374}
375
376static int
377mac_none_fragment_match(struct mbuf *fragment, struct label *fragmentlabel,
378    struct ipq *ipq, struct label *ipqlabel)
379{
380
381	return (1);
382}
383
384static void
385mac_none_relabel_ifnet(struct ucred *cred, struct ifnet *ifnet,
386    struct label *ifnetlabel, struct label *newlabel)
387{
388
389}
390
391static void
392mac_none_update_ipq(struct mbuf *fragment, struct label *fragmentlabel,
393    struct ipq *ipq, struct label *ipqlabel)
394{
395
396}
397
398/*
399 * Labeling event operations: processes.
400 */
401static void
402mac_none_create_cred(struct ucred *cred_parent, struct ucred *cred_child)
403{
404
405}
406
407static void
408mac_none_execve_transition(struct ucred *old, struct ucred *new,
409    struct vnode *vp, struct label *vnodelabel)
410{
411
412}
413
414static int
415mac_none_execve_will_transition(struct ucred *old, struct vnode *vp,
416    struct label *vnodelabel)
417{
418
419	return (0);
420}
421
422static void
423mac_none_create_proc0(struct ucred *cred)
424{
425
426}
427
428static void
429mac_none_create_proc1(struct ucred *cred)
430{
431
432}
433
434static void
435mac_none_relabel_cred(struct ucred *cred, struct label *newlabel)
436{
437
438}
439
440/*
441 * Access control checks.
442 */
443static int
444mac_none_check_bpfdesc_receive(struct bpf_d *bpf_d, struct label *bpflabel,
445    struct ifnet *ifnet, struct label *ifnet_label)
446{
447
448        return (0);
449}
450
451static int
452mac_none_check_cred_relabel(struct ucred *cred, struct label *newlabel)
453{
454
455	return (0);
456}
457
458static int
459mac_none_check_cred_visible(struct ucred *u1, struct ucred *u2)
460{
461
462	return (0);
463}
464
465static int
466mac_none_check_ifnet_relabel(struct ucred *cred, struct ifnet *ifnet,
467    struct label *newlabel)
468{
469
470	return (0);
471}
472
473static int
474mac_none_check_ifnet_transmit(struct ifnet *ifnet, struct label *ifnetlabel,
475    struct mbuf *m, struct label *mbuflabel)
476{
477
478	return (0);
479}
480
481static int
482mac_none_check_mount_stat(struct ucred *cred, struct mount *mp,
483    struct label *mntlabel)
484{
485
486	return (0);
487}
488
489static int
490mac_none_check_pipe_ioctl(struct ucred *cred, struct pipe *pipe,
491    struct label *pipelabel, unsigned long cmd, void /* caddr_t */ *data)
492{
493
494	return (0);
495}
496
497static int
498mac_none_check_pipe_poll(struct ucred *cred, struct pipe *pipe,
499    struct label *pipelabel)
500{
501
502	return (0);
503}
504
505static int
506mac_none_check_pipe_read(struct ucred *cred, struct pipe *pipe,
507    struct label *pipelabel)
508{
509
510	return (0);
511}
512
513static int
514mac_none_check_pipe_relabel(struct ucred *cred, struct pipe *pipe,
515    struct label *pipelabel, struct label *newlabel)
516{
517
518	return (0);
519}
520
521static int
522mac_none_check_pipe_stat(struct ucred *cred, struct pipe *pipe,
523    struct label *pipelabel)
524{
525
526	return (0);
527}
528
529static int
530mac_none_check_pipe_write(struct ucred *cred, struct pipe *pipe,
531    struct label *pipelabel)
532{
533
534	return (0);
535}
536
537static int
538mac_none_check_proc_debug(struct ucred *cred, struct proc *proc)
539{
540
541	return (0);
542}
543
544static int
545mac_none_check_proc_sched(struct ucred *cred, struct proc *proc)
546{
547
548	return (0);
549}
550
551static int
552mac_none_check_proc_signal(struct ucred *cred, struct proc *proc, int signum)
553{
554
555	return (0);
556}
557
558static int
559mac_none_check_socket_bind(struct ucred *cred, struct socket *socket,
560    struct label *socketlabel, struct sockaddr *sockaddr)
561{
562
563	return (0);
564}
565
566static int
567mac_none_check_socket_connect(struct ucred *cred, struct socket *socket,
568    struct label *socketlabel, struct sockaddr *sockaddr)
569{
570
571	return (0);
572}
573
574static int
575mac_none_check_socket_deliver(struct socket *so, struct label *socketlabel,
576    struct mbuf *m, struct label *mbuflabel)
577{
578
579	return (0);
580}
581
582static int
583mac_none_check_socket_listen(struct ucred *cred, struct vnode *vp,
584    struct label *socketlabel)
585{
586
587	return (0);
588}
589
590static int
591mac_none_check_socket_relabel(struct ucred *cred, struct socket *socket,
592    struct label *socketlabel, struct label *newlabel)
593{
594
595	return (0);
596}
597
598static int
599mac_none_check_socket_visible(struct ucred *cred, struct socket *socket,
600   struct label *socketlabel)
601{
602
603	return (0);
604}
605
606static int
607mac_none_check_vnode_access(struct ucred *cred, struct vnode *vp,
608    struct label *label, mode_t flags)
609{
610
611	return (0);
612}
613
614static int
615mac_none_check_vnode_chdir(struct ucred *cred, struct vnode *dvp,
616    struct label *dlabel)
617{
618
619	return (0);
620}
621
622static int
623mac_none_check_vnode_chroot(struct ucred *cred, struct vnode *dvp,
624    struct label *dlabel)
625{
626
627	return (0);
628}
629
630static int
631mac_none_check_vnode_create(struct ucred *cred, struct vnode *dvp,
632    struct label *dlabel, struct componentname *cnp, struct vattr *vap)
633{
634
635	return (0);
636}
637
638static int
639mac_none_check_vnode_delete(struct ucred *cred, struct vnode *dvp,
640    struct label *dlabel, struct vnode *vp, struct label *label,
641    struct componentname *cnp)
642{
643
644	return (0);
645}
646
647static int
648mac_none_check_vnode_deleteacl(struct ucred *cred, struct vnode *vp,
649    struct label *label, acl_type_t type)
650{
651
652	return (0);
653}
654
655static int
656mac_none_check_vnode_exec(struct ucred *cred, struct vnode *vp,
657    struct label *label)
658{
659
660	return (0);
661}
662
663static int
664mac_none_check_vnode_getacl(struct ucred *cred, struct vnode *vp,
665    struct label *label, acl_type_t type)
666{
667
668	return (0);
669}
670
671static int
672mac_none_check_vnode_getextattr(struct ucred *cred, struct vnode *vp,
673    struct label *label, int attrnamespace, const char *name, struct uio *uio)
674{
675
676	return (0);
677}
678
679static int
680mac_none_check_vnode_link(struct ucred *cred, struct vnode *dvp,
681    struct label *dlabel, struct vnode *vp, struct label *label,
682    struct componentname *cnp)
683{
684
685	return (0);
686}
687
688static int
689mac_none_check_vnode_lookup(struct ucred *cred, struct vnode *dvp,
690    struct label *dlabel, struct componentname *cnp)
691{
692
693	return (0);
694}
695
696static int
697mac_none_check_vnode_mmap(struct ucred *cred, struct vnode *vp,
698    struct label *label, int prot)
699{
700
701	return (0);
702}
703
704static int
705mac_none_check_vnode_mprotect(struct ucred *cred, struct vnode *vp,
706    struct label *label, int prot)
707{
708
709	return (0);
710}
711
712static int
713mac_none_check_vnode_open(struct ucred *cred, struct vnode *vp,
714    struct label *filelabel, mode_t acc_mode)
715{
716
717	return (0);
718}
719
720static int
721mac_none_check_vnode_poll(struct ucred *active_cred, struct ucred *file_cred,
722    struct vnode *vp, struct label *label)
723{
724
725	return (0);
726}
727
728static int
729mac_none_check_vnode_read(struct ucred *active_cred, struct ucred *file_cred,
730    struct vnode *vp, struct label *label)
731{
732
733	return (0);
734}
735
736static int
737mac_none_check_vnode_readdir(struct ucred *cred, struct vnode *vp,
738    struct label *dlabel)
739{
740
741	return (0);
742}
743
744static int
745mac_none_check_vnode_readlink(struct ucred *cred, struct vnode *vp,
746    struct label *vnodelabel)
747{
748
749	return (0);
750}
751
752static int
753mac_none_check_vnode_relabel(struct ucred *cred, struct vnode *vp,
754    struct label *vnodelabel, struct label *newlabel)
755{
756
757	return (0);
758}
759
760static int
761mac_none_check_vnode_rename_from(struct ucred *cred, struct vnode *dvp,
762    struct label *dlabel, struct vnode *vp, struct label *label,
763    struct componentname *cnp)
764{
765
766	return (0);
767}
768
769static int
770mac_none_check_vnode_rename_to(struct ucred *cred, struct vnode *dvp,
771    struct label *dlabel, struct vnode *vp, struct label *label, int samedir,
772    struct componentname *cnp)
773{
774
775	return (0);
776}
777
778static int
779mac_none_check_vnode_revoke(struct ucred *cred, struct vnode *vp,
780    struct label *label)
781{
782
783	return (0);
784}
785
786static int
787mac_none_check_vnode_setacl(struct ucred *cred, struct vnode *vp,
788    struct label *label, acl_type_t type, struct acl *acl)
789{
790
791	return (0);
792}
793
794static int
795mac_none_check_vnode_setextattr(struct ucred *cred, struct vnode *vp,
796    struct label *label, int attrnamespace, const char *name, struct uio *uio)
797{
798
799	return (0);
800}
801
802static int
803mac_none_check_vnode_setflags(struct ucred *cred, struct vnode *vp,
804    struct label *label, u_long flags)
805{
806
807	return (0);
808}
809
810static int
811mac_none_check_vnode_setmode(struct ucred *cred, struct vnode *vp,
812    struct label *label, mode_t mode)
813{
814
815	return (0);
816}
817
818static int
819mac_none_check_vnode_setowner(struct ucred *cred, struct vnode *vp,
820    struct label *label, uid_t uid, gid_t gid)
821{
822
823	return (0);
824}
825
826static int
827mac_none_check_vnode_setutimes(struct ucred *cred, struct vnode *vp,
828    struct label *label, struct timespec atime, struct timespec mtime)
829{
830
831	return (0);
832}
833
834static int
835mac_none_check_vnode_stat(struct ucred *active_cred, struct ucred *file_cred,
836    struct vnode *vp, struct label *label)
837{
838
839	return (0);
840}
841
842static int
843mac_none_check_vnode_write(struct ucred *active_cred,
844    struct ucred *file_cred, struct vnode *vp, struct label *label)
845{
846
847	return (0);
848}
849
850static struct mac_policy_op_entry mac_none_ops[] =
851{
852	{ MAC_DESTROY,
853	    (macop_t)mac_none_destroy },
854	{ MAC_INIT,
855	    (macop_t)mac_none_init },
856	{ MAC_SYSCALL,
857	    (macop_t)mac_none_syscall },
858	{ MAC_INIT_BPFDESC_LABEL,
859	    (macop_t)mac_none_init_label },
860	{ MAC_INIT_CRED_LABEL,
861	    (macop_t)mac_none_init_label },
862	{ MAC_INIT_DEVFSDIRENT_LABEL,
863	    (macop_t)mac_none_init_label },
864	{ MAC_INIT_IFNET_LABEL,
865	    (macop_t)mac_none_init_label },
866	{ MAC_INIT_IPQ_LABEL,
867	    (macop_t)mac_none_init_label },
868	{ MAC_INIT_MBUF_LABEL,
869	    (macop_t)mac_none_init_label_waitcheck },
870	{ MAC_INIT_MOUNT_LABEL,
871	    (macop_t)mac_none_init_label },
872	{ MAC_INIT_MOUNT_FS_LABEL,
873	    (macop_t)mac_none_init_label },
874	{ MAC_INIT_PIPE_LABEL,
875	    (macop_t)mac_none_init_label },
876	{ MAC_INIT_SOCKET_LABEL,
877	    (macop_t)mac_none_init_label_waitcheck },
878	{ MAC_INIT_SOCKET_PEER_LABEL,
879	    (macop_t)mac_none_init_label_waitcheck },
880	{ MAC_INIT_TEMP_LABEL,
881	    (macop_t)mac_none_init_label },
882	{ MAC_INIT_VNODE_LABEL,
883	    (macop_t)mac_none_init_label },
884	{ MAC_DESTROY_BPFDESC_LABEL,
885	    (macop_t)mac_none_destroy_label },
886	{ MAC_DESTROY_CRED_LABEL,
887	    (macop_t)mac_none_destroy_label },
888	{ MAC_DESTROY_DEVFSDIRENT_LABEL,
889	    (macop_t)mac_none_destroy_label },
890	{ MAC_DESTROY_IFNET_LABEL,
891	    (macop_t)mac_none_destroy_label },
892	{ MAC_DESTROY_IPQ_LABEL,
893	    (macop_t)mac_none_destroy_label },
894	{ MAC_DESTROY_MBUF_LABEL,
895	    (macop_t)mac_none_destroy_label },
896	{ MAC_DESTROY_MOUNT_LABEL,
897	    (macop_t)mac_none_destroy_label },
898	{ MAC_DESTROY_MOUNT_FS_LABEL,
899	    (macop_t)mac_none_destroy_label },
900	{ MAC_DESTROY_PIPE_LABEL,
901	    (macop_t)mac_none_destroy_label },
902	{ MAC_DESTROY_SOCKET_LABEL,
903	    (macop_t)mac_none_destroy_label },
904	{ MAC_DESTROY_SOCKET_PEER_LABEL,
905	    (macop_t)mac_none_destroy_label },
906	{ MAC_DESTROY_TEMP_LABEL,
907	    (macop_t)mac_none_destroy_label },
908	{ MAC_DESTROY_VNODE_LABEL,
909	    (macop_t)mac_none_destroy_label },
910	{ MAC_EXTERNALIZE,
911	    (macop_t)mac_none_externalize },
912	{ MAC_INTERNALIZE,
913	    (macop_t)mac_none_internalize },
914	{ MAC_CREATE_DEVFS_DEVICE,
915	    (macop_t)mac_none_create_devfs_device },
916	{ MAC_CREATE_DEVFS_DIRECTORY,
917	    (macop_t)mac_none_create_devfs_directory },
918	{ MAC_CREATE_DEVFS_SYMLINK,
919	    (macop_t)mac_none_create_devfs_symlink },
920	{ MAC_CREATE_DEVFS_VNODE,
921	    (macop_t)mac_none_create_devfs_vnode },
922	{ MAC_CREATE_VNODE,
923	    (macop_t)mac_none_create_vnode },
924	{ MAC_CREATE_MOUNT,
925	    (macop_t)mac_none_create_mount },
926	{ MAC_CREATE_ROOT_MOUNT,
927	    (macop_t)mac_none_create_root_mount },
928	{ MAC_RELABEL_VNODE,
929	    (macop_t)mac_none_relabel_vnode },
930	{ MAC_UPDATE_DEVFSDIRENT,
931	    (macop_t)mac_none_update_devfsdirent },
932	{ MAC_UPDATE_PROCFSVNODE,
933	    (macop_t)mac_none_update_procfsvnode },
934	{ MAC_UPDATE_VNODE_FROM_EXTERNALIZED,
935	    (macop_t)mac_none_update_vnode_from_externalized },
936	{ MAC_UPDATE_VNODE_FROM_MOUNT,
937	    (macop_t)mac_none_update_vnode_from_mount },
938	{ MAC_CREATE_MBUF_FROM_SOCKET,
939	    (macop_t)mac_none_create_mbuf_from_socket },
940	{ MAC_CREATE_PIPE,
941	    (macop_t)mac_none_create_pipe },
942	{ MAC_CREATE_SOCKET,
943	    (macop_t)mac_none_create_socket },
944	{ MAC_CREATE_SOCKET_FROM_SOCKET,
945	    (macop_t)mac_none_create_socket_from_socket },
946	{ MAC_RELABEL_PIPE,
947	    (macop_t)mac_none_relabel_pipe },
948	{ MAC_RELABEL_SOCKET,
949	    (macop_t)mac_none_relabel_socket },
950	{ MAC_SET_SOCKET_PEER_FROM_MBUF,
951	    (macop_t)mac_none_set_socket_peer_from_mbuf },
952	{ MAC_SET_SOCKET_PEER_FROM_SOCKET,
953	    (macop_t)mac_none_set_socket_peer_from_socket },
954	{ MAC_CREATE_BPFDESC,
955	    (macop_t)mac_none_create_bpfdesc },
956	{ MAC_CREATE_IFNET,
957	    (macop_t)mac_none_create_ifnet },
958	{ MAC_CREATE_IPQ,
959	    (macop_t)mac_none_create_ipq },
960	{ MAC_CREATE_DATAGRAM_FROM_IPQ,
961	    (macop_t)mac_none_create_datagram_from_ipq },
962	{ MAC_CREATE_FRAGMENT,
963	    (macop_t)mac_none_create_fragment },
964	{ MAC_CREATE_IPQ,
965	    (macop_t)mac_none_create_ipq },
966	{ MAC_CREATE_MBUF_FROM_MBUF,
967	    (macop_t)mac_none_create_mbuf_from_mbuf },
968	{ MAC_CREATE_MBUF_LINKLAYER,
969	    (macop_t)mac_none_create_mbuf_linklayer },
970	{ MAC_CREATE_MBUF_FROM_BPFDESC,
971	    (macop_t)mac_none_create_mbuf_from_bpfdesc },
972	{ MAC_CREATE_MBUF_FROM_IFNET,
973	    (macop_t)mac_none_create_mbuf_from_ifnet },
974	{ MAC_CREATE_MBUF_MULTICAST_ENCAP,
975	    (macop_t)mac_none_create_mbuf_multicast_encap },
976	{ MAC_CREATE_MBUF_NETLAYER,
977	    (macop_t)mac_none_create_mbuf_netlayer },
978	{ MAC_FRAGMENT_MATCH,
979	    (macop_t)mac_none_fragment_match },
980	{ MAC_RELABEL_IFNET,
981	    (macop_t)mac_none_relabel_ifnet },
982	{ MAC_UPDATE_IPQ,
983	    (macop_t)mac_none_update_ipq },
984	{ MAC_CREATE_CRED,
985	    (macop_t)mac_none_create_cred },
986	{ MAC_EXECVE_TRANSITION,
987	    (macop_t)mac_none_execve_transition },
988	{ MAC_EXECVE_WILL_TRANSITION,
989	    (macop_t)mac_none_execve_will_transition },
990	{ MAC_CREATE_PROC0,
991	    (macop_t)mac_none_create_proc0 },
992	{ MAC_CREATE_PROC1,
993	    (macop_t)mac_none_create_proc1 },
994	{ MAC_RELABEL_CRED,
995	    (macop_t)mac_none_relabel_cred },
996	{ MAC_CHECK_BPFDESC_RECEIVE,
997	    (macop_t)mac_none_check_bpfdesc_receive },
998	{ MAC_CHECK_CRED_RELABEL,
999	    (macop_t)mac_none_check_cred_relabel },
1000	{ MAC_CHECK_CRED_VISIBLE,
1001	    (macop_t)mac_none_check_cred_visible },
1002	{ MAC_CHECK_IFNET_RELABEL,
1003	    (macop_t)mac_none_check_ifnet_relabel },
1004	{ MAC_CHECK_IFNET_TRANSMIT,
1005	    (macop_t)mac_none_check_ifnet_transmit },
1006	{ MAC_CHECK_MOUNT_STAT,
1007	    (macop_t)mac_none_check_mount_stat },
1008	{ MAC_CHECK_PIPE_IOCTL,
1009	    (macop_t)mac_none_check_pipe_ioctl },
1010	{ MAC_CHECK_PIPE_POLL,
1011	    (macop_t)mac_none_check_pipe_poll },
1012	{ MAC_CHECK_PIPE_READ,
1013	    (macop_t)mac_none_check_pipe_read },
1014	{ MAC_CHECK_PIPE_RELABEL,
1015	    (macop_t)mac_none_check_pipe_relabel },
1016	{ MAC_CHECK_PIPE_STAT,
1017	    (macop_t)mac_none_check_pipe_stat },
1018	{ MAC_CHECK_PIPE_WRITE,
1019	    (macop_t)mac_none_check_pipe_write },
1020	{ MAC_CHECK_PROC_DEBUG,
1021	    (macop_t)mac_none_check_proc_debug },
1022	{ MAC_CHECK_PROC_SCHED,
1023	    (macop_t)mac_none_check_proc_sched },
1024	{ MAC_CHECK_PROC_SIGNAL,
1025	    (macop_t)mac_none_check_proc_signal },
1026	{ MAC_CHECK_SOCKET_BIND,
1027	    (macop_t)mac_none_check_socket_bind },
1028	{ MAC_CHECK_SOCKET_CONNECT,
1029	    (macop_t)mac_none_check_socket_connect },
1030	{ MAC_CHECK_SOCKET_DELIVER,
1031	    (macop_t)mac_none_check_socket_deliver },
1032	{ MAC_CHECK_SOCKET_LISTEN,
1033	    (macop_t)mac_none_check_socket_listen },
1034	{ MAC_CHECK_SOCKET_RELABEL,
1035	    (macop_t)mac_none_check_socket_relabel },
1036	{ MAC_CHECK_SOCKET_VISIBLE,
1037	    (macop_t)mac_none_check_socket_visible },
1038	{ MAC_CHECK_VNODE_ACCESS,
1039	    (macop_t)mac_none_check_vnode_access },
1040	{ MAC_CHECK_VNODE_CHDIR,
1041	    (macop_t)mac_none_check_vnode_chdir },
1042	{ MAC_CHECK_VNODE_CHROOT,
1043	    (macop_t)mac_none_check_vnode_chroot },
1044	{ MAC_CHECK_VNODE_CREATE,
1045	    (macop_t)mac_none_check_vnode_create },
1046	{ MAC_CHECK_VNODE_DELETE,
1047	    (macop_t)mac_none_check_vnode_delete },
1048	{ MAC_CHECK_VNODE_DELETEACL,
1049	    (macop_t)mac_none_check_vnode_deleteacl },
1050	{ MAC_CHECK_VNODE_EXEC,
1051	    (macop_t)mac_none_check_vnode_exec },
1052	{ MAC_CHECK_VNODE_GETACL,
1053	    (macop_t)mac_none_check_vnode_getacl },
1054	{ MAC_CHECK_VNODE_GETEXTATTR,
1055	    (macop_t)mac_none_check_vnode_getextattr },
1056	{ MAC_CHECK_VNODE_LINK,
1057	    (macop_t)mac_none_check_vnode_link },
1058	{ MAC_CHECK_VNODE_LOOKUP,
1059	    (macop_t)mac_none_check_vnode_lookup },
1060	{ MAC_CHECK_VNODE_MMAP,
1061	    (macop_t)mac_none_check_vnode_mmap },
1062	{ MAC_CHECK_VNODE_MPROTECT,
1063	    (macop_t)mac_none_check_vnode_mprotect },
1064	{ MAC_CHECK_VNODE_OPEN,
1065	    (macop_t)mac_none_check_vnode_open },
1066	{ MAC_CHECK_VNODE_POLL,
1067	    (macop_t)mac_none_check_vnode_poll },
1068	{ MAC_CHECK_VNODE_READ,
1069	    (macop_t)mac_none_check_vnode_read },
1070	{ MAC_CHECK_VNODE_READDIR,
1071	    (macop_t)mac_none_check_vnode_readdir },
1072	{ MAC_CHECK_VNODE_READLINK,
1073	    (macop_t)mac_none_check_vnode_readlink },
1074	{ MAC_CHECK_VNODE_RELABEL,
1075	    (macop_t)mac_none_check_vnode_relabel },
1076	{ MAC_CHECK_VNODE_RENAME_FROM,
1077	    (macop_t)mac_none_check_vnode_rename_from },
1078	{ MAC_CHECK_VNODE_RENAME_TO,
1079	    (macop_t)mac_none_check_vnode_rename_to },
1080	{ MAC_CHECK_VNODE_REVOKE,
1081	    (macop_t)mac_none_check_vnode_revoke },
1082	{ MAC_CHECK_VNODE_SETACL,
1083	    (macop_t)mac_none_check_vnode_setacl },
1084	{ MAC_CHECK_VNODE_SETEXTATTR,
1085	    (macop_t)mac_none_check_vnode_setextattr },
1086	{ MAC_CHECK_VNODE_SETFLAGS,
1087	    (macop_t)mac_none_check_vnode_setflags },
1088	{ MAC_CHECK_VNODE_SETMODE,
1089	    (macop_t)mac_none_check_vnode_setmode },
1090	{ MAC_CHECK_VNODE_SETOWNER,
1091	    (macop_t)mac_none_check_vnode_setowner },
1092	{ MAC_CHECK_VNODE_SETUTIMES,
1093	    (macop_t)mac_none_check_vnode_setutimes },
1094	{ MAC_CHECK_VNODE_STAT,
1095	    (macop_t)mac_none_check_vnode_stat },
1096	{ MAC_CHECK_VNODE_WRITE,
1097	    (macop_t)mac_none_check_vnode_write },
1098	{ MAC_OP_LAST, NULL }
1099};
1100
1101MAC_POLICY_SET(mac_none_ops, trustedbsd_mac_none, "TrustedBSD MAC/None",
1102    MPC_LOADTIME_FLAG_UNLOADOK, NULL);
1103