Deleted Added
full compact
mac_test.c (122875) mac_test.c (123173)
1/*-
2 * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
3 * Copyright (c) 2001, 2002, 2003 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 Network

--- 17 unchanged lines hidden (view full) ---

26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
1/*-
2 * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
3 * Copyright (c) 2001, 2002, 2003 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 Network

--- 17 unchanged lines hidden (view full) ---

26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * $FreeBSD: head/sys/security/mac_test/mac_test.c 122875 2003-11-18 00:39:07Z rwatson $
34 * $FreeBSD: head/sys/security/mac_test/mac_test.c 123173 2003-12-06 21:48:03Z rwatson $
35 */
36
37/*
38 * Developed by the TrustedBSD Project.
39 * Generic mandatory access module that does nothing.
40 */
41
42#include <sys/types.h>

--- 543 unchanged lines hidden (view full) ---

586 } else if (SLOT(label) == EXMAGIC) {
587 Debugger("mac_test_destroy_vnode: dup destroy");
588 } else {
589 Debugger("mac_test_destroy_vnode: corrupted label");
590 }
591}
592
593static void
35 */
36
37/*
38 * Developed by the TrustedBSD Project.
39 * Generic mandatory access module that does nothing.
40 */
41
42#include <sys/types.h>

--- 543 unchanged lines hidden (view full) ---

586 } else if (SLOT(label) == EXMAGIC) {
587 Debugger("mac_test_destroy_vnode: dup destroy");
588 } else {
589 Debugger("mac_test_destroy_vnode: corrupted label");
590 }
591}
592
593static void
594mac_test_copy_cred_label(struct label *src, struct label *dest)
595{
596
597 ASSERT_CRED_LABEL(src);
598 ASSERT_CRED_LABEL(dest);
599}
600
601static void
594mac_test_copy_mbuf_label(struct label *src, struct label *dest)
595{
596
597 ASSERT_MBUF_LABEL(src);
598 ASSERT_MBUF_LABEL(dest);
599}
600
601static void

--- 414 unchanged lines hidden (view full) ---

1016 ASSERT_SOCKET_LABEL(solabel);
1017 ASSERT_INPCB_LABEL(inplabel);
1018}
1019
1020/*
1021 * Labeling event operations: processes.
1022 */
1023static void
602mac_test_copy_mbuf_label(struct label *src, struct label *dest)
603{
604
605 ASSERT_MBUF_LABEL(src);
606 ASSERT_MBUF_LABEL(dest);
607}
608
609static void

--- 414 unchanged lines hidden (view full) ---

