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-changelog

[Xen-changelog] [xen-unstable] hvm: copy_{to, from}_user_hvm shoudl retu

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] hvm: copy_{to, from}_user_hvm shoudl return appropriate error codes.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 28 Dec 2007 12:00:07 -0800
Delivery-date: Fri, 28 Dec 2007 12:00:05 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1198796510 0
# Node ID 4624795a2346438bab8115b6a5eac7218be9e6d9
# Parent  7fbc521b07a918512a62dee712e3c2b1f228f8e0
hvm: copy_{to,from}_user_hvm shoudl return appropriate error codes.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/hvm/platform.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff -r 7fbc521b07a9 -r 4624795a2346 xen/arch/x86/hvm/platform.c
--- a/xen/arch/x86/hvm/platform.c       Thu Dec 27 13:00:40 2007 +0000
+++ b/xen/arch/x86/hvm/platform.c       Thu Dec 27 23:01:50 2007 +0000
@@ -1310,26 +1310,30 @@ DEFINE_PER_CPU(int, guest_handles_in_xen
    deal with this. */
 unsigned long copy_to_user_hvm(void *to, const void *from, unsigned len)
 {
+    int rc;
+
     if ( this_cpu(guest_handles_in_xen_space) )
     {
         memcpy(to, from, len);
         return 0;
     }
 
-    return hvm_copy_to_guest_virt_nofault(
-        (unsigned long)to, (void *)from, len);
+    rc = hvm_copy_to_guest_virt_nofault((unsigned long)to, (void *)from, len);
+    return rc ? len : 0; /* fake a copy_to_user() return code */
 }
 
 unsigned long copy_from_user_hvm(void *to, const void *from, unsigned len)
 {
+    int rc;
+
     if ( this_cpu(guest_handles_in_xen_space) )
     {
         memcpy(to, from, len);
         return 0;
     }
 
-    return hvm_copy_from_guest_virt_nofault(
-        to, (unsigned long)from, len);
+    rc = hvm_copy_from_guest_virt_nofault(to, (unsigned long)from, len);
+    return rc ? len : 0; /* fake a copy_from_user() return code */
 }
 
 /*

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] hvm: copy_{to, from}_user_hvm shoudl return appropriate error codes., Xen patchbot-unstable <=