linux-coco.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Jörg Rödel" <jroedel@suse.de>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: linux-coco@lists.linux.dev, amd-sev-snp@lists.suse.com
Subject: Re: SVSM initiated early attestation / guest secrets injection
Date: Fri, 13 Jan 2023 18:22:38 +0100	[thread overview]
Message-ID: <Y8GTXpfqlOe53cEr@suse.de> (raw)
In-Reply-To: <Y8AbnM0cnKfXXW23@redhat.com>

Hi Daniel,

On Thu, Jan 12, 2023 at 02:39:24PM +0000, Daniel P. Berrangé wrote:
>  4. SVSM requests an attestation report from SEV-SNP firmware, embedding a
>     hash of the attestation server public key and its own public key.
> 
>  5. SVSM transmits the attestation report and the two public keys on the ISA
>     serial port

This basically emulates the secret injection mechanism that was
implemented for SEV and SEV-ES by the firmware, right?

I see a problem here which allows a potential host owner to steal
the secrets from the attestation server. Maybe I am wrong, but I think
the following is possible with the above sequence:

	1. Host owner sets up a CVM like the guest owner would do, with
	   the same SVSM and Firmware binaries, same initial state and
	   so on, so that the initial measurement is the same as if the
	   VM was setup by the guest owner.

	2. Host owner attaches a different disk image with malicious
	   content, e.g. a boot loader that sends the secrets to the host
	   owner.

	3. SVSM and attestation server have no way of detecting this,
	   because the disk image is not part of the initial measurement
	   from the SNP firmware. So above sequence would complete and
	   SVSM gets the secrets from the attestation server.

	4. The malicious software loaded from the disk image gets access
	   to the secrets and sends them to the host owner.

	4. Host owner can use the guest owners secrets to steal data
	   from the encrypted disk image the guest owner provided.

To prevent this it is necessary that the measurement sent to the
attestation server includes all software and data which is
executed/loaded from unencrypted storage. For example, in a common boot
flow it needs to include the Grub binary and Grub configuration.

But these parts are not included in the initial measurement that the
SVSM gets from the SNP firmware.

Regards,

	Joerg

  reply	other threads:[~2023-01-13 17:22 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12 14:39 SVSM initiated early attestation / guest secrets injection Daniel P. Berrangé
2023-01-13 17:22 ` Jörg Rödel [this message]
2023-01-13 18:02   ` James Bottomley
2023-01-14 16:57     ` Jörg Rödel
2023-01-19 14:05     ` Christophe de Dinechin Dupont de Dinechin
2023-01-19 14:10       ` James Bottomley
2023-01-19 21:18         ` Jörg Rödel
2023-01-19 21:29           ` James Bottomley
2023-01-20  8:37             ` Jörg Rödel
2023-01-20  8:57               ` Daniel P. Berrangé
2023-01-20 12:39                 ` James Bottomley
2023-01-20 12:51                   ` Daniel P. Berrangé
2023-01-20 17:10                     ` James Bottomley
2023-01-20 12:32               ` James Bottomley
2023-01-13 18:28   ` Daniel P. Berrangé
2023-01-13 18:52     ` Dionna Amalie Glaze
2023-01-16  9:36       ` Daniel P. Berrangé
2023-01-14 17:08     ` Jörg Rödel
2023-01-14 18:22       ` James Bottomley
2023-01-16 16:55         ` Jörg Rödel
2023-01-16 16:59           ` James Bottomley
2023-01-17 16:47             ` Jörg Rödel
2023-01-16 17:13           ` Daniel P. Berrangé
2023-01-17 16:53             ` Jörg Rödel

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=Y8GTXpfqlOe53cEr@suse.de \
    --to=jroedel@suse.de \
    --cc=amd-sev-snp@lists.suse.com \
    --cc=berrange@redhat.com \
    --cc=linux-coco@lists.linux.dev \
    /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).