qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/14] Fix memory region use-after-finalization
@ 2025-09-17 10:32 Akihiko Odaki
  2025-09-17 10:32 ` [PATCH 01/14] hw/pci-bridge: Do not assume immediate MemoryRegion finalization Akihiko Odaki
                   ` (14 more replies)
  0 siblings, 15 replies; 25+ messages in thread
From: Akihiko Odaki @ 2025-09-17 10:32 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

Based-on: <20250917-use-v3-0-72c2a6887c6c@rsg.ci.i.u-tokyo.ac.jp>
("[PATCH v3 0/7] Do not unparent in instance_finalize()")

This patch series was spun off from "[PATCH v2 00/15] Fix memory region
leaks and use-after-finalization":
https://lore.kernel.org/qemu-devel/20250915-use-v2-0-f4c7ff13bfe9@rsg.ci.i.u-tokyo.ac.jp/

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 (14):
      hw/pci-bridge: Do not assume immediate MemoryRegion finalization
      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 +
 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/nvme/ctrl.c             |  2 -
 hw/pci/pci.c               | 22 +----------
 hw/pci/pci_bridge.c        | 96 +++++++++++++++++++++++++---------------------
 hw/ppc/spapr_pci.c         | 22 -----------
 hw/usb/hcd-ehci.c          |  4 --
 hw/usb/hcd-xhci.c          | 10 -----
 hw/vfio-user/pci.c         |  6 ---
 stubs/memory.c             |  9 +++++
 stubs/meson.build          |  1 +
 19 files changed, 80 insertions(+), 156 deletions(-)
---
base-commit: e101d33792530093fa0b0a6e5f43e4d8cfe4581e
change-id: 20250917-subregion-907ced7da1ed
prerequisite-change-id: 20250906-use-37ecc903a9e0:v3
prerequisite-patch-id: d464fda86a3c79ff8e6d7a2e623d979b2a47019b
prerequisite-patch-id: 17b153237f69c898b9c5b93aad0d5116d0bfe49f
prerequisite-patch-id: ac51d9c4ac483054ee91cecbb5575def67dbb602
prerequisite-patch-id: 205aa86c0ef087c97dbcf736062661a45c287bf3
prerequisite-patch-id: 26e18a249afaf9cd1b72961f9e2e3ebf97966a3c
prerequisite-patch-id: d3e0b87f84a216e05bd4aa3dee8ae77cf9df062a
prerequisite-patch-id: 510a59304274e1bc35f8fbe77c91fc2f32a2f087

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



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

end of thread, other threads:[~2025-10-10 15:35 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-17 10:32 [PATCH 00/14] Fix memory region use-after-finalization Akihiko Odaki
2025-09-17 10:32 ` [PATCH 01/14] hw/pci-bridge: Do not assume immediate MemoryRegion finalization Akihiko Odaki
2025-10-02 18:47   ` Peter Xu
2025-10-03 13:38     ` Akihiko Odaki
2025-09-17 10:32 ` [PATCH 02/14] qdev: Automatically delete memory subregions Akihiko Odaki
2025-10-02 19:23   ` Peter Xu
2025-10-02 19:40     ` Peter Xu
2025-10-03 14:01       ` Akihiko Odaki
2025-10-03 15:26         ` Peter Xu
2025-10-10  5:55           ` Akihiko Odaki
2025-09-17 10:32 ` [PATCH 03/14] vfio-user: Do not delete the subregion Akihiko Odaki
2025-09-17 10:32 ` [PATCH 04/14] hw/char/diva-gsp: " Akihiko Odaki
2025-09-17 10:32 ` [PATCH 05/14] hw/char/serial-pci-multi: " Akihiko Odaki
2025-09-17 10:32 ` [PATCH 06/14] secondary-vga: Do not delete the subregions Akihiko Odaki
2025-09-17 10:32 ` [PATCH 07/14] cmd646: " Akihiko Odaki
2025-09-17 10:32 ` [PATCH 08/14] hw/ide/piix: " Akihiko Odaki
2025-09-17 10:32 ` [PATCH 09/14] hw/ide/via: " Akihiko Odaki
2025-09-17 10:32 ` [PATCH 10/14] hw/nvme: Do not delete the subregion Akihiko Odaki
2025-09-17 10:32 ` [PATCH 11/14] pci: Do not delete the subregions Akihiko Odaki
2025-09-17 10:32 ` [PATCH 12/14] hw/ppc/spapr_pci: " Akihiko Odaki
2025-09-17 10:32 ` [PATCH 13/14] hw/usb/hcd-ehci: " Akihiko Odaki
2025-09-17 10:33 ` [PATCH 14/14] hw/usb/hcd-xhci: " Akihiko Odaki
2025-10-02 15:03 ` [PATCH 00/14] Fix memory region use-after-finalization Paolo Bonzini
2025-10-10 10:20   ` Akihiko Odaki
2025-10-10 15:32     ` Peter Xu

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).