Re: make PROT_WRITE imply PROT_READ

From: Pavel Machek
Date: Tue Jun 27 2006 - 05:55:47 EST


Hi!

> >you ask for it, and the kernel is supposed to deliver the best behavior
> >it can.
>
> The kernel should provide
>
> - a stable, reliable interface
>
> - a consistent interface at least accross architectures, maybe even
> platforms
>
>
> Providing write-only support for memory falls into none of these
> categories. When Jason and I discussed this my position actually was
> to disallow PROT_WRITE without PROT_READ completely, making it an
> error of mmap and mprotect. That's perfectly legal according to POSIX
> and it will teach those who write broken code like this.

Well, some hardware can probably support write-only, and such support
can be useful for "weird" applications, such as just-in-time
compilers, etc.

Usability for "normal" C applications is probably not too high... so
why not work around it in glibc, if at all?
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/