qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/22] Fix memory region leaks and use-after-finalization
@ 2025-09-06  2:11 Akihiko Odaki
  2025-09-06  2:11 ` [PATCH 01/22] docs/devel: Do not unparent in instance_finalize() Akihiko Odaki
                   ` (21 more replies)
  0 siblings, 22 replies; 43+ messages in thread
From: Akihiko Odaki @ 2025-09-06  2:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Williamson, Cédric Le Goater, Paolo Bonzini,
	Daniel P. Berrangé, Eduardo Habkost, Peter Xu,
	David Hildenbrand, Philippe Mathieu-Daudé, Richard Henderson,
	Helge Deller, Marc-André Lureau, Michael S. Tsirkin,
	Gerd Hoffmann, John Snow, qemu-block, Keith Busch, Klaus Jensen,
	Jesper Devantier, Marcel Apfelbaum, Nicholas Piggin, qemu-ppc,
	John Levon, Thanos Makatos, Yanan Wang, BALATON Zoltan,
	Jiaxun Yang, Daniel Henrique Barboza, David Gibson,
	Harsh Prateek Bora, Alexey Kardashevskiy, Alex Bennée,
	Fabiano Rosas, Thomas Huth, Laurent Vivier, Peter Maydell,
	Aurelien Jarno, Aleksandar Rikalo, Max Filippov,
	Hervé Poussineau, Mark Cave-Ayland, Artyom Tarasenko,
	Akihiko Odaki

When developing the next version of "[PATCH 00/16] memory: Stop
piggybacking on memory region owners*", I faced multiple memory region
leaks and use-after-finalization. This series extracts their fixes so
that the number of Cc: won't explode.

Patch "qdev: Automatically delete memory subregions" and the succeeding
patches are for refactoring, but patch "vfio-user: Do not delete the
subregion" does fix use-after-finalization.

* https://lore.kernel.org/qemu-devel/20250901-mr-v1-0-dd7cb6b1480b@rsg.ci.i.u-tokyo.ac.jp/

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
---
Akihiko Odaki (22):
      docs/devel: Do not unparent in instance_finalize()
      vfio/pci: Do not unparent in instance_finalize()
      hw/pci-bridge: Do not assume immediate MemoryRegion finalization
      target/mips: Fix AddressSpace exposure timing
      target/xtensa: Fix AddressSpace exposure timing
      auxbus: Fix AddressSpace exposure timing
      hw/pci-host/raven: Fix AddressSpace exposure timing
      sun4m: Fix AddressSpace exposure timing
      sun4u: Fix AddressSpace exposure timing
      qdev: Automatically delete memory subregions
      vfio-user: Do not delete the subregion
      hw/char/diva-gsp: Do not delete the subregion
      hw/char/serial-pci-multi: Do not delete the subregion
      secondary-vga: Do not delete the subregions
      cmd646: Do not delete the subregions
      hw/ide/piix: Do not delete the subregions
      hw/ide/via: Do not delete the subregions
      hw/nvme: Do not delete the subregion
      pci: Do not delete the subregions
      hw/ppc/spapr_pci: Do not delete the subregions
      hw/usb/hcd-ehci: Do not delete the subregions
      hw/usb/hcd-xhci: Do not delete the subregions

 MAINTAINERS                |  1 +
 docs/devel/memory.rst      | 19 +++------
 include/hw/pci/pci.h       |  1 +
 include/hw/qdev-core.h     |  1 +
 hw/char/diva-gsp.c         |  1 -
 hw/char/serial-pci-multi.c |  1 -
 hw/core/qdev.c             | 14 +++++++
 hw/display/vga-pci.c       |  8 ----
 hw/ide/cmd646.c            | 12 ------
 hw/ide/piix.c              | 13 -------
 hw/ide/via.c               | 12 ------
 hw/misc/auxbus.c           |  2 +-
 hw/nvme/ctrl.c             |  2 -
 hw/pci-host/raven.c        | 27 ++++++-------
 hw/pci/pci.c               | 22 +----------
 hw/pci/pci_bridge.c        | 96 +++++++++++++++++++++++++---------------------
 hw/ppc/spapr_pci.c         | 22 -----------
 hw/sparc/sun4m_iommu.c     |  9 ++++-
 hw/sparc64/sun4u_iommu.c   |  9 ++++-
 hw/usb/hcd-ehci.c          |  4 --
 hw/usb/hcd-xhci.c          | 10 -----
 hw/vfio-user/pci.c         |  6 ---
 hw/vfio/pci.c              |  4 --
 stubs/memory.c             |  9 +++++
 target/mips/cpu.c          |  9 ++++-
 target/xtensa/cpu.c        |  8 ++--
 stubs/meson.build          |  1 +
 27 files changed, 129 insertions(+), 194 deletions(-)
