Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Apr 2004 00:41:23 -0400
From:      "Mark W. Krentel" <krentel@dreamscape.com>
To:        "David G. Lawrence" <dg@dglawrence.com>
Cc:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/64573: mmap with PROT_NONE, but still could be read 
Message-ID:  <200404140441.i3E4fNaK038974@blue.mwk.domain>
In-Reply-To: Your message of "Tue, 13 Apr 2004 20:43:42 PDT." <20040414034342.GA2439@nexus.dglawrence.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>   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



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