All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 0/3] usb: fix segfault when hot-unplugging usb host adapter
@ 2015-03-18  1:49 arei.gonglei
  2015-03-18  1:49 ` [Qemu-devel] [PATCH v3 1/3] uhci: fix segfault when hot-unplugging uhci controller arei.gonglei
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: arei.gonglei @ 2015-03-18  1:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Gonglei, peter.huangpeng, kraxel

From: Gonglei <arei.gonglei@huawei.com>

When hot-unplugging the usb controllers (ehci/uhci),
we have to clean all resouce of these devices,
involved registered reset handler. Otherwise, it
may cause NULL pointer access and/or segmentation fault
if we reboot the guest os after hot-unplugging.
    
Let's hook up reset via DeviceClass->reset() and drop
the qemu_register_reset() call. Then Qemu will register
and unregister the reset handler automatically.

Cc: qemu-stable <qemu-stable@nongnu.org>

v2 -> v3:
 - rewrite each patch's title

v1 -> v2:
 - hooking up reset via DeviceClass->reset 
 and drop the qemu_register_reset() calls.   (Gerd)


Gonglei (3):
  uhci: fix segfault when hot-unplugging uhci controller
  ehci: fix segfault when hot-unplugging ehci controller
  ohci: fix resource cleanup leak

 hw/usb/hcd-ehci-pci.c | 10 ++++++++++
 hw/usb/hcd-ehci.c     |  3 +--
 hw/usb/hcd-ehci.h     |  1 +
 hw/usb/hcd-ohci.c     | 11 ++++++++++-
 hw/usb/hcd-uhci.c     | 12 ++++++------
 5 files changed, 28 insertions(+), 9 deletions(-)

-- 
1.7.12.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-03-18  9:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-18  1:49 [Qemu-devel] [PATCH v3 0/3] usb: fix segfault when hot-unplugging usb host adapter arei.gonglei
2015-03-18  1:49 ` [Qemu-devel] [PATCH v3 1/3] uhci: fix segfault when hot-unplugging uhci controller arei.gonglei
2015-03-18  7:02   ` Gerd Hoffmann
2015-03-18  7:21     ` Gonglei
2015-03-18  7:35     ` Markus Armbruster
2015-03-18  7:55       ` Gonglei
2015-03-18  1:49 ` [Qemu-devel] [PATCH v3 2/3] ehci: fix segfault when hot-unplugging ehci controller arei.gonglei
2015-03-18  8:23   ` Gerd Hoffmann
2015-03-18  9:06     ` Gonglei
2015-03-18  1:49 ` [Qemu-devel] [PATCH v3 3/3] ohci: fix resource cleanup leak arei.gonglei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.