---
base-commit: e101d33792530093fa0b0a6e5f43e4d8cfe4581e
change-id: 20250906-use-37ecc903a9e0

Best regards,
-- 
Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>



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

end of thread, other threads:[~2025-09-16 11:48 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-06  2:11 [PATCH 00/22] Fix memory region leaks and use-after-finalization Akihiko Odaki
2025-09-06  2:11 ` [PATCH 01/22] docs/devel: Do not unparent in instance_finalize() Akihiko Odaki
2025-09-06  2:11 ` [PATCH 02/22] vfio/pci: " Akihiko Odaki
2025-09-10 20:41   ` Peter Xu
2025-09-11  3:47     ` Akihiko Odaki
2025-09-11 21:37       ` Peter Xu
2025-09-12  2:09         ` Akihiko Odaki
2025-09-12 21:26           ` Peter Xu
2025-09-14  9:06             ` Akihiko Odaki
2025-09-15 20:30               ` Peter Xu
2025-09-16 11:45                 ` Akihiko Odaki
2025-09-06  2:11 ` [PATCH 03/22] hw/pci-bridge: Do not assume immediate MemoryRegion finalization Akihiko Odaki
2025-09-06  2:11 ` [PATCH 04/22] target/mips: Fix AddressSpace exposure timing Akihiko Odaki
2025-09-09  9:39   ` Thomas Huth
2025-09-06  2:11 ` [PATCH 05/22] target/xtensa: " Akihiko Odaki
2025-09-09  9:42   ` Thomas Huth
2025-09-06  2:11 ` [PATCH 06/22] auxbus: " Akihiko Odaki
2025-09-09  9:43   ` Thomas Huth
2025-09-06  2:11 ` [PATCH 07/22] hw/pci-host/raven: " Akihiko Odaki
2025-09-06  9:03   ` BALATON Zoltan
2025-09-08 15:20     ` Akihiko Odaki
2025-09-08 15:31       ` Peter Maydell
2025-09-06  2:11 ` [PATCH 08/22] sun4m: " Akihiko Odaki
2025-09-09  9:48   ` Thomas Huth
2025-09-09 20:25   ` Mark Cave-Ayland
2025-09-06  2:11 ` [PATCH 09/22] sun4u: " Akihiko Odaki
2025-09-09  9:54   ` Thomas Huth
2025-09-09 20:26   ` Mark Cave-Ayland
2025-09-06  2:11 ` [PATCH 10/22] qdev: Automatically delete memory subregions Akihiko Odaki
2025-09-10 21:10   ` Peter Xu
2025-09-11  3:55     ` Akihiko Odaki
2025-09-06  2:11 ` [PATCH 11/22] vfio-user: Do not delete the subregion Akihiko Odaki
2025-09-06  2:11 ` [PATCH 12/22] hw/char/diva-gsp: " Akihiko Odaki
2025-09-06  2:11 ` [PATCH 13/22] hw/char/serial-pci-multi: " Akihiko Odaki
2025-09-06  2:11 ` [PATCH 14/22] secondary-vga: Do not delete the subregions Akihiko Odaki
2025-09-06  2:11 ` [PATCH 15/22] cmd646: " Akihiko Odaki
2025-09-06  2:11 ` [PATCH 16/22] hw/ide/piix: " Akihiko Odaki
2025-09-06  2:11 ` [PATCH 17/22] hw/ide/via: " Akihiko Odaki
2025-09-06  2:11 ` [PATCH 18/22] hw/nvme: Do not delete the subregion Akihiko Odaki
2025-09-06  2:11 ` [PATCH 19/22] pci: Do not delete the subregions Akihiko Odaki
2025-09-06  2:11 ` [PATCH 20/22] hw/ppc/spapr_pci: " Akihiko Odaki
2025-09-06  2:11 ` [PATCH 21/22] hw/usb/hcd-ehci: " Akihiko Odaki
2025-09-06  2:11 ` [PATCH 22/22] hw/usb/hcd-xhci: " Akihiko Odaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).