Re: make PROT_WRITE imply PROT_READ

From: Pavel Machek
Date: Thu Jun 29 2006 - 13:19:22 EST


Hi!

> > > PROT_READ to be used or implicitly adding it. Don't confuse people
> > > with wrong statement like yours.
> >
> > Can you quote part of POSIX where it says that PROT_WRITE must imply
> > PROT_READ?
>
> I don't believe POSIX cares either way
>
> "An implementation may permit accesses other than those specified by
> prot; however, if the Memory Protection option is supported, the
> implementation shall not permit a write to succeed where PROT_WRITE has
> not been set or shall not permit any access where PROT_NONE alone has
> been set."
>
> However the current behaviour of "write to map read might work some days
> depending on the execution order of instructions" (and in some cases the
> order that the specific CPU does its tests for access rights) is not
> sane, not conducive to application stability and not good practice.

Well, some architectures may have working PROT_WRITE without
PROT_READ. If you are careful and code your userland application in
assembly, it should work okay.

On processors where that combination depends randomly depending on
phase of moon (i386, apparently), I guess change is okay. But the
patch disabled PROT_WRITE w/o PROT_READ on _all_ processors.

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/