Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Nov 2002 12:18:08 -0800
From:      Alfred Perlstein <alfred@FreeBSD.ORG>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        current@FreeBSD.ORG, tanimura@FreeBSD.ORG
Subject:   Re: Lock order reversals in sys_pipe.c and kern_sig.c
Message-ID:  <20021118201808.GB16066@elvis.mu.org>
In-Reply-To: <20021118200229.GA24837@rot13.obsecurity.org>
References:  <20021118190819.GK12906@rot13.obsecurity.org> <20021118193901.GA16066@elvis.mu.org> <20021118200229.GA24837@rot13.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Kris Kennaway <kris@obsecurity.org> [021118 12:01] wrote:
> On Mon, Nov 18, 2002 at 11:39:01AM -0800, Alfred Perlstein wrote:
> 
> > Well now they are, I will investigate as time permits.
> 
> Thanks.
> 
> > I'm still in a holding pattern about adding more debugging info to
> > lockd now that we're in release candidate mode.  I may ask for a
> > branch to be done, but i'm not sure yet.
> 
> Feel free to give me non-committed patches to test :-)

GRR, witless always gives me the locations of the correct lock
order, never the locations of the incorrect ones, so here, try this
and give me a backtrace, it should nail you with extreme prejudice
when you get what i think is the wrong order:


Index: pipe.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/pipe.h,v
retrieving revision 1.20
diff -u -r1.20 pipe.h
--- pipe.h	14 Aug 2002 01:04:43 -0000	1.20
+++ pipe.h	18 Nov 2002 20:13:13 -0000
@@ -112,7 +112,11 @@
 };
 
 #define PIPE_MTX(pipe)		(pipe)->pipe_mtxp
-#define PIPE_LOCK(pipe)		mtx_lock(PIPE_MTX(pipe))
+#define PIPE_LOCK(pipe)					\
+	do {						\
+		mtx_lock(PIPE_MTX(pipe));		\
+		mtx_assert(&sigio_lock, MA_NOTOWNED);	\
+	} while (0)
 #define PIPE_UNLOCK(pipe)	mtx_unlock(PIPE_MTX(pipe))
 #define PIPE_LOCK_ASSERT(pipe, type)  mtx_assert(PIPE_MTX(pipe), (type))
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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