[PATCH] PCI: Allow untainted driver_override for PCI stub drivers
From: Alex Williamson
Date: Wed Nov 18 2026 - 18:57:32 EST
As the name suggests, the pci-stub driver is only a stub, it performs
no hardware access and is typically used only to prevent other drivers
from binding to the device.
Similarly, pci-pf-stub only interacts with devices through the SR-IOV
capability, and may be used to create VFs on any PF that otherwise does
not require a PF driver.
Both of these are often used with driver_override, as this is our
standard, non-racy mechanism for associating a driver to a device.
With the introduction of support_driver_override in driver core, this
use case needs to be explicitly flagged as safe or else the bind will
be denied or taint the kernel. Declare these drivers as safe for use
with driver_override.
Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
Cc: linux-pci@xxxxxxxxxxxxxxx
Signed-off-by: Alex Williamson <alex@xxxxxxxxxxx>
---
Uwe, both these PCI stub drivers should allow driver_override use cases.
Thanks,
Alex
drivers/pci/pci-pf-stub.c | 1 +
drivers/pci/pci-stub.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/pci/pci-pf-stub.c b/drivers/pci/pci-pf-stub.c
index da4db4928907..328fb4a57092 100644
--- a/drivers/pci/pci-pf-stub.c
+++ b/drivers/pci/pci-pf-stub.c
@@ -36,6 +36,7 @@ static struct pci_driver pf_stub_driver = {
.id_table = pci_pf_stub_whitelist,
.probe = pci_pf_stub_probe,
.sriov_configure = pci_sriov_configure_simple,
+ .driver.support_driver_override = true,
};
module_pci_driver(pf_stub_driver);
diff --git a/drivers/pci/pci-stub.c b/drivers/pci/pci-stub.c
index 9bc478df4e8f..acbd43c17adc 100644
--- a/drivers/pci/pci-stub.c
+++ b/drivers/pci/pci-stub.c
@@ -37,6 +37,7 @@ static struct pci_driver stub_driver = {
.id_table = NULL, /* only dynamic id's */
.probe = pci_stub_probe,
.driver_managed_dma = true,
+ .driver.support_driver_override = true,
};
static int __init pci_stub_init(void)
--
2.54.0