From owner-freebsd-current Mon Feb 3 12:57: 4 2003 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 58D3637B401 for ; Mon, 3 Feb 2003 12:57:02 -0800 (PST) Received: from milla.ask33.net (milla.ask33.net [217.197.166.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09BBC43F79 for ; Mon, 3 Feb 2003 12:57:01 -0800 (PST) (envelope-from nick@milla.ask33.net) Received: by milla.ask33.net (Postfix, from userid 1001) id 3F3AB3ABB3B; Mon, 3 Feb 2003 21:59:13 +0100 (CET) Date: Mon, 3 Feb 2003 21:59:12 +0100 From: Pawel Jakub Dawidek To: freebsd-current@freebsd.org Subject: Re: LOR: if_ether.c -> route.c. Message-ID: <20030203205912.GB9430@garage.freebsd.pl> References: <20030203110628.GA9430@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="/fkgiuYTZoXudvFa" Content-Disposition: inline In-Reply-To: <20030203110628.GA9430@garage.freebsd.pl> X-PGP-Key-URL: http://garage.freebsd.pl/jules.asc X-OS: FreeBSD 4.7-STABLE i386 User-Agent: Mutt/1.5.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --/fkgiuYTZoXudvFa Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 03, 2003 at 12:06:28PM +0100, Pawel Jakub Dawidek wrote: +> We got lock order reversal here: +>=20 +> 1st 0xc0384800 arp mutex (arp mutex) @ /usr/src/sys/netinet/if_ether.c:= 151 +> 2nd 0xc1886b7c radix node head (radix node head) @ /usr/src/sys/net/rou= te.c:549 +>=20 +> Simple backtrace: +> rtreqest1() [route.c] +> rtreqest() [route.c] +> arptfree() [if_ether.c] +> arptimer() [if_ether.c] I think that MTX_DUPOK is needed here, so: --- radix.h.orig Sun Feb 2 20:07:42 2003 +++ radix.h Mon Feb 3 21:48:30 2003 @@ -159,7 +159,7 @@ =20 =20 #define RADIX_NODE_HEAD_LOCK_INIT(rnh) \ - mtx_init(&(rnh)->rnh_mtx, "radix node head", NULL, MTX_DEF | MTX_RECUR= SE) + mtx_init(&(rnh)->rnh_mtx, "radix node head", NULL, MTX_DEF | MTX_RECUR= SE | MTX_DUPOK) #define RADIX_NODE_HEAD_LOCK(rnh) mtx_lock(&(rnh)->rnh_mtx) #define RADIX_NODE_HEAD_UNLOCK(rnh) mtx_unlock(&(rnh)->rnh_mtx) #define RADIX_NODE_HEAD_DESTROY(rnh) mtx_destroy(&(rnh)->rnh_mtx) Am I right? "radix node head" is locked first time in arptimer() and 2nd in rtrequest1(= ). And (if I understand code well) those locks should be in both functions, because rtrequest1() is not only called through arptimer(), but also through other functions that don't lock it eariler. --=20 Pawel Jakub Dawidek UNIX Systems Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am. --/fkgiuYTZoXudvFa Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iQCVAwUBPj7YID/PhmMH/Mf1AQE0QQP/b19cs9k+Z0f2XvVXbOhO4AblPcai9qzv qxMQXgT0wVrOUhGIR4a7ZppeOp2YFTqJAp0bkvpR+7NZD/Ldu9FvuDs48AA1uadc JBFRAPgeBuwyXH4kc3u0rHhavzEpGVzDnr8RmaC+EkgtApvy7slDfE23R+ojKUz5 xtKiCnp3pJg= =9gGb -----END PGP SIGNATURE----- --/fkgiuYTZoXudvFa-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message