+7
−4
+0
−28
+0
−1
Loading
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: 782a985d ("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>