WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Wei Liu <liuw@xxxxxxxxx>
Subject: Re: [Xen-devel] mmap in PV xen-4.0.1
From: Eric Camachat <eric.camachat@xxxxxxxxx>
Date: Wed, 10 Aug 2011 18:29:20 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 10 Aug 2011 18:30:29 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=uaDGUjNwgChUPHa93TQkzZ+OTQth3MlLzvbW/47hkR4=; b=MAF0CfCyErLTC+vLx+uwu6K1i5TfiBTkDH7km3n6bZYee92kaS8/mljGBGJha+Is/Y 6vAoPhNRQem7w+KiHA6QhGiun7y3Y/uGQfgc3QioHkDPiW7hxwgv/JLcFvxYc9zR2zsj Gdj8fVXRgmxiIt8bRVtvDGFmctCry+CddJDnM=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110811012109.GA1889@limbo>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <CACeEFf77eOLLNgsJwEYdzeiuxm+qDcO2zs09FK-Waas0sxcwLQ@xxxxxxxxxxxxxx> <CACeEFf5yDb3dh+M3nycmYMaW5Vf+6C57QXZjXEBQZhrwkTHkHg@xxxxxxxxxxxxxx> <20110810091256.GA1537@limbo> <CACeEFf6HoD10k5PUP7gNBNteyY=Wh3XTJCOZEmvs+Us+WfahNw@xxxxxxxxxxxxxx> <20110811012109.GA1889@limbo>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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) {
>> >>        case MEMTEST_DMA_SIZE:
>> >>                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.

/Eric

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>