From owner-freebsd-bugs@FreeBSD.ORG Tue Apr 13 21:41:17 2004 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 48AE516A4CE for ; Tue, 13 Apr 2004 21:41:17 -0700 (PDT) Received: from catapult.dreamscape.com (catapult.dreamscape.com [206.64.128.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id C388943D5A for ; Tue, 13 Apr 2004 21:41:16 -0700 (PDT) (envelope-from krentel@dreamscape.com) Received: from mail3.dreamscape.com (mail3.dreamscape.com [206.64.128.213]) i3E4fDfJ029405; Wed, 14 Apr 2004 00:41:13 -0400 (EDT) Received: from blue.mwk.domain (sA16-p10.dreamscape.com [209.217.195.137]) i3E4fBgp025257; Wed, 14 Apr 2004 00:41:12 -0400 (EDT) Received: from blue.mwk.domain (localhost [127.0.0.1]) by blue.mwk.domain (8.12.9p2/8.12.9) with ESMTP id i3E4fNaK038974; Wed, 14 Apr 2004 00:41:23 -0400 (EDT) (envelope-from krentel@blue.mwk.domain) Message-Id: <200404140441.i3E4fNaK038974@blue.mwk.domain> To: "David G. Lawrence" In-Reply-To: Your message of "Tue, 13 Apr 2004 20:43:42 PDT." <20040414034342.GA2439@nexus.dglawrence.com> Date: Wed, 14 Apr 2004 00:41:23 -0400 From: "Mark W. Krentel" cc: freebsd-bugs@FreeBSD.org Subject: Re: kern/64573: mmap with PROT_NONE, but still could be read X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2004 04:41:17 -0000 > Why would anyone want to mmap a file with PROT_NONE? The same reason you're allowed to create a file with mode 000. The OS doesn't make value judgements about your program. If you ask for PROT_NONE, then you're supposed to get PROT_NONE. The same bug happens mmap()-ing a file with PROT_WRITE, you still get read access. In this case, PROT_NONE was just the simplest way to demonstrate the bug. --Mark