- util: introduce object for holding a system inhibitor lock (RHEL-83064) - src: convert drivers over to new virInhibitor APIs (RHEL-83064) - rpc: remove logind support for virNetDaemon (RHEL-83064) - util: fix off-by-1 in inhibitor constants (RHEL-83064) - util: don't attempt to acquire logind inhibitor if not requested (RHEL-83064) - network: Free inhibitor in networkStateCleanup() (RHEL-83064) - conf: introduce support for multiple ACPI tables (RHEL-81041) - src: validate permitted ACPI table types in libxl/qemu drivers (RHEL-81041) - src: introduce 'raw' and 'rawset' ACPI table types (RHEL-81041) - qemu: support 'raw' ACPI table type (RHEL-81041) - libxl: support 'rawset' ACPI table type (RHEL-81041) - conf: support MSDM ACPI table type (RHEL-81041) - qemu: support MSDM ACPI table type (RHEL-81041) - qemuxmlconftest: Include shared memory 'net-vhostuser' test cases (RHEL-84133) - qemuValidateDomainDeviceDefNetwork: Require shared memory for all vhost-user interfaces (RHEL-84133) - qemu: process: Remove un-updated 'qemuProcessStartWarnShmem' (RHEL-84133) Resolves: RHEL-81041, RHEL-83064, RHEL-84133
95 lines
3.2 KiB
Diff
95 lines
3.2 KiB
Diff
From 39e946bdfdd15667379debea04d91fac43bde541 Mon Sep 17 00:00:00 2001
|
|
Message-ID: <39e946bdfdd15667379debea04d91fac43bde541.1742990721.git.jdenemar@redhat.com>
|
|
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
|
|
Date: Mon, 17 Feb 2025 16:39:29 +0000
|
|
Subject: [PATCH] src: validate permitted ACPI table types in libxl/qemu
|
|
drivers
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
This forces us to update the drivers when defining new table types
|
|
to avoid incorrectly accepting them by default.
|
|
|
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
|
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
(cherry picked from commit 3d94587655696509f34492f75c2a31a7a93eb2f9)
|
|
Resolves: https://issues.redhat.com/browse/RHEL-81041
|
|
---
|
|
src/libxl/libxl_domain.c | 19 +++++++++++++++++++
|
|
src/qemu/qemu_validate.c | 15 +++++++++++++++
|
|
2 files changed, 34 insertions(+)
|
|
|
|
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
|
|
index 6805160923..efd01840de 100644
|
|
--- a/src/libxl/libxl_domain.c
|
|
+++ b/src/libxl/libxl_domain.c
|
|
@@ -306,6 +306,7 @@ libxlDomainDefValidate(const virDomainDef *def,
|
|
libxlDriverPrivate *driver = opaque;
|
|
g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
|
|
bool reqSecureBoot = false;
|
|
+ size_t i;
|
|
|
|
if (!virCapabilitiesDomainSupported(cfg->caps, def->os.type,
|
|
def->os.arch,
|
|
@@ -330,6 +331,24 @@ libxlDomainDefValidate(const virDomainDef *def,
|
|
return -1;
|
|
}
|
|
|
|
+ for (i = 0; i < def->os.nacpiTables; i++) {
|
|
+ switch (def->os.acpiTables[i]->type) {
|
|
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC:
|
|
+ break;
|
|
+
|
|
+ default:
|
|
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST:
|
|
+ virReportEnumRangeError(virDomainOsACPITable,
|
|
+ def->os.acpiTables[i]->type);
|
|
+ return -1;
|
|
+ }
|
|
+ }
|
|
+ if (def->os.nacpiTables > 1) {
|
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
+ _("Only a single ACPI table is supported"));
|
|
+ return -1;
|
|
+ }
|
|
+
|
|
if (def->nsounds > 0) {
|
|
virDomainSoundDef *snd = def->sounds[0];
|
|
|
|
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
|
|
index 289a3f94cc..e500a5d314 100644
|
|
--- a/src/qemu/qemu_validate.c
|
|
+++ b/src/qemu/qemu_validate.c
|
|
@@ -686,6 +686,8 @@ static int
|
|
qemuValidateDomainDefBoot(const virDomainDef *def,
|
|
virQEMUCaps *qemuCaps)
|
|
{
|
|
+ size_t i;
|
|
+
|
|
if (def->os.bootloader || def->os.bootloaderArgs) {
|
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
_("bootloader is not supported by QEMU"));
|
|
@@ -725,6 +727,19 @@ qemuValidateDomainDefBoot(const virDomainDef *def,
|
|
return -1;
|
|
}
|
|
|
|
+ for (i = 0; i < def->os.nacpiTables; i++) {
|
|
+ switch (def->os.acpiTables[i]->type) {
|
|
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC:
|
|
+ break;
|
|
+
|
|
+ default:
|
|
+ case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST:
|
|
+ virReportEnumRangeError(virDomainOsACPITable,
|
|
+ def->os.acpiTables[i]->type);
|
|
+ return -1;
|
|
+ }
|
|
+ }
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
--
|
|
2.49.0
|