Re: make PROT_WRITE imply PROT_READ

From: Alan Cox
Date: Thu Jun 29 2006 - 07:41:10 EST


Ar Iau, 2006-06-29 am 09:30 +0200, ysgrifennodd Pavel Machek:
> > 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.

Alan

-
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/