From owner-freebsd-current@FreeBSD.ORG Thu Apr 22 14:49:27 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5CB6516A4CF; Thu, 22 Apr 2004 14:49:27 -0700 (PDT) Received: from zaphod.nitro.dk (port324.ds1-khk.adsl.cybercity.dk [212.242.113.79]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2719E43D41; Thu, 22 Apr 2004 14:49:26 -0700 (PDT) (envelope-from simon@zaphod.nitro.dk) Received: by zaphod.nitro.dk (Postfix, from userid 3000) id 8DEAF1198A; Thu, 22 Apr 2004 23:49:23 +0200 (CEST) Date: Thu, 22 Apr 2004 23:49:23 +0200 From: "Simon L. Nielsen" To: Robert Watson Message-ID: <20040422214923.GC801@zaphod.nitro.dk> References: <20040422212448.GB801@zaphod.nitro.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GZVR6ND4mMseVXL/" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i cc: freebsd-current@FreeBSD.org Subject: Re: panic: mutex Giant not owned at src/sys/security/mac/mac_net.c:355 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 21:49:27 -0000 --GZVR6ND4mMseVXL/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2004.04.22 17:27:11 -0400, Robert Watson wrote: >=20 > On Thu, 22 Apr 2004, Simon L. Nielsen wrote: >=20 > > On 2004.04.22 17:19:32 -0400, Robert Watson wrote: > > >=20 > > > On Thu, 22 Apr 2004, Simon L. Nielsen wrote: > > >=20 > > > > I have a reproduceable panic when I have MAC enabled in my kernel a= nd I > > > > try to run tcpdump on the interface I have logged in on via ssh (I'= m not > > > > really sure why it only happens in this case and in other cases). = I run > > > > "tcpdump -n -i sis0" and the panic as shown below. I do not have a= ny > > > > MAC policies loaded.=20 > > > >=20 > > > > The problem is (if I understand the code correctly) that MAC calls > > > > BPFD_LOCK_ASSERT, which rwatson added NET_ASSERT_GIANT to, but sinc= e the > > > > sis interrupt handler is marked INTR_MPSAFE then GIANT isn't aquired > > > > before bpf_mtap (and therefor mac_check_bpfdesc_receive) is called. > > > >=20 > > > > I'm not really sure what the correct fix is, but if bpf is locked, = is > > > > GIANT really required for it? > > >=20 > > > Are you running a main line kernel with debug.mpsafenet turned on? > >=20 > > Main line kernel (I assume you mean no special patches), but > > debug.mpsafenet is turned off.=20 > >=20 > > [root@soekris:~] sysctl debug.mpsafenet > > debug.mpsafenet: 0 >=20 > In the main line kernel with debug.mpsafenet turned off, INTR_MPSAFE is > supposed to be ignored for network interrupts, resulting in inbound > network stack code running with Giant held. Is there any chance that the > interrupt thread is being shared with another device? dmesg output would Possibly, I'm not really sure how to check that. > be useful, along with some devinfo output. It could be there's a problem > resulting in Giant not being held under those circumstances, or that Giant > is being dropped somewhere it shouldn't be.=20 OK, my kernel foo is not sufficient know if that is the case, but here is dmesg and outut from devinfo output : Copyright (c) 1992-2004 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 5.2-CURRENT #12: Thu Apr 22 21:01:48 CEST 2004 simon@zaphod.nitro.dk:/data/obj/data/nanobsd/src/sys/SOEKRIS Preloaded elf kernel "/boot/kernel/kernel" at 0xc0730000. Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: Geode(TM) Integrated Processor by National Semi (266.66-MHz 586-class = CPU) Origin =3D "Geode by NSC" Id =3D 0x540 real memory =3D 134217728 (128 MB) avail memory =3D 125984768 (120 MB) random: cpu0 on motherboard npx0: [FAST] npx0: on motherboard npx0: INT 16 interface pcibios: BIOS version 2.00 pcib0: at pcibus 0 on motherboard pci0: on pcib0 sis0: port 0xe100-0xe1ff mem 0xa0000000-0= xa0000fff irq 10 at device 6.0 on pci0 sis0: Reserved 0x100 bytes for rid 0x10 type 4 at 0xe100 sis0: Silicon Revision: DP83816A miibus0: on sis0 ukphy0: on miibus0 ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto sis0: Ethernet address: 00:00:24:c1:c9:20 sis0: [GIANT-LOCKED] sis1: port 0xe200-0xe2ff mem 0xa0001000-0= xa0001fff irq 10 at device 7.0 on pci0 sis1: Reserved 0x100 bytes for rid 0x10 type 4 at 0xe200 sis1: Silicon Revision: DP83816A miibus1: on sis1 ukphy1: on miibus1 ukphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto sis1: Ethernet address: 00:00:24:c1:c9:21 sis1: [GIANT-LOCKED] sis2: port 0xe300-0xe3ff mem 0xa0002000-0= xa0002fff irq 10 at device 8.0 on pci0 sis2: Reserved 0x100 bytes for rid 0x10 type 4 at 0xe300 sis2: Silicon Revision: DP83816A miibus2: on sis2 ukphy2: on miibus2 ukphy2: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto sis2: Ethernet address: 00:00:24:c1:c9:22 sis2: [GIANT-LOCKED] wi0: mem 0xa0003000-0xa0003fff irq 11 at device 10.0 on= pci0 wi0: Reserved 0x1000 bytes for rid 0x10 type 3 at 0xa0003000 wi0: [GIANT-LOCKED] wi0: using RF:PRISM2.5 MAC:ISL3874A(Mini-PCI) wi0: Intersil Firmware: Primary (1.0.7), Station (1.3.6) wi0: Ethernet address: 00:09:5b:91:a1:88 wi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps Geode GPIO@ =3D 6100 isab0: port 0x6200-0x623f,0x6100-0x613f at device 18.0 on = pci0 isa0: on isab0 pci0: at device 18.1 (no driver attached) atapci0: port 0xe000-0xe00f,0x376,= 0x170-0x177,0x3f6,0x1f0-0x1f7 at device 18.2 on pci0 atapci0: Reserved 0x10 bytes for rid 0x20 type 4 at 0xe000 atapci0: Reserved 0x8 bytes for rid 0x10 type 4 at 0x1f0 atapci0: Reserved 0x1 bytes for rid 0x14 type 4 at 0x3f6 ata0: at 0x1f0 irq 14 on atapci0 atapci0: Reserved 0x8 bytes for rid 0x18 type 4 at 0x170 atapci0: Reserved 0x1 bytes for rid 0x1c type 4 at 0x376 ata1: at 0x170 irq 15 on atapci0 Geode CBA@ 0x6000 Geode rev: 06 03 Timecounter "Geode" frequency 27000000 Hz quality 1000 pci0: at device 18.5 (no driver attached) ohci0: mem 0xa0004000-0xa0004fff irq 5 at d= evice 19.0 on pci0 ohci0: Reserved 0x1000 bytes for rid 0x10 type 3 at 0xa0004000 ohci0: [GIANT-LOCKED] usb0: OHCI version 1.0, legacy support usb0: on ohci0 usb0: USB revision 1.0 uhub0: (0x0e11) OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 3 ports with 3 removable, self powered umass0: USB Solid state disk, rev 1.10/1.00, addr 2 orm0: