Re: How to read-protect a vm_area?

Gabriel Paubert (paubert@iram.es)
Mon, 16 Feb 1998 19:11:48 +0100 (MET)


On 14 Feb 1998, Linus Torvalds wrote:

> In article <m0y3fyk-0005FsC@lightning.swansea.linux.org.uk>,
> Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> >> I looked in an i386 book. It has a Present bit and a Read/Write bit as
> >> part of its page protection system. I think it is simply not possible
> >> to read-protect a page without swapping it!
> >
> >You just mark it "not present". Its up to you to remember its really around
> >somewhere ;)
>
> Actually, the way Linux does it is to mark it "supervisor mode only"
> (clear the "US" bit) - which essentially read-protects it from user
> mode.
>

Does it mean that a write(2) with a buffer from an
mprotect( , , PROT_NONE)'ed area will succeed ?

I can't see right now how it could fail (on Intel with kernel v2.1.xx).

Gabriel.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu