[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] mmap in PV xen-4.0.1

On Wed, Aug 10, 2011 at 6:21 PM, Wei Liu <liuw@xxxxxxxxx> wrote:
> On Wed, Aug 10, 2011 at 11:31:29AM -0700, Eric Camachat wrote:
>> >>
>> >> Â Â Â Âswitch(cmd) {
>> >> Â Â Â Â Â Â Â Âsize = (uint32_t*)arg;
>> >> Â Â Â Â Â Â Â Â*size = _size;
>> >
>> > Though your output shows that this assignment works, shouldn't this
>> > kind of direct assignment across kernel space and user land be
>> > avoided? It is bad practice to do direct assignment I think.
>> >
>> > copy_{from,to}_user should do the job.
>> >
>> I want share some memory between kernel and user applications, so I am
>> trying to use mmap instead of copy_{from,to} multiple times.
> I understand.
> But I still insist you use copy_{from,to}_user when doing syscalls,
> just to validate the pointer for syscalls. AFAICT, a syscall is not
> about sharing things, it is about providing service routines to user
> space. If user space application issues syscall with wrong pointer,
> your system is likely to get compromised. (well, I major in
> Information Security so may be to sensitive on this...)
> When you're running your own application, you can choose whatever
> method you like to share data between kernel and user land.
> Wei.

Even though it can resolved by copy_{from,to}, I still don't know why
it didn't work in PV.
I want figure out this, cause we want port our existing servers into
XEN and keep minimum code changes to avoid any side effects.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.