domctl: don't allow a toolstack domain to call domain_pause() on itself
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 1 Apr 2015 09:08:33 +0000 (10:08 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 1 Apr 2015 09:16:25 +0000 (10:16 +0100)
These DOMCTL subops were accidentally declared safe for disaggregation
in the wake of XSA-77.

This is XSA-127 / CVE-2015-2751.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/x86/domctl.c
xen/common/domctl.c

index 6bcdb98c1ede70c0168a31b07203c851f60cbdb3..32d3fcd27765bd4995372fead7e1b0256c0b1cb8 100644 (file)
@@ -886,6 +886,10 @@ long arch_do_domctl(
     {
         xen_guest_tsc_info_t info;
 
+        ret = -EINVAL;
+        if ( d == current->domain ) /* no domain_pause() */
+            break;
+
         domain_pause(d);
         tsc_get_info(d, &info.tsc_mode,
                         &info.elapsed_nsec,
@@ -901,6 +905,10 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_settscinfo:
     {
+        ret = -EINVAL;
+        if ( d == current->domain ) /* no domain_pause() */
+            break;
+
         domain_pause(d);
         tsc_set_info(d, domctl->u.tsc_info.info.tsc_mode,
                      domctl->u.tsc_info.info.elapsed_nsec,
index c2e60a7d6f3d16776866fd1c8fb13f833a406433..c8bcb2d32b812715f7b60f195485008e54c0cbdb 100644 (file)
@@ -531,7 +531,10 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         break;
 
     case XEN_DOMCTL_resumedomain:
-        domain_resume(d);
+        if ( d == current->domain ) /* no domain_pause() */
+            ret = -EINVAL;
+        else
+            domain_resume(d);
         break;
 
     case XEN_DOMCTL_createdomain: