From owner-p4-projects@FreeBSD.ORG Mon Jan 22 15:20:39 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7090916A40D; Mon, 22 Jan 2007 15:20:39 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 339D216A408 for ; Mon, 22 Jan 2007 15:20:39 +0000 (UTC) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id E74F013C469 for ; Mon, 22 Jan 2007 15:20:38 +0000 (UTC) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l0MFKcPb004415 for ; Mon, 22 Jan 2007 15:20:38 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l0MFKcvo004412 for perforce@freebsd.org; Mon, 22 Jan 2007 15:20:38 GMT (envelope-from millert@freebsd.org) Date: Mon, 22 Jan 2007 15:20:38 GMT Message-Id: <200701221520.l0MFKcvo004412@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 113322 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jan 2007 15:20:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=113322 Change 113322 by millert@millert_macbook on 2007/01/22 15:19:53 Use m_dup_pkthdr() instead of M_COPY_PKTHDR() in m_copym() and m_copym_with_hdrs() since with MAC, M_COPY_PKTHDR() moves the mbuf tags instead of copying them, which effectively leaves the source mbuf unlabeled. Also need to zero out m_pkthdr.aux in the source mbuf after m_dup_pkthdr(). m_copy_pkthdr() did this for us but m_dup_pkthdr() does not. Affected files ... .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/kern/uipc_mbuf.c#6 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/kern/uipc_mbuf.c#6 (text+ko) ==== @@ -1536,7 +1536,11 @@ if (n == 0) goto nospace; if (copyhdr) { - M_COPY_PKTHDR(n, m); + MBUF_UNLOCK(); + if (!m_dup_pkthdr(n, m, wait)) + goto nospace_unlock; + MBUF_LOCK(); + m->m_pkthdr.aux = (struct mbuf *)NULL; if (len == M_COPYALL) n->m_pkthdr.len -= off0; else @@ -1579,6 +1583,7 @@ nospace: MBUF_UNLOCK(); +nospace_unlock: m_freem(top); MCFail++; return (0); @@ -1677,7 +1682,11 @@ *np = n; if (copyhdr) { - M_COPY_PKTHDR(n, m); + MBUF_UNLOCK(); + if (!m_dup_pkthdr(n, m, wait)) + goto nospace_unlock; + MBUF_LOCK(); + m->m_pkthdr.aux = (struct mbuf *)NULL; n->m_pkthdr.len = len; copyhdr = 0; }