only kernel can access copy_area ?

View: New views
4 Messages — Rating Filter:   Alert me  

only kernel can access copy_area ?

by lion :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi, all
     Thank you for these days' help.
     Now, I am learning about  ipc. And have a question again. Sorry for troubling you!
 
     About the copy_area,when A sends a message to B, only kernel A and user B can access
the copy_area. But user A can not. Is these correct ? And why ?
     In my opinion, the page table of A's copy_area is copyed from B whick is user accessiable.
So,user A can access the copy_area. Is that right?
     Thank you
    

---
Best regards

Bo Liu




Get news, entertainment and everything you care about at Live.com. Check it out!

Re: only kernel can access copy_area ?

by lion :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Still uncleanly about that...
About the copy_area's implemention.

lion wrote:
Hi, all
     Thank you for these days' help.
     Now, I am learning about  ipc. And have a question again. Sorry for troubling you!
 
     About the copy_area,when A sends a message to B, only kernel A and user B can access
the copy_area. But user A can not. Is these correct ? And why ?
     In my opinion, the page table of A's copy_area is copyed from B which is user accessiable.
So,user A can access the copy_area. Is that right?

     Thank you
     ---Best regardsBo Liu
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx

Re: only kernel can access copy_area ?

by Raphael Neider :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2008-10-14 at 00:33, lion wrote:
>
> Still uncleanly about that...
> About the copy_area's implemention.
>
> >      About the copy_area,

The copy area is a temporary mapping of a part of B's address space (the
destination of the string transfer) into the kernel region in order to
make B's memory accessible while A's address space is active (otherwise
there would be no name, i.e., virtual address in A's address space, to
access that memory).
In principle, both A and B could access the mapping area: it is not protected
by means of page protections (the page is user accessible due to its page
table entry being copied from B and the page being user accessible there) nor
by means of segmentation (on x86, due to L4 not using segments for protection
at all except with small spaces).

But: The copy area is unmapped
    (a) before A returns to user mode after the IPC and/or
    (b) at the next thread switch (whichever occurs first),
so neither A nor B (nor any other thread at user level) has a chance of
actually accessing B's memory by means of the copy area.

Now back to answering your questions:
> > when A sends a message to B, only kernel A and user B can access
> > the copy_area. But user A can not. Is these correct ? And why ?
That's not correct. Theoretically, user A, user B, kernel A, and kernel B
can access the copy area, but due to kernel guarantees as to which thread
actually runs, only kernel A gets the chance to do so.
The `why' should have been answered above.

> >      In my opinion, the page table of A's copy_area is copyed from B which
> > is user accessiable.
> > So,user A can access the copy_area. Is that right?
Again: Yes, but only in theory as user A never runs while the mapping exists.

Hoping that helped to clear things up a bit,
Raphael



RE: only kernel can access copy_area ?

by lion :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Thank you Raphael. It's so clearly!
It seems easy and simple. But I couldn't understand it before.
I think i need introspection and think more. 

---
Best regards

Bo Liu



> Date: Tue, 14 Oct 2008 10:29:35 +0200
> From: neider@...
> To: bo-liu@...
> CC: l4ka@...
> Subject: Re: only kernel can access copy_area ?
>
> On 2008-10-14 at 00:33, lion wrote:
> >
> > Still uncleanly about that...
> > About the copy_area's implemention.
> >
> > > About the copy_area,
>
> The copy area is a temporary mapping of a part of B's address space (the
> destination of the string transfer) into the kernel region in order to
> make B's memory accessible while A's address space is active (otherwise
> there would be no name, i.e., virtual address in A's address space, to
> access that memory).
> In principle, both A and B could access the mapping area: it is not protected
> by means of page protections (the page is user accessible due to its page
> table entry being copied from B and the page being user accessible there) nor
> by means of segmentation (on x86, due to L4 not using segments for protection
> at all except with small spaces).
>
> But: The copy area is unmapped
> (a) before A returns to user mode after the IPC and/or
> (b) at the next thread switch (whichever occurs first),
> so neither A nor B (nor any other thread at user level) has a chance of
> actually accessing B's memory by means of the copy area.
>
> Now back to answering your questions:
> > > when A sends a message to B, only kernel A and user B can access
> > > the copy_area. But user A can not. Is these correct ? And why ?
> That's not correct. Theoretically, user A, user B, kernel A, and kernel B
> can access the copy area, but due to kernel guarantees as to which thread
> actually runs, only kernel A gets the chance to do so.
> The `why' should have been answered above.
>
> > > In my opinion, the page table of A's copy_area is copyed from B which
> > > is user accessiable.
> > > So,user A can access the copy_area. Is that right?
> Again: Yes, but only in theory as user A never runs while the mapping exists.
>
> Hoping that helped to clear things up a bit,
> Raphael
>



Explore the seven wonders of the world Learn more!