xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Keir Fraser <keir@xen.org>
Subject: Re: [PATCH 2/3] domctl: also pause domain for extended context updates
Date: Wed, 5 Feb 2014 15:05:07 +0000	[thread overview]
Message-ID: <52F25323.9080208@citrix.com> (raw)
In-Reply-To: <52F25E9902000078001196E8@nat28.tlf.novell.com>


[-- Attachment #1.1: Type: text/plain, Size: 2508 bytes --]

On 05/02/14 14:54, Jan Beulich wrote:
> This is not just for consistency with "base" context updates, but
> actually needed so that guest side accesses can't race with control
> domain side updates.
>
> This would have been a security issue if XSA-77 hadn't waived them on
> the affected domctl operation.
>
> While looking at the code I also spotted a redundant NULL check in the
> "base" context update handling code, which is being removed.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -853,6 +853,8 @@ long arch_do_domctl(
>          }
>          else
>          {
> +            if ( d == current->domain ) /* no domain_pause() */
> +                break;
>              ret = -EINVAL;
>              if ( evc->size < offsetof(typeof(*evc), vmce) )
>                  break;
> @@ -861,6 +863,7 @@ long arch_do_domctl(
>                  if ( !is_canonical_address(evc->sysenter_callback_eip) ||
>                       !is_canonical_address(evc->syscall32_callback_eip) )
>                      break;
> +                domain_pause(d);
>                  fixup_guest_code_selector(d, evc->sysenter_callback_cs);
>                  v->arch.pv_vcpu.sysenter_callback_cs      =
>                      evc->sysenter_callback_cs;
> @@ -881,6 +884,8 @@ long arch_do_domctl(
>                        (evc->syscall32_callback_cs & ~3) ||
>                        evc->syscall32_callback_eip )
>                  break;
> +            else
> +                domain_pause(d);
>  
>              BUILD_BUG_ON(offsetof(struct xen_domctl_ext_vcpucontext,
>                                    mcg_cap) !=
> @@ -899,6 +904,8 @@ long arch_do_domctl(
>              }
>              else
>                  ret = 0;
> +
> +            domain_unpause(d);
>          }
>      }
>      break;
> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -334,10 +334,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
>          unsigned int vcpu = op->u.vcpucontext.vcpu;
>          struct vcpu *v;
>  
> -        ret = -ESRCH;
> -        if ( d == NULL )
> -            break;
> -
>          ret = -EINVAL;
>          if ( (d == current->domain) || /* no domain_pause() */
>               (vcpu >= d->max_vcpus) || ((v = d->vcpu[vcpu]) == NULL) )
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 3359 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

  reply	other threads:[~2014-02-05 15:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 14:48 [PATCH 0/3] guest context management adjustments Jan Beulich
2014-02-05 14:52 ` [PATCH 1/3] x86: fix FS/GS base handling when using the fsgsbase feature Jan Beulich
2014-02-05 15:50   ` Andrew Cooper
2014-02-05 14:54 ` [PATCH 2/3] domctl: also pause domain for extended context updates Jan Beulich
2014-02-05 15:05   ` Andrew Cooper [this message]
2014-02-05 14:54 ` [PATCH 3/3] domctl: pause vCPU for context reads Jan Beulich
2014-02-05 15:29   ` Andrew Cooper
2014-02-05 15:39     ` Jan Beulich
2014-02-05 15:43       ` Andrew Cooper
2014-02-05 14:55 ` [PATCH 0/3] guest context management adjustments Jan Beulich
2014-02-05 16:02   ` George Dunlap
2014-02-05 15:35 ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52F25323.9080208@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).