From owner-freebsd-stable@FreeBSD.ORG Thu Apr 5 03:40:05 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 25BE216A475 for ; Thu, 5 Apr 2007 03:40:05 +0000 (UTC) (envelope-from kuriyama@imgsrc.co.jp) Received: from black.imgsrc.co.jp (black.imgsrc.co.jp [210.226.20.147]) by mx1.freebsd.org (Postfix) with ESMTP id D92A913C44B for ; Thu, 5 Apr 2007 03:40:04 +0000 (UTC) (envelope-from kuriyama@imgsrc.co.jp) Received: from localhost (magenta.imgsrc.co.jp [210.226.20.134]) by black.imgsrc.co.jp (Postfix) with ESMTP id BB26B50FD4; Thu, 5 Apr 2007 12:16:43 +0900 (JST) X-Virus-Scanned: IMG SRC scanner at virus.imgsrc.co.jp (magenta) Received: from black.imgsrc.co.jp ([210.226.20.147]) by localhost (magenta.imgsrc.co.jp [210.226.20.134]) (amavisd-new, port 10024) with ESMTP id hrfw2KiuH2e6; Thu, 5 Apr 2007 12:16:43 +0900 (JST) Received: from pink.imgsrc.co.jp (pink.imgsrc.co.jp [210.226.20.36]) by black.imgsrc.co.jp (Postfix) with ESMTP id 8FB3550FF8; Thu, 5 Apr 2007 12:16:43 +0900 (JST) Date: Thu, 05 Apr 2007 12:16:43 +0900 Message-ID: <7mabxnfr38.wl%kuriyama@imgsrc.co.jp> From: Jun Kuriyama To: Kris Kennaway In-Reply-To: <20060309005722.GA55432@xor.obsecurity.org> References: <20060308224531.GA53611@xor.obsecurity.org> <200603090026.k290Qihj002701@compaq.anjos.strangled.net> <20060309005722.GA55432@xor.obsecurity.org> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/21.3 (i386--freebsd) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: kuriyama@imgsrc.co.jp, Miguel Lopes Santos Ramos , freebsd-stable@freebsd.org Subject: Re: rpc.lockd brokenness (2) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2007 03:40:05 -0000 At Wed, 8 Mar 2006 19:57:22 -0500, Kris Kennaway wrote: > > No, no, you got me wrong. The pidfile is left locked after cron stopped > > running (with /etc/rc.d/cron stop). This behaviour must be wrong. > > OK, I misunderstood. The rc.d script will signal cron to kill it, > which should be closing the file descriptors and causing rpc.lockd to > release the lock. Perhaps this part is broken. OK, I tested this > with daemon -p, and it indeed seems to be broken: > > haessal# daemon -p pid_file sleep 100000 > haessal# kill -KILL `cat pid_file` > haessal# ps -p `cat pid_file` > PID TT STAT TIME COMMAND > haessal# lockf -t 0 pid_file echo Yay > lockf: pid_file: already locked Interesting. I just do little investigation. Our daemon(8) locks a file before fork(2), which makes NFS lock registration with svid(PID) of daemon(8) process. When above sleep(1) killed, this process has another PID than daemon(8)'s, and request NFS unlock call with sleep(1)'s svid(PID). Our rpc.lockd(8) refuses this request because of svid unmatch. Which side should be fixed, daemon(8) and rpc.lockd(8)? -- Jun Kuriyama // S2 Factory, Inc. // IMG SRC, Inc. // FreeBSD Project