kern/64573: mmap with PROT_NONE, but still could be read

Mark W. Krentel krentel at dreamscape.com
Tue Apr 13 21:41:17 PDT 2004


>   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


More information about the freebsd-bugs mailing list