[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 034/108] qdev: Fix crash by validating the object ty
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 034/108] qdev: Fix crash by validating the object type |
Date: |
Wed, 6 Aug 2014 15:38:44 -0500 |
From: Amos Kong <address@hidden>
QEMU crashed when I try to list device parameters and the driver name is
actually an available bus name.
# qemu -device virtio-pci-bus,?
# qemu -device virtio-bus,?
# qemu -device virtio-serial-bus,?
qdev-monitor.c:212:qdev_device_help: Object 0x7fd932f50620 is not an
instance of type device
Aborted (core dumped)
We can also reproduce this bug by adding device from monitor, so it's
worth to fix the crash.
(qemu) device_add virtio-serial-bus
qdev-monitor.c:491:qdev_device_add: Object 0x7f5e89530920 is not an
instance of type device
Aborted (core dumped)
Cc: address@hidden
Signed-off-by: Amos Kong <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
(cherry picked from commit ce0abca3e35a9f95e9edcb5d6b2910b2fcd52099)
Signed-off-by: Michael Roth <address@hidden>
---
qdev-monitor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 9268c87..40c117d 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -206,7 +206,7 @@ int qdev_device_help(QemuOpts *opts)
}
}
- if (!klass) {
+ if (!object_class_dynamic_cast(klass, TYPE_DEVICE)) {
return 0;
}
do {
--
1.9.1
- [Qemu-devel] [PATCH 057/108] block/vvfat: Plug memory leak in check_directory_consistency(), (continued)
- [Qemu-devel] [PATCH 057/108] block/vvfat: Plug memory leak in check_directory_consistency(), Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 058/108] block/qapi: Plug memory leak in dump_qobject() case QTYPE_QERROR, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 059/108] blockdev: Plug memory leak in drive_init(), Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 060/108] blockdev: Plug memory leak in blockdev_init(), Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 062/108] block: Plug memory leak on brv_open_image() error path, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 064/108] linux-user: Don't overrun guest buffer in sched_getaffinity, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 063/108] qcow2: Plug memory leak on qcow2_invalidate_cache() error paths, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 061/108] qemu-io: Plug memory leak in open command, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 065/108] tcg-i386: Fix win64 qemu store, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 066/108] target-arm: Fix errors in writes to generic timer control registers, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 034/108] qdev: Fix crash by validating the object type,
Michael Roth <=
- [Qemu-devel] [PATCH 067/108] s390x/css: handle emw correctly for tsch, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 068/108] aio: fix qemu_bh_schedule() bh->ctx race condition, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 070/108] migration: remove duplicate code, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 069/108] qga: Fix handle fd leak in acquire_privilege(), Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 071/108] arch_init: Be sure of only one exit entry with DPRINTF() for ram_load(), Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 072/108] migration: catch unknown flags in ram_load, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 073/108] rdma: bug fixes, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 075/108] qdev: reorganize error reporting in bus_set_realized, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 076/108] qdev: recursively unrealize devices when unrealizing bus, Michael Roth, 2014/08/06
- [Qemu-devel] [PATCH 078/108] vhost: fix resource leak in error handling, Michael Roth, 2014/08/06