Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Mar 2003 11:56:16 -0800 (PST)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 27369 for review
Message-ID:  <200303251956.h2PJuGSW092270@repoman.freebsd.org>

index | next in thread | raw e-mail

http://perforce.freebsd.org/chv.cgi?CH=27369

Change 27369 by rwatson@rwatson_tislabs on 2003/03/25 11:56:02

	Make sure to pass in only malloc() flags to MAC allocation
	interfaces for labels, not mbuf allocation "how" arguments.
	Should clear up several Witness warnings involving blocking
	in the netisr path.

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/kern/subr_mbuf.c#29 edit
.. //depot/projects/trustedbsd/mac/sys/kern/uipc_mbuf.c#19 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/kern/subr_mbuf.c#29 (text+ko) ====

@@ -1306,7 +1306,7 @@
 	if (mb != NULL) {
 		_mbhdr_setup(mb, type);
 #ifdef MAC
-		if (mac_init_mbuf(mb, how) != 0) {
+		if (mac_init_mbuf(mb, MBUF_TO_MALLOC(how)) != 0) {
 			m_free(mb);
 			return NULL;
 		}
@@ -1355,7 +1355,7 @@
 	if (mb != NULL) {
 		_mbhdr_setup(mb, type);
 #ifdef MAC
-		if (mac_init_mbuf(mb, how) != 0) {
+		if (mac_init_mbuf(mb, MBUF_TO_MALLOC(how)) != 0) {
 			m_free(mb);
 			return NULL;
 		}
@@ -1502,7 +1502,8 @@
 		_mext_init_ref(mb, &cl_refcntmap[cl2ref(mb->m_ext.ext_buf)]);
 	}
 #ifdef MAC
-	if ((flags & M_PKTHDR) && (mac_init_mbuf(mb, how) != 0)) {
+	if ((flags & M_PKTHDR) && (mac_init_mbuf(mb, MBUF_TO_MALLOC(how))
+	    != 0)) {
 		m_free(mb);
 		return NULL;
 	}

==== //depot/projects/trustedbsd/mac/sys/kern/uipc_mbuf.c#19 (text+ko) ====

@@ -89,7 +89,7 @@
 	to->m_data = to->m_pktdat;
 	to->m_pkthdr = from->m_pkthdr;		/* especially tags */
 #ifdef MAC
-	mac_init_mbuf(to, 1);			/* XXXMAC no way to fail */
+	mac_init_mbuf(to, M_WAITOK);		/* XXXMAC no way to fail */
 	mac_create_mbuf_from_mbuf(from, to);
 #endif
 	SLIST_INIT(&from->m_pkthdr.tags);	/* purge tags from src */
@@ -125,7 +125,7 @@
 	to->m_data = to->m_pktdat;
 	to->m_pkthdr = from->m_pkthdr;
 #ifdef MAC
-	mac_init_mbuf(to, 1);			/* XXXMAC no way to fail */
+	mac_init_mbuf(to, M_WAITOK);		/* XXXMAC no way to fail */
 	mac_create_mbuf_from_mbuf(from, to);
 #endif
 	SLIST_INIT(&to->m_pkthdr.tags);

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message



help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303251956.h2PJuGSW092270>