Cool. This does indeed explain it.
The _PAGE_PROTNONE was a clever way to get the correct unreadability on an
x86, but I did indeed miss the fact that now a page can be marked
"present" as far as the Linux memory management is concerned, yet not be
writable by looking at _PAGE_RW.
Your suggestion not only should fix this, but is also the RightThing(tm)
to do.
It also explains why so few people saw this - PROT_NONE is not something
that is normally used.
> What are
> the implications for other architectures which organise their ptes
> differently?
Other architectures may have the same bug, but it's actually fairly
unlikely. Most other architectures tend to have a nicer way to do
PROT_NONE anyway, and the x86 thing is a hack (but a very nice hack,
because it leaves the mm layer completely unaware of the fact that the x86
page tables are fairly deficient in this area).
So it's not a conceptual problem, it might just be something that needs to
be looked at. Certainly the alpha does not have this problem.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu