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