Re: [PATCH v4 0/3] driver core: add TAINT_FORCED_BIND for when userspace manually messes with devices and drivers
From: Jason Gunthorpe
Date: Mon Oct 26 2026 - 18:55:10 EST
On Mon, Oct 26, 2026 at 09:27:25PM +0100, Greg Kroah-Hartman wrote:
> > > Sorry, late to the party, but this isn't a few user scripts that rely
> > > on this behavior. Effectively every use case of vfio relies on this
> > > behavior. We rely on unbinding the default driver from the device
> > > before using driver_override and drivers_probe. That means every
> > > hypervisor with device assignment and every userspace driver use case
> > > now experiences a tainted kernel. That seems like a significant
> > > regression.
> >
> > Sorry, I was on vacation and missed this change earlier. This change will
> > affect SR-IOV deployments around the world, which *rely* on being able to
> > bind a driver manually *after* virtual functions are created but before
> > they are used.
>
> Why can't a real driver bind to those virtual functions? Like is
> happening in the rust apis?
Most people using SRIOV will bind the VFs to the VFIO driver.
The rest, it is the same as the CC case, there needs to be a gap after
creating the PCI VF functions and before binding a real driver, with a
proper match and a correct id.
This is usually managed by clearing drivers_autoprobe
Ie look at commit b8c5cec23d5c ("Driver core: udev triggered
device-<>driver binding") from 2007 explaining this workflow.
The taint on sysfs unbind makes zero sense here because we can trigger
unbind of those VFs just by disabling SRIOV through sysfs. Should we
taint that too?
> > This is needed for two reasons: to save hardware and software resources
> > when creating a large number of VFs, and to allow the PCI config space to
> > be configured *before* the driver starts using it.
>
> How is hardware and software resources an issue here at all?
If you create a 1024 VFs, which is what people on big servers seem to
do, then that can use 1024 x megabytes of resources to load all those
drivers which will memory exhaust a hypervisor.
This is a real case actual users run into, I saw the support requests
go by :|
> And you can write to PCI config space from userspace today,
Not allowed in lockdown, triggered by secure boot, which pretty much
every server uses.
> > There is no in-kernel alternative.
>
> Then just don't have a in-kernel driver for the device and all is good?
What? How do you use the HW then? Is this a serious reply?
Jason