From: Andrew Cooper Subject: [PATCH 2/2] x86/domctl: Don't allow a toolstack domain to pause itself Date: Wed, 1 Apr 2015 16:31:03 +0100 Message-ID: <1427902263-363-3-git-send-email-andrew.cooper3@citrix.com> References: <1427902263-363-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1427902263-363-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Andrew Cooper , Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org Signed-off-by: Andrew Cooper CC: Keir Fraser CC: Jan Beulich --- xen/arch/x86/domctl.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index bcbdf95..ff3b423 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); @@ -896,7 +899,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); -- 1.7.10.4