[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <82e133af-6ad4-6910-8b1a-3f9e1a42a0fa@linux.intel.com>
Date: Sun, 29 Aug 2021 09:43:14 -0700
From: Andi Kleen <ak@...ux.intel.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: Christoph Hellwig <hch@...radead.org>,
"Kuppuswamy, Sathyanarayanan"
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Richard Henderson <rth@...ddle.net>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
James E J Bottomley <James.Bottomley@...senpartnership.com>,
Helge Deller <deller@....de>,
"David S . Miller" <davem@...emloft.net>,
Arnd Bergmann <arnd@...db.de>,
Jonathan Corbet <corbet@....net>,
Peter H Anvin <hpa@...or.com>,
Dave Hansen <dave.hansen@...el.com>,
Tony Luck <tony.luck@...el.com>,
Dan Williams <dan.j.williams@...el.com>,
Kirill Shutemov <kirill.shutemov@...ux.intel.com>,
Sean Christopherson <seanjc@...gle.com>,
Kuppuswamy Sathyanarayanan <knsathya@...nel.org>,
x86@...nel.org, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org, linux-alpha@...r.kernel.org,
linux-mips@...r.kernel.org, linux-parisc@...r.kernel.org,
sparclinux@...r.kernel.org, linux-arch@...r.kernel.org,
linux-doc@...r.kernel.org,
virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH v4 11/15] pci: Add pci_iomap_shared{,_range}
> All this makes sense but ioremap is such a random place to declare
> driver has been audited, and it's baked into the binary with no way for
> userspace to set policy.
>
> Again all we will end up with is gradual replacement of all ioremap
> calls with ioremap_shared as people discover a given driver does not
> work in a VM.
No the device filter will prevent that. They would need to submit
patches to the central list.
Or they can override it at the command line, but there is already an
option to force all ioremaps to be shared. So if you just want some
driver to run without caring about security you can already do that
without modifying it.
Besides the shared concept only makes sense for virtual devices, so if
you don't have a device model for a device this will never happen either.
So I don't think your scenario of all ioremaps becoming shared will ever
happen.
> How are you going to know driver has actually been
> audited? what the quality of the audit was? did the people doing the
> auditing understand what they are auditing for? No way, right?
First the primary purpose of the ioremap policy is to avoid messing with
all the legacy drivers (which is 99+% of the code base)
How to handle someone maliciously submitting a driver to the kernel is a
completely different problem. To some degree there is trust of course.
If someone says they audited and a maintainer trusts them with their
statement, but they actually didn't there is a problem, but it's larger
than just TDX. But in such a case the community code audit will also
focus on such areas, and people interested in confidential computing
security will also start taking a look.
And we're also working on fuzzing, so these drivers will be fuzzed at
some point, so mistakes will be eventually found.
But in any case the ioremap policy is mainly to prevent having to handle
this for all legacy drivers.
I would rather change the few drivers that are actually needed, than all
the other drivers.
That's really the fundamental problem this is addressing: how to get
reasonable security with all the legacy drivers out of the box without
touching them.
-Andi
Powered by blists - more mailing lists