All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tian, Kevin" <kevin.tian@intel.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Cc: "Tamas K Lengyel" <tamas@tklengyel.com>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Jan Beulich" <JBeulich@suse.com>,
	"Razvan Cojocaru" <rcojocaru@bitdefender.com>,
	"Nakajima, Jun" <jun.nakajima@intel.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v2 3/4] x86/vmx: Fix security issue when a guest balloons out the #VE info page
Date: Thu, 28 Feb 2019 05:48:12 +0000	[thread overview]
Message-ID: <AADFC41AFE54684AB9EE6CBC0274A5D19C96B354@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1550780337-638-1-git-send-email-andrew.cooper3@citrix.com>

> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
> Sent: Friday, February 22, 2019 4:19 AM
> 
> The logic in altp2m_vcpu_{en,dis}able_ve() and
> vmx_vcpu_update_vmfunc_ve() is
> dangerous.  After #VE has been set up, the guest can balloon out and free the
> nominated GFN, after which the processor may write to it.  Also, the unlocked
> GFN query means the MFN is stale by the time it is used.  Alternatively, a
> guest can race two disable calls to cause one VMCS to still reference the
> nominated GFN after the tracking information was dropped.
> 
> Rework the logic from scratch to make it safe.
> 
> Hold an extra page reference on the underlying frame, to account for the
> VMCS's reference.  This means that if the GFN gets ballooned out, it isn't
> freed back to Xen until #VE is disabled, and the VMCS no longer refers to the
> page.
> 
> A consequence of this is that altp2m_vcpu_disable_ve() needs to be called
> during the domain_kill() path, to drop the reference for domains which shut
> down with #VE still enabled.
> 
> For domains using altp2m, we expect a single enable call and no disable for
> the remaining lifetime of the domain.  However, to avoid problems with
> concurrent calls, use cmpxchg() to locklessly maintain safety.
> 
> This doesn't have an XSA because altp2m is not yet a security-supported
> feature.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Release-acked-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Kevin Tian <kevin.tian@intel.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-02-28  5:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-19 22:18 [PATCH tentitively for-4.12 0/4] x86/altp2m: Fix multiple security issues Andrew Cooper
2019-02-19 22:18 ` [PATCH 1/4] xen/common: Break domain_unmap_resources() out of domain_kill() Andrew Cooper
2019-02-19 22:39   ` Razvan Cojocaru
2019-02-19 22:46     ` Andrew Cooper
2019-02-20 14:11       ` Jan Beulich
2019-02-19 22:18 ` [PATCH 2/4] x86/altp2m: Rework #VE enable/disable paths Andrew Cooper
2019-02-19 23:10   ` Razvan Cojocaru
2019-02-20 14:14     ` Jan Beulich
2019-02-19 22:18 ` [PATCH 3/4] x86/vmx: Fix security issue when a guest balloons out the #VE info page Andrew Cooper
2019-02-20  9:45   ` Razvan Cojocaru
2019-02-20 14:37   ` Jan Beulich
2019-02-21 17:03     ` Andrew Cooper
2019-02-22  8:49       ` Jan Beulich
2019-02-21 20:18   ` [PATCH v2 " Andrew Cooper
2019-02-21 21:28     ` Razvan Cojocaru
2019-02-22 12:24     ` Jan Beulich
2019-02-22 14:03       ` Andrew Cooper
2019-02-28  5:48     ` Tian, Kevin [this message]
2019-02-19 22:18 ` [PATCH 4/4] x86/vmx: Properly flush the TLB when an altp2m is modified Andrew Cooper
2019-02-19 23:20   ` Razvan Cojocaru
2019-02-20 14:47   ` Jan Beulich
2019-02-28  5:50   ` Tian, Kevin
2019-02-21 13:13 ` [PATCH tentitively for-4.12 0/4] x86/altp2m: Fix multiple security issues Juergen Gross

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=AADFC41AFE54684AB9EE6CBC0274A5D19C96B354@SHSMSX104.ccr.corp.intel.com \
    --to=kevin.tian@intel.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=roger.pau@citrix.com \
    --cc=tamas@tklengyel.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.