From owner-freebsd-current@FreeBSD.ORG Sun Apr 4 21:56:20 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 9F8CA16A4CE; Sun, 4 Apr 2004 21:56:20 -0700 (PDT) Received: from newman.gte.com (newman.gte.com [132.197.8.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id F3ADB43D5E; Sun, 4 Apr 2004 21:56:19 -0700 (PDT) (envelope-from ak03@gte.com) Received: from h132-197-179-27.gte.com (kanpc.gte.com [132.197.179.27]) by newman.gte.com (8.9.1/8.9.1) with ESMTP id AAA09968; Mon, 5 Apr 2004 00:56:19 -0400 (EDT) Received: from kanpc.gte.com (ak03@localhost [127.0.0.1]) i354uINh040644; Mon, 5 Apr 2004 00:56:18 -0400 (EDT) (envelope-from ak03@kanpc.gte.com) Received: (from ak03@localhost) by kanpc.gte.com (8.12.11/8.12.11/Submit) id i354uIjq040643; Mon, 5 Apr 2004 00:56:18 -0400 (EDT) (envelope-from ak03) Date: Mon, 5 Apr 2004 00:56:18 -0400 From: Alexander Kabaev To: Alan Cox Message-ID: <20040405045618.GA40623@kanpc.gte.com> References: <20040402191254.GK26131@elvis.mu.org> <35917.1080933274@critter.freebsd.dk> <20040402195957.GN26131@elvis.mu.org> <20040404201251.GP15786@cs.rice.edu> <20040405041147.GA39962@kanpc.gte.com> <20040405042010.GQ15786@cs.rice.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040405042010.GQ15786@cs.rice.edu> User-Agent: Mutt/1.5.6i cc: alc@freebsd.org cc: kan@freebsd.org cc: Poul-Henning Kamp cc: Alfred Perlstein cc: current@freebsd.org 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: Mon, 05 Apr 2004 04:56:20 -0000 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! -- Alexander Kabaev