From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 2/2] x86/domctl: Don't allow a toolstack domain to pause itself Date: Wed, 1 Apr 2015 16:14:18 -0400 Message-ID: <20150401201418.GB13356@l.oracle.com> References: <1427902263-363-1-git-send-email-andrew.cooper3@citrix.com> <1427902263-363-3-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1427902263-363-3-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: Andrew Cooper Cc: Keir Fraser , Jan Beulich , Xen-devel List-Id: xen-devel@lists.xenproject.org On Wed, Apr 01, 2015 at 04:31:03PM +0100, Andrew Cooper wrote: > Signed-off-by: Andrew Cooper > CC: Keir Fraser > CC: Jan Beulich Reviewed-by: Konrad Rzeszutek Wilk > --- > 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 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel