mac_process.c (112675) | mac_process.c (113255) |
---|---|
1/*- 2 * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson 3 * Copyright (c) 2001 Ilmar S. Habibulin 4 * Copyright (c) 2001, 2002 Networks Associates Technology, Inc. 5 * All rights reserved. 6 * 7 * This software was developed by Robert Watson and Ilmar Habibulin for the 8 * TrustedBSD Project. --- 19 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * | 1/*- 2 * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson 3 * Copyright (c) 2001 Ilmar S. Habibulin 4 * Copyright (c) 2001, 2002 Networks Associates Technology, Inc. 5 * All rights reserved. 6 * 7 * This software was developed by Robert Watson and Ilmar Habibulin for the 8 * TrustedBSD Project. --- 19 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * |
36 * $FreeBSD: head/sys/security/mac/mac_process.c 112675 2003-03-26 15:12:03Z rwatson $ | 36 * $FreeBSD: head/sys/security/mac/mac_process.c 113255 2003-04-08 14:25:47Z des $ |
37 */ 38/* 39 * Developed by the TrustedBSD Project. 40 * 41 * Framework for extensible kernel access control. Kernel and userland 42 * interface to the framework, policy registration and composition. 43 */ 44 --- 671 unchanged lines hidden (view full) --- 716 return (error); 717} 718 719int 720mac_init_mbuf(struct mbuf *m, int flag) 721{ 722 int error; 723 | 37 */ 38/* 39 * Developed by the TrustedBSD Project. 40 * 41 * Framework for extensible kernel access control. Kernel and userland 42 * interface to the framework, policy registration and composition. 43 */ 44 --- 671 unchanged lines hidden (view full) --- 716 return (error); 717} 718 719int 720mac_init_mbuf(struct mbuf *m, int flag) 721{ 722 int error; 723 |
724 KASSERT(m->m_flags & M_PKTHDR, ("mac_init_mbuf on non-header mbuf")); | 724 M_ASSERTPKTHDR(m); |
725 726 mac_init_label(&m->m_pkthdr.label); 727 728 MAC_CHECK(init_mbuf_label, &m->m_pkthdr.label, flag); 729 if (error) { 730 MAC_PERFORM(destroy_mbuf_label, &m->m_pkthdr.label); 731 mac_destroy_label(&m->m_pkthdr.label); 732 } --- 1532 unchanged lines hidden (view full) --- 2265int 2266mac_check_ifnet_transmit(struct ifnet *ifnet, struct mbuf *mbuf) 2267{ 2268 int error; 2269 2270 if (!mac_enforce_network) 2271 return (0); 2272 | 725 726 mac_init_label(&m->m_pkthdr.label); 727 728 MAC_CHECK(init_mbuf_label, &m->m_pkthdr.label, flag); 729 if (error) { 730 MAC_PERFORM(destroy_mbuf_label, &m->m_pkthdr.label); 731 mac_destroy_label(&m->m_pkthdr.label); 732 } --- 1532 unchanged lines hidden (view full) --- 2265int 2266mac_check_ifnet_transmit(struct ifnet *ifnet, struct mbuf *mbuf) 2267{ 2268 int error; 2269 2270 if (!mac_enforce_network) 2271 return (0); 2272 |
2273 KASSERT(mbuf->m_flags & M_PKTHDR, ("packet has no pkthdr")); | 2273 M_ASSERTPKTHDR(mbuf); |
2274 if (!(mbuf->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED)) 2275 if_printf(ifnet, "not initialized\n"); 2276 2277 MAC_CHECK(check_ifnet_transmit, ifnet, &ifnet->if_label, mbuf, 2278 &mbuf->m_pkthdr.label); 2279 2280 return (error); 2281} --- 1435 unchanged lines hidden --- | 2274 if (!(mbuf->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED)) 2275 if_printf(ifnet, "not initialized\n"); 2276 2277 MAC_CHECK(check_ifnet_transmit, ifnet, &ifnet->if_label, mbuf, 2278 &mbuf->m_pkthdr.label); 2279 2280 return (error); 2281} --- 1435 unchanged lines hidden --- |