From owner-freebsd-current@FreeBSD.ORG Thu Apr 22 14:17:34 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 7C25F16A4CE; Thu, 22 Apr 2004 14:17:34 -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 C7E6043D1F; Thu, 22 Apr 2004 14:17:33 -0700 (PDT) (envelope-from simon@zaphod.nitro.dk) Received: by zaphod.nitro.dk (Postfix, from userid 3000) id D39871198A; Thu, 22 Apr 2004 23:17:30 +0200 (CEST) Date: Thu, 22 Apr 2004 23:17:30 +0200 From: "Simon L. Nielsen" To: freebsd-current@freebsd.org Message-ID: <20040422211730.GA801@zaphod.nitro.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="45Z9DzgjV8m4Oswq" Content-Disposition: inline User-Agent: Mutt/1.5.6i cc: Robert Watson Subject: 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:17:34 -0000 --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello 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? panic: mutex Giant not owned at /data/nanobsd/src/sys/security/mac/mac_net.= c:355 at line 729 in file /data/nanobsd/src/sys/kern/kern_mutex.c Debugger("panic") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> trace Debugger(c063705f) at Debugger+0x45 __panic(c06363ea,2d9,c063655f,c063669a,c0646fff) at __panic+0xc7 _mtx_assert(c0689720,1,c0646fff,163) at _mtx_assert+0xc2 mac_check_bpfdesc_receive(c1995c00,c1750c00) at mac_check_bpfdesc_receive+0= x40 bpf_mtap(c17536c0,c0adfa00) at bpf_mtap+0xa6 sis_start(c1750c00) at sis_start+0x1a7 sis_tick(c1750c00) at sis_tick+0x70 softclock(0) at softclock+0x176 ithread_loop(c0ac2500,c80c2d48,c0ac2500,c04c2e80,0) at ithread_loop+0x11c fork_exit(c04c2e80,c0ac2500,c80c2d48) at fork_exit+0xa8 fork_trampoline() at fork_trampoline+0x8 --- trap 0x1, eip =3D 0, esp =3D 0xc80c2d7c, ebp =3D 0 --- --=20 Simon L. Nielsen FreeBSD Documentation Team --45Z9DzgjV8m4Oswq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAiDZqh9pcDSc1mlERAs/fAJ9giCS75EkPi6F6asEBQlR1yQrKnQCfRS99 mBBzRtcAxBs0szW3ZCzPpRA= =hvww -----END PGP SIGNATURE----- --45Z9DzgjV8m4Oswq--