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