From: Jan Beulich Date: Wed, 22 Apr 2020 11:01:10 +0000 (+0200) Subject: x86: validate VM assist value in arch_set_info_guest() X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~373 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a62c6fe05c4ae905b7d4cb0ca946508b7f96d522;p=xen.git x86: validate VM assist value in arch_set_info_guest() 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 Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 7f18f4a88a..a4428190d5 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -932,6 +932,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 )