1024 ASSERT_SOCKET_LABEL(solabel);
1025 ASSERT_INPCB_LABEL(inplabel);
1026}
1027
1028/*
1029 * Labeling event operations: processes.
1030 */
1031static void
1024mac_test_create_cred(struct ucred *cred_parent, struct ucred *cred_child)
1025{
1026
1027 ASSERT_CRED_LABEL(cred_parent->cr_label);
1028 ASSERT_CRED_LABEL(cred_child->cr_label);
1029}
1030
1031static void
1032mac_test_execve_transition(struct ucred *old, struct ucred *new,
1033 struct vnode *vp, struct label *filelabel,
1034 struct label *interpvnodelabel, struct image_params *imgp,
1035 struct label *execlabel)
1036{
1037
1038 ASSERT_CRED_LABEL(old->cr_label);
1039 ASSERT_CRED_LABEL(new->cr_label);

--- 834 unchanged lines hidden (view full) ---

1874 .mpo_destroy_mbuf_label = mac_test_destroy_mbuf_label,
1875 .mpo_destroy_mount_label = mac_test_destroy_mount_label,
1876 .mpo_destroy_mount_fs_label = mac_test_destroy_mount_fs_label,
1877 .mpo_destroy_pipe_label = mac_test_destroy_pipe_label,
1878 .mpo_destroy_proc_label = mac_test_destroy_proc_label,
1879 .mpo_destroy_socket_label = mac_test_destroy_socket_label,
1880 .mpo_destroy_socket_peer_label = mac_test_destroy_socket_peer_label,
1881 .mpo_destroy_vnode_label = mac_test_destroy_vnode_label,
1032mac_test_execve_transition(struct ucred *old, struct ucred *new,
1033 struct vnode *vp, struct label *filelabel,
1034 struct label *interpvnodelabel, struct image_params *imgp,
1035 struct label *execlabel)
1036{
1037
1038 ASSERT_CRED_LABEL(old->cr_label);
1039 ASSERT_CRED_LABEL(new->cr_label);

--- 834 unchanged lines hidden (view full) ---

1874 .mpo_destroy_mbuf_label = mac_test_destroy_mbuf_label,
1875 .mpo_destroy_mount_label = mac_test_destroy_mount_label,
1876 .mpo_destroy_mount_fs_label = mac_test_destroy_mount_fs_label,
1877 .mpo_destroy_pipe_label = mac_test_destroy_pipe_label,
1878 .mpo_destroy_proc_label = mac_test_destroy_proc_label,
1879 .mpo_destroy_socket_label = mac_test_destroy_socket_label,
1880 .mpo_destroy_socket_peer_label = mac_test_destroy_socket_peer_label,
1881 .mpo_destroy_vnode_label = mac_test_destroy_vnode_label,
1882 .mpo_copy_cred_label = mac_test_copy_cred_label,
1882 .mpo_copy_mbuf_label = mac_test_copy_mbuf_label,
1883 .mpo_copy_pipe_label = mac_test_copy_pipe_label,
1884 .mpo_copy_socket_label = mac_test_copy_socket_label,
1885 .mpo_copy_vnode_label = mac_test_copy_vnode_label,
1886 .mpo_externalize_cred_label = mac_test_externalize_label,
1887 .mpo_externalize_ifnet_label = mac_test_externalize_label,
1888 .mpo_externalize_pipe_label = mac_test_externalize_label,
1889 .mpo_externalize_socket_label = mac_test_externalize_label,

--- 37 unchanged lines hidden (view full) ---

1927 .mpo_create_mbuf_multicast_encap = mac_test_create_mbuf_multicast_encap,
1928 .mpo_create_mbuf_netlayer = mac_test_create_mbuf_netlayer,
1929 .mpo_fragment_match = mac_test_fragment_match,
1930 .mpo_reflect_mbuf_icmp = mac_test_reflect_mbuf_icmp,
1931 .mpo_reflect_mbuf_tcp = mac_test_reflect_mbuf_tcp,
1932 .mpo_relabel_ifnet = mac_test_relabel_ifnet,
1933 .mpo_update_ipq = mac_test_update_ipq,
1934 .mpo_inpcb_sosetlabel = mac_test_inpcb_sosetlabel,
1883 .mpo_copy_mbuf_label = mac_test_copy_mbuf_label,
1884 .mpo_copy_pipe_label = mac_test_copy_pipe_label,
1885 .mpo_copy_socket_label = mac_test_copy_socket_label,
1886 .mpo_copy_vnode_label = mac_test_copy_vnode_label,
1887 .mpo_externalize_cred_label = mac_test_externalize_label,
1888 .mpo_externalize_ifnet_label = mac_test_externalize_label,
1889 .mpo_externalize_pipe_label = mac_test_externalize_label,
1890 .mpo_externalize_socket_label = mac_test_externalize_label,

--- 37 unchanged lines hidden (view full) ---

1928 .mpo_create_mbuf_multicast_encap = mac_test_create_mbuf_multicast_encap,
1929 .mpo_create_mbuf_netlayer = mac_test_create_mbuf_netlayer,
1930 .mpo_fragment_match = mac_test_fragment_match,
1931 .mpo_reflect_mbuf_icmp = mac_test_reflect_mbuf_icmp,
1932 .mpo_reflect_mbuf_tcp = mac_test_reflect_mbuf_tcp,
1933 .mpo_relabel_ifnet = mac_test_relabel_ifnet,
1934 .mpo_update_ipq = mac_test_update_ipq,
1935 .mpo_inpcb_sosetlabel = mac_test_inpcb_sosetlabel,
1935 .mpo_create_cred = mac_test_create_cred,
1936 .mpo_execve_transition = mac_test_execve_transition,
1937 .mpo_execve_will_transition = mac_test_execve_will_transition,
1938 .mpo_create_proc0 = mac_test_create_proc0,
1939 .mpo_create_proc1 = mac_test_create_proc1,
1940 .mpo_relabel_cred = mac_test_relabel_cred,
1941 .mpo_thread_userret = mac_test_thread_userret,
1942 .mpo_check_bpfdesc_receive = mac_test_check_bpfdesc_receive,
1943 .mpo_check_cred_relabel = mac_test_check_cred_relabel,

--- 70 unchanged lines hidden ---
1936 .mpo_execve_transition = mac_test_execve_transition,
1937 .mpo_execve_will_transition = mac_test_execve_will_transition,
1938 .mpo_create_proc0 = mac_test_create_proc0,
1939 .mpo_create_proc1 = mac_test_create_proc1,
1940 .mpo_relabel_cred = mac_test_relabel_cred,
1941 .mpo_thread_userret = mac_test_thread_userret,
1942 .mpo_check_bpfdesc_receive = mac_test_check_bpfdesc_receive,
1943 .mpo_check_cred_relabel = mac_test_check_cred_relabel,

--- 70 unchanged lines hidden ---