qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Daniel P. Berrange" <berrange@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Brijesh Singh <brijesh.singh@amd.com>,
	crosthwaite.peter@gmail.com, p.fedin@samsung.com,
	qemu-devel@nongnu.org, armbru@redhat.com, lcapitulino@redhat.com,
	rth@twiddle.net
Subject: Re: [Qemu-devel] [RFC PATCH v1 10/22] sev: add SEV debug decrypt command
Date: Thu, 15 Sep 2016 01:05:12 +0300	[thread overview]
Message-ID: <20160914211803-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20160914173541.GF24695@thinpad.lan.raisama.net>

On Wed, Sep 14, 2016 at 02:35:41PM -0300, Eduardo Habkost wrote:
> On Wed, Sep 14, 2016 at 06:46:20PM +0300, Michael S. Tsirkin wrote:
> > On Wed, Sep 14, 2016 at 04:06:33PM +0100, Daniel P. Berrange wrote:
> > > On Wed, Sep 14, 2016 at 05:48:17PM +0300, Michael S. Tsirkin wrote:
> > > > On Wed, Sep 14, 2016 at 03:15:07PM +0100, Daniel P. Berrange wrote:
> > > > > On Wed, Sep 14, 2016 at 04:50:51PM +0300, Michael S. Tsirkin wrote:
> > > > > > On Wed, Sep 14, 2016 at 02:37:49PM +0100, Daniel P. Berrange wrote:
> > > > > > > On Wed, Sep 14, 2016 at 04:32:44PM +0300, Michael S. Tsirkin wrote:
> > > > > > > > On Wed, Sep 14, 2016 at 02:23:14PM +0100, Daniel P. Berrange wrote:
> > > > > > > > > On Wed, Sep 14, 2016 at 03:07:58PM +0200, Paolo Bonzini wrote:
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > On 14/09/2016 15:05, Michael S. Tsirkin wrote:
> > > > > > > > > > > I assumed that with debug on, memory is still encrypted but the
> > > > > > > > > > > hypervisor can break encryption, and as the cover letter states, the
> > > > > > > > > > > hypervisor is assumed benign. If true I don't see a need to
> > > > > > > > > > > give users more rope.
> > > > > > > > > > 
> > > > > > > > > > The hypervisor is assumed benign but vulnerable.
> > > > > > > > > > 
> > > > > > > > > > So, if somebody breaks the hypervisor, you would like to make it as hard
> > > > > > > > > > as possible for the attacker to do evil stuff to the guests.  If the
> > > > > > > > > > attacker can just ask the secure processor "decrypt some memory for me",
> > > > > > > > > > then the encryption is effectively broken.
> > > > > > > > > 
> > > > > > > > > So there's going to be a tradeoff here between use of SEV and use of
> > > > > > > > > certain other features. eg, it seems that if you're using SEV, then
> > > > > > > > > any concept of creating & analysing guest core dumps from the host
> > > > > > > > > is out.
> > > > > > > > 
> > > > > > > > I don't see why - as long as we don't trigger dumps, there's no leak :)
> > > > > > > 
> > > > > > > If the facility to trigger dumps is available, then the memory
> > > > > > > encryption feature of SEV is as useful as a chocolate teapot,
> > > > > > > as the would be attacker can simply trigger a dump
> > > > > > 
> > > > > > If attacker can trigger things, IOW execute code in hypervisor,
> > > > > > then encrypting memory is not useful anyway.
> > > > > 
> > > > > The presentation at KVM forum claimed it *would* protect against
> > > > > this, and that things like core dump of unencrypted memory would
> > > > > not be permitted, so there's a disconnect between that preso and
> > > > > what you're saying.
> > > > > 
> > > > > Regards,
> > > > > Daniel
> > > > 
> > > > You mean presentation claimed protection against leaks to a malicious
> > > > active attacker within a hypervisor?  I guess the presentation covers
> > > > more than this patchset does then.  And the disconnect would be with
> > > > what the patchset cover letter says, not just with what I say.  Clearly
> > > > encrypting memory is not enough to protect against a malicious
> > > > hypervisor. E.g. just running info cpus is enough to leak information
> > > > from guest.
> > > 
> > > It was explicit about the fact that the host admin would not have any
> > > way to get access to the full contents of guest memory, without the
> > > guest admin granting it. Only those non-encrypted pages used for I/O
> > > transfer between host & guest would be accessible.
> > > 
> > > Regards,
> > > Daniel
> > 
> > If you like, that's the vision. I'd rather discuss the patchset in
> > question though. It encrypts all memory but this does not protect against
> > all attackers, only passive ones. If you disable debugging,
> > it seems to additionally reduce the amount of information that can be
> > leaked to an active attacker in the hypervisor at one go.
> > 
> > Paolo seems to think it's useful, but it's a far cry from a deal
> > breaker, and your email just makes me worry that it has been oversold to
> > the point where everyone will start disabling debugging everywhere in
> > production and claim that otherwise it's a security problem.  IMO a much
> > better in-tree documentation is needed so people know what they are
> > getting in return.
> > 
> > Attestation seems mostly unrelated. The whitepaper says
> > 	With this attestation, a guest owner can ensure that the hypervisor did
> > 	not interfere with the initialization of SEV before transmitting
> > 	confidential information to the guest.
> > which seems to imply an active attacker that is able to interfere
> > with the hypervisor during guest initialization but not afterwards.
> 
> I believe this assumes a compromised hypervisor both before and
> after guest launch, but this assumes the hypervisor:
> 1) Won't be able to change guest memory before attestation
>    without being detected.
> 2) Won't be able to attack the guest after memory is encrypted.

