mac_test.c (172955) | mac_test.c (173018) |
---|---|
1/*- 2 * Copyright (c) 1999-2002, 2007 Robert N. M. Watson 3 * Copyright (c) 2001-2005 McAfee, Inc. 4 * Copyright (c) 2006 SPARTA, Inc. 5 * All rights reserved. 6 * 7 * This software was developed by Robert Watson for the TrustedBSD Project. 8 * --- 21 unchanged lines hidden (view full) --- 30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * | 1/*- 2 * Copyright (c) 1999-2002, 2007 Robert N. M. Watson 3 * Copyright (c) 2001-2005 McAfee, Inc. 4 * Copyright (c) 2006 SPARTA, Inc. 5 * All rights reserved. 6 * 7 * This software was developed by Robert Watson for the TrustedBSD Project. 8 * --- 21 unchanged lines hidden (view full) --- 30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * |
38 * $FreeBSD: head/sys/security/mac_test/mac_test.c 172955 2007-10-25 11:31:11Z rwatson $ | 38 * $FreeBSD: head/sys/security/mac_test/mac_test.c 173018 2007-10-26 13:18:38Z rwatson $ |
39 */ 40 41/* 42 * Developed by the TrustedBSD Project. 43 * 44 * MAC Test policy - tests MAC Framework labeling by assigning object class 45 * magic numbers to each label and validates that each time an object label 46 * is passed into the policy, it has a consistent object type, catching --- 903 unchanged lines hidden (view full) --- 950 struct mbuf *m, struct label *mlabel) 951{ 952 953 LABEL_CHECK(inplabel, MAGIC_INPCB); 954 LABEL_CHECK(mlabel, MAGIC_MBUF); 955 COUNTER_INC(inpcb_create_mbuf); 956} 957 | 39 */ 40 41/* 42 * Developed by the TrustedBSD Project. 43 * 44 * MAC Test policy - tests MAC Framework labeling by assigning object class 45 * magic numbers to each label and validates that each time an object label 46 * is passed into the policy, it has a consistent object type, catching --- 903 unchanged lines hidden (view full) --- 950 struct mbuf *m, struct label *mlabel) 951{ 952 953 LABEL_CHECK(inplabel, MAGIC_INPCB); 954 LABEL_CHECK(mlabel, MAGIC_MBUF); 955 COUNTER_INC(inpcb_create_mbuf); 956} 957 |
958COUNTER_DECL(create_mbuf_linklayer); | 958COUNTER_DECL(mbuf_create_linklayer); |
959static void | 959static void |
960test_create_mbuf_linklayer(struct ifnet *ifp, struct label *ifplabel, | 960test_mbuf_create_linklayer(struct ifnet *ifp, struct label *ifplabel, |
961 struct mbuf *mbuf, struct label *mbuflabel) 962{ 963 964 LABEL_CHECK(ifplabel, MAGIC_IFNET); 965 LABEL_CHECK(mbuflabel, MAGIC_MBUF); | 961 struct mbuf *mbuf, struct label *mbuflabel) 962{ 963 964 LABEL_CHECK(ifplabel, MAGIC_IFNET); 965 LABEL_CHECK(mbuflabel, MAGIC_MBUF); |
966 COUNTER_INC(create_mbuf_linklayer); | 966 COUNTER_INC(mbuf_create_linklayer); |
967} 968 969COUNTER_DECL(bpfdesc_create_mbuf); 970static void 971test_bpfdesc_create_mbuf(struct bpf_d *bpf_d, struct label *bpflabel, 972 struct mbuf *mbuf, struct label *mbuflabel) 973{ 974 --- 1581 unchanged lines hidden (view full) --- 2556 .mpo_sysvmsg_create = test_sysvmsg_create, 2557 .mpo_sysvmsq_create = test_sysvmsq_create, 2558 .mpo_sysvsem_create = test_sysvsem_create, 2559 .mpo_sysvshm_create = test_sysvshm_create, 2560 .mpo_ipq_reassemble = test_ipq_reassemble, 2561 .mpo_netinet_fragment = test_netinet_fragment, 2562 .mpo_ipq_create = test_ipq_create, 2563 .mpo_inpcb_create_mbuf = test_inpcb_create_mbuf, | 967} 968 969COUNTER_DECL(bpfdesc_create_mbuf); 970static void 971test_bpfdesc_create_mbuf(struct bpf_d *bpf_d, struct label *bpflabel, 972 struct mbuf *mbuf, struct label *mbuflabel) 973{ 974 --- 1581 unchanged lines hidden (view full) --- 2556 .mpo_sysvmsg_create = test_sysvmsg_create, 2557 .mpo_sysvmsq_create = test_sysvmsq_create, 2558 .mpo_sysvsem_create = test_sysvsem_create, 2559 .mpo_sysvshm_create = test_sysvshm_create, 2560 .mpo_ipq_reassemble = test_ipq_reassemble, 2561 .mpo_netinet_fragment = test_netinet_fragment, 2562 .mpo_ipq_create = test_ipq_create, 2563 .mpo_inpcb_create_mbuf = test_inpcb_create_mbuf, |
2564 .mpo_create_mbuf_linklayer = test_create_mbuf_linklayer, | 2564 .mpo_mbuf_create_linklayer = test_mbuf_create_linklayer, |
2565 .mpo_bpfdesc_create_mbuf = test_bpfdesc_create_mbuf, 2566 .mpo_ifnet_create_mbuf = test_ifnet_create_mbuf, 2567 .mpo_mbuf_create_multicast_encap = test_mbuf_create_multicast_encap, 2568 .mpo_mbuf_create_netlayer = test_mbuf_create_netlayer, 2569 .mpo_ipq_match = test_ipq_match, 2570 .mpo_netinet_icmp_reply = test_netinet_icmp_reply, 2571 .mpo_netinet_tcp_reply = test_netinet_tcp_reply, 2572 .mpo_ifnet_relabel = test_ifnet_relabel, --- 122 unchanged lines hidden --- | 2565 .mpo_bpfdesc_create_mbuf = test_bpfdesc_create_mbuf, 2566 .mpo_ifnet_create_mbuf = test_ifnet_create_mbuf, 2567 .mpo_mbuf_create_multicast_encap = test_mbuf_create_multicast_encap, 2568 .mpo_mbuf_create_netlayer = test_mbuf_create_netlayer, 2569 .mpo_ipq_match = test_ipq_match, 2570 .mpo_netinet_icmp_reply = test_netinet_icmp_reply, 2571 .mpo_netinet_tcp_reply = test_netinet_tcp_reply, 2572 .mpo_ifnet_relabel = test_ifnet_relabel, --- 122 unchanged lines hidden --- |