All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/3] usb: fix segfault when hot-unplugging usb host adapter
@ 2015-03-18  1:36 arei.gonglei
  2015-03-18  1:36 ` [Qemu-devel] [PATCH v2 1/3] uhci: using DeviceClasss->reset qemu_register_reset() call arei.gonglei
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: arei.gonglei @ 2015-03-18  1:36 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>

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

Gonglei (3):
  uhci: using DeviceClasss->reset qemu_register_reset() call
  ehci: using DeviceClasss->reset qemu_register_reset() call
  ohci: using DeviceClasss->reset qemu_register_reset() call

 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] 5+ messages in thread

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-18  1:36 [Qemu-devel] [PATCH v2 0/3] usb: fix segfault when hot-unplugging usb host adapter arei.gonglei
2015-03-18  1:36 ` [Qemu-devel] [PATCH v2 1/3] uhci: using DeviceClasss->reset qemu_register_reset() call arei.gonglei
2015-03-18  1:36 ` [Qemu-devel] [PATCH v2 2/3] ehci: " arei.gonglei
2015-03-18  1:36 ` [Qemu-devel] [PATCH v2 3/3] ohci: " arei.gonglei
2015-03-18  1:46 ` [Qemu-devel] [PATCH v2 0/3] usb: fix segfault when hot-unplugging usb host adapter 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.