aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/virt_ctrl.c
diff options
context:
space:
mode:
authorDov Murik <dovmurik@linux.ibm.com>2021-11-11 10:00:46 +0000
committerDaniel P. Berrangé <berrange@redhat.com>2021-11-18 11:08:03 +0000
commita0190bf15044d2410e84f9a12aeac9ed56bd58b0 (patch)
tree4eda5ab8c9f9fd2fc193bdeec36f339b3791cd21 /hw/misc/virt_ctrl.c
parent5a0294a21c7677498bf40a447cc4a417d51a3cf4 (diff)
downloadqemu-a0190bf15044d2410e84f9a12aeac9ed56bd58b0.zip
qemu-a0190bf15044d2410e84f9a12aeac9ed56bd58b0.tar.gz
qemu-a0190bf15044d2410e84f9a12aeac9ed56bd58b0.tar.bz2
target/i386/sev: Fail when invalid hashes table area detected
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> Acked-by: Brijesh Singh <brijesh.singh@amd.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'hw/misc/virt_ctrl.c')
0 files changed, 0 insertions, 0 deletions