diff --git a/sys/security/mac_stub/mac_stub.c b/sys/security/mac_stub/mac_stub.c index c2ce7e702bdc..236cf11e8e3a 100644 --- a/sys/security/mac_stub/mac_stub.c +++ b/sys/security/mac_stub/mac_stub.c @@ -1,6 +1,6 @@ /*- * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson - * Copyright (c) 2001, 2002 Networks Associates Technology, Inc. + * Copyright (c) 2001, 2002, 2003 Networks Associates Technology, Inc. * All rights reserved. * * This software was developed by Robert Watson for the TrustedBSD Project. @@ -36,7 +36,9 @@ /* * Developed by the TrustedBSD Project. - * Generic mandatory access module that does nothing. + * + * Stub module that implements a NOOP for most (if not all) MAC Framework + * policy entry points. */ #include @@ -74,30 +76,30 @@ SYSCTL_DECL(_security_mac); -SYSCTL_NODE(_security_mac, OID_AUTO, none, CTLFLAG_RW, 0, - "TrustedBSD mac_none policy controls"); +SYSCTL_NODE(_security_mac, OID_AUTO, stub, CTLFLAG_RW, 0, + "TrustedBSD mac_stub policy controls"); -static int mac_none_enabled = 1; -SYSCTL_INT(_security_mac_none, OID_AUTO, enabled, CTLFLAG_RW, - &mac_none_enabled, 0, "Enforce none policy"); +static int stub_enabled = 1; +SYSCTL_INT(_security_mac_stub, OID_AUTO, enabled, CTLFLAG_RW, + &stub_enabled, 0, "Enforce mac_stub policy"); /* * Policy module operations. */ static void -mac_none_destroy(struct mac_policy_conf *conf) +stub_destroy(struct mac_policy_conf *conf) { } static void -mac_none_init(struct mac_policy_conf *conf) +stub_init(struct mac_policy_conf *conf) { } static int -mac_none_syscall(struct thread *td, int call, void *arg) +stub_syscall(struct thread *td, int call, void *arg) { return (0); @@ -107,26 +109,26 @@ mac_none_syscall(struct thread *td, int call, void *arg) * Label operations. */ static void -mac_none_init_label(struct label *label) +stub_init_label(struct label *label) { } static int -mac_none_init_label_waitcheck(struct label *label, int flag) +stub_init_label_waitcheck(struct label *label, int flag) { return (0); } static void -mac_none_destroy_label(struct label *label) +stub_destroy_label(struct label *label) { } static int -mac_none_externalize_label(struct label *label, char *element_name, +stub_externalize_label(struct label *label, char *element_name, struct sbuf *sb, int *claimed) { @@ -134,7 +136,7 @@ mac_none_externalize_label(struct label *label, char *element_name, } static int -mac_none_internalize_label(struct label *label, char *element_name, +stub_internalize_label(struct label *label, char *element_name, char *element_data, int *claimed) { @@ -146,7 +148,7 @@ mac_none_internalize_label(struct label *label, char *element_name, * a lot like file system objects. */ static void -mac_none_associate_vnode_devfs(struct mount *mp, struct label *fslabel, +stub_associate_vnode_devfs(struct mount *mp, struct label *fslabel, struct devfs_dirent *de, struct label *delabel, struct vnode *vp, struct label *vlabel) { @@ -154,7 +156,7 @@ mac_none_associate_vnode_devfs(struct mount *mp, struct label *fslabel, } static int -mac_none_associate_vnode_extattr(struct mount *mp, struct label *fslabel, +stub_associate_vnode_extattr(struct mount *mp, struct label *fslabel, struct vnode *vp, struct label *vlabel) { @@ -162,28 +164,28 @@ mac_none_associate_vnode_extattr(struct mount *mp, struct label *fslabel, } static void -mac_none_associate_vnode_singlelabel(struct mount *mp, +stub_associate_vnode_singlelabel(struct mount *mp, struct label *fslabel, struct vnode *vp, struct label *vlabel) { } static void -mac_none_create_devfs_device(struct mount *mp, dev_t dev, +stub_create_devfs_device(struct mount *mp, dev_t dev, struct devfs_dirent *devfs_dirent, struct label *label) { } static void -mac_none_create_devfs_directory(struct mount *mp, char *dirname, +stub_create_devfs_directory(struct mount *mp, char *dirname, int dirnamelen, struct devfs_dirent *devfs_dirent, struct label *label) { } static void -mac_none_create_devfs_symlink(struct ucred *cred, struct mount *mp, +stub_create_devfs_symlink(struct ucred *cred, struct mount *mp, struct devfs_dirent *dd, struct label *ddlabel, struct devfs_dirent *de, struct label *delabel) { @@ -191,7 +193,7 @@ mac_none_create_devfs_symlink(struct ucred *cred, struct mount *mp, } static int -mac_none_create_vnode_extattr(struct ucred *cred, struct mount *mp, +stub_create_vnode_extattr(struct ucred *cred, struct mount *mp, struct label *fslabel, struct vnode *dvp, struct label *dlabel, struct vnode *vp, struct label *vlabel, struct componentname *cnp) { @@ -200,28 +202,28 @@ mac_none_create_vnode_extattr(struct ucred *cred, struct mount *mp, } static void -mac_none_create_mount(struct ucred *cred, struct mount *mp, +stub_create_mount(struct ucred *cred, struct mount *mp, struct label *mntlabel, struct label *fslabel) { } static void -mac_none_create_root_mount(struct ucred *cred, struct mount *mp, +stub_create_root_mount(struct ucred *cred, struct mount *mp, struct label *mntlabel, struct label *fslabel) { } static void -mac_none_relabel_vnode(struct ucred *cred, struct vnode *vp, +stub_relabel_vnode(struct ucred *cred, struct vnode *vp, struct label *vnodelabel, struct label *label) { } static int -mac_none_setlabel_vnode_extattr(struct ucred *cred, struct vnode *vp, +stub_setlabel_vnode_extattr(struct ucred *cred, struct vnode *vp, struct label *vlabel, struct label *intlabel) { @@ -229,7 +231,7 @@ mac_none_setlabel_vnode_extattr(struct ucred *cred, struct vnode *vp, } static void -mac_none_update_devfsdirent(struct mount *mp, +stub_update_devfsdirent(struct mount *mp, struct devfs_dirent *devfs_dirent, struct label *direntlabel, struct vnode *vp, struct label *vnodelabel) { @@ -240,28 +242,28 @@ mac_none_update_devfsdirent(struct mount *mp, * Labeling event operations: IPC object. */ static void -mac_none_create_mbuf_from_socket(struct socket *so, struct label *socketlabel, +stub_create_mbuf_from_socket(struct socket *so, struct label *socketlabel, struct mbuf *m, struct label *mbuflabel) { } static void -mac_none_create_socket(struct ucred *cred, struct socket *socket, +stub_create_socket(struct ucred *cred, struct socket *socket, struct label *socketlabel) { } static void -mac_none_create_pipe(struct ucred *cred, struct pipe *pipe, +stub_create_pipe(struct ucred *cred, struct pipe *pipe, struct label *pipelabel) { } static void -mac_none_create_socket_from_socket(struct socket *oldsocket, +stub_create_socket_from_socket(struct socket *oldsocket, struct label *oldsocketlabel, struct socket *newsocket, struct label *newsocketlabel) { @@ -269,28 +271,28 @@ mac_none_create_socket_from_socket(struct socket *oldsocket, } static void -mac_none_relabel_socket(struct ucred *cred, struct socket *socket, +stub_relabel_socket(struct ucred *cred, struct socket *socket, struct label *socketlabel, struct label *newlabel) { } static void -mac_none_relabel_pipe(struct ucred *cred, struct pipe *pipe, +stub_relabel_pipe(struct ucred *cred, struct pipe *pipe, struct label *pipelabel, struct label *newlabel) { } static void -mac_none_set_socket_peer_from_mbuf(struct mbuf *mbuf, struct label *mbuflabel, +stub_set_socket_peer_from_mbuf(struct mbuf *mbuf, struct label *mbuflabel, struct socket *socket, struct label *socketpeerlabel) { } static void -mac_none_set_socket_peer_from_socket(struct socket *oldsocket, +stub_set_socket_peer_from_socket(struct socket *oldsocket, struct label *oldsocketlabel, struct socket *newsocket, struct label *newsocketpeerlabel) { @@ -301,41 +303,41 @@ mac_none_set_socket_peer_from_socket(struct socket *oldsocket, * Labeling event operations: network objects. */ static void -mac_none_create_bpfdesc(struct ucred *cred, struct bpf_d *bpf_d, +stub_create_bpfdesc(struct ucred *cred, struct bpf_d *bpf_d, struct label *bpflabel) { } static void -mac_none_create_datagram_from_ipq(struct ipq *ipq, struct label *ipqlabel, +stub_create_datagram_from_ipq(struct ipq *ipq, struct label *ipqlabel, struct mbuf *datagram, struct label *datagramlabel) { } static void -mac_none_create_fragment(struct mbuf *datagram, struct label *datagramlabel, +stub_create_fragment(struct mbuf *datagram, struct label *datagramlabel, struct mbuf *fragment, struct label *fragmentlabel) { } static void -mac_none_create_ifnet(struct ifnet *ifnet, struct label *ifnetlabel) +stub_create_ifnet(struct ifnet *ifnet, struct label *ifnetlabel) { } static void -mac_none_create_ipq(struct mbuf *fragment, struct label *fragmentlabel, +stub_create_ipq(struct mbuf *fragment, struct label *fragmentlabel, struct ipq *ipq, struct label *ipqlabel) { } static void -mac_none_create_mbuf_from_mbuf(struct mbuf *oldmbuf, +stub_create_mbuf_from_mbuf(struct mbuf *oldmbuf, struct label *oldmbuflabel, struct mbuf *newmbuf, struct label *newmbuflabel) { @@ -343,28 +345,28 @@ mac_none_create_mbuf_from_mbuf(struct mbuf *oldmbuf, } static void -mac_none_create_mbuf_linklayer(struct ifnet *ifnet, struct label *ifnetlabel, +stub_create_mbuf_linklayer(struct ifnet *ifnet, struct label *ifnetlabel, struct mbuf *mbuf, struct label *mbuflabel) { } static void -mac_none_create_mbuf_from_bpfdesc(struct bpf_d *bpf_d, struct label *bpflabel, +stub_create_mbuf_from_bpfdesc(struct bpf_d *bpf_d, struct label *bpflabel, struct mbuf *mbuf, struct label *mbuflabel) { } static void -mac_none_create_mbuf_from_ifnet(struct ifnet *ifnet, struct label *ifnetlabel, +stub_create_mbuf_from_ifnet(struct ifnet *ifnet, struct label *ifnetlabel, struct mbuf *m, struct label *mbuflabel) { } static void -mac_none_create_mbuf_multicast_encap(struct mbuf *oldmbuf, +stub_create_mbuf_multicast_encap(struct mbuf *oldmbuf, struct label *oldmbuflabel, struct ifnet *ifnet, struct label *ifnetlabel, struct mbuf *newmbuf, struct label *newmbuflabel) { @@ -372,14 +374,14 @@ mac_none_create_mbuf_multicast_encap(struct mbuf *oldmbuf, } static void -mac_none_create_mbuf_netlayer(struct mbuf *oldmbuf, +stub_create_mbuf_netlayer(struct mbuf *oldmbuf, struct label *oldmbuflabel, struct mbuf *newmbuf, struct label *newmbuflabel) { } static int -mac_none_fragment_match(struct mbuf *fragment, struct label *fragmentlabel, +stub_fragment_match(struct mbuf *fragment, struct label *fragmentlabel, struct ipq *ipq, struct label *ipqlabel) { @@ -387,14 +389,14 @@ mac_none_fragment_match(struct mbuf *fragment, struct label *fragmentlabel, } static void -mac_none_relabel_ifnet(struct ucred *cred, struct ifnet *ifnet, +stub_relabel_ifnet(struct ucred *cred, struct ifnet *ifnet, struct label *ifnetlabel, struct label *newlabel) { } static void -mac_none_update_ipq(struct mbuf *fragment, struct label *fragmentlabel, +stub_update_ipq(struct mbuf *fragment, struct label *fragmentlabel, struct ipq *ipq, struct label *ipqlabel) { @@ -404,13 +406,13 @@ mac_none_update_ipq(struct mbuf *fragment, struct label *fragmentlabel, * Labeling event operations: processes. */ static void -mac_none_create_cred(struct ucred *cred_parent, struct ucred *cred_child) +stub_create_cred(struct ucred *cred_parent, struct ucred *cred_child) { } static void -mac_none_execve_transition(struct ucred *old, struct ucred *new, +stub_execve_transition(struct ucred *old, struct ucred *new, struct vnode *vp, struct label *vnodelabel, struct label *interpvnodelabel, struct image_params *imgp, struct label *execlabel) @@ -419,7 +421,7 @@ mac_none_execve_transition(struct ucred *old, struct ucred *new, } static int -mac_none_execve_will_transition(struct ucred *old, struct vnode *vp, +stub_execve_will_transition(struct ucred *old, struct vnode *vp, struct label *vnodelabel, struct label *interpvnodelabel, struct image_params *imgp, struct label *execlabel) { @@ -428,25 +430,25 @@ mac_none_execve_will_transition(struct ucred *old, struct vnode *vp, } static void -mac_none_create_proc0(struct ucred *cred) +stub_create_proc0(struct ucred *cred) { } static void -mac_none_create_proc1(struct ucred *cred) +stub_create_proc1(struct ucred *cred) { } static void -mac_none_relabel_cred(struct ucred *cred, struct label *newlabel) +stub_relabel_cred(struct ucred *cred, struct label *newlabel) { } static void -mac_none_thread_userret(struct thread *td) +stub_thread_userret(struct thread *td) { } @@ -455,7 +457,7 @@ mac_none_thread_userret(struct thread *td) * Access control checks. */ static int -mac_none_check_bpfdesc_receive(struct bpf_d *bpf_d, struct label *bpflabel, +stub_check_bpfdesc_receive(struct bpf_d *bpf_d, struct label *bpflabel, struct ifnet *ifnet, struct label *ifnet_label) { @@ -463,21 +465,21 @@ mac_none_check_bpfdesc_receive(struct bpf_d *bpf_d, struct label *bpflabel, } static int -mac_none_check_cred_relabel(struct ucred *cred, struct label *newlabel) +stub_check_cred_relabel(struct ucred *cred, struct label *newlabel) { return (0); } static int -mac_none_check_cred_visible(struct ucred *u1, struct ucred *u2) +stub_check_cred_visible(struct ucred *u1, struct ucred *u2) { return (0); } static int -mac_none_check_ifnet_relabel(struct ucred *cred, struct ifnet *ifnet, +stub_check_ifnet_relabel(struct ucred *cred, struct ifnet *ifnet, struct label *ifnetlabel, struct label *newlabel) { @@ -485,7 +487,7 @@ mac_none_check_ifnet_relabel(struct ucred *cred, struct ifnet *ifnet, } static int -mac_none_check_ifnet_transmit(struct ifnet *ifnet, struct label *ifnetlabel, +stub_check_ifnet_transmit(struct ifnet *ifnet, struct label *ifnetlabel, struct mbuf *m, struct label *mbuflabel) { @@ -493,35 +495,35 @@ mac_none_check_ifnet_transmit(struct ifnet *ifnet, struct label *ifnetlabel, } static int -mac_none_check_kenv_dump(struct ucred *cred) +stub_check_kenv_dump(struct ucred *cred) { return (0); } static int -mac_none_check_kenv_get(struct ucred *cred, char *name) +stub_check_kenv_get(struct ucred *cred, char *name) { return (0); } static int -mac_none_check_kenv_set(struct ucred *cred, char *name, char *value) +stub_check_kenv_set(struct ucred *cred, char *name, char *value) { return (0); } static int -mac_none_check_kenv_unset(struct ucred *cred, char *name) +stub_check_kenv_unset(struct ucred *cred, char *name) { return (0); } static int -mac_none_check_kld_load(struct ucred *cred, struct vnode *vp, +stub_check_kld_load(struct ucred *cred, struct vnode *vp, struct label *vlabel) { @@ -529,21 +531,21 @@ mac_none_check_kld_load(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_kld_stat(struct ucred *cred) +stub_check_kld_stat(struct ucred *cred) { return (0); } static int -mac_none_check_kld_unload(struct ucred *cred) +stub_check_kld_unload(struct ucred *cred) { return (0); } static int -mac_none_check_mount_stat(struct ucred *cred, struct mount *mp, +stub_check_mount_stat(struct ucred *cred, struct mount *mp, struct label *mntlabel) { @@ -551,7 +553,7 @@ mac_none_check_mount_stat(struct ucred *cred, struct mount *mp, } static int -mac_none_check_pipe_ioctl(struct ucred *cred, struct pipe *pipe, +stub_check_pipe_ioctl(struct ucred *cred, struct pipe *pipe, struct label *pipelabel, unsigned long cmd, void /* caddr_t */ *data) { @@ -559,7 +561,7 @@ mac_none_check_pipe_ioctl(struct ucred *cred, struct pipe *pipe, } static int -mac_none_check_pipe_poll(struct ucred *cred, struct pipe *pipe, +stub_check_pipe_poll(struct ucred *cred, struct pipe *pipe, struct label *pipelabel) { @@ -567,7 +569,7 @@ mac_none_check_pipe_poll(struct ucred *cred, struct pipe *pipe, } static int -mac_none_check_pipe_read(struct ucred *cred, struct pipe *pipe, +stub_check_pipe_read(struct ucred *cred, struct pipe *pipe, struct label *pipelabel) { @@ -575,7 +577,7 @@ mac_none_check_pipe_read(struct ucred *cred, struct pipe *pipe, } static int -mac_none_check_pipe_relabel(struct ucred *cred, struct pipe *pipe, +stub_check_pipe_relabel(struct ucred *cred, struct pipe *pipe, struct label *pipelabel, struct label *newlabel) { @@ -583,7 +585,7 @@ mac_none_check_pipe_relabel(struct ucred *cred, struct pipe *pipe, } static int -mac_none_check_pipe_stat(struct ucred *cred, struct pipe *pipe, +stub_check_pipe_stat(struct ucred *cred, struct pipe *pipe, struct label *pipelabel) { @@ -591,7 +593,7 @@ mac_none_check_pipe_stat(struct ucred *cred, struct pipe *pipe, } static int -mac_none_check_pipe_write(struct ucred *cred, struct pipe *pipe, +stub_check_pipe_write(struct ucred *cred, struct pipe *pipe, struct label *pipelabel) { @@ -599,28 +601,28 @@ mac_none_check_pipe_write(struct ucred *cred, struct pipe *pipe, } static int -mac_none_check_proc_debug(struct ucred *cred, struct proc *proc) +stub_check_proc_debug(struct ucred *cred, struct proc *proc) { return (0); } static int -mac_none_check_proc_sched(struct ucred *cred, struct proc *proc) +stub_check_proc_sched(struct ucred *cred, struct proc *proc) { return (0); } static int -mac_none_check_proc_signal(struct ucred *cred, struct proc *proc, int signum) +stub_check_proc_signal(struct ucred *cred, struct proc *proc, int signum) { return (0); } static int -mac_none_check_socket_bind(struct ucred *cred, struct socket *socket, +stub_check_socket_bind(struct ucred *cred, struct socket *socket, struct label *socketlabel, struct sockaddr *sockaddr) { @@ -628,7 +630,7 @@ mac_none_check_socket_bind(struct ucred *cred, struct socket *socket, } static int -mac_none_check_socket_connect(struct ucred *cred, struct socket *socket, +stub_check_socket_connect(struct ucred *cred, struct socket *socket, struct label *socketlabel, struct sockaddr *sockaddr) { @@ -636,7 +638,7 @@ mac_none_check_socket_connect(struct ucred *cred, struct socket *socket, } static int -mac_none_check_socket_deliver(struct socket *so, struct label *socketlabel, +stub_check_socket_deliver(struct socket *so, struct label *socketlabel, struct mbuf *m, struct label *mbuflabel) { @@ -644,7 +646,7 @@ mac_none_check_socket_deliver(struct socket *so, struct label *socketlabel, } static int -mac_none_check_socket_listen(struct ucred *cred, struct socket *so, +stub_check_socket_listen(struct ucred *cred, struct socket *so, struct label *socketlabel) { @@ -652,7 +654,7 @@ mac_none_check_socket_listen(struct ucred *cred, struct socket *so, } static int -mac_none_check_socket_relabel(struct ucred *cred, struct socket *socket, +stub_check_socket_relabel(struct ucred *cred, struct socket *socket, struct label *socketlabel, struct label *newlabel) { @@ -660,7 +662,7 @@ mac_none_check_socket_relabel(struct ucred *cred, struct socket *socket, } static int -mac_none_check_socket_visible(struct ucred *cred, struct socket *socket, +stub_check_socket_visible(struct ucred *cred, struct socket *socket, struct label *socketlabel) { @@ -668,14 +670,14 @@ mac_none_check_socket_visible(struct ucred *cred, struct socket *socket, } static int -mac_none_check_sysarch_ioperm(struct ucred *cred) +stub_check_sysarch_ioperm(struct ucred *cred) { return (0); } static int -mac_none_check_system_acct(struct ucred *cred, struct vnode *vp, +stub_check_system_acct(struct ucred *cred, struct vnode *vp, struct label *vlabel) { @@ -683,21 +685,21 @@ mac_none_check_system_acct(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_system_reboot(struct ucred *cred, int how) +stub_check_system_reboot(struct ucred *cred, int how) { return (0); } static int -mac_none_check_system_settime(struct ucred *cred) +stub_check_system_settime(struct ucred *cred) { return (0); } static int -mac_none_check_system_swapon(struct ucred *cred, struct vnode *vp, +stub_check_system_swapon(struct ucred *cred, struct vnode *vp, struct label *label) { @@ -705,7 +707,7 @@ mac_none_check_system_swapon(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_system_swapoff(struct ucred *cred, struct vnode *vp, +stub_check_system_swapoff(struct ucred *cred, struct vnode *vp, struct label *label) { @@ -713,7 +715,7 @@ mac_none_check_system_swapoff(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_system_sysctl(struct ucred *cred, int *name, u_int namelen, +stub_check_system_sysctl(struct ucred *cred, int *name, u_int namelen, void *old, size_t *oldlenp, int inkernel, void *new, size_t newlen) { @@ -721,7 +723,7 @@ mac_none_check_system_sysctl(struct ucred *cred, int *name, u_int namelen, } static int -mac_none_check_vnode_access(struct ucred *cred, struct vnode *vp, +stub_check_vnode_access(struct ucred *cred, struct vnode *vp, struct label *label, int acc_mode) { @@ -729,7 +731,7 @@ mac_none_check_vnode_access(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_chdir(struct ucred *cred, struct vnode *dvp, +stub_check_vnode_chdir(struct ucred *cred, struct vnode *dvp, struct label *dlabel) { @@ -737,7 +739,7 @@ mac_none_check_vnode_chdir(struct ucred *cred, struct vnode *dvp, } static int -mac_none_check_vnode_chroot(struct ucred *cred, struct vnode *dvp, +stub_check_vnode_chroot(struct ucred *cred, struct vnode *dvp, struct label *dlabel) { @@ -745,7 +747,7 @@ mac_none_check_vnode_chroot(struct ucred *cred, struct vnode *dvp, } static int -mac_none_check_vnode_create(struct ucred *cred, struct vnode *dvp, +stub_check_vnode_create(struct ucred *cred, struct vnode *dvp, struct label *dlabel, struct componentname *cnp, struct vattr *vap) { @@ -753,7 +755,7 @@ mac_none_check_vnode_create(struct ucred *cred, struct vnode *dvp, } static int -mac_none_check_vnode_delete(struct ucred *cred, struct vnode *dvp, +stub_check_vnode_delete(struct ucred *cred, struct vnode *dvp, struct label *dlabel, struct vnode *vp, struct label *label, struct componentname *cnp) { @@ -762,7 +764,7 @@ mac_none_check_vnode_delete(struct ucred *cred, struct vnode *dvp, } static int -mac_none_check_vnode_deleteacl(struct ucred *cred, struct vnode *vp, +stub_check_vnode_deleteacl(struct ucred *cred, struct vnode *vp, struct label *label, acl_type_t type) { @@ -770,7 +772,7 @@ mac_none_check_vnode_deleteacl(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_exec(struct ucred *cred, struct vnode *vp, +stub_check_vnode_exec(struct ucred *cred, struct vnode *vp, struct label *label, struct image_params *imgp, struct label *execlabel) { @@ -779,7 +781,7 @@ mac_none_check_vnode_exec(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_getacl(struct ucred *cred, struct vnode *vp, +stub_check_vnode_getacl(struct ucred *cred, struct vnode *vp, struct label *label, acl_type_t type) { @@ -787,7 +789,7 @@ mac_none_check_vnode_getacl(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_getextattr(struct ucred *cred, struct vnode *vp, +stub_check_vnode_getextattr(struct ucred *cred, struct vnode *vp, struct label *label, int attrnamespace, const char *name, struct uio *uio) { @@ -795,7 +797,7 @@ mac_none_check_vnode_getextattr(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_link(struct ucred *cred, struct vnode *dvp, +stub_check_vnode_link(struct ucred *cred, struct vnode *dvp, struct label *dlabel, struct vnode *vp, struct label *label, struct componentname *cnp) { @@ -804,7 +806,7 @@ mac_none_check_vnode_link(struct ucred *cred, struct vnode *dvp, } static int -mac_none_check_vnode_lookup(struct ucred *cred, struct vnode *dvp, +stub_check_vnode_lookup(struct ucred *cred, struct vnode *dvp, struct label *dlabel, struct componentname *cnp) { @@ -812,7 +814,7 @@ mac_none_check_vnode_lookup(struct ucred *cred, struct vnode *dvp, } static int -mac_none_check_vnode_mmap(struct ucred *cred, struct vnode *vp, +stub_check_vnode_mmap(struct ucred *cred, struct vnode *vp, struct label *label, int prot) { @@ -820,7 +822,7 @@ mac_none_check_vnode_mmap(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_mprotect(struct ucred *cred, struct vnode *vp, +stub_check_vnode_mprotect(struct ucred *cred, struct vnode *vp, struct label *label, int prot) { @@ -828,7 +830,7 @@ mac_none_check_vnode_mprotect(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_open(struct ucred *cred, struct vnode *vp, +stub_check_vnode_open(struct ucred *cred, struct vnode *vp, struct label *filelabel, int acc_mode) { @@ -836,7 +838,7 @@ mac_none_check_vnode_open(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_poll(struct ucred *active_cred, struct ucred *file_cred, +stub_check_vnode_poll(struct ucred *active_cred, struct ucred *file_cred, struct vnode *vp, struct label *label) { @@ -844,7 +846,7 @@ mac_none_check_vnode_poll(struct ucred *active_cred, struct ucred *file_cred, } static int -mac_none_check_vnode_read(struct ucred *active_cred, struct ucred *file_cred, +stub_check_vnode_read(struct ucred *active_cred, struct ucred *file_cred, struct vnode *vp, struct label *label) { @@ -852,7 +854,7 @@ mac_none_check_vnode_read(struct ucred *active_cred, struct ucred *file_cred, } static int -mac_none_check_vnode_readdir(struct ucred *cred, struct vnode *vp, +stub_check_vnode_readdir(struct ucred *cred, struct vnode *vp, struct label *dlabel) { @@ -860,7 +862,7 @@ mac_none_check_vnode_readdir(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_readlink(struct ucred *cred, struct vnode *vp, +stub_check_vnode_readlink(struct ucred *cred, struct vnode *vp, struct label *vnodelabel) { @@ -868,7 +870,7 @@ mac_none_check_vnode_readlink(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_relabel(struct ucred *cred, struct vnode *vp, +stub_check_vnode_relabel(struct ucred *cred, struct vnode *vp, struct label *vnodelabel, struct label *newlabel) { @@ -876,7 +878,7 @@ mac_none_check_vnode_relabel(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_rename_from(struct ucred *cred, struct vnode *dvp, +stub_check_vnode_rename_from(struct ucred *cred, struct vnode *dvp, struct label *dlabel, struct vnode *vp, struct label *label, struct componentname *cnp) { @@ -885,7 +887,7 @@ mac_none_check_vnode_rename_from(struct ucred *cred, struct vnode *dvp, } static int -mac_none_check_vnode_rename_to(struct ucred *cred, struct vnode *dvp, +stub_check_vnode_rename_to(struct ucred *cred, struct vnode *dvp, struct label *dlabel, struct vnode *vp, struct label *label, int samedir, struct componentname *cnp) { @@ -894,7 +896,7 @@ mac_none_check_vnode_rename_to(struct ucred *cred, struct vnode *dvp, } static int -mac_none_check_vnode_revoke(struct ucred *cred, struct vnode *vp, +stub_check_vnode_revoke(struct ucred *cred, struct vnode *vp, struct label *label) { @@ -902,7 +904,7 @@ mac_none_check_vnode_revoke(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_setacl(struct ucred *cred, struct vnode *vp, +stub_check_vnode_setacl(struct ucred *cred, struct vnode *vp, struct label *label, acl_type_t type, struct acl *acl) { @@ -910,7 +912,7 @@ mac_none_check_vnode_setacl(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_setextattr(struct ucred *cred, struct vnode *vp, +stub_check_vnode_setextattr(struct ucred *cred, struct vnode *vp, struct label *label, int attrnamespace, const char *name, struct uio *uio) { @@ -918,7 +920,7 @@ mac_none_check_vnode_setextattr(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_setflags(struct ucred *cred, struct vnode *vp, +stub_check_vnode_setflags(struct ucred *cred, struct vnode *vp, struct label *label, u_long flags) { @@ -926,7 +928,7 @@ mac_none_check_vnode_setflags(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_setmode(struct ucred *cred, struct vnode *vp, +stub_check_vnode_setmode(struct ucred *cred, struct vnode *vp, struct label *label, mode_t mode) { @@ -934,7 +936,7 @@ mac_none_check_vnode_setmode(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_setowner(struct ucred *cred, struct vnode *vp, +stub_check_vnode_setowner(struct ucred *cred, struct vnode *vp, struct label *label, uid_t uid, gid_t gid) { @@ -942,7 +944,7 @@ mac_none_check_vnode_setowner(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_setutimes(struct ucred *cred, struct vnode *vp, +stub_check_vnode_setutimes(struct ucred *cred, struct vnode *vp, struct label *label, struct timespec atime, struct timespec mtime) { @@ -950,7 +952,7 @@ mac_none_check_vnode_setutimes(struct ucred *cred, struct vnode *vp, } static int -mac_none_check_vnode_stat(struct ucred *active_cred, struct ucred *file_cred, +stub_check_vnode_stat(struct ucred *active_cred, struct ucred *file_cred, struct vnode *vp, struct label *label) { @@ -958,161 +960,161 @@ mac_none_check_vnode_stat(struct ucred *active_cred, struct ucred *file_cred, } static int -mac_none_check_vnode_write(struct ucred *active_cred, +stub_check_vnode_write(struct ucred *active_cred, struct ucred *file_cred, struct vnode *vp, struct label *label) { return (0); } -static struct mac_policy_ops mac_none_ops = +static struct mac_policy_ops mac_stub_ops = { - .mpo_destroy = mac_none_destroy, - .mpo_init = mac_none_init, - .mpo_syscall = mac_none_syscall, - .mpo_init_bpfdesc_label = mac_none_init_label, - .mpo_init_cred_label = mac_none_init_label, - .mpo_init_devfsdirent_label = mac_none_init_label, - .mpo_init_ifnet_label = mac_none_init_label, - .mpo_init_ipq_label = mac_none_init_label_waitcheck, - .mpo_init_mbuf_label = mac_none_init_label_waitcheck, - .mpo_init_mount_label = mac_none_init_label, - .mpo_init_mount_fs_label = mac_none_init_label, - .mpo_init_pipe_label = mac_none_init_label, - .mpo_init_socket_label = mac_none_init_label_waitcheck, - .mpo_init_socket_peer_label = mac_none_init_label_waitcheck, - .mpo_init_vnode_label = mac_none_init_label, - .mpo_destroy_bpfdesc_label = mac_none_destroy_label, - .mpo_destroy_cred_label = mac_none_destroy_label, - .mpo_destroy_devfsdirent_label = mac_none_destroy_label, - .mpo_destroy_ifnet_label = mac_none_destroy_label, - .mpo_destroy_ipq_label = mac_none_destroy_label, - .mpo_destroy_mbuf_label = mac_none_destroy_label, - .mpo_destroy_mount_label = mac_none_destroy_label, - .mpo_destroy_mount_fs_label = mac_none_destroy_label, - .mpo_destroy_pipe_label = mac_none_destroy_label, - .mpo_destroy_socket_label = mac_none_destroy_label, - .mpo_destroy_socket_peer_label = mac_none_destroy_label, - .mpo_destroy_vnode_label = mac_none_destroy_label, - .mpo_externalize_cred_label = mac_none_externalize_label, - .mpo_externalize_ifnet_label = mac_none_externalize_label, - .mpo_externalize_pipe_label = mac_none_externalize_label, - .mpo_externalize_socket_label = mac_none_externalize_label, - .mpo_externalize_socket_peer_label = mac_none_externalize_label, - .mpo_externalize_vnode_label = mac_none_externalize_label, - .mpo_internalize_cred_label = mac_none_internalize_label, - .mpo_internalize_ifnet_label = mac_none_internalize_label, - .mpo_internalize_pipe_label = mac_none_internalize_label, - .mpo_internalize_socket_label = mac_none_internalize_label, - .mpo_internalize_vnode_label = mac_none_internalize_label, - .mpo_associate_vnode_devfs = mac_none_associate_vnode_devfs, - .mpo_associate_vnode_extattr = mac_none_associate_vnode_extattr, - .mpo_associate_vnode_singlelabel = mac_none_associate_vnode_singlelabel, - .mpo_create_devfs_device = mac_none_create_devfs_device, - .mpo_create_devfs_directory = mac_none_create_devfs_directory, - .mpo_create_devfs_symlink = mac_none_create_devfs_symlink, - .mpo_create_vnode_extattr = mac_none_create_vnode_extattr, - .mpo_create_mount = mac_none_create_mount, - .mpo_create_root_mount = mac_none_create_root_mount, - .mpo_relabel_vnode = mac_none_relabel_vnode, - .mpo_setlabel_vnode_extattr = mac_none_setlabel_vnode_extattr, - .mpo_update_devfsdirent = mac_none_update_devfsdirent, - .mpo_create_mbuf_from_socket = mac_none_create_mbuf_from_socket, - .mpo_create_pipe = mac_none_create_pipe, - .mpo_create_socket = mac_none_create_socket, - .mpo_create_socket_from_socket = mac_none_create_socket_from_socket, - .mpo_relabel_pipe = mac_none_relabel_pipe, - .mpo_relabel_socket = mac_none_relabel_socket, - .mpo_set_socket_peer_from_mbuf = mac_none_set_socket_peer_from_mbuf, - .mpo_set_socket_peer_from_socket = mac_none_set_socket_peer_from_socket, - .mpo_create_bpfdesc = mac_none_create_bpfdesc, - .mpo_create_ifnet = mac_none_create_ifnet, - .mpo_create_ipq = mac_none_create_ipq, - .mpo_create_datagram_from_ipq = mac_none_create_datagram_from_ipq, - .mpo_create_fragment = mac_none_create_fragment, - .mpo_create_ipq = mac_none_create_ipq, - .mpo_create_mbuf_from_mbuf = mac_none_create_mbuf_from_mbuf, - .mpo_create_mbuf_linklayer = mac_none_create_mbuf_linklayer, - .mpo_create_mbuf_from_bpfdesc = mac_none_create_mbuf_from_bpfdesc, - .mpo_create_mbuf_from_ifnet = mac_none_create_mbuf_from_ifnet, - .mpo_create_mbuf_multicast_encap = mac_none_create_mbuf_multicast_encap, - .mpo_create_mbuf_netlayer = mac_none_create_mbuf_netlayer, - .mpo_fragment_match = mac_none_fragment_match, - .mpo_relabel_ifnet = mac_none_relabel_ifnet, - .mpo_update_ipq = mac_none_update_ipq, - .mpo_create_cred = mac_none_create_cred, - .mpo_execve_transition = mac_none_execve_transition, - .mpo_execve_will_transition = mac_none_execve_will_transition, - .mpo_create_proc0 = mac_none_create_proc0, - .mpo_create_proc1 = mac_none_create_proc1, - .mpo_relabel_cred = mac_none_relabel_cred, - .mpo_thread_userret = mac_none_thread_userret, - .mpo_check_bpfdesc_receive = mac_none_check_bpfdesc_receive, - .mpo_check_cred_relabel = mac_none_check_cred_relabel, - .mpo_check_cred_visible = mac_none_check_cred_visible, - .mpo_check_ifnet_relabel = mac_none_check_ifnet_relabel, - .mpo_check_ifnet_transmit = mac_none_check_ifnet_transmit, - .mpo_check_kenv_dump = mac_none_check_kenv_dump, - .mpo_check_kenv_get = mac_none_check_kenv_get, - .mpo_check_kenv_set = mac_none_check_kenv_set, - .mpo_check_kenv_unset = mac_none_check_kenv_unset, - .mpo_check_kld_load = mac_none_check_kld_load, - .mpo_check_kld_stat = mac_none_check_kld_stat, - .mpo_check_kld_unload = mac_none_check_kld_unload, - .mpo_check_mount_stat = mac_none_check_mount_stat, - .mpo_check_pipe_ioctl = mac_none_check_pipe_ioctl, - .mpo_check_pipe_poll = mac_none_check_pipe_poll, - .mpo_check_pipe_read = mac_none_check_pipe_read, - .mpo_check_pipe_relabel = mac_none_check_pipe_relabel, - .mpo_check_pipe_stat = mac_none_check_pipe_stat, - .mpo_check_pipe_write = mac_none_check_pipe_write, - .mpo_check_proc_debug = mac_none_check_proc_debug, - .mpo_check_proc_sched = mac_none_check_proc_sched, - .mpo_check_proc_signal = mac_none_check_proc_signal, - .mpo_check_socket_bind = mac_none_check_socket_bind, - .mpo_check_socket_connect = mac_none_check_socket_connect, - .mpo_check_socket_deliver = mac_none_check_socket_deliver, - .mpo_check_socket_listen = mac_none_check_socket_listen, - .mpo_check_socket_relabel = mac_none_check_socket_relabel, - .mpo_check_socket_visible = mac_none_check_socket_visible, - .mpo_check_sysarch_ioperm = mac_none_check_sysarch_ioperm, - .mpo_check_system_acct = mac_none_check_system_acct, - .mpo_check_system_reboot = mac_none_check_system_reboot, - .mpo_check_system_settime = mac_none_check_system_settime, - .mpo_check_system_swapon = mac_none_check_system_swapon, - .mpo_check_system_swapoff = mac_none_check_system_swapoff, - .mpo_check_system_sysctl = mac_none_check_system_sysctl, - .mpo_check_vnode_access = mac_none_check_vnode_access, - .mpo_check_vnode_chdir = mac_none_check_vnode_chdir, - .mpo_check_vnode_chroot = mac_none_check_vnode_chroot, - .mpo_check_vnode_create = mac_none_check_vnode_create, - .mpo_check_vnode_delete = mac_none_check_vnode_delete, - .mpo_check_vnode_deleteacl = mac_none_check_vnode_deleteacl, - .mpo_check_vnode_exec = mac_none_check_vnode_exec, - .mpo_check_vnode_getacl = mac_none_check_vnode_getacl, - .mpo_check_vnode_getextattr = mac_none_check_vnode_getextattr, - .mpo_check_vnode_link = mac_none_check_vnode_link, - .mpo_check_vnode_lookup = mac_none_check_vnode_lookup, - .mpo_check_vnode_mmap = mac_none_check_vnode_mmap, - .mpo_check_vnode_mprotect = mac_none_check_vnode_mprotect, - .mpo_check_vnode_open = mac_none_check_vnode_open, - .mpo_check_vnode_poll = mac_none_check_vnode_poll, - .mpo_check_vnode_read = mac_none_check_vnode_read, - .mpo_check_vnode_readdir = mac_none_check_vnode_readdir, - .mpo_check_vnode_readlink = mac_none_check_vnode_readlink, - .mpo_check_vnode_relabel = mac_none_check_vnode_relabel, - .mpo_check_vnode_rename_from = mac_none_check_vnode_rename_from, - .mpo_check_vnode_rename_to = mac_none_check_vnode_rename_to, - .mpo_check_vnode_revoke = mac_none_check_vnode_revoke, - .mpo_check_vnode_setacl = mac_none_check_vnode_setacl, - .mpo_check_vnode_setextattr = mac_none_check_vnode_setextattr, - .mpo_check_vnode_setflags = mac_none_check_vnode_setflags, - .mpo_check_vnode_setmode = mac_none_check_vnode_setmode, - .mpo_check_vnode_setowner = mac_none_check_vnode_setowner, - .mpo_check_vnode_setutimes = mac_none_check_vnode_setutimes, - .mpo_check_vnode_stat = mac_none_check_vnode_stat, - .mpo_check_vnode_write = mac_none_check_vnode_write, + .mpo_destroy = stub_destroy, + .mpo_init = stub_init, + .mpo_syscall = stub_syscall, + .mpo_init_bpfdesc_label = stub_init_label, + .mpo_init_cred_label = stub_init_label, + .mpo_init_devfsdirent_label = stub_init_label, + .mpo_init_ifnet_label = stub_init_label, + .mpo_init_ipq_label = stub_init_label_waitcheck, + .mpo_init_mbuf_label = stub_init_label_waitcheck, + .mpo_init_mount_label = stub_init_label, + .mpo_init_mount_fs_label = stub_init_label, + .mpo_init_pipe_label = stub_init_label, + .mpo_init_socket_label = stub_init_label_waitcheck, + .mpo_init_socket_peer_label = stub_init_label_waitcheck, + .mpo_init_vnode_label = stub_init_label, + .mpo_destroy_bpfdesc_label = stub_destroy_label, + .mpo_destroy_cred_label = stub_destroy_label, + .mpo_destroy_devfsdirent_label = stub_destroy_label, + .mpo_destroy_ifnet_label = stub_destroy_label, + .mpo_destroy_ipq_label = stub_destroy_label, + .mpo_destroy_mbuf_label = stub_destroy_label, + .mpo_destroy_mount_label = stub_destroy_label, + .mpo_destroy_mount_fs_label = stub_destroy_label, + .mpo_destroy_pipe_label = stub_destroy_label, + .mpo_destroy_socket_label = stub_destroy_label, + .mpo_destroy_socket_peer_label = stub_destroy_label, + .mpo_destroy_vnode_label = stub_destroy_label, + .mpo_externalize_cred_label = stub_externalize_label, + .mpo_externalize_ifnet_label = stub_externalize_label, + .mpo_externalize_pipe_label = stub_externalize_label, + .mpo_externalize_socket_label = stub_externalize_label, + .mpo_externalize_socket_peer_label = stub_externalize_label, + .mpo_externalize_vnode_label = stub_externalize_label, + .mpo_internalize_cred_label = stub_internalize_label, + .mpo_internalize_ifnet_label = stub_internalize_label, + .mpo_internalize_pipe_label = stub_internalize_label, + .mpo_internalize_socket_label = stub_internalize_label, + .mpo_internalize_vnode_label = stub_internalize_label, + .mpo_associate_vnode_devfs = stub_associate_vnode_devfs, + .mpo_associate_vnode_extattr = stub_associate_vnode_extattr, + .mpo_associate_vnode_singlelabel = stub_associate_vnode_singlelabel, + .mpo_create_devfs_device = stub_create_devfs_device, + .mpo_create_devfs_directory = stub_create_devfs_directory, + .mpo_create_devfs_symlink = stub_create_devfs_symlink, + .mpo_create_vnode_extattr = stub_create_vnode_extattr, + .mpo_create_mount = stub_create_mount, + .mpo_create_root_mount = stub_create_root_mount, + .mpo_relabel_vnode = stub_relabel_vnode, + .mpo_setlabel_vnode_extattr = stub_setlabel_vnode_extattr, + .mpo_update_devfsdirent = stub_update_devfsdirent, + .mpo_create_mbuf_from_socket = stub_create_mbuf_from_socket, + .mpo_create_pipe = stub_create_pipe, + .mpo_create_socket = stub_create_socket, + .mpo_create_socket_from_socket = stub_create_socket_from_socket, + .mpo_relabel_pipe = stub_relabel_pipe, + .mpo_relabel_socket = stub_relabel_socket, + .mpo_set_socket_peer_from_mbuf = stub_set_socket_peer_from_mbuf, + .mpo_set_socket_peer_from_socket = stub_set_socket_peer_from_socket, + .mpo_create_bpfdesc = stub_create_bpfdesc, + .mpo_create_ifnet = stub_create_ifnet, + .mpo_create_ipq = stub_create_ipq, + .mpo_create_datagram_from_ipq = stub_create_datagram_from_ipq, + .mpo_create_fragment = stub_create_fragment, + .mpo_create_ipq = stub_create_ipq, + .mpo_create_mbuf_from_mbuf = stub_create_mbuf_from_mbuf, + .mpo_create_mbuf_linklayer = stub_create_mbuf_linklayer, + .mpo_create_mbuf_from_bpfdesc = stub_create_mbuf_from_bpfdesc, + .mpo_create_mbuf_from_ifnet = stub_create_mbuf_from_ifnet, + .mpo_create_mbuf_multicast_encap = stub_create_mbuf_multicast_encap, + .mpo_create_mbuf_netlayer = stub_create_mbuf_netlayer, + .mpo_fragment_match = stub_fragment_match, + .mpo_relabel_ifnet = stub_relabel_ifnet, + .mpo_update_ipq = stub_update_ipq, + .mpo_create_cred = stub_create_cred, + .mpo_execve_transition = stub_execve_transition, + .mpo_execve_will_transition = stub_execve_will_transition, + .mpo_create_proc0 = stub_create_proc0, + .mpo_create_proc1 = stub_create_proc1, + .mpo_relabel_cred = stub_relabel_cred, + .mpo_thread_userret = stub_thread_userret, + .mpo_check_bpfdesc_receive = stub_check_bpfdesc_receive, + .mpo_check_cred_relabel = stub_check_cred_relabel, + .mpo_check_cred_visible = stub_check_cred_visible, + .mpo_check_ifnet_relabel = stub_check_ifnet_relabel, + .mpo_check_ifnet_transmit = stub_check_ifnet_transmit, + .mpo_check_kenv_dump = stub_check_kenv_dump, + .mpo_check_kenv_get = stub_check_kenv_get, + .mpo_check_kenv_set = stub_check_kenv_set, + .mpo_check_kenv_unset = stub_check_kenv_unset, + .mpo_check_kld_load = stub_check_kld_load, + .mpo_check_kld_stat = stub_check_kld_stat, + .mpo_check_kld_unload = stub_check_kld_unload, + .mpo_check_mount_stat = stub_check_mount_stat, + .mpo_check_pipe_ioctl = stub_check_pipe_ioctl, + .mpo_check_pipe_poll = stub_check_pipe_poll, + .mpo_check_pipe_read = stub_check_pipe_read, + .mpo_check_pipe_relabel = stub_check_pipe_relabel, + .mpo_check_pipe_stat = stub_check_pipe_stat, + .mpo_check_pipe_write = stub_check_pipe_write, + .mpo_check_proc_debug = stub_check_proc_debug, + .mpo_check_proc_sched = stub_check_proc_sched, + .mpo_check_proc_signal = stub_check_proc_signal, + .mpo_check_socket_bind = stub_check_socket_bind, + .mpo_check_socket_connect = stub_check_socket_connect, + .mpo_check_socket_deliver = stub_check_socket_deliver, + .mpo_check_socket_listen = stub_check_socket_listen, + .mpo_check_socket_relabel = stub_check_socket_relabel, + .mpo_check_socket_visible = stub_check_socket_visible, + .mpo_check_sysarch_ioperm = stub_check_sysarch_ioperm, + .mpo_check_system_acct = stub_check_system_acct, + .mpo_check_system_reboot = stub_check_system_reboot, + .mpo_check_system_settime = stub_check_system_settime, + .mpo_check_system_swapon = stub_check_system_swapon, + .mpo_check_system_swapoff = stub_check_system_swapoff, + .mpo_check_system_sysctl = stub_check_system_sysctl, + .mpo_check_vnode_access = stub_check_vnode_access, + .mpo_check_vnode_chdir = stub_check_vnode_chdir, + .mpo_check_vnode_chroot = stub_check_vnode_chroot, + .mpo_check_vnode_create = stub_check_vnode_create, + .mpo_check_vnode_delete = stub_check_vnode_delete, + .mpo_check_vnode_deleteacl = stub_check_vnode_deleteacl, + .mpo_check_vnode_exec = stub_check_vnode_exec, + .mpo_check_vnode_getacl = stub_check_vnode_getacl, + .mpo_check_vnode_getextattr = stub_check_vnode_getextattr, + .mpo_check_vnode_link = stub_check_vnode_link, + .mpo_check_vnode_lookup = stub_check_vnode_lookup, + .mpo_check_vnode_mmap = stub_check_vnode_mmap, + .mpo_check_vnode_mprotect = stub_check_vnode_mprotect, + .mpo_check_vnode_open = stub_check_vnode_open, + .mpo_check_vnode_poll = stub_check_vnode_poll, + .mpo_check_vnode_read = stub_check_vnode_read, + .mpo_check_vnode_readdir = stub_check_vnode_readdir, + .mpo_check_vnode_readlink = stub_check_vnode_readlink, + .mpo_check_vnode_relabel = stub_check_vnode_relabel, + .mpo_check_vnode_rename_from = stub_check_vnode_rename_from, + .mpo_check_vnode_rename_to = stub_check_vnode_rename_to, + .mpo_check_vnode_revoke = stub_check_vnode_revoke, + .mpo_check_vnode_setacl = stub_check_vnode_setacl, + .mpo_check_vnode_setextattr = stub_check_vnode_setextattr, + .mpo_check_vnode_setflags = stub_check_vnode_setflags, + .mpo_check_vnode_setmode = stub_check_vnode_setmode, + .mpo_check_vnode_setowner = stub_check_vnode_setowner, + .mpo_check_vnode_setutimes = stub_check_vnode_setutimes, + .mpo_check_vnode_stat = stub_check_vnode_stat, + .mpo_check_vnode_write = stub_check_vnode_write, }; -MAC_POLICY_SET(&mac_none_ops, mac_none, "TrustedBSD MAC/None", +MAC_POLICY_SET(&mac_stub_ops, mac_stub, "TrustedBSD MAC/Stub", MPC_LOADTIME_FLAG_UNLOADOK, NULL);