From owner-freebsd-current@FreeBSD.ORG Mon Apr 5 17:44:06 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 8301316A4CE; Mon, 5 Apr 2004 17:44:06 -0700 (PDT) Received: from daintree.corp.yahoo.com (daintree.corp.yahoo.com [216.145.52.172]) by mx1.FreeBSD.org (Postfix) with ESMTP id 71E9843D39; Mon, 5 Apr 2004 17:44:06 -0700 (PDT) (envelope-from peter@yahoo-inc.com) Received: by daintree.corp.yahoo.com (Postfix, from userid 2154) id D5D138824; Mon, 5 Apr 2004 17:43:32 -0700 (PDT) From: Peter Wemm To: freebsd-current@freebsd.org Date: Mon, 5 Apr 2004 17:43:32 -0700 User-Agent: KMail/1.6.1 References: <20040402191254.GK26131@elvis.mu.org> <20040405042010.GQ15786@cs.rice.edu> <20040405045618.GA40623@kanpc.gte.com> In-Reply-To: <20040405045618.GA40623@kanpc.gte.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200404051743.32556.peter@wemm.org> cc: current@freebsd.org cc: alc@freebsd.org cc: Alfred Perlstein cc: Alan Cox cc: kan@freebsd.org cc: Poul-Henning Kamp Subject: Re: mmap breakage? 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: Tue, 06 Apr 2004 00:44:06 -0000 On Sunday 04 April 2004 09:56 pm, Alexander Kabaev wrote: > On Sun, Apr 04, 2004 at 11:20:10PM -0500, Alan Cox wrote: > > On Mon, Apr 05, 2004 at 12:11:47AM -0400, Alexander Kabaev wrote: > > > On Sun, Apr 04, 2004 at 03:12:51PM -0500, Alan Cox wrote: > > > > Alfred, > > > > > > > > Please try the attached patch. This problems appears to be a > > > > consequence of vm/vm_mmap.c revision 1.180, where as part of a > > > > much needed code reorganization for locking the check for the > > > > /dev/zero special case got placed after the permissions check > > > > for the general case. This patch simply delays the permissions > > > > check for devices until you have the necessary lock to also > > > > check for /dev/zero. > > > > > > > > Since kan@ authored the reorganization, I'm cc:'ing him on this > > > > message for purposes of obtaining a review. (At least one > > > > comment should be updated to reflect my code changes.) > > > > > > > > Regards, > > > > Alan > > > > > > Alan, Alfred, > > > > > > I had the following patch which is currently pending a review by > > > Peter Wemm. I meant to commit it on Friday, but ran out of time: > > > > > > > > > http://perforce.freebsd.org/chv.cgi?CH=50213 > > > > I believe that there is a problem with this patch. Specifically, > > if maxprot is set to VM_PROT_ALL for devices in mmap(), then the > > security check in vm_mmap_vnode() has no effect. Please take a > > look at the entirety of the changes that I propose to mmap(). > > > > Regards, > > Alan > > There is a problem indeed. I committed your (correct!) patch instead. > Thanks! Heh. Now I'm glad I suggested that you check with Alan :-) -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5