linux/drivers/xen/xen-pciback
Danilo Krummrich 10a4206a24 PCI: use generic driver_override infrastructure
When a driver is probed through __driver_attach(), the bus' match()
callback is called without the device lock held, thus accessing the
driver_override field without a lock, which can cause a UAF.

Fix this by using the driver-core driver_override infrastructure taking
care of proper locking internally.

Note that calling match() from __driver_attach() without the device lock
held is intentional. [1]

Link: https://lore.kernel.org/driver-core/DGRGTIRHA62X.3RY09D9SOK77P@kernel.org/ [1]
Reported-by: Gui-Dong Han <hanguidong02@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220789
Fixes: 782a985d7a ("PCI: Introduce new device binding path using pci_dev.driver_override")
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Alex Williamson <alex@shazbot.org>
Tested-by: Gui-Dong Han <hanguidong02@gmail.com>
Reviewed-by: Gui-Dong Han <hanguidong02@gmail.com>
Link: https://patch.msgid.link/20260324005919.2408620-6-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-04-04 00:44:30 +02:00
..
conf_space_capability.c xen/pciback: fix cast to restricted pci_ers_result_t and pci_power_t 2024-09-25 11:31:09 +02:00
conf_space_header.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
conf_space_quirks.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
conf_space_quirks.h xen-pciback: Remove unused function declarations 2023-08-21 09:53:22 +02:00
conf_space.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
conf_space.h
Makefile xen-pciback: allow compiling on other archs than x86 2021-11-02 08:03:43 -05:00
passthrough.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pci_stub.c PCI: use generic driver_override infrastructure 2026-04-04 00:44:30 +02:00
pciback_ops.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pciback.h xen/pciback: Remove unused pcistub_get_pci_dev 2025-03-14 11:19:49 +01:00
vpci.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xenbus.c xen: branch for v7.0-rc3 2026-03-07 07:44:32 -08:00