Re: Page fault handling within a language
- From: "Arthur J. O'Dwyer" <ajonospam@xxxxxxxxxxxxxx>
- Date: Fri, 24 Mar 2006 15:55:58 -0500 (EST)
On Fri, 24 Mar 2006, James Harris wrote:
<jdholzer@xxxxxxxxxxx> wrote in message[...]James Harris (e-mail address ignored) wrote:Anyone seen or considered data structures that handle
their own address faults?
I can't see an OS creater ever allowing a user space process to truly
manage its own page faults. Doesn't sound like a good idea at all to
me.
Why do you object to this? Can you see a problem with it?
Here's the normal (Unix) sequence of events, as I understand it:
Process tries to access page N, which isn't mapped yet.
Hardware calls the OS's page fault handler.
OS handler allocates a new physical frame and fills it somehow.
OS handler adds the new frame to the virtual page directory.
OS handler returns to process.
AIUI, you're proposing that the sequence of events go like this:
Process tries to access page N, which isn't mapped yet.
Hardware calls the OS's page fault handler.
OS's page fault handler jumps to the user's page fault handler.
User's handler allocates a new physical frame and fills it somehow.
User's handler adds the new frame to the virtual page directory.
User's handler returns to process.
(We need to have the OS handler in there; otherwise, you couldn't
have two different processes each with their own custom page fault handler.)
Now, this method requires the user process to know about the OS's
method of allocating physical frames. That's bad. But worse, it requires the user process to be able to modify the virtual page directory.
That means that the user process is free to re-map any pages anywhere
in its virtual address space, pretty much any time it wants. And that
means that a suitably clever program can execute privileged instructions,
by changing the virtual-to-physical mapping on the pages that are supposed
to hold the kernel's own code (for system calls and so on).
So in conclusion, this is a gigantic security hole, at least AIUI.
If you're thinking of a different sequence of events above, please
explain what you're thinking of.
-Arthur
.
- References:
- Page fault handling within a language
- From: James Harris (e-mail address ignored)
- Re: Page fault handling within a language
- From: jdholzer
- Re: Page fault handling within a language
- From: James Harris
- Page fault handling within a language
- Prev by Date: Re: Page fault handling within a language
- Next by Date: Re: find a number
- Previous by thread: Re: Page fault handling within a language
- Next by thread: Re: Page fault handling within a language
- Index(es):
Relevant Pages
|
Loading