[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 46/58] qdev-monitor: Fix crash when device_add is cal
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 46/58] qdev-monitor: Fix crash when device_add is called with abstract driver |
Date: |
Tue, 8 Oct 2013 19:44:44 +0200 |
From: Igor Mammedov <address@hidden>
User is able to crash running QEMU when following monitor
command is called:
device_add intel-hda-generic
Crash is caused by assertion in object_initialize_with_type()
when type is abstract.
Checking if type is abstract before instance is created in
qdev_device_add() allows to prevent crash on incorrect user input.
Cc: address@hidden
Signed-off-by: Igor Mammedov <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
qdev-monitor.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 51bfec0..b1ce26a 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -472,6 +472,12 @@ DeviceState *qdev_device_add(QemuOpts *opts)
return NULL;
}
+ if (object_class_is_abstract(oc)) {
+ qerror_report(QERR_INVALID_PARAMETER_VALUE, "driver",
+ "non-abstract device type");
+ return NULL;
+ }
+
dc = DEVICE_CLASS(oc);
/* find bus */
--
1.8.1.4
- [Qemu-devel] [PULL 02/58] hw/arm: Tidy up conditional calls to arm_load_kernel(), (continued)
- [Qemu-devel] [PULL 02/58] hw/arm: Tidy up conditional calls to arm_load_kernel(), Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 24/58] a9scu: QOM cleanups, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 30/58] a15mpcore: Split off instance_init, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 41/58] realview_gic: Prepare for QOM embedding, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 16/58] shix: Drop debug output, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 39/58] arm11mpcore: Convert ARM11MPCorePriveState to QOM realize, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 15/58] milkymist: Suppress -kernel/-bios/-drive error for qtest, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 06/58] gumstix: Don't enforce use of -pflash for qtest, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 05/58] mainstone: Don't enforce use of -pflash for qtest, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 55/58] pcmcia: QOM'ify PCMCIACardState and MicroDriveState, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 46/58] qdev-monitor: Fix crash when device_add is called with abstract driver,
Andreas Färber <=
- [Qemu-devel] [PULL 32/58] a15mpcore: Convert to QOM realize, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 23/58] a9mpcore: Embed GICState, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 31/58] a15mpcore: Embed GICState, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 17/58] shix: Don't require firmware presence for qtest, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 08/58] palm: Don't enforce loading ROM or kernel for qtest, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 04/58] puv3: Turn puv3_load_kernel() into a no-op for qtest without -kernel, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 07/58] z2: Don't enforce use of -pflash for qtest, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 40/58] realview_gic: Convert to QOM realize, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 51/58] qom: Include error.h directly in object.h, Andreas Färber, 2013/10/08
- [Qemu-devel] [PULL 34/58] a9scu: Build only once, Andreas Färber, 2013/10/08