Re: [patch 1/1] make PROT_WRITE imply PROT_READ

Chris Wedgwood
2006-09-18T00:57:26Z

On Sun, Sep 17, 2006 at 10:14:06PM +0100, Alan Cox wrote:

> Unfortunately yes. This was discovered in the real world.

Are there a lot of these applications and does it break badly? Do you
know which ones they are?

It's not an intuitive change and as the current behavior isn't
entirely consistent and (presumably) these applications work, so is
this change really needed?

Fixing userspace assumptions but setting a (counter-intuitive)
precedent in the kernel seems wrong.

> Executable types already let us handle that, or as you suggest but
> the other way around you add PROT_REALLYLIKEWRITEONLYOK as a new
> mmap type (and as PROT_WRITE) for a new binary format later if the
> CPU ever supports it.

True, but it's more complexity further down the line.

> Frankly I think the odds of Intel cpus growing write-only are
> remote....

Even with VT/Pacifica? Might those not provide support to catch reads
and writes to certain regions? At some point I imagine there will be
in-kernel awareness of those technologies when the kernel isn't
running uder a hypervisor to make things like running a VM inside
Linux easier (I would assume vmware is/has done this already perhaps).