[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 4/6] target/i386/sev: Fail when invalid hashes table area
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v2 4/6] target/i386/sev: Fail when invalid hashes table area detected |
Date: |
Thu, 11 Nov 2021 09:29:44 +0000 |
User-agent: |
Mutt/2.0.7 (2021-05-04) |
On Mon, Nov 08, 2021 at 01:48:38PM +0000, Dov Murik wrote:
> Commit cff03145ed3c ("sev/i386: Introduce sev_add_kernel_loader_hashes
> for measured linux boot", 2021-09-30) introduced measured direct boot
> with -kernel, using an OVMF-designated hashes table which QEMU fills.
>
> However, no checks are performed on the validity of the hashes area
> designated by OVMF. Specifically, if OVMF publishes the
> SEV_HASH_TABLE_RV_GUID entry but it is filled with zeroes, this will
> cause QEMU to write the hashes entries over the first page of the
> guest's memory (GPA 0).
>
> Add validity checks to the published area. If the hashes table area's
> base address is zero, or its size is too small to fit the aligned hashes
> table, display an error and stop the guest launch. In such case, the
> following error will be displayed:
>
> qemu-system-x86_64: SEV: guest firmware hashes table area is invalid
> (base=0x0 size=0x0)
>
> Signed-off-by: Dov Murik <dovmurik@linux.ibm.com>
> Reported-by: Brijesh Singh <brijesh.singh@amd.com>
> ---
> target/i386/sev.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [PATCH v2 0/6] SEV: add kernel-hashes=on for measured -kernel launch, Dov Murik, 2021/11/08
- [PATCH v2 4/6] target/i386/sev: Fail when invalid hashes table area detected, Dov Murik, 2021/11/08
- Re: [PATCH v2 4/6] target/i386/sev: Fail when invalid hashes table area detected,
Daniel P . Berrangé <=
- [PATCH v2 3/6] target/i386/sev: Rephrase error message when no hashes table in guest firmware, Dov Murik, 2021/11/08
- [PATCH v2 5/6] target/i386/sev: Perform padding calculations at compile-time, Dov Murik, 2021/11/08
- [PATCH v2 1/6] qapi/qom, target/i386: sev-guest: Introduce kernel-hashes=on|off option, Dov Murik, 2021/11/08