[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/32] acpi: fix OEM ID/OEM Table ID padding
From: |
Michael S. Tsirkin |
Subject: |
[PULL 05/32] acpi: fix OEM ID/OEM Table ID padding |
Date: |
Fri, 4 Feb 2022 20:42:49 -0500 |
From: Igor Mammedov <imammedo@redhat.com>
Commit [2] broke original '\0' padding of OEM ID and OEM Table ID
fields in headers of ACPI tables. While it doesn't have impact on
default values since QEMU uses 6 and 8 characters long values
respectively, it broke usecase where IDs are provided on QEMU CLI.
It shouldn't affect guest (but may cause licensing verification
issues in guest OS).
One of the broken usecases is user supplied SLIC table with IDs
shorter than max possible length, where [2] mangles IDs with extra
spaces in RSDT and FADT tables whereas guest OS expects those to
mirror the respective values of the used SLIC table.
Fix it by replacing whitespace padding with '\0' padding in
accordance with [1] and expectations of guest OS
1) ACPI spec, v2.0b
17.2 AML Grammar Definition
...
//OEM ID of up to 6 characters. If the OEM ID is
//shorter than 6 characters, it can be terminated
//with a NULL character.
2)
Fixes: 602b458201 ("acpi: Permit OEM ID and OEM table ID fields to be changed")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/707
Reported-by: Dmitry V. Orekhov <dima.orekhov@gmail.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-stable@nongnu.org
Message-Id: <20220112130332.1648664-4-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Tested-by: Dmitry V. Orekhov dima.orekhov@gmail.com
---
hw/acpi/aml-build.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index bb2cad63b5..8966e16320 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -1724,9 +1724,9 @@ void acpi_table_begin(AcpiTable *desc, GArray *array)
build_append_int_noprefix(array, 0, 4); /* Length */
build_append_int_noprefix(array, desc->rev, 1); /* Revision */
build_append_int_noprefix(array, 0, 1); /* Checksum */
- build_append_padded_str(array, desc->oem_id, 6, ' '); /* OEMID */
+ build_append_padded_str(array, desc->oem_id, 6, '\0'); /* OEMID */
/* OEM Table ID */
- build_append_padded_str(array, desc->oem_table_id, 8, ' ');
+ build_append_padded_str(array, desc->oem_table_id, 8, '\0');
build_append_int_noprefix(array, 1, 4); /* OEM Revision */
g_array_append_vals(array, ACPI_BUILD_APPNAME8, 4); /* Creator ID */
build_append_int_noprefix(array, 1, 4); /* Creator Revision */
--
MST
- [PULL 00/32] virtio,pc: features, cleanups, fixes, Michael S. Tsirkin, 2022/02/04
- [PULL 01/32] cpuid: use unsigned for max cpuid, Michael S. Tsirkin, 2022/02/04
- [PULL 02/32] hw/i386: Add the possibility to disable the 'isapc' machine, Michael S. Tsirkin, 2022/02/04
- [PULL 03/32] tests: acpi: manually pad OEM_ID/OEM_TABLE_ID for test_oem_fields() test, Michael S. Tsirkin, 2022/02/04
- [PULL 04/32] tests: acpi: whitelist nvdimm's SSDT and FACP.slic expected blobs, Michael S. Tsirkin, 2022/02/04
- [PULL 05/32] acpi: fix OEM ID/OEM Table ID padding,
Michael S. Tsirkin <=
- [PULL 07/32] tests: acpi: test short OEM_ID/OEM_TABLE_ID values in test_oem_fields(), Michael S. Tsirkin, 2022/02/04
- [PULL 10/32] libvhost-user: Simplify VHOST_USER_REM_MEM_REG, Michael S. Tsirkin, 2022/02/04
- [PULL 14/32] libvhost-user: Map shared RAM with MAP_NORESERVE to support virtio-mem with hugetlb, Michael S. Tsirkin, 2022/02/04
- [PULL 12/32] libvhost-user: prevent over-running max RAM slots, Michael S. Tsirkin, 2022/02/04
- [PULL 09/32] libvhost-user: Add vu_add_mem_reg input validation, Michael S. Tsirkin, 2022/02/04
- [PULL 13/32] libvhost-user: handle removal of identical regions, Michael S. Tsirkin, 2022/02/04
- [PULL 18/32] qmp: add QMP command x-query-virtio-status, Michael S. Tsirkin, 2022/02/04
- [PULL 27/32] ACPI ERST: build the ACPI ERST table, Michael S. Tsirkin, 2022/02/04
- [PULL 23/32] ACPI ERST: bios-tables-test.c steps 1 and 2, Michael S. Tsirkin, 2022/02/04
- [PULL 06/32] tests: acpi: update expected blobs, Michael S. Tsirkin, 2022/02/04