From nobody@FreeBSD.org  Mon Jun 21 21:20:55 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EFD2A106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Jun 2010 21:20:55 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id DE7178FC18
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Jun 2010 21:20:55 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o5LLKtlf072919
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Jun 2010 21:20:55 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o5LLKshc072918;
	Mon, 21 Jun 2010 21:20:54 GMT
	(envelope-from nobody)
Message-Id: <201006212120.o5LLKshc072918@www.freebsd.org>
Date: Mon, 21 Jun 2010 21:20:54 GMT
From: Oleg Ginzburg <oleg.ginzburg@nevosoft.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: 9.0-CURRENT panic when tcpdump ipfw0 and net.inet.ip.fw.verbose=0
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         148050
>Category:       kern
>Synopsis:       9.0-CURRENT panic when tcpdump ipfw0 and net.inet.ip.fw.verbose=0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    glebius
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 21 21:30:01 UTC 2010
>Closed-Date:    Thu Sep 16 15:07:40 UTC 2010
>Last-Modified:  Thu Sep 16 15:07:40 UTC 2010
>Originator:     Oleg Ginzburg
>Release:        9.0-CURRENT
>Organization:
>Environment:
FreeBSD localhost.my.domain 9.0-CURRENT FreeBSD 9.0-CURRENT #5: Sun Jun 20 18:48:44 MSD 2010     root@localhost.my.domain:/usr/obj/usr/src/sys/GENERIC-NODEBUG  amd64

>Description:
kernel make panic with messages:

panic: page fault
panic: bufwrite : buffer is not busy?

when IPFIREWALL_VERBOSE disable, ipfw have log options and tcpdump looking to ipfw0 interface

I've producible this problem on amd64 and i386 (both 9.0-CURRENT)
>How-To-Repeat:
kldload ipfw
sysctl -w net.inet.ip.fw.verbose=0
ipfw add 1 count log ip from any to any
tcpdump -n -i ipfw0 &
ping -c1 localhost

>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: glebius 
State-Changed-When: Thu Jul 8 12:35:11 UTC 2010 
State-Changed-Why:  
Fixed in head/. 


Responsible-Changed-From-To: freebsd-bugs->glebius 
Responsible-Changed-By: glebius 
Responsible-Changed-When: Thu Jul 8 12:35:11 UTC 2010 
Responsible-Changed-Why:  
Fixed in head/. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148050 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/148050: commit references a PR
Date: Thu,  8 Jul 2010 13:07:54 +0000 (UTC)

 Author: glebius
 Date: Thu Jul  8 13:07:40 2010
 New Revision: 209797
 URL: http://svn.freebsd.org/changeset/base/209797
 
 Log:
   Since r209216 bpf(4) searches for mbuf_tags(9) and thus will not work with
   a stub m_hdr instead of a full mbuf.
   
   PR:		kern/148050
 
 Modified:
   head/sys/netinet/ipfw/ip_fw_log.c
 
 Modified: head/sys/netinet/ipfw/ip_fw_log.c
 ==============================================================================
 --- head/sys/netinet/ipfw/ip_fw_log.c	Thu Jul  8 12:21:25 2010	(r209796)
 +++ head/sys/netinet/ipfw/ip_fw_log.c	Thu Jul  8 13:07:40 2010	(r209797)
 @@ -152,22 +152,24 @@ ipfw_log(struct ip_fw *f, u_int hlen, st
  
  	if (V_fw_verbose == 0) {
  #ifndef WITHOUT_BPF
 -		struct m_hdr mh;
 +		struct mbuf m0;
  
  		if (log_if == NULL || log_if->if_bpf == NULL)
  			return;
 +
  		/* BPF treats the "mbuf" as read-only */
 -		mh.mh_next = m;
 -		mh.mh_len = ETHER_HDR_LEN;
 +		bzero(&m0, sizeof(struct mbuf));
 +		m0.m_hdr.mh_next = m;
 +		m0.m_hdr.mh_len = ETHER_HDR_LEN;
  		if (args->eh) { /* layer2, use orig hdr */
 -			mh.mh_data = (char *)args->eh;
 +			m0.m_hdr.mh_data = (char *)args->eh;
  		} else {
  			/* add fake header. Later we will store
  			 * more info in the header
  			 */
 -			mh.mh_data = "DDDDDDSSSSSS\x08\x00";
 +			m0.m_hdr.mh_data = "DDDDDDSSSSSS\x08\x00";
  		}
 -		BPF_MTAP(log_if, (struct mbuf *)&mh);
 +		BPF_MTAP(log_if, &m0);
  #endif /* !WITHOUT_BPF */
  		return;
  	}
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: glebius 
State-Changed-When: Thu Sep 16 15:01:16 UTC 2010 
State-Changed-Why:  
Merged to stable/8. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148050 
>Unformatted:
