]> xenbits.xensource.com Git - xen.git/commitdiff
x86: validate VM assist value in arch_set_info_guest()
authorJan Beulich <jbeulich@suse.com>
Mon, 27 Apr 2020 13:57:13 +0000 (15:57 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 27 Apr 2020 13:57:13 +0000 (15:57 +0200)
While I can't spot anything that would go wrong, just like the
respective hypercall only permits applicable bits to be set, we should
also do so when loading guest context.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: a62c6fe05c4ae905b7d4cb0ca946508b7f96d522
master date: 2020-04-22 13:01:10 +0200

xen/arch/x86/domain.c

index 745da387f665d6ad9e84d53c61bab6e3fbb59d81..6b0cb689a1ebb128d7db272db43b1c0b55a0077b 100644 (file)
@@ -868,6 +868,9 @@ int arch_set_info_guest(
         }
     }
 
+    if ( v->vcpu_id == 0 && (c(vm_assist) & ~arch_vm_assist_valid_mask(d)) )
+        return -EINVAL;
+
     if ( is_hvm_domain(d) )
     {
         for ( i = 0; i < ARRAY_SIZE(v->arch.dr); ++i )