From: Andrew Cooper Date: Tue, 21 Apr 2015 07:05:26 +0000 (+0200) Subject: x86/domctl: don't allow a toolstack domain to pause itself X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3400 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=176d24bcb2e7e43ca9e1178b06f81b49fdbb9142;p=xen.git x86/domctl: don't allow a toolstack domain to pause itself Signed-off-by: Andrew Cooper Reviewed-by: Konrad Rzeszutek Wilk --- diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index b6df23ab91..20cdccb111 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -411,7 +411,8 @@ long arch_do_domctl( struct hvm_domain_context c = { .size = domctl->u.hvmcontext.size }; ret = -EINVAL; - if ( !is_hvm_domain(d) ) + if ( (d == currd) || /* no domain_pause() */ + !is_hvm_domain(d) ) goto sethvmcontext_out; ret = -ENOMEM; @@ -436,7 +437,8 @@ long arch_do_domctl( struct hvm_domain_context c = { 0 }; ret = -EINVAL; - if ( !is_hvm_domain(d) ) + if ( (d == currd) || /* no domain_pause() */ + !is_hvm_domain(d) ) goto gethvmcontext_out; c.size = hvm_save_size(d); @@ -475,7 +477,8 @@ long arch_do_domctl( case XEN_DOMCTL_gethvmcontext_partial: ret = -EINVAL; - if ( !is_hvm_domain(d) ) + if ( (d == currd) || /* no domain_pause() */ + !is_hvm_domain(d) ) break; domain_pause(d); @@ -894,7 +897,8 @@ long arch_do_domctl( break; ret = -EINVAL; - if ( !is_hvm_domain(d)) + if ( (v == curr) || /* no vcpu_pause() */ + !is_hvm_domain(d) ) break; ret = hvm_debug_op(v, domctl->u.debug_op.op);