qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dov Murik <dovmurik@linux.ibm.com>
To: Tom Lendacky <thomas.lendacky@amd.com>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, "James Bottomley" <jejb@linux.ibm.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Tobin Feldman-Fitzthum" <tobin@linux.ibm.com>,
	"Dov Murik" <dovmurik@linux.ibm.com>
Subject: Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests
Date: Wed, 8 Feb 2023 17:52:31 +0200	[thread overview]
Message-ID: <7ebb1a30-075c-d723-c66f-eaba82fcd578@linux.ibm.com> (raw)
In-Reply-To: <7c4e3018-2f0f-1fd8-45b2-6d72221e9452@linux.ibm.com>



On 08/02/2023 17:49, Dov Murik wrote:
> But I now think there's another bug with the current patches: 
> 
> 
>   /*
>    * Add the NUL terminator, some padding for the microvm cmdline fiddling
>    * hack, and then align to 16 bytes as a paranoia measure
>    */
>   cmdline_size = (strlen(machine->kernel_cmdline) + 1 +
>                   VIRTIO_CMDLINE_TOTAL_MAX_LEN + 16) & ~15;
>   /* Make a copy, since we might append arbitrary bytes to it later. */
>   kernel_cmdline = g_strndup(machine->kernel_cmdline, cmdline_size);
> 
> 
> This code at the beginning of x86_load_linux() will make the cmdline longer.
> So the measurement of the cmdline will change (currently we expect it to be
> the exactly value of the '-append' argument with a terminating '\0' byte).
> This means that the SHA256 that QEMU and OVMF calculate is not the same as
> what the Guest Owner will calculate for a given cmdline.

Tomorrow I'll add debug code that prints the hashes table that QEMU
builds for SEV measured boot, and I'll check whether the hashes stay the
same (for given values of -kernel/-initrd/-append) across the versions
of QEMU.

-Dov


  parent reply	other threads:[~2023-02-08 15:53 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07  8:41 [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests Dov Murik
2023-02-07 17:28 ` Jason A. Donenfeld
2023-02-07 21:45 ` Michael S. Tsirkin
2023-02-07 22:17   ` Jason A. Donenfeld
2023-02-07 22:31     ` Michael S. Tsirkin
2023-02-07 22:33       ` Jason A. Donenfeld
2023-02-07 22:49         ` Jason A. Donenfeld
2023-02-08  9:11         ` Michael S. Tsirkin
2023-02-08 11:23           ` Dov Murik
2023-02-08 13:20             ` Michael S. Tsirkin
2023-02-08 13:30               ` Jason A. Donenfeld
2023-02-08 13:58                 ` Michael S. Tsirkin
2023-02-07 23:21   ` Tom Lendacky
2023-02-07 23:24     ` Jason A. Donenfeld
2023-02-08 11:35       ` Dov Murik
2023-02-08 15:26       ` Tom Lendacky
2023-02-08 15:39         ` Michael S. Tsirkin
2023-02-08 15:47         ` Jason A. Donenfeld
2023-02-08 15:49         ` Dov Murik
2023-02-08 15:51           ` Jason A. Donenfeld
2023-02-08 15:52           ` Dov Murik [this message]
2023-02-08 15:54           ` Jason A. Donenfeld
2023-02-08 11:57     ` Dov Murik
2023-02-08  9:35   ` Daniel P. Berrangé
2023-02-08  9:50     ` Michael S. Tsirkin
2023-02-08  9:30 ` Daniel P. Berrangé
2023-02-08 11:27   ` Dov Murik

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=7ebb1a30-075c-d723-c66f-eaba82fcd578@linux.ibm.com \
    --to=dovmurik@linux.ibm.com \
    --cc=Jason@zx2c4.com \
    --cc=berrange@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=hpa@zytor.com \
    --cc=jejb@linux.ibm.com \
    --cc=kraxel@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thomas.lendacky@amd.com \
    --cc=tobin@linux.ibm.com \
    /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).