[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/2] x86/domctl: Don't allow a toolstack domain to pause itself



On Wed, Apr 01, 2015 at 04:31:03PM +0100, Andrew Cooper wrote:
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> CC: Keir Fraser <keir@xxxxxxx>
> CC: Jan Beulich <JBeulich@xxxxxxxx>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.