Why would you need to measure things then?  If you assume this, at what
point *can* attacker change memory?

> > So I have no idea why that's useful at the moment - I suspect
> > it's part of the future vision when there are protections
> > against all active attackers in place, but for now it seems to extend the
> > firmware/software interface unnecessarily.
> 
> "Protection against all active attackers" is a very broad
> requirement. Effective protection against a given subset of
> attacks would be reasonable enough to me.

Well selecting a random point in time and saying "I protect against
attacks at this point only" would be a very weak protection, akin to
just adding an assert statement at a random place in code - even though
yes, if you hit that assert you are protected.

This is not to say this is what this patchset does, merely
that it should include a bit more information about the
motivation for the measurement part than
"this is what we can easily implement".


> -- 
> Eduardo

  reply	other threads:[~2016-09-14 22:05 UTC|newest]

Thread overview: 125+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 14:46 [Qemu-devel] [RFC PATCH v1 00/22] x86: Secure Encrypted Virtualization (AMD) Brijesh Singh
2016-09-13 14:46 ` [Qemu-devel] [RFC PATCH v1 01/22] exec: add guest RAM read/write ops Brijesh Singh
2016-09-13 14:47 ` [Qemu-devel] [RFC PATCH v1 02/22] cpu-common: add debug version of physical memory read/write Brijesh Singh
2016-09-13 14:47 ` [Qemu-devel] [RFC PATCH v1 03/22] monitor: use debug version of physical memory read api Brijesh Singh
2016-09-13 14:47 ` [Qemu-devel] [RFC PATCH v1 04/22] memattrs: add SEV debug attrs Brijesh Singh
2016-09-13 23:00   ` Paolo Bonzini
2016-09-14 20:30     ` Brijesh Singh
2016-09-13 14:47 ` [Qemu-devel] [RFC PATCH v1 05/22] i386: add new option to enable SEV guest Brijesh Singh
2016-09-13 22:41   ` Paolo Bonzini
2016-09-14  8:41     ` Daniel P. Berrange
2016-09-14  9:11       ` Paolo Bonzini
2016-09-13 14:47 ` [Qemu-devel] [RFC PATCH v1 06/22] sev: add initial SEV support Brijesh Singh
2016-09-13 15:58   ` Eduardo Habkost
2016-09-13 19:54     ` Brijesh Singh
2016-09-13 20:10       ` Michael S. Tsirkin
2016-09-13 22:00       ` Eduardo Habkost
2016-09-14  8:30         ` Daniel P. Berrange
2016-09-14 11:54           ` Eduardo Habkost
2016-09-14 11:58             ` Daniel P. Berrange
2016-09-14 16:10         ` Brijesh Singh
2016-09-14 16:13           ` Daniel P. Berrange
2016-09-14 16:20           ` Michael S. Tsirkin
2016-09-14 18:46             ` Brijesh Singh
2016-09-14 20:23               ` Michael S. Tsirkin
2016-09-14  8:37   ` Daniel P. Berrange
2016-09-13 14:47 ` [Qemu-devel] [RFC PATCH v1 07/22] sev: add SEV launch start command Brijesh Singh
2016-09-13 14:48 ` [Qemu-devel] [RFC PATCH v1 08/22] sev: add SEV launch update command Brijesh Singh
2016-09-13 14:48 ` [Qemu-devel] [RFC PATCH v1 09/22] sev: add SEV launch finish command Brijesh Singh
2016-09-13 22:15   ` Eduardo Habkost
2016-09-13 14:48 ` [Qemu-devel] [RFC PATCH v1 10/22] sev: add SEV debug decrypt command Brijesh Singh
2016-09-14  2:28   ` Michael S. Tsirkin
2016-09-14  8:57     ` Paolo Bonzini
2016-09-14 13:05       ` Michael S. Tsirkin
2016-09-14 13:07         ` Paolo Bonzini
2016-09-14 13:23           ` Daniel P. Berrange
2016-09-14 13:32             ` Michael S. Tsirkin
2016-09-14 13:37               ` Daniel P. Berrange
2016-09-14 13:50                 ` Michael S. Tsirkin
2016-09-14 14:08                   ` Eduardo Habkost
2016-09-14 14:14                     ` Paolo Bonzini
2016-09-14 14:38                       ` Michael S. Tsirkin
2016-09-14 15:17                     ` Michael S. Tsirkin
2016-09-14 14:15                   ` Daniel P. Berrange
2016-09-14 14:48                     ` Michael S. Tsirkin
2016-09-14 15:06                       ` Daniel P. Berrange
2016-09-14 15:46                         ` Michael S. Tsirkin
2016-09-14 17:35                           ` Eduardo Habkost
2016-09-14 22:05                             ` Michael S. Tsirkin [this message]
2016-09-15 14:58                               ` Eduardo Habkost
2016-09-14 13:27           ` [Qemu-devel] [PATCH v2] virtio_pci: Limit DMA mask to 44 bits for legacy virtio devices Michael S. Tsirkin
2016-09-14 13:36     ` [Qemu-devel] [RFC PATCH v1 10/22] sev: add SEV debug decrypt command Brijesh Singh
2016-09-14 13:48       ` Michael S. Tsirkin
2016-09-14 14:19         ` Paolo Bonzini
2016-09-14 15:02           ` Michael S. Tsirkin
2016-09-14 16:53             ` Paolo Bonzini
2016-09-14 18:15               ` Michael S. Tsirkin
2016-09-14 18:45                 ` Paolo Bonzini
2016-09-14 19:24                   ` Michael S. Tsirkin
2016-09-14 19:58                     ` Paolo Bonzini
2016-09-14 20:36                       ` Michael S. Tsirkin
2016-09-14 20:44                         ` Paolo Bonzini
2016-09-14 21:25                           ` Brijesh Singh
2016-09-14 21:38                           ` Michael S. Tsirkin
2016-09-13 14:48 ` [Qemu-devel] [RFC PATCH v1 11/22] sev: add SEV debug encrypt command Brijesh Singh
2016-09-13 14:48 ` [Qemu-devel] [RFC PATCH v1 12/22] sev: add SEV guest status command Brijesh Singh
2016-09-13 14:48 ` [Qemu-devel] [RFC PATCH v1 13/22] hmp: update 'info kvm' to display SEV status Brijesh Singh
2016-09-13 16:09   ` Eric Blake
2016-09-14 16:16     ` Brijesh Singh
2016-09-15  4:13       ` Michael S. Tsirkin
2016-09-13 23:01   ` Paolo Bonzini
2016-09-13 14:49 ` [Qemu-devel] [RFC PATCH v1 14/22] sev: provide SEV-enabled guest RAM read/write ops Brijesh Singh
2016-09-13 14:49 ` [Qemu-devel] [RFC PATCH v1 15/22] i386: sev: register RAM read/write ops for BIOS and PC.RAM region Brijesh Singh
2016-09-13 23:05   ` Paolo Bonzini
2016-09-14 20:59     ` Brijesh Singh
2016-09-14 21:00       ` Paolo Bonzini
2016-09-14 21:47         ` Brijesh Singh
2016-09-14 21:52           ` Paolo Bonzini
2016-09-14 22:06             ` Brijesh Singh
2016-09-14 22:17               ` Paolo Bonzini
2016-09-14 22:26                 ` Brijesh Singh
2016-09-15 14:13                 ` Brijesh Singh
2016-09-15 15:19                   ` Paolo Bonzini
2016-09-13 14:49 ` [Qemu-devel] [RFC PATCH v1 17/22] target-i386: add cpuid Fn8000_001f Brijesh Singh
2016-09-13 23:07   ` Paolo Bonzini
2016-09-21 16:20     ` Brijesh Singh
2016-09-21 16:24       ` Paolo Bonzini
2016-09-21 18:21       ` Eduardo Habkost
2016-09-13 14:49 ` [Qemu-devel] [RFC PATCH v1 18/22] i386: clear C-bit in SEV guest page table walk Brijesh Singh
2016-09-13 14:49 ` [Qemu-devel] [RFC PATCH v1 19/22] exec: set debug attribute in SEV-enabled guest Brijesh Singh
2016-09-13 23:06   ` Paolo Bonzini
2016-09-13 14:50 ` [Qemu-devel] [RFC PATCH v1 20/22] fw_cfg: sev: disable dma in real mode Brijesh Singh
2016-09-13 18:39   ` Michael S. Tsirkin
2016-09-13 20:46     ` Brijesh Singh
2016-09-13 20:55       ` Michael S. Tsirkin
2016-09-13 22:53   ` Paolo Bonzini
2016-09-14  2:33     ` Michael S. Tsirkin
2016-09-14  8:58       ` Paolo Bonzini
2016-09-21 18:00         ` [Qemu-devel] [RFC PATCH v1 20/22] fw_cfg: sev: disable dma in real mode Message-ID: <20160921205731-mutt-send-email-mst@kernel.org> Michael S. Tsirkin
2016-09-14 12:09       ` [Qemu-devel] [RFC PATCH v1 20/22] fw_cfg: sev: disable dma in real mode Eduardo Habkost
2016-09-14 13:01         ` Paolo Bonzini
2016-09-14 13:14           ` Michael S. Tsirkin
2016-09-14 13:51             ` Eduardo Habkost
2016-09-14 16:10               ` Michael S. Tsirkin
2016-09-14 17:25                 ` Eduardo Habkost
2016-09-21 18:03         ` Michael S. Tsirkin
2016-09-21 18:19           ` Brijesh Singh
2016-09-13 14:50 ` [Qemu-devel] [RFC PATCH v1 21/22] hw: add pre and post system reset callback Brijesh Singh
2016-09-13 22:47   ` Paolo Bonzini
2016-09-14 16:19     ` Brijesh Singh
2016-09-13 14:50 ` [Qemu-devel] [RFC PATCH v1 22/22] loader: reload bios image on ROM reset in SEV-enabled guest Brijesh Singh
2016-09-13 18:47   ` Michael S. Tsirkin
2016-09-13 22:59   ` Paolo Bonzini
2016-09-14  2:38     ` Michael S. Tsirkin
2016-09-14 20:29     ` Brijesh Singh
2016-09-14 20:38       ` Paolo Bonzini
2016-09-14 21:09         ` Michael S. Tsirkin
2016-09-14 21:11           ` Paolo Bonzini
2016-09-14 21:24         ` Brijesh Singh
2016-09-13 15:20 ` [Qemu-devel] [RFC PATCH v1 00/22] x86: Secure Encrypted Virtualization (AMD) Eduardo Habkost
     [not found] ` <147377816978.11859.942423377333907417.stgit@brijesh-build-machine>
2016-09-13 18:37   ` [Qemu-devel] [RFC PATCH v1 16/22] i386: pc: load OS images at fixed location in SEV-enabled guest Michael S. Tsirkin
2016-09-21 15:55     ` Brijesh Singh
2016-09-21 15:58       ` Paolo Bonzini
2016-09-21 16:08         ` Brijesh Singh
2016-09-21 16:17           ` Paolo Bonzini
2016-09-14  2:55 ` [Qemu-devel] [RFC PATCH v1 00/22] x86: Secure Encrypted Virtualization (AMD) Michael S. Tsirkin

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=20160914211803-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=brijesh.singh@amd.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=p.fedin@samsung.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).