From mharo@bitsurf.net  Mon Sep  6 09:32:01 2004
Return-Path: <mharo@bitsurf.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 14F7816A4D0
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  6 Sep 2004 09:32:01 +0000 (GMT)
Received: from burrito.bitsurf.net (dcn235-229.dcn.davis.ca.us [168.150.235.229])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B8D2C43D53
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  6 Sep 2004 09:32:00 +0000 (GMT)
	(envelope-from mharo@bitsurf.net)
Received: from burrito.bitsurf.net (localhost [127.0.0.1])
	by burrito.bitsurf.net (8.12.10/8.12.10) with ESMTP id i869W9Qe029488
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 6 Sep 2004 02:32:09 -0700 (PDT)
	(envelope-from mharo@burrito.bitsurf.net)
Received: (from mharo@localhost)
	by burrito.bitsurf.net (8.12.10/8.12.10/Submit) id i869W9WD029487;
	Mon, 6 Sep 2004 02:32:09 -0700 (PDT)
	(envelope-from mharo)
Message-Id: <200409060932.i869W9WD029487@burrito.bitsurf.net>
Date: Mon, 6 Sep 2004 02:32:09 -0700 (PDT)
From: Michael Haro <mharo@freebsd.org>
Reply-To: Michael Haro <mharo@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: LOR in sys/net/bpf
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         71422
>Category:       kern
>Synopsis:       [lor] in sys/net/bpf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    csjp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 06 09:40:24 GMT 2004
>Closed-Date:    Tue Mar 03 14:59:15 UTC 2009
>Last-Modified:  Tue Mar 03 14:59:15 UTC 2009
>Originator:     Michael Haro
>Release:        FreeBSD 5.3-BETA3 i386
>Organization:
>Environment:
System: FreeBSD ****.****.ucdavis.edu 5.3-BETA3 FreeBSD 5.3-BETA3 #0: Sat Sep  4 16:43:17 PDT 2004     root@****.****.ucdavis.edu:/usr/obj/usr/src/sys/GENERIC


>Description:

When I boot my 5.3-BETA3 (RELENG_5 as of yesterday) system and start kismet
dmesg shows the following:

lock order reversal
 1st 0xc1701ad8 bpf interface lock (bpf interface lock) @ /usr/src/sys/net/bpf.c:1273
 2nd 0xc191ab64 bpf0 (bpf cdev lock) @ /usr/src/sys/net/bpf.c:1277
KDB: stack backtrace:
kdb_backtrace(0,ffffffff,c08bddc8,c08bd558,c084c8bc) at kdb_backtrace+0x29
witness_checkorder(c191ab64,9,c07f9506,4fd) at witness_checkorder+0x544
_mtx_lock_flags(c191ab64,0,c07f9506,4fd,c16d0200) at _mtx_lock_flags+0x5b
bpf_mtap2(c1701ac0,c1713020,10,c16d0200) at bpf_mtap2+0x8c
wi_rx_intr(c1711000) at wi_rx_intr+0x432
wi_intr(c1711000) at wi_intr+0x143
pccard_intr(c1705e00,c1701c00,cbd0cd1c,c05ed790,c15f4440) at pccard_intr+0x60
cbb_func_intr(c15f4440) at cbb_func_intr+0x45
ithread_loop(c150c400,cbd0cd48,c150c400,c05ed66c,0) at ithread_loop+0x124
fork_exit(c05ed66c,c150c400,cbd0cd48) at fork_exit+0xa4
fork_trampoline() at fork_trampoline+0x8
--- trap 0x1, eip = 0, esp = 0xcbd0cd7c, ebp = 0 ---

I've not done anything special with any tunable variables or anything.
Let me know if you'd like more information as I'm not really sure what to report.

>How-To-Repeat:

If I reboot and start kismet it happens again.

>Fix:

Not sure, but willing to test patches.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->rwatson 
Responsible-Changed-By: rwatson 
Responsible-Changed-When: Thu Sep 9 04:36:42 GMT 2004 
Responsible-Changed-Why:  
I've picked up several BPF related locking bugs, so will grab ownership 
of this.  I'm about to introduce a hard-coded lock order to 6.x to 
catch the source of this reversal earlier, and will follow up with 
details. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=71422 
Responsible-Changed-From-To: rwatson->csjp 
Responsible-Changed-By: rwatson 
Responsible-Changed-When: Mon Jun 12 11:45:52 UTC 2006 
Responsible-Changed-Why:  
Assign BPF PR to csjp, who has recently been doing significant locking 
cleanup on the BPF code. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=71422 
State-Changed-From-To: open->analyzed 
State-Changed-By: csjp 
State-Changed-When: Mon Jun 26 14:54:18 UTC 2006 
State-Changed-Why:  
After some review of the locking, it appears that this is a false 
positive. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71422 
State-Changed-From-To: analyzed->closed 
State-Changed-By: csjp 
State-Changed-When: Tue Mar 3 14:58:56 UTC 2009 
State-Changed-Why:  
This issue was fixed some time ago. 

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