* [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 01/10] " Uwe Kleine-König
` (9 more replies)
0 siblings, 10 replies; 16+ 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] 16+ messages in thread
* [PATCH v2 01/10] driver core: Disable driver overriding by default
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 18:59 ` Jason Gunthorpe
2026-11-20 11:11 ` [PATCH v2 02/10] PCI: Allow untainted driver_override for PCI stub drivers Uwe Kleine-König
` (8 subsequent siblings)
9 siblings, 1 reply; 16+ messages in thread
From: Uwe Kleine-König @ 2026-11-20 11:11 UTC (permalink / raw)
To: Greg Kroah-Hartman, Danilo Krummrich, Johan Hovold
Cc: Jonathan Corbet, Rafael J. Wysocki, Steven Rostedt,
Bradley Morgan, Armin Wolf, Masami Hiramatsu, linux-doc,
driver-core, linux-kernel, linux-trace-kernel
Driver overriding is useful only in a very limited set of situations
and then only with very few drivers that are designed to support that.
Disallow matching via driver_override unless the driver explicitly
allows it or the safe guard is disabled using the
"allow_driver_override=1" kernel parameter.
There are many drivers that don't expect to be force-bound and often
doing it anyhow results in a NULL pointer exception. To make debugging
such cases easier, add a new taint if such a forced match happens.
Implementation detail: device_match_driver_override() isn't a static
inline any more. It grew a certain complexity (e.g. a pr_info()) and so
was made a regular exported function.
Reviewed-by: Bradley Morgan <bradley.morgan@linux.dev>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
.../admin-guide/kernel-parameters.txt | 6 +++
Documentation/admin-guide/tainted-kernels.rst | 54 ++++++++++---------
drivers/base/bus.c | 51 ++++++++++++++++++
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 +-
tools/debugging/kernel-chktaint | 9 ++++
9 files changed, 105 insertions(+), 45 deletions(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 8228c9acc530..ed505e362b1d 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -424,6 +424,12 @@ Kernel parameters
do not want to use tracing_snapshot_alloc() as it needs
to be done where GFP_KERNEL allocations are allowed.
+ allow_driver_override
+ Allow matching drivers without
+ .support_driver_override = true to devices using
+ driver_override. This is a dangerous operation in
+ general allowing root to oops the kernel.
+
allow_mismatched_32bit_el0 [ARM64,EARLY]
Allow execve() of 32-bit applications and setting of the
PER_LINUX32 personality on systems where only a strict
diff --git a/Documentation/admin-guide/tainted-kernels.rst b/Documentation/admin-guide/tainted-kernels.rst
index fcb8b9734548..f4ddb63dc704 100644
--- a/Documentation/admin-guide/tainted-kernels.rst
+++ b/Documentation/admin-guide/tainted-kernels.rst
@@ -74,35 +74,36 @@ a particular type of taint. It's best to leave that to the aforementioned
script, but if you need something quick you can use this shell command to check
which bits are set::
- $ for i in $(seq 0 19); do echo $i $(($(cat /proc/sys/kernel/tainted)>>$i&1));done
+ $ for i in $(seq 0 20); do echo $i $(($(cat /proc/sys/kernel/tainted)>>$i&1));done
Table for decoding tainted state
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-=== === ====== ========================================================
-Bit Log Number Reason that got the kernel tainted
-=== === ====== ========================================================
- 0 G/P 1 proprietary module was loaded
- 1 _/F 2 module was force loaded
- 2 _/S 4 kernel running on an out of specification system
- 3 _/R 8 module was force unloaded
- 4 _/M 16 processor reported a Machine Check Exception (MCE)
- 5 _/B 32 bad page referenced or some unexpected page flags
- 6 _/U 64 taint requested by userspace application
- 7 _/D 128 kernel died recently, i.e. there was an OOPS or BUG
- 8 _/A 256 ACPI table overridden by user
- 9 _/W 512 kernel issued warning
- 10 _/C 1024 staging driver was loaded
- 11 _/I 2048 workaround for bug in platform firmware applied
- 12 _/O 4096 externally-built ("out-of-tree") module was loaded
- 13 _/E 8192 unsigned module was loaded
- 14 _/L 16384 soft lockup occurred
- 15 _/K 32768 kernel has been live patched
- 16 _/X 65536 auxiliary taint, defined for and used by distros
- 17 _/T 131072 kernel was built with the struct randomization plugin
- 18 _/N 262144 an in-kernel test has been run
- 19 _/J 524288 userspace used a mutating debug operation in fwctl
-=== === ====== ========================================================
+=== === ======= ========================================================
+Bit Log Number Reason that got the kernel tainted
+=== === ======= ========================================================
+ 0 G/P 1 proprietary module was loaded
+ 1 _/F 2 module was force loaded
+ 2 _/S 4 kernel running on an out of specification system
+ 3 _/R 8 module was force unloaded
+ 4 _/M 16 processor reported a Machine Check Exception (MCE)
+ 5 _/B 32 bad page referenced or some unexpected page flags
+ 6 _/U 64 taint requested by userspace application
+ 7 _/D 128 kernel died recently, i.e. there was an OOPS or BUG
+ 8 _/A 256 ACPI table overridden by user
+ 9 _/W 512 kernel issued warning
+ 10 _/C 1024 staging driver was loaded
+ 11 _/I 2048 workaround for bug in platform firmware applied
+ 12 _/O 4096 externally-built ("out-of-tree") module was loaded
+ 13 _/E 8192 unsigned module was loaded
+ 14 _/L 16384 soft lockup occurred
+ 15 _/K 32768 kernel has been live patched
+ 16 _/X 65536 auxiliary taint, defined for and used by distros
+ 17 _/T 131072 kernel was built with the struct randomization plugin
+ 18 _/N 262144 an in-kernel test has been run
+ 19 _/J 524288 userspace used a mutating debug operation in fwctl
+ 20 _/Z 1048576 A device was matched using driver_override to a driver not supporting that
+=== === ======= ========================================================
Note: The character ``_`` is representing a blank in this table to make reading
easier.
@@ -189,3 +190,6 @@ More detailed explanation for tainting
19) ``J`` if userspace opened /dev/fwctl/* and performed a FWTCL_RPC_DEBUG_WRITE
to use the devices debugging features. Device debugging features could
cause the device to malfunction in undefined ways.
+
+ 20) ``Z`` if a device was matched using the `driver_override` sysfs property
+ to a driver that didn't explicitly allow that.
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 396097fdb316..1b4dd98a1286 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -603,6 +603,57 @@ int bus_add_device(struct device *dev)
return error;
}
+static bool __read_mostly allow_driver_override;
+
+static int __init allow_driver_override_setup(char *str)
+{
+ if (!str || *str != '\0')
+ return 0;
+
+ allow_driver_override = true;
+ return 1;
+}
+__setup("allow_driver_override", allow_driver_override_setup);
+
+/**
+ * device_match_driver_override() - Match a driver against the device's driver_override.
+ * @dev: device to check
+ * @drv: driver to match against
+ *
+ * Returns > 0 if a driver override is set and matches the given driver, 0 if a
+ * driver override is set but does not match or is ignored, or < 0 if a driver
+ * override is not set at all.
+ */
+int device_match_driver_override(struct device *dev,
+ const struct device_driver *drv)
+{
+ guard(spinlock)(&dev->driver_override.lock);
+ if (dev->driver_override.name) {
+ int ret = !strcmp(dev->driver_override.name, drv->name);
+
+ if (ret && !drv->support_driver_override) {
+ if (allow_driver_override) {
+ add_taint_module(drv->owner,
+ TAINT_DRIVER_OVERRIDE, LOCKDEP_STILL_OK);
+ } else {
+ /*
+ * If you hit this warning and you need to
+ * quickly workaround this check, boot with
+ * allow_driver_override=1 on the kernel
+ * commandline. The right fix is to set the
+ * driver's .support_driver_override property.
+ */
+ dev_warn(dev, "Denied matching to %s via driver override.\n", drv->name);
+ return 0;
+ }
+ }
+
+ return ret;
+ }
+ return -1;
+}
+EXPORT_SYMBOL_GPL(device_match_driver_override);
+
static void __bus_probe_device(struct device *dev)
{
struct subsys_private *sp = bus_to_subsys(dev->bus);
diff --git a/include/linux/device.h b/include/linux/device.h
index 6b082c638d45..05413c1a9454 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -907,23 +907,8 @@ static inline bool device_has_driver_override(struct device *dev)
return !!dev->driver_override.name;
}
-/**
- * device_match_driver_override() - Match a driver against the device's driver_override.
- * @dev: device to check
- * @drv: driver to match against
- *
- * Returns > 0 if a driver override is set and matches the given driver, 0 if a
- * driver override is set but does not match, or < 0 if a driver override is not
- * set at all.
- */
-static inline int device_match_driver_override(struct device *dev,
- const struct device_driver *drv)
-{
- guard(spinlock)(&dev->driver_override.lock);
- if (dev->driver_override.name)
- return !strcmp(dev->driver_override.name, drv->name);
- return -1;
-}
+int device_match_driver_override(struct device *dev,
+ const struct device_driver *drv);
/**
* device_iommu_mapped - Returns true when the device DMA is translated
diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h
index 29fbc01ef06f..0153cfcbe1b9 100644
--- a/include/linux/device/driver.h
+++ b/include/linux/device/driver.h
@@ -56,6 +56,7 @@ enum probe_type {
* @bus: The bus which the device of this driver belongs to.
* @owner: The module owner.
* @mod_name: Used for built-in modules.
+ * @support_driver_override: driver_override only works if this is true.
* @suppress_bind_attrs: Disables bind/unbind via sysfs.
* @probe_type: Type of the probe (synchronous or asynchronous) to use.
* @of_match_table: The open firmware table.
@@ -104,6 +105,7 @@ struct device_driver {
struct module *owner;
const char *mod_name; /* used for built-in modules */
+ bool support_driver_override;
bool suppress_bind_attrs; /* disables bind/unbind via sysfs */
enum probe_type probe_type;
diff --git a/include/linux/panic.h b/include/linux/panic.h
index 17e61b61c45f..009232511cc7 100644
--- a/include/linux/panic.h
+++ b/include/linux/panic.h
@@ -89,7 +89,8 @@ static inline void set_arch_panic_timeout(int timeout, int arch_default_timeout)
#define TAINT_RANDSTRUCT 17
#define TAINT_TEST 18
#define TAINT_FWCTL 19
-#define TAINT_FLAGS_COUNT 20
+#define TAINT_DRIVER_OVERRIDE 20
+#define TAINT_FLAGS_COUNT 21
#define TAINT_FLAGS_MAX ((1UL << TAINT_FLAGS_COUNT) - 1)
struct taint_flag {
diff --git a/include/trace/events/module.h b/include/trace/events/module.h
index e5a006be9dc6..d54ce3c7572b 100644
--- a/include/trace/events/module.h
+++ b/include/trace/events/module.h
@@ -26,7 +26,8 @@ struct module;
{ (1UL << TAINT_OOT_MODULE), "O" }, \
{ (1UL << TAINT_FORCED_MODULE), "F" }, \
{ (1UL << TAINT_CRAP), "C" }, \
- { (1UL << TAINT_UNSIGNED_MODULE), "E" })
+ { (1UL << TAINT_UNSIGNED_MODULE), "E" }, \
+ { (1UL << TAINT_DRIVER_OVERRIDE), "Z" })
TRACE_EVENT(module_load,
diff --git a/kernel/panic.c b/kernel/panic.c
index 91e48d33b7db..81ea9ef9afb0 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -825,6 +825,7 @@ const struct taint_flag taint_flags[TAINT_FLAGS_COUNT] = {
TAINT_FLAG(RANDSTRUCT, 'T', ' '),
TAINT_FLAG(TEST, 'N', ' '),
TAINT_FLAG(FWCTL, 'J', ' '),
+ TAINT_FLAG(DRIVER_OVERRIDE, 'Z', ' '),
};
#undef TAINT_FLAG
@@ -861,7 +862,7 @@ static void print_tainted_seq(struct seq_buf *s, bool verbose)
* exact size is allocated dynamically; the initial buffer remains
* as a fallback if allocation fails.
*
- * The verbose taint string currently requires up to 327 characters.
+ * The verbose taint string currently requires up to 348 characters.
*/
#define INIT_TAINT_BUF_MAX 350
diff --git a/tools/debugging/kernel-chktaint b/tools/debugging/kernel-chktaint
index e1571c04afb5..56215e0f5112 100755
--- a/tools/debugging/kernel-chktaint
+++ b/tools/debugging/kernel-chktaint
@@ -211,6 +211,15 @@ else
addout "J"
echo " * fwctl's mutating debug interface was used (#19)"
fi
+
+T=`expr $T / 2`
+if [ `expr $T % 2` -eq 0 ]; then
+ addout " "
+else
+ addout "Z"
+ echo " * A device was matched using driver_override to a driver not supporting that (#20)"
+fi
+
echo "Raw taint value as int/string: $taint/'$out'"
# report on any tainted loadable modules
--
2.56.0.rc1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 02/10] PCI: Allow untainted driver_override for PCI stub drivers
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 01/10] " Uwe Kleine-König
@ 2026-11-20 11:11 ` Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 03/10] vfio: Allow untainted use of driver_override Uwe Kleine-König
` (7 subsequent siblings)
9 siblings, 0 replies; 16+ messages in thread
From: Uwe Kleine-König @ 2026-11-20 11:11 UTC (permalink / raw)
To: Greg Kroah-Hartman, Bjorn Helgaas; +Cc: Alex Williamson, linux-pci
From: Alex Williamson <alex@shazbot.org>
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.
Signed-off-by: Alex Williamson <alex@shazbot.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
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.56.0.rc1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 03/10] 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 ` [PATCH v2 01/10] " Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 02/10] PCI: Allow untainted driver_override for PCI stub drivers Uwe Kleine-König
@ 2026-11-20 11:11 ` Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 04/10] s390/vfio: " Uwe Kleine-König
` (6 subsequent siblings)
9 siblings, 0 replies; 16+ messages in thread
From: Uwe Kleine-König @ 2026-11-20 11:11 UTC (permalink / raw)
To: Greg Kroah-Hartman, Nipun Gupta, Nikhil Agarwal, Ioana Ciornei,
Longfang Liu, Julian Ruess, Ankit Agrawal, Brett Creeley,
Giovanni Cabiddu, Michał Winiarski, Eric Auger
Cc: Alex Williamson, Mostafa Saleh, kvm, qat-linux, virtualization,
intel-xe
From: Alex Williamson <alex@shazbot.org>
Driver overrides are the standard mechanism for binding vfio drivers
to devices. 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 driver struct across all
vfio drivers.
Signed-off-by: Alex Williamson <alex@shazbot.org>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Reviewed-by: Mostafa Saleh <smostafa@google.com>
Reviewed-by: Ankit Agrawal <ankita@nvidia.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/vfio/cdx/main.c | 1 +
drivers/vfio/fsl-mc/vfio_fsl_mc.c | 1 +
drivers/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 +
13 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/drivers/vfio/cdx/main.c b/drivers/vfio/cdx/main.c
index 28dc8c825600..fb7679bf92fd 100644
--- a/drivers/vfio/cdx/main.c
+++ b/drivers/vfio/cdx/main.c
@@ -358,6 +358,7 @@ static struct cdx_driver vfio_cdx_driver = {
.match_id_table = vfio_cdx_table,
.driver = {
.name = "vfio-cdx",
+ .support_driver_override = true,
},
.driver_managed_dma = true,
};
diff --git a/drivers/vfio/fsl-mc/vfio_fsl_mc.c b/drivers/vfio/fsl-mc/vfio_fsl_mc.c
index 15b05b8c0c90..1603f81e0257 100644
--- a/drivers/vfio/fsl-mc/vfio_fsl_mc.c
+++ b/drivers/vfio/fsl-mc/vfio_fsl_mc.c
@@ -597,6 +597,7 @@ static struct fsl_mc_driver vfio_fsl_mc_driver = {
.remove = vfio_fsl_mc_remove,
.driver = {
.name = "vfio-fsl-mc",
+ .support_driver_override = true,
},
.driver_managed_dma = true,
};
diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
index c82c59246a3f..5c56aff8db01 100644
--- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
+++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
@@ -1737,7 +1737,8 @@ static struct pci_driver hisi_acc_vfio_pci_driver = {
.id_table = hisi_acc_vfio_pci_table,
.probe = hisi_acc_vfio_pci_probe,
.remove = hisi_acc_vfio_pci_remove,
- .driver = { .pm = pm_ptr(&hisi_acc_vf_pm_ops) },
+ .driver = { .pm = pm_ptr(&hisi_acc_vf_pm_ops),
+ .support_driver_override = true },
.err_handler = &hisi_acc_vf_err_handlers,
.driver_managed_dma = true,
};
diff --git a/drivers/vfio/pci/ism/main.c b/drivers/vfio/pci/ism/main.c
index cce3bdf1f070..263b377e87c4 100644
--- a/drivers/vfio/pci/ism/main.c
+++ b/drivers/vfio/pci/ism/main.c
@@ -399,7 +399,8 @@ static struct pci_driver ism_vfio_pci_driver = {
.id_table = ism_device_table,
.probe = ism_vfio_pci_probe,
.remove = ism_vfio_pci_remove,
- .driver = { .pm = pm_ptr(&ism_vfio_pm_ops) },
+ .driver = { .pm = pm_ptr(&ism_vfio_pm_ops),
+ .support_driver_override = true },
.err_handler = &ism_vfio_err_handlers,
.driver_managed_dma = true,
};
diff --git a/drivers/vfio/pci/mlx5/main.c b/drivers/vfio/pci/mlx5/main.c
index 18a6d224b1fd..63c89e461be8 100644
--- a/drivers/vfio/pci/mlx5/main.c
+++ b/drivers/vfio/pci/mlx5/main.c
@@ -1451,7 +1451,8 @@ static struct pci_driver mlx5vf_pci_driver = {
.id_table = mlx5vf_pci_table,
.probe = mlx5vf_pci_probe,
.remove = mlx5vf_pci_remove,
- .driver = { .pm = pm_ptr(&mlx5vf_pm_ops) },
+ .driver = { .pm = pm_ptr(&mlx5vf_pm_ops),
+ .support_driver_override = true },
.err_handler = &mlx5vf_err_handlers,
.driver_managed_dma = true,
};
diff --git a/drivers/vfio/pci/nvgrace-gpu/main.c b/drivers/vfio/pci/nvgrace-gpu/main.c
index 5ddec340b73b..946da32c61ff 100644
--- a/drivers/vfio/pci/nvgrace-gpu/main.c
+++ b/drivers/vfio/pci/nvgrace-gpu/main.c
@@ -1438,7 +1438,8 @@ static struct pci_driver nvgrace_gpu_vfio_pci_driver = {
.id_table = nvgrace_gpu_vfio_pci_table,
.probe = nvgrace_gpu_probe,
.remove = nvgrace_gpu_remove,
- .driver = { .pm = pm_ptr(&nvgrace_gpu_pm_ops) },
+ .driver = { .pm = pm_ptr(&nvgrace_gpu_pm_ops),
+ .support_driver_override = true },
.err_handler = &nvgrace_gpu_vfio_pci_err_handlers,
.driver_managed_dma = true,
};
diff --git a/drivers/vfio/pci/pds/pci_drv.c b/drivers/vfio/pci/pds/pci_drv.c
index cf7e33d4d17b..1fcef987f1b0 100644
--- a/drivers/vfio/pci/pds/pci_drv.c
+++ b/drivers/vfio/pci/pds/pci_drv.c
@@ -184,7 +184,8 @@ static struct pci_driver pds_vfio_pci_driver = {
.id_table = pds_vfio_pci_table,
.probe = pds_vfio_pci_probe,
.remove = pds_vfio_pci_remove,
- .driver = { .pm = pm_ptr(&pds_vfio_pm_ops) },
+ .driver = { .pm = pm_ptr(&pds_vfio_pm_ops),
+ .support_driver_override = true },
.err_handler = &pds_vfio_pci_err_handlers,
.driver_managed_dma = true,
};
diff --git a/drivers/vfio/pci/qat/main.c b/drivers/vfio/pci/qat/main.c
index 69448fa57df4..8a616f9b6494 100644
--- a/drivers/vfio/pci/qat/main.c
+++ b/drivers/vfio/pci/qat/main.c
@@ -695,7 +695,8 @@ static struct pci_driver qat_vf_vfio_pci_driver = {
.id_table = qat_vf_vfio_pci_table,
.probe = qat_vf_vfio_pci_probe,
.remove = qat_vf_vfio_pci_remove,
- .driver = { .pm = pm_ptr(&qat_vf_pm_ops) },
+ .driver = { .pm = pm_ptr(&qat_vf_pm_ops),
+ .support_driver_override = true },
.err_handler = &qat_vf_err_handlers,
.driver_managed_dma = true,
};
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index e7c012febe91..fde2c3fc88eb 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@@ -260,7 +260,8 @@ static struct pci_driver vfio_pci_driver = {
.remove = vfio_pci_remove,
.sriov_configure = vfio_pci_sriov_configure,
.err_handler = &vfio_pci_err_handlers,
- .driver = { .pm = pm_ptr(&vfio_pci_pm_ops) },
+ .driver = { .pm = pm_ptr(&vfio_pci_pm_ops),
+ .support_driver_override = true },
.driver_managed_dma = true,
};
diff --git a/drivers/vfio/pci/virtio/main.c b/drivers/vfio/pci/virtio/main.c
index 123ff5193812..1e02a8fd4a61 100644
--- a/drivers/vfio/pci/virtio/main.c
+++ b/drivers/vfio/pci/virtio/main.c
@@ -222,7 +222,8 @@ static struct pci_driver virtiovf_pci_driver = {
.id_table = virtiovf_pci_table,
.probe = virtiovf_pci_probe,
.remove = virtiovf_pci_remove,
- .driver = { .pm = pm_ptr(&virtiovf_pm_ops) },
+ .driver = { .pm = pm_ptr(&virtiovf_pm_ops),
+ .support_driver_override = true },
.err_handler = &virtiovf_err_handlers,
.driver_managed_dma = true,
};
diff --git a/drivers/vfio/pci/xe/main.c b/drivers/vfio/pci/xe/main.c
index 7dab3e024aa8..e0ab61f604de 100644
--- a/drivers/vfio/pci/xe/main.c
+++ b/drivers/vfio/pci/xe/main.c
@@ -592,7 +592,8 @@ static struct pci_driver xe_vfio_pci_driver = {
.id_table = xe_vfio_pci_table,
.probe = xe_vfio_pci_probe,
.remove = xe_vfio_pci_remove,
- .driver = { .pm = pm_ptr(&xe_vfio_pm_ops) },
+ .driver = { .pm = pm_ptr(&xe_vfio_pm_ops),
+ .support_driver_override = true },
.err_handler = &xe_vfio_pci_err_handlers,
.driver_managed_dma = true,
};
diff --git a/drivers/vfio/platform/vfio_amba.c b/drivers/vfio/platform/vfio_amba.c
index fa754f203b2d..2c87caf1b7f7 100644
--- a/drivers/vfio/platform/vfio_amba.c
+++ b/drivers/vfio/platform/vfio_amba.c
@@ -137,6 +137,7 @@ static struct amba_driver vfio_amba_driver = {
.id_table = vfio_amba_ids,
.drv = {
.name = "vfio-amba",
+ .support_driver_override = true,
},
.driver_managed_dma = true,
};
diff --git a/drivers/vfio/platform/vfio_platform.c b/drivers/vfio/platform/vfio_platform.c
index a4d3ace3e02d..93d06032cdde 100644
--- a/drivers/vfio/platform/vfio_platform.c
+++ b/drivers/vfio/platform/vfio_platform.c
@@ -116,6 +116,7 @@ static struct platform_driver vfio_platform_driver = {
.remove = vfio_platform_remove,
.driver = {
.name = "vfio-platform",
+ .support_driver_override = true,
},
.driver_managed_dma = true,
};
--
2.56.0.rc1
^ permalink raw reply related [flat|nested] 16+ 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
` (2 preceding siblings ...)
2026-11-20 11:11 ` [PATCH v2 03/10] vfio: Allow untainted use of driver_override Uwe Kleine-König
@ 2026-11-20 11:11 ` Uwe Kleine-König
2026-11-20 11:58 ` Harald Freudenberger
2026-11-20 11:11 ` [PATCH v2 05/10] uio: " Uwe Kleine-König
` (5 subsequent siblings)
9 siblings, 1 reply; 16+ 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] 16+ messages in thread
* [PATCH v2 05/10] uio: 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
` (3 preceding siblings ...)
2026-11-20 11:11 ` [PATCH v2 04/10] s390/vfio: " Uwe Kleine-König
@ 2026-11-20 11:11 ` Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 06/10] spi: spidev: " Uwe Kleine-König
` (4 subsequent siblings)
9 siblings, 0 replies; 16+ messages in thread
From: Uwe Kleine-König @ 2026-11-20 11:11 UTC (permalink / raw)
To: Greg Kroah-Hartman, Haiyang Zhang, Wei Liu, Dexuan Cui,
Michael S. Tsirkin
Cc: linux-kernel, linux-hyperv, kvm
uio drivers support being matched to devices using the driver_override
mechanism. Add .support_driver_override = true to continue having
this mechanism work for them without tainting the kernel.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
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 +
4 files changed, 4 insertions(+)
diff --git a/drivers/uio/uio_dmem_genirq.c b/drivers/uio/uio_dmem_genirq.c
index 263c1ebc2d57..71992431770e 100644
--- a/drivers/uio/uio_dmem_genirq.c
+++ b/drivers/uio/uio_dmem_genirq.c
@@ -309,6 +309,7 @@ static struct platform_driver uio_dmem_genirq = {
.driver = {
.name = DRIVER_NAME,
.of_match_table = of_match_ptr(uio_of_genirq_match),
+ .support_driver_override = true,
},
};
diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index dff92dcbb10d..255c2b5730f6 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -407,6 +407,7 @@ static struct hv_driver hv_uio_drv = {
.id_table = hv_uio_id_table,
.probe = hv_uio_probe,
.remove = hv_uio_remove,
+ .driver.support_driver_override = true,
};
static int __init
diff --git a/drivers/uio/uio_pci_generic.c b/drivers/uio/uio_pci_generic.c
index c0cab3adb7b0..9785df9fc5de 100644
--- a/drivers/uio/uio_pci_generic.c
+++ b/drivers/uio/uio_pci_generic.c
@@ -140,6 +140,7 @@ static struct pci_driver uio_pci_driver = {
.name = "uio_pci_generic",
.id_table = NULL, /* only dynamic id's */
.probe = probe,
+ .driver.support_driver_override = true,
};
module_pci_driver(uio_pci_driver);
diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
index 87e43821ab0c..022178248962 100644
--- a/drivers/uio/uio_pdrv_genirq.c
+++ b/drivers/uio/uio_pdrv_genirq.c
@@ -261,6 +261,7 @@ static struct platform_driver uio_pdrv_genirq = {
.driver = {
.name = DRIVER_NAME,
.of_match_table = of_match_ptr(uio_of_genirq_match),
+ .support_driver_override = true,
},
};
--
2.56.0.rc1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 06/10] spi: spidev: 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
` (4 preceding siblings ...)
2026-11-20 11:11 ` [PATCH v2 05/10] uio: " Uwe Kleine-König
@ 2026-11-20 11:11 ` Uwe Kleine-König
2026-11-20 11:35 ` Mark Brown
2026-11-20 11:11 ` [PATCH v2 07/10] clk: imx: scu: " Uwe Kleine-König
` (3 subsequent siblings)
9 siblings, 1 reply; 16+ messages in thread
From: Uwe Kleine-König @ 2026-11-20 11:11 UTC (permalink / raw)
To: Greg Kroah-Hartman, Mark Brown; +Cc: linux-spi
The spidev driver is designed to be bound to devices using the
driver_override mechanism. Set .support_driver_override = true to
continue having this mechanism work for it without tainting the kernel.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/spi/spidev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 15d2aaeb08e9..0b50474ab20b 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -843,6 +843,7 @@ static struct spi_driver spidev_spi_driver = {
.name = "spidev",
.of_match_table = spidev_dt_ids,
.acpi_match_table = spidev_acpi_ids,
+ .support_driver_override = true,
},
.probe = spidev_probe,
.remove = spidev_remove,
--
2.56.0.rc1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 07/10] clk: imx: scu: 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
` (5 preceding siblings ...)
2026-11-20 11:11 ` [PATCH v2 06/10] spi: spidev: " Uwe Kleine-König
@ 2026-11-20 11:11 ` Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 08/10] remoteproc: " Uwe Kleine-König
` (2 subsequent siblings)
9 siblings, 0 replies; 16+ messages in thread
From: Uwe Kleine-König @ 2026-11-20 11:11 UTC (permalink / raw)
To: Greg Kroah-Hartman, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet
Cc: Frank Li, Sascha Hauer, linux-clk, imx, linux-arm-kernel
The driver makes use of device_set_driver_override and so should be
allowed to match via that driver_override. Note that the .probe()
function assumes that platform_data is set for the device to bind, so it
can very likely allow root to oops the kernel. This is not a regression
however.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/clk/imx/clk-scu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c
index 0d034e206c6b..7622890d1124 100644
--- a/drivers/clk/imx/clk-scu.c
+++ b/drivers/clk/imx/clk-scu.c
@@ -626,6 +626,7 @@ static struct platform_driver imx_clk_scu_driver = {
.name = "imx-scu-clk",
.suppress_bind_attrs = true,
.pm = &imx_clk_scu_pm_ops,
+ .support_driver_override = true,
},
.probe = imx_clk_scu_probe,
};
--
2.56.0.rc1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 08/10] remoteproc: 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
` (6 preceding siblings ...)
2026-11-20 11:11 ` [PATCH v2 07/10] clk: imx: scu: " Uwe Kleine-König
@ 2026-11-20 11:11 ` Uwe Kleine-König
2026-11-20 15:13 ` Mathieu Poirier
2026-11-20 11:11 ` [PATCH v2 09/10] slimbus: qcom-ngd-ctrl: " Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 10/10] ASoC: samsung: i2s: " Uwe Kleine-König
9 siblings, 1 reply; 16+ messages in thread
From: Uwe Kleine-König @ 2026-11-20 11:11 UTC (permalink / raw)
To: Greg Kroah-Hartman, Bjorn Andersson, Mathieu Poirier; +Cc: linux-remoteproc
The two drivers are expected to be bound to devices using a driver
override. (See the respective use of device_set_driver_override()) and
so should be allowed to match via that mechanism.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/rpmsg/rpmsg_ctrl.c | 1 +
drivers/rpmsg/rpmsg_ns.c | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/rpmsg/rpmsg_ctrl.c b/drivers/rpmsg/rpmsg_ctrl.c
index 5c19188d0294..79ae495c9c07 100644
--- a/drivers/rpmsg/rpmsg_ctrl.c
+++ b/drivers/rpmsg/rpmsg_ctrl.c
@@ -210,6 +210,7 @@ static struct rpmsg_driver rpmsg_ctrldev_driver = {
.remove = rpmsg_ctrldev_remove,
.drv = {
.name = "rpmsg_ctrl",
+ .support_driver_override = true,
},
};
diff --git a/drivers/rpmsg/rpmsg_ns.c b/drivers/rpmsg/rpmsg_ns.c
index bde8c8d433e0..820dabbc9500 100644
--- a/drivers/rpmsg/rpmsg_ns.c
+++ b/drivers/rpmsg/rpmsg_ns.c
@@ -96,7 +96,10 @@ static int rpmsg_ns_probe(struct rpmsg_device *rpdev)
}
static struct rpmsg_driver rpmsg_ns_driver = {
- .drv.name = KBUILD_MODNAME,
+ .drv = {
+ .name = KBUILD_MODNAME,
+ .support_driver_override = true,
+ },
.probe = rpmsg_ns_probe,
};
--
2.56.0.rc1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 09/10] slimbus: qcom-ngd-ctrl: 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
` (7 preceding siblings ...)
2026-11-20 11:11 ` [PATCH v2 08/10] remoteproc: " Uwe Kleine-König
@ 2026-11-20 11:11 ` Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 10/10] ASoC: samsung: i2s: " Uwe Kleine-König
9 siblings, 0 replies; 16+ messages in thread
From: Uwe Kleine-König @ 2026-11-20 11:11 UTC (permalink / raw)
To: Greg Kroah-Hartman, Srinivas Kandagatla; +Cc: linux-arm-msm, linux-sound
The driver is expected to be bound to devices using a driver
override---see the respective use of device_set_driver_override()---and
so should be allowed to match via that mechanism.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/slimbus/qcom-ngd-ctrl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index 8da75c4b50e5..f501740fa4a6 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1837,6 +1837,7 @@ static struct platform_driver qcom_slim_ngd_driver = {
.driver = {
.name = QCOM_SLIM_NGD_DRV_NAME,
.pm = &qcom_slim_ngd_dev_pm_ops,
+ .support_driver_override = true,
},
};
--
2.56.0.rc1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 10/10] ASoC: samsung: i2s: 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
` (8 preceding siblings ...)
2026-11-20 11:11 ` [PATCH v2 09/10] slimbus: qcom-ngd-ctrl: " Uwe Kleine-König
@ 2026-11-20 11:11 ` Uwe Kleine-König
9 siblings, 0 replies; 16+ messages in thread
From: Uwe Kleine-König @ 2026-11-20 11:11 UTC (permalink / raw)
To: Greg Kroah-Hartman, Sylwester Nawrocki, Liam Girdwood, Mark Brown,
Jaroslav Kysela
Cc: Takashi Iwai, linux-sound
The driver is expected to be bound to devices using a driver
override---see the respective use of device_set_driver_override()---and
so should be allowed to match via that mechanism.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
sound/soc/samsung/i2s.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 8a938d0d79f9..fdddd3d4eb65 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1740,6 +1740,7 @@ static struct platform_driver samsung_i2s_driver = {
.name = "samsung-i2s",
.of_match_table = of_match_ptr(exynos_i2s_match),
.pm = pm_ptr(&samsung_i2s_pm),
+ .support_driver_override = true,
},
};
--
2.56.0.rc1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2 06/10] spi: spidev: Allow untainted use of driver_override
2026-11-20 11:11 ` [PATCH v2 06/10] spi: spidev: " Uwe Kleine-König
@ 2026-11-20 11:35 ` Mark Brown
0 siblings, 0 replies; 16+ messages in thread
From: Mark Brown @ 2026-11-20 11:35 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Greg Kroah-Hartman, linux-spi
[-- Attachment #1: Type: text/plain, Size: 322 bytes --]
On Fri, Nov 20, 2026 at 12:11:07PM +0100, Uwe Kleine-König wrote:
> The spidev driver is designed to be bound to devices using the
> driver_override mechanism. Set .support_driver_override = true to
> continue having this mechanism work for it without tainting the kernel.
Acked-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 16+ 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: " Uwe Kleine-König
@ 2026-11-20 11:58 ` Harald Freudenberger
2026-11-20 14:05 ` Uwe Kleine-König
0 siblings, 1 reply; 16+ 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] 16+ 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; 16+ 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] 16+ messages in thread
* Re: [PATCH v2 08/10] remoteproc: Allow untainted use of driver_override
2026-11-20 11:11 ` [PATCH v2 08/10] remoteproc: " Uwe Kleine-König
@ 2026-11-20 15:13 ` Mathieu Poirier
0 siblings, 0 replies; 16+ messages in thread
From: Mathieu Poirier @ 2026-11-20 15:13 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Greg Kroah-Hartman, Bjorn Andersson, linux-remoteproc
On Fri, 20 Nov 2026 at 05:11, Uwe Kleine-König
<u.kleine-koenig@baylibre.com> wrote:
>
> The two drivers are expected to be bound to devices using a driver
> override. (See the respective use of device_set_driver_override()) and
> so should be allowed to match via that mechanism.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> drivers/rpmsg/rpmsg_ctrl.c | 1 +
> drivers/rpmsg/rpmsg_ns.c | 5 ++++-
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> diff --git a/drivers/rpmsg/rpmsg_ctrl.c b/drivers/rpmsg/rpmsg_ctrl.c
> index 5c19188d0294..79ae495c9c07 100644
> --- a/drivers/rpmsg/rpmsg_ctrl.c
> +++ b/drivers/rpmsg/rpmsg_ctrl.c
> @@ -210,6 +210,7 @@ static struct rpmsg_driver rpmsg_ctrldev_driver = {
> .remove = rpmsg_ctrldev_remove,
> .drv = {
> .name = "rpmsg_ctrl",
> + .support_driver_override = true,
> },
> };
>
> diff --git a/drivers/rpmsg/rpmsg_ns.c b/drivers/rpmsg/rpmsg_ns.c
> index bde8c8d433e0..820dabbc9500 100644
> --- a/drivers/rpmsg/rpmsg_ns.c
> +++ b/drivers/rpmsg/rpmsg_ns.c
> @@ -96,7 +96,10 @@ static int rpmsg_ns_probe(struct rpmsg_device *rpdev)
> }
>
> static struct rpmsg_driver rpmsg_ns_driver = {
> - .drv.name = KBUILD_MODNAME,
> + .drv = {
> + .name = KBUILD_MODNAME,
> + .support_driver_override = true,
> + },
> .probe = rpmsg_ns_probe,
> };
>
> --
> 2.56.0.rc1
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 01/10] driver core: Disable driver overriding by default
2026-11-20 11:11 ` [PATCH v2 01/10] " Uwe Kleine-König
@ 2026-11-20 18:59 ` Jason Gunthorpe
0 siblings, 0 replies; 16+ messages in thread
From: Jason Gunthorpe @ 2026-11-20 18:59 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Greg Kroah-Hartman, Danilo Krummrich, Johan Hovold,
Jonathan Corbet, Rafael J. Wysocki, Steven Rostedt,
Bradley Morgan, Armin Wolf, Masami Hiramatsu, linux-doc,
driver-core, linux-kernel, linux-trace-kernel
On Fri, Nov 20, 2026 at 12:11:02PM +0100, Uwe Kleine-König wrote:
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 8228c9acc530..ed505e362b1d 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -424,6 +424,12 @@ Kernel parameters
> do not want to use tracing_snapshot_alloc() as it needs
> to be done where GFP_KERNEL allocations are allowed.
>
> + allow_driver_override
> + Allow matching drivers without
> + .support_driver_override = true to devices using
> + driver_override. This is a dangerous operation in
> + general allowing root to oops the kernel.
> +
I feel like this is more appropriate as a lockdown level than a kernel
command line?
Jason
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2026-11-20 18:59 UTC | newest]
Thread overview: 16+ 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 01/10] " Uwe Kleine-König
2026-11-20 18:59 ` Jason Gunthorpe
2026-11-20 11:11 ` [PATCH v2 02/10] PCI: Allow untainted driver_override for PCI stub drivers Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 03/10] vfio: Allow untainted use of driver_override Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 04/10] s390/vfio: " Uwe Kleine-König
2026-11-20 11:58 ` Harald Freudenberger
2026-11-20 14:05 ` Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 05/10] uio: " Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 06/10] spi: spidev: " Uwe Kleine-König
2026-11-20 11:35 ` Mark Brown
2026-11-20 11:11 ` [PATCH v2 07/10] clk: imx: scu: " Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 08/10] remoteproc: " Uwe Kleine-König
2026-11-20 15:13 ` Mathieu Poirier
2026-11-20 11:11 ` [PATCH v2 09/10] slimbus: qcom-ngd-ctrl: " Uwe Kleine-König
2026-11-20 11:11 ` [PATCH v2 10/10] ASoC: samsung: i2s: " Uwe Kleine-König
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.