qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dov Murik <dovmurik@linux.ibm.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>,
	Tom Lendacky <thomas.lendacky@amd.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 13:35:25 +0200	[thread overview]
Message-ID: <4ce043a5-65af-468c-2b5d-47799dd70372@linux.ibm.com> (raw)
In-Reply-To: <CAHmME9rrqRY0gOVBav4LjMypmu6uicx3vD9kozApyFoytNg84Q@mail.gmail.com>



On 08/02/2023 1:24, Jason A. Donenfeld wrote:
> Hi Tom,
> 
> On Tue, Feb 7, 2023 at 8:21 PM Tom Lendacky <thomas.lendacky@amd.com> wrote:
>>
>> On 2/7/23 15:45, Michael S. Tsirkin wrote:
>>> On Tue, Feb 07, 2023 at 08:41:16AM +0000, Dov Murik wrote:
>>>> Recent feature to supply RNG seed to the guest kernel modifies the
>>>> kernel command-line by adding extra data at its end; this breaks
>>>> measured boot with SEV and OVMF, and possibly signed boot.
>>>>
>>>> Specifically SEV doesn't miss this feature because it uses UEFI/OVMF
>>>> which has its own way of getting random seed (not to mention that
>>>> getting the random seed from the untrusted host breaks the confidential
>>>> computing trust model).
>>>
>>> Nope - getting a random seed from an untrusted source should not break
>>> anything assuming you also have some other randomness source.
>>> If you don't then you have other problems.
>>>
>>>> Disable the RNG seed feature in SEV guests.
>>>>
>>>> Fixes: eac7a7791bb6 ("x86: don't let decompressed kernel image clobber setup_data")
>>>> Reported-by: Tom Lendacky <thomas.lendacky@amd.com>
>>>> Signed-off-by: Dov Murik <dovmurik@linux.ibm.com>
>>>>
>>>> ---
>>>>
>>>> There might be a need for a wider change to the ways setup_data entries
>>>> are handled in x86_load_linux(); here I just try to restore the
>>>> situation for SEV guests prior to the addition of the SETUP_RNG_SEED
>>>> entry.
>>>>
>>>> Recent discussions on other (safer?) ways to pass this setup_data entry:
>>>> [1] https://lore.kernel.org/qemu-devel/da39abab9785aea2a2e7652ed6403b6268aeb31f.camel@linux.ibm.com/
>>>>
>>>> Note that in qemu 7.2.0 this is broken as well -- there the
>>>> SETUP_RNG_SEED entry is appended to the Linux kernel data (and therefore
>>>> modifies and breaks the measurement of the kernel in SEV measured boot).
>>>> A similar fix will be needed there (but I fear this patch cannot be
>>>> applied as-is).
>>>
>>> So it's not a regression, is it?
>>
>> SEV kernel hash comparison succeeded with Qemu v7.1.0, but fails with
>> v7.2.0, so I think that is a regression.
> 
> Please let me know if this series fixes it:
> https://lore.kernel.org/all/20230207224847.94429-1-Jason@zx2c4.com/>

I tested this series and it passes measured boot on SEV - OK.  I can
confirm that in non-SEV VM linux sees the SETUP_RNG_SEED; I didn't check
all the re-seeding scenarios.

-Dov


  reply	other threads:[~2023-02-08 11:36 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 [this message]
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
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=4ce043a5-65af-468c-2b5d-47799dd70372@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).