Commit 0618402fff for qemu.org
commit 0618402fff7a234c9b7744031a2ff3cde3ad8be1
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: Tue Sep 9 14:54:11 2025 +0100
system: check security of device types
This wires up the DeviceClass types to have their
security checked when devices are created.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c
index a62ad23ecf..c483b4e628 100644
--- a/system/qdev-monitor.c
+++ b/system/qdev-monitor.c
@@ -672,6 +672,10 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts,
return NULL;
}
+ if (!object_class_check_security(OBJECT_CLASS(dc), errp)) {
+ return NULL;
+ }
+
/* find bus */
path = qdict_get_try_str(opts, "bus");
if (path != NULL) {