qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests


From: Dov Murik
Subject: Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests
Date: Wed, 8 Feb 2023 17:52:31 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1


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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]