Re: [PATCH v1] driver: base: Add driver filter support
From: Andi Kleen
Date: Thu Aug 05 2021 - 14:44:54 EST
On 8/5/2021 11:09 AM, Greg Kroah-Hartman wrote:
On Thu, Aug 05, 2021 at 10:58:46AM -0700, Andi Kleen wrote:
On 8/5/2021 10:51 AM, Greg Kroah-Hartman wrote:
It's controlled by whatever you want to use in userspace. usbguard has
been handling this logic in userspace for over a decade now just fine.
So how does that work with builtin USB drivers? Do you delay the USB binding
until usbguard starts up?
Yes.
That won't work for confidential guests, e.g. we need a virtio driver
for the console and some other things.
This doesn't help us handle builtin drivers that initialize before user
space is up.
Then have the default setting for your bus be "unauthorized" like we
allow for some busses today.
We need some early boot drivers, just not all of them. For example in your
scheme we would need to reject all early platform drivers, which would break
booting. Or allow all early platform drivers, but then we exactly get into
the problem that there are far too many of them to properly harden.
Define "harden" please. Why not just allow all platform drivers, they
should all be trusted. If not, well, you have bigger problems...
Trusted here means someone audited them and also fuzzed them. That's all
a lot of work and also needs to be maintained forever so we're trying to
do only a minimum set. There are actually quite a few platform drivers,
it's difficult to audit them all.
Anyway, feel free to build on top of the existing scheme please, but do
not ignore it and try to create yet-another-way-to-do-this that I have
to maintain for the next 20+ years.
We have to establish the existing scheme solves the problem statement
first. So far it seems it doesn't seem to solve the problem at all for
early drivers that are needed for booting. Unless I'm missing something?
For late (e.g. modular) drivers it would probably be usable, but it
would complicate deployment quite a bit with complex user space changes,
so I can't say it looks very attractive.
But if we solve the problem for the early drivers then I don't think we
need the user space controlled scheme at all, because it should work all
the same.
So it seems they existing approach is not really cutting it.
That's why I think the builtin allow list hook is still needed. Thoughts?
-Andi