Re: panic: mutex Giant not owned at src/sys/security/mac/mac_net.c:355

From: Simon L. Nielsen <simon_at_FreeBSD.org>
Date: Thu, 22 Apr 2004 23:49:23 +0200
On 2004.04.22 17:27:11 -0400, Robert Watson wrote:
> 
> On Thu, 22 Apr 2004, Simon L. Nielsen wrote:
> 
> > On 2004.04.22 17:19:32 -0400, Robert Watson wrote:
> > > 
> > > On Thu, 22 Apr 2004, Simon L. Nielsen wrote:
> > > 
> > > > I have a reproduceable panic when I have MAC enabled in my kernel and 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 any
> > > > MAC policies loaded. 
> > > > 
> > > > The problem is (if I understand the code correctly) that MAC calls
> > > > BPFD_LOCK_ASSERT, which rwatson added NET_ASSERT_GIANT to, but since the
> > > > sis interrupt handler is marked INTR_MPSAFE then GIANT isn't aquired
> > > > before bpf_mtap (and therefor mac_check_bpfdesc_receive) is called.
> > > > 
> > > > I'm not really sure what the correct fix is, but if bpf is locked, is
> > > > GIANT really required for it?
> > > 
> > > Are you running a main line kernel with debug.mpsafenet turned on?
> > 
> > Main line kernel (I assume you mean no special patches), but
> > debug.mpsafenet is turned off. 
> > 
> > [root_at_soekris:~] sysctl debug.mpsafenet
> > debug.mpsafenet: 0
> 
> 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. 

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_at_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 = "Geode by NSC"  Id = 0x540
real memory  = 134217728 (128 MB)
avail memory = 125984768 (120 MB)
random: <entropy source, Software, Yarrow>
cpu0 on motherboard
npx0: [FAST]
npx0: <math processor> on motherboard
npx0: INT 16 interface
pcibios: BIOS version 2.00
pcib0: <Host to PCI bridge> at pcibus 0 on motherboard
pci0: <PCI bus> on pcib0
sis0: <NatSemi DP8381[56] 10/100BaseTX> port 0xe100-0xe1ff mem 0xa0000000-0xa0000fff irq 10 at device 6.0 on pci0
sis0: Reserved 0x100 bytes for rid 0x10 type 4 at 0xe100
sis0: Silicon Revision: DP83816A
miibus0: <MII bus> on sis0
ukphy0: <Generic IEEE 802.3u media interface> on miibus0
ukphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
sis0: Ethernet address: 00:00:24:c1:c9:20
sis0: [GIANT-LOCKED]
sis1: <NatSemi DP8381[56] 10/100BaseTX> port 0xe200-0xe2ff mem 0xa0001000-0xa0001fff irq 10 at device 7.0 on pci0
sis1: Reserved 0x100 bytes for rid 0x10 type 4 at 0xe200
sis1: Silicon Revision: DP83816A
miibus1: <MII bus> on sis1
ukphy1: <Generic IEEE 802.3u media interface> on miibus1
ukphy1:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
sis1: Ethernet address: 00:00:24:c1:c9:21
sis1: [GIANT-LOCKED]
sis2: <NatSemi DP8381[56] 10/100BaseTX> port 0xe300-0xe3ff mem 0xa0002000-0xa0002fff irq 10 at device 8.0 on pci0
sis2: Reserved 0x100 bytes for rid 0x10 type 4 at 0xe300
sis2: Silicon Revision: DP83816A
miibus2: <MII bus> on sis2
ukphy2: <Generic IEEE 802.3u media interface> on miibus2
ukphy2:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
sis2: Ethernet address: 00:00:24:c1:c9:22
sis2: [GIANT-LOCKED]
wi0: <Intersil Prism2.5> 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_at_ = 6100
isab0: <PCI-ISA bridge> port 0x6200-0x623f,0x6100-0x613f at device 18.0 on pci0
isa0: <ISA bus> on isab0
pci0: <bridge, PCI-unknown> at device 18.1 (no driver attached)
atapci0: <National Geode SC1100 ATA33 controller> 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_at_ 0x6000
Geode rev: 06 03
Timecounter "Geode" frequency 27000000 Hz quality 1000
pci0: <bridge, PCI-unknown> at device 18.5 (no driver attached)
ohci0: <OHCI (generic) USB controller> mem 0xa0004000-0xa0004fff irq 5 at device 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: <OHCI (generic) USB controller> 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: <Option ROM> at iomem 0xc8000-0xd1fff on isa0
pmtimer0 on isa0
atkbdc0: <Keyboard controller (i8042)> at port 0x64,0x60 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
atkbd0: [GIANT-LOCKED]
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A, console
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
Timecounters tick every 10.000 msec
ipfw2 initialized, divert enabled, rule-based forwarding enabled, default to deny, logging limited to 100 packets/entry by default
ata0-master: FAILURE - SETFEATURES SET TRANSFER MODE status=51<READY,DSC,ERROR> error=4<ABORTED>
ata0-master: FAILURE - SETFEATURES SET TRANSFER MODE status=51<READY,DSC,ERROR> error=4<ABORTED>
ad0: FAILURE - SETFEATURES ENABLE RCACHE status=51<READY,DSC,ERROR> error=4<ABORTED>
ad0: FAILURE - SETFEATURES ENABLE WCACHE status=51<READY,DSC,ERROR> error=4<ABORTED>
ad0: 122MB <SanDisk SDCFA-128> [980/8/32] at ata0-master BIOSPIO
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <_ Tiny Disk 1.11> Removable Direct Access SCSI-2 device 
da0: 1.000MB/s transfers
da0: 63MB (129024 512 byte sectors: 64H 32S/T 63C)
Mounting root from ufs:/dev/ad0s2a

[root_at_soekris:~] devinfo -r
nexus0
  cpu0
  legacy0
    pcib0
      pci0
        hostb0
        sis0
            Interrupt request lines:
                0xa
            I/O ports:
                0xe100-0xe1ff
            I/O memory addresses:
                0xa0000000-0xa0000fff
          miibus0
            ukphy0
        sis1
            I/O ports:
                0xe200-0xe2ff
            I/O memory addresses:
                0xa0001000-0xa0001fff
          miibus1
            ukphy1
        sis2
            I/O ports:
                0xe300-0xe3ff
            I/O memory addresses:
                0xa0002000-0xa0002fff
          miibus2
            ukphy2
        wi0
            Interrupt request lines:
                0xb
            I/O memory addresses:
                0xa0003000-0xa0003fff
        isab0
            I/O ports:
                0x6100-0x613f
                0x6200-0x623f
          isa0
            atkbdc0
                I/O ports:
                    0x60
                    0x64
              atkbd0
                  Interrupt request lines:
                      0x1
            sio0
                Interrupt request lines:
                    0x4
                I/O ports:
                    0x3f8-0x3ff
            sio1
                Interrupt request lines:
                    0x3
                I/O ports:
                    0x2f8-0x2ff
            orm0
                I/O memory addresses:
                    0xc8000-0xd1fff
            pmtimer0
        atapci0
            I/O ports:
                0x170-0x177
                0x1f0-0x1f7
                0x376
                0x3f6
                0xe000-0xe00f
          ata0
              Interrupt request lines:
                  0xe
          ata1
              Interrupt request lines:
                  0xf
        ohci0
            Interrupt request lines:
                0x5
            I/O memory addresses:
                0xa0004000-0xa0004fff
          usb0
            uhub0
              umass0
  npx0

-- 
Simon L. Nielsen
FreeBSD Documentation Team

Received on Thu Apr 22 2004 - 12:49:27 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:52 UTC