[PATCH v3 00/11] driver core: Disable driver overriding by default

From: Uwe Kleine-König

Date: Fri Dec 04 2026 - 05:48:00 EST


Hello,

here comes v3 of this series, compared to v2[1] the following things
changed:

- reshuffled the series to have patches which I consider adequately
acked by maintainers to be picked up (that is patch #2 (spi) for
sure, I'd say #3-#5 (remoteproc, s390/*) are fine, too).

- Added a patch by Peter Oberparleiter that was created in reply to
v2's patch #4

- Dropped a =1 in patch #1's commit log that I failed to adapt for the
changed parameter usage, thanks to Michael Kelley.

As before this series closes the possibility for root-triggered oopses
which happen for many drivers when bound to devices they don't match to
without the driver_override mechanism. With this series drivers must
explicitly allow matching devices using driver_override. If a driver is
missed, this can be easily addressed by setting the new driver flag (as
done in patches #2 and later) and for end-users there is a kernel
parameter that can be set without source changes to restore the current
behaviour (with a taint however).

Danilo Krummrich wrote that he expects a stable branch won't be needed
and just taking the whole patch set via driver-core should be fine. I'd
give him the responsibility to judge if the patches without maintainer
feedback should be picked, too. If you're such a maintainer, an ack
would be helpful for sure. That would be:

- patch #6: PCI: Allow untainted driver_override for PCI stub drivers
Bjorn Helgaas <bhelgaas@xxxxxxxxxx>

- patch #7: vfio: Allow untainted use of driver_override
Alex Williamson <alex@xxxxxxxxxxx> (I assume that one is fine, too,
given he is the author of the patch)

- patch #8: uio: Allow untainted use of driver_override
Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

- patch #9: clk: imx: scu: Allow untainted use of driver_override
Stephen Boyd <sboyd@xxxxxxxxxx>
Brian Masney <bmasney+clk@xxxxxxxxxx>
Jerome Brunet <jbrunet+clk@xxxxxxxxxxxx>

- patch #10: slimbus: qcom-ngd-ctrl: Allow untainted use of driver_override
Srinivas Kandagatla <srini@xxxxxxxxxx>

- patch #11: ASoC: samsung: i2s: Allow untainted use of driver_override
Liam Girdwood <lgirdwood@xxxxxxxxx>
Mark Brown <broonie@xxxxxxxxxx>
Jaroslav Kysela <perex@xxxxxxxx> (?)
Takashi Iwai <tiwai@xxxxxxxx> (?)

Gary Guo mentioned an alternative for some busses in
https://lore.kernel.org/lkml/DN4RPY231N71.1XDIB9HKGBU0O@xxxxxxxxxxx . I
didn't check/understood his proposal in detail, but I think for all the
busses that don't have their own override management the approach from
this patch set is the way to go. For the busses mentioned by Gary (CDX,
PCI, s390/css, s390/ap, spi, and vdpa) the special handling can be
discussed separately.
@Gary: Please speak up if I misjudged that and this series needs
adaption.

Best regards
Uwe

[1] https:/lore.kernel.org/lkml/cover.1795171088.git.u.kleine-koenig@xxxxxxxxxxxx


Alex Williamson (3):
s390/vfio: Allow untainted use of driver_override
PCI: Allow untainted driver_override for PCI stub drivers
vfio: Allow untainted use of driver_override

Peter Oberparleiter (1):
s390/cio: Allow untainted use of driver_override

Uwe Kleine-König (7):
driver core: Disable driver overriding by default
spi: spidev: Allow untainted use of driver_override
remoteproc: Allow untainted use of driver_override
uio: Allow untainted use of driver_override
clk: imx: scu: Allow untainted use of driver_override
slimbus: qcom-ngd-ctrl: Allow untainted use of driver_override
ASoC: samsung: i2s: Allow untainted use of driver_override

.../admin-guide/kernel-parameters.txt | 6 +++
Documentation/admin-guide/tainted-kernels.rst | 54 ++++++++++---------
drivers/base/bus.c | 51 ++++++++++++++++++
drivers/clk/imx/clk-scu.c | 1 +
drivers/pci/pci-pf-stub.c | 1 +
drivers/pci/pci-stub.c | 1 +
drivers/rpmsg/rpmsg_ctrl.c | 1 +
drivers/rpmsg/rpmsg_ns.c | 5 +-
drivers/s390/cio/device.c | 1 +
drivers/s390/cio/vfio_ccw_drv.c | 1 +
drivers/s390/crypto/vfio_ap_drv.c | 1 +
drivers/slimbus/qcom-ngd-ctrl.c | 1 +
drivers/spi/spidev.c | 1 +
drivers/uio/uio_dmem_genirq.c | 1 +
drivers/uio/uio_hv_generic.c | 1 +
drivers/uio/uio_pci_generic.c | 1 +
drivers/uio/uio_pdrv_genirq.c | 1 +
drivers/vfio/cdx/main.c | 1 +
drivers/vfio/fsl-mc/vfio_fsl_mc.c | 1 +
.../vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 3 +-
drivers/vfio/pci/ism/main.c | 3 +-
drivers/vfio/pci/mlx5/main.c | 3 +-
drivers/vfio/pci/nvgrace-gpu/main.c | 3 +-
drivers/vfio/pci/pds/pci_drv.c | 3 +-
drivers/vfio/pci/qat/main.c | 3 +-
drivers/vfio/pci/vfio_pci.c | 3 +-
drivers/vfio/pci/virtio/main.c | 3 +-
drivers/vfio/pci/xe/main.c | 3 +-
drivers/vfio/platform/vfio_amba.c | 1 +
drivers/vfio/platform/vfio_platform.c | 1 +
include/linux/device.h | 19 +------
include/linux/device/driver.h | 2 +
include/linux/panic.h | 3 +-
include/trace/events/module.h | 3 +-
kernel/panic.c | 3 +-
sound/soc/samsung/i2s.c | 1 +
tools/debugging/kernel-chktaint | 9 ++++
37 files changed, 145 insertions(+), 55 deletions(-)


base-commit: 0b5bb03d26a268f2606e3f574b277a1105136328
--
2.47.3