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