Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Mar 2008 16:55:28 +0100
From:      Max Laier <max@love2party.net>
To:        Alex Popa <razor@dataxnet.ro>
Cc:        Robert Watson <rwatson@freebsd.org>, freebsd-stable@freebsd.org
Subject:   Re: Lock Order Reversal on 7.0-STABLE with pf and ipfw / dummynet (traces)
Message-ID:  <200803221655.28975.max@love2party.net>
In-Reply-To: <20080322102933.GA76747@dataxnet.ro>
References:  <20080314192359.GA4677@dataxnet.ro> <200803152217.02568.max@love2party.net> <20080322102933.GA76747@dataxnet.ro>

next in thread | previous in thread | raw e-mail | index | archive | help
--Boundary-00=_wvS5Hdzr8z13U66
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi Alex,

On Saturday 22 March 2008 11:29:33 Alex Popa wrote:
> Sorry for the big delay, but here are the traces you requested.

don't worry, you are a great help!

Could you try the attached patch?  I missed the fact that you are using 
FASTROUTE in your setup.  There is obviously a problem with it, but the 
attached patch should work around that.  The other LOR really is harmless 
and rather an oversight in WITNESS: a LOR with a shared/read lock can't 
cause a deadlock (unless there is also a LOR with the same lock in 
exclusive mode).  But this is rather complex to check and might not be 
easily implemented in WITNESS.

Anyways - I believe this patch should work around your problem.  Let us 
know your findings - thanks.

-- 
/"\  Best regards,                      | mlaier@freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier@EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News

--Boundary-00=_wvS5Hdzr8z13U66
Content-Type: text/x-diff;
  charset="utf-8";
  name="pf_route.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="pf_route.diff"

Index: pf.c
===================================================================
RCS file: /home/mlaier/fcvs/src/sys/contrib/pf/net/pf.c,v
retrieving revision 1.51
diff -u -r1.51 pf.c
--- pf.c	21 Nov 2007 10:12:52 -0000	1.51
+++ pf.c	22 Mar 2008 15:42:18 -0000
@@ -6106,7 +6106,13 @@
 	dst->sin_addr = ip->ip_dst;
 
 	if (r->rt == PF_FASTROUTE) {
+#ifdef __FreeBSD__
+		PF_UNLOCK();
+#endif
 		rtalloc(ro);
+#ifdef __FreeBSD__
+		PF_LOCK();
+#endif
 		if (ro->ro_rt == 0) {
 			ipstat.ips_noroute++;
 			goto bad;

--Boundary-00=_wvS5Hdzr8z13U66--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803221655.28975.max>