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

[Xen-devel] Re: [patch] Add missing breaks to {set, get}_address_size do

To: Xen devel list <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [patch] Add missing breaks to {set, get}_address_size domctls.
From: Gerd Hoffmann <kraxel@xxxxxxx>
Date: Wed, 14 Feb 2007 16:25:06 +0100
Cc: Jan Beulich <jbeulich@xxxxxxxxxx>
Delivery-date: Wed, 14 Feb 2007 07:24:25 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <45D300DA.9050708@xxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
References: <45D300DA.9050708@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.9 (X11/20060911)
Gerd Hoffmann wrote:
>   Hi,
> 
> $subject says all ;)

Oops, fix was incomplete, the get_address_size also lacks the
copy_to_guest() ...

updated patch attached,
  Gerd

-- 
Gerd Hoffmann <kraxel@xxxxxxx>
diff -r ad9bbd103034 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c     Fri Feb 09 18:19:24 2007 +0000
+++ b/xen/arch/x86/domctl.c     Wed Feb 14 15:42:34 2007 +0100
@@ -398,6 +398,7 @@ long arch_do_domctl(
 
         put_domain(d);
     }
+    break;
 
     case XEN_DOMCTL_get_address_size:
     {
@@ -407,11 +408,16 @@ long arch_do_domctl(
         if ( (d = get_domain_by_id(domctl->domain)) == NULL )
             break;
 
+       printk("%s: offset %zd\n", __FUNCTION__, offsetof(struct xen_domctl, 
u.address_size.size));
         domctl->u.address_size.size = BITS_PER_GUEST_LONG(d);
 
         ret = 0;
         put_domain(d);
-    }
+
+        if (copy_to_guest(u_domctl, domctl, 1))
+            ret = -EFAULT;
+    }
+    break;
 
     default:
         ret = -ENOSYS;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel