* [PATCH v2 00/10] driver core: Disable driver overriding by default
@ 2026-11-20 11:11 Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 04/10] s390/vfio: Allow untainted use of driver_override Uwe Kleine-König
0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2026-11-20 11:11 UTC (permalink / raw)
To: Greg Kroah-Hartman, Danilo Krummrich, Johan Hovold, Bjorn Helgaas,
Nipun Gupta, Nikhil Agarwal, Ioana Ciornei, Longfang Liu,
Julian Ruess, Ankit Agrawal, Brett Creeley, Giovanni Cabiddu,
Michał Winiarski, Eric Auger, Eric Farman, Matthew Rosato,
Tony Krowiak, Jason Herne, Harald Freudenberger, Holger Dengler,
Haiyang Zhang, Wei Liu, Dexuan Cui, Michael S. Tsirkin,
Mark Brown, Abel Vesa, Stephen Boyd, Brian Masney, Jerome Brunet,
Bjorn Andersson, Mathieu Poirier, Srinivas Kandagatla,
Sylwester Nawrocki, Liam Girdwood, Jaroslav Kysela
Cc: Jonathan Corbet, Rafael J. Wysocki, Steven Rostedt,
Bradley Morgan, Armin Wolf, Masami Hiramatsu, linux-doc,
driver-core, linux-kernel, linux-trace-kernel, linux-pci,
Alex Williamson, Mostafa Saleh, kvm, qat-linux, virtualization,
intel-xe, Vineeth Vijayan, Peter Oberparleiter, Heiko Carstens,
Vasily Gorbik, Alexander Gordeev, linux-s390, linux-hyperv,
linux-spi, Frank Li, Sascha Hauer, linux-clk, imx,
linux-arm-kernel, linux-remoteproc, linux-arm-msm, linux-sound,
Takashi Iwai
Hello,
here comes v2 which addresses the review feedback I got for (implicit)
v1. See https://lore.kernel.org/linux-kernel/20261116110853.3418077-2-u.kleine-koenig@baylibre.com
for the discussion about that previous submission.
The objective is to deny force binding a device to a driver that isn't
prepared for that. There are many drivers that run in a null pointer
exception when this happens and only very few drivers are supposed to be
used like that. So the first patch implements an explicit opt-in for
drivers and denies other matches; the remaining patches implement the
opt-in for drivers that rely on it. This makes it unnecessary to fix
individual drivers to explicitly refuse such bindings. See commit
1e50a0349012 ("iio: adc: mcp3564: reject devices without match data")
for an example of such a driver-specific fix.
Changes since (implicit) v1:
- Rework parameter parsing to just use `allow_driver_override` on the
kernel commandline
- Add review tags
- Add patches by Alex Williamson setting .support_driver_override in
pci and vfio drivers
- Add patches for uio, spidev and a few more drivers setting
.support_driver_override
- align wording in Documentation/admin-guide/tainted-kernels.rst with
tools/debugging/kernel-chktaint
It is sensible to merge the driver core change (patch #1) together with
the individual driver patches setting .support_driver_override because
with the driver core change the driver override doesn't work any more
for the unmodified drivers (unless the new kernel parameter is provided
and a taint is accepted). So I suggest (once there is agreement that the
patches are fine) to merge them all in one go and provide a stable
branch in case a driver was missed to be adapted. I can create such a
branch and ask Greg or Linus to pull it, or Greg can do that.
So if you're the maintainer of one of the drivers touched by patches #2
and later and assuming your ok with that patch, please provide your Ack
(plus the required coordination if applicable) for not merging via your
usual tree.
Best regards
Uwe
Alex Williamson (3):
PCI: Allow untainted driver_override for PCI stub drivers
vfio: Allow untainted use of driver_override
s390/vfio: Allow untainted use of driver_override
Uwe Kleine-König (7):
driver core: Disable driver overriding by default
uio: Allow untainted use of driver_override
spi: spidev: Allow untainted use of driver_override
clk: imx: scu: Allow untainted use of driver_override
remoteproc: 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/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 ++++
36 files changed, 144 insertions(+), 55 deletions(-)
base-commit: 7cfbf79c66c63e807ea452abf0546e6f6d6833a6
--
2.56.0.rc1
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v2 04/10] s390/vfio: Allow untainted use of driver_override
2026-11-20 11:11 [PATCH v2 00/10] driver core: Disable driver overriding by default Uwe Kleine-König
@ 2026-11-20 11:11 ` Uwe Kleine-König
2026-11-20 11:58 ` Harald Freudenberger
0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2026-11-20 11:11 UTC (permalink / raw)
To: Greg Kroah-Hartman, Eric Farman, Matthew Rosato, Tony Krowiak,
Jason Herne, Harald Freudenberger, Holger Dengler
Cc: Alex Williamson, Vineeth Vijayan, Peter Oberparleiter,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev, linux-s390, kvm
From: Alex Williamson <alex@shazbot.org>
The vfio_ap and vfio_ccw drivers bind devices through driver_override.
With the introduction of the support_driver_override flag in the core
driver struct, it's now required for drivers to declare themselves as
driver_override compatible, otherwise driver_override bindings will be
denied or generate a kernel taint.
Set the support_driver_override flag on the vfio_ap and vfio_ccw driver
structs.
Signed-off-by: Alex Williamson <alex@shazbot.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/s390/cio/vfio_ccw_drv.c | 1 +
drivers/s390/crypto/vfio_ap_drv.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/s390/cio/vfio_ccw_drv.c b/drivers/s390/cio/vfio_ccw_drv.c
index 7546bd137e4e..77765cde87f7 100644
--- a/drivers/s390/cio/vfio_ccw_drv.c
+++ b/drivers/s390/cio/vfio_ccw_drv.c
@@ -375,6 +375,7 @@ static struct css_driver vfio_ccw_sch_driver = {
.drv = {
.name = "vfio_ccw",
.owner = THIS_MODULE,
+ .support_driver_override = true,
},
.subchannel_type = vfio_ccw_sch_ids,
.irq = vfio_ccw_sch_irq,
diff --git a/drivers/s390/crypto/vfio_ap_drv.c b/drivers/s390/crypto/vfio_ap_drv.c
index 8e69ed286bb9..2d47dc643269 100644
--- a/drivers/s390/crypto/vfio_ap_drv.c
+++ b/drivers/s390/crypto/vfio_ap_drv.c
@@ -62,6 +62,7 @@ static struct ap_driver vfio_ap_drv = {
.on_config_changed = vfio_ap_on_cfg_changed,
.on_scan_complete = vfio_ap_on_scan_complete,
.ids = ap_queue_ids,
+ .driver.support_driver_override = true,
};
static void vfio_ap_matrix_dev_release(struct device *dev)
--
2.56.0.rc1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v2 04/10] s390/vfio: Allow untainted use of driver_override
2026-11-20 11:11 ` [PATCH v2 04/10] s390/vfio: Allow untainted use of driver_override Uwe Kleine-König
@ 2026-11-20 11:58 ` Harald Freudenberger
2026-11-20 14:05 ` Uwe Kleine-König
0 siblings, 1 reply; 4+ messages in thread
From: Harald Freudenberger @ 2026-11-20 11:58 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Greg Kroah-Hartman, Eric Farman, Matthew Rosato, Tony Krowiak,
Jason Herne, Holger Dengler, Alex Williamson, Vineeth Vijayan,
Peter Oberparleiter, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, linux-s390, kvm
On 2026-11-20 12:11, Uwe Kleine-König wrote:
> From: Alex Williamson <alex@shazbot.org>
>
> The vfio_ap and vfio_ccw drivers bind devices through driver_override.
> With the introduction of the support_driver_override flag in the core
> driver struct, it's now required for drivers to declare themselves as
> driver_override compatible, otherwise driver_override bindings will be
> denied or generate a kernel taint.
>
> Set the support_driver_override flag on the vfio_ap and vfio_ccw driver
> structs.
>
> Signed-off-by: Alex Williamson <alex@shazbot.org>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> drivers/s390/cio/vfio_ccw_drv.c | 1 +
> drivers/s390/crypto/vfio_ap_drv.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/drivers/s390/cio/vfio_ccw_drv.c
> b/drivers/s390/cio/vfio_ccw_drv.c
> index 7546bd137e4e..77765cde87f7 100644
> --- a/drivers/s390/cio/vfio_ccw_drv.c
> +++ b/drivers/s390/cio/vfio_ccw_drv.c
> @@ -375,6 +375,7 @@ static struct css_driver vfio_ccw_sch_driver = {
> .drv = {
> .name = "vfio_ccw",
> .owner = THIS_MODULE,
> + .support_driver_override = true,
> },
> .subchannel_type = vfio_ccw_sch_ids,
> .irq = vfio_ccw_sch_irq,
> diff --git a/drivers/s390/crypto/vfio_ap_drv.c
> b/drivers/s390/crypto/vfio_ap_drv.c
> index 8e69ed286bb9..2d47dc643269 100644
> --- a/drivers/s390/crypto/vfio_ap_drv.c
> +++ b/drivers/s390/crypto/vfio_ap_drv.c
> @@ -62,6 +62,7 @@ static struct ap_driver vfio_ap_drv = {
> .on_config_changed = vfio_ap_on_cfg_changed,
> .on_scan_complete = vfio_ap_on_scan_complete,
> .ids = ap_queue_ids,
> + .driver.support_driver_override = true,
> };
>
> static void vfio_ap_matrix_dev_release(struct device *dev)
Hm, honestly I don' get this...
The driver_override is a bus thing. So the AP bus has support for
driver_override.
The sysfs functions are in drivers/s390/crypto/ap_queue.c. There exist
currently
two drivers which shall be bound to an AP queue: vfio_ap and the default
driver
which is the zcrypt driver "cex4queue". It sounds like the driver needs
the
tagging about driver_override support and then similar to the
vfio_ap_drv.c
the static struct ap_driver initialization may also need a
.driver.support_driver_override = true line.
regards
Harald Freudenberger
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2 04/10] s390/vfio: Allow untainted use of driver_override
2026-11-20 11:58 ` Harald Freudenberger
@ 2026-11-20 14:05 ` Uwe Kleine-König
0 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2026-11-20 14:05 UTC (permalink / raw)
To: Harald Freudenberger
Cc: Greg Kroah-Hartman, Eric Farman, Matthew Rosato, Tony Krowiak,
Jason Herne, Holger Dengler, Alex Williamson, Vineeth Vijayan,
Peter Oberparleiter, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, linux-s390, kvm
[-- Attachment #1: Type: text/plain, Size: 3059 bytes --]
On Fri, Nov 20, 2026 at 12:58:52PM +0100, Harald Freudenberger wrote:
> On 2026-11-20 12:11, Uwe Kleine-König wrote:
> > From: Alex Williamson <alex@shazbot.org>
> >
> > The vfio_ap and vfio_ccw drivers bind devices through driver_override.
> > With the introduction of the support_driver_override flag in the core
> > driver struct, it's now required for drivers to declare themselves as
> > driver_override compatible, otherwise driver_override bindings will be
> > denied or generate a kernel taint.
> >
> > Set the support_driver_override flag on the vfio_ap and vfio_ccw driver
> > structs.
> >
> > Signed-off-by: Alex Williamson <alex@shazbot.org>
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> > ---
> > drivers/s390/cio/vfio_ccw_drv.c | 1 +
> > drivers/s390/crypto/vfio_ap_drv.c | 1 +
> > 2 files changed, 2 insertions(+)
> >
> > diff --git a/drivers/s390/cio/vfio_ccw_drv.c
> > b/drivers/s390/cio/vfio_ccw_drv.c
> > index 7546bd137e4e..77765cde87f7 100644
> > --- a/drivers/s390/cio/vfio_ccw_drv.c
> > +++ b/drivers/s390/cio/vfio_ccw_drv.c
> > @@ -375,6 +375,7 @@ static struct css_driver vfio_ccw_sch_driver = {
> > .drv = {
> > .name = "vfio_ccw",
> > .owner = THIS_MODULE,
> > + .support_driver_override = true,
> > },
> > .subchannel_type = vfio_ccw_sch_ids,
> > .irq = vfio_ccw_sch_irq,
> > diff --git a/drivers/s390/crypto/vfio_ap_drv.c
> > b/drivers/s390/crypto/vfio_ap_drv.c
> > index 8e69ed286bb9..2d47dc643269 100644
> > --- a/drivers/s390/crypto/vfio_ap_drv.c
> > +++ b/drivers/s390/crypto/vfio_ap_drv.c
> > @@ -62,6 +62,7 @@ static struct ap_driver vfio_ap_drv = {
> > .on_config_changed = vfio_ap_on_cfg_changed,
> > .on_scan_complete = vfio_ap_on_scan_complete,
> > .ids = ap_queue_ids,
> > + .driver.support_driver_override = true,
> > };
> >
> > static void vfio_ap_matrix_dev_release(struct device *dev)
>
> Hm, honestly I don' get this...
> The driver_override is a bus thing. So the AP bus has support for
> driver_override.
Yes, and ap_device_probe() calls device_match_driver_override() which
requires .driver.support_driver_override to be true to make the override
work.
> The sysfs functions are in drivers/s390/crypto/ap_queue.c. There exist
> currently
> two drivers which shall be bound to an AP queue: vfio_ap and the default
> driver
> which is the zcrypt driver "cex4queue". It sounds like the driver needs the
> tagging about driver_override support and then similar to the vfio_ap_drv.c
> the static struct ap_driver initialization may also need a
> .driver.support_driver_override = true line.
Can you please talk in form of a patch? I have difficulties following
your words. (Hint: "the driver" is ambigous if you just talked about two
different ones. Also what is "the static struct ap_driver
initialization"?)
Alternatively something like: "I tested you changes and the xyz driver
fails to bind, this is the respective kernel output: ..." would be
welcome, too.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-20 14:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 11:11 [PATCH v2 00/10] driver core: Disable driver overriding by default Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 04/10] s390/vfio: Allow untainted use of driver_override Uwe Kleine-König
2026-11-20 11:58 ` Harald Freudenberger
2026-11-20 14:05 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox