From: "Michael S. Tsirkin" <mst@redhat.com>
To: Andi Kleen <ak@linux.intel.com>
Cc: Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@linux.intel.com>,
Kuppuswamy Sathyanarayanan <knsathya@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
linux-pci@vger.kernel.org, linux-mips@vger.kernel.org,
James E J Bottomley <James.Bottomley@hansenpartnership.com>,
Dave Hansen <dave.hansen@intel.com>,
Peter H Anvin <hpa@zytor.com>,
sparclinux@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Andrea Arcangeli <aarcange@redhat.com>,
Jonathan Corbet <corbet@lwn.net>, Helge Deller <deller@gmx.de>,
x86@kernel.org, Ingo Molnar <mingo@redhat.com>,
linux-arch@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>,
Andy Lutomirski <luto@kernel.org>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Dan Williams <dan.j.williams@intel.com>,
virtualization@lists.linux-foundation.org,
Richard Henderson <rth@twiddle.net>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
linux-parisc@vger.kernel.org,
Sean Christopherson <seanjc@google.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-alpha@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
"David S . Miller" <davem@davemloft.net>,
Kirill Shutemov <kirill.shutemov@linux.intel.com>
Subject: Re: [PATCH v5 12/16] PCI: Add pci_iomap_host_shared(), pci_iomap_host_shared_range()
Date: Mon, 11 Oct 2021 07:59:17 -0400 [thread overview]
Message-ID: <20211011073614-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <cec62ebb-87d7-d725-1096-2c97c5eedbc3@linux.intel.com>
On Sun, Oct 10, 2021 at 03:22:39PM -0700, Andi Kleen wrote:
>
> > To which Andi replied
> > One problem with removing the ioremap opt-in is that
> > it's still possible for drivers to get at devices without going through probe.
> >
> > To which Greg replied:
> > https://lore.kernel.org/all/YVXBNJ431YIWwZdQ@kroah.com/
> > If there are in-kernel PCI drivers that do not do this, they need to be
> > fixed today.
> >
> > Can you guys resolve the differences here?
>
>
> I addressed this in my other mail, but we may need more discussion.
Hopefully Greg will reply to that one.
>
> >
> > And once they are resolved, mention this in the commit log so
> > I don't get to re-read the series just to find out nothing
> > changed in this respect?
> >
> > I frankly do not believe we are anywhere near being able to harden
> > an arbitrary kernel config against attack.
>
> Why not? Device filter and the opt-ins together are a fairly strong
> mechanism.
Because it does not end with I/O operations, that's a trivial example.
module unloading is famous for being racy: I just re-read that part of
virtio drivers and sure enough we have bugs there, this is after
they have presumably been audited, so a TDX guest is better off
just disabling hot-unplug completely, and hotplug isn't far behind.
Malicious filesystems can exploit many linux systems unless
you take pains to limit what is mounted and how.
Networking devices tend to get into the default namespaces and can
do more or less whatever CAP_NET_ADMIN can.
Etc.
I am not saying this makes the effort worthless, I am saying userspace
better know very well what it's doing, and kernel better be
configured in a very specific way.
> And it's not that they're a lot of code or super complicated either.
>
> You're essentially objecting to a single line change in your subsystem here.
Well I commented on the API patch, not the virtio patch.
If it's a way for a driver to say "I am hardened
and audited" then I guess it should at least say so. It has nothing
to do with host or sharing, that's an implementation detail,
and it obscures the actual limitations of the approach,
in that eventually in an ideal world all drivers would be secure
and use this API.
Yes, if that's the API that PCI gains then virtio will use it.
> > How about creating a defconfig that makes sense for TDX then?
>
> TDX can be used in many different ways, I don't think a defconfig is
> practical.
>
> In theory you could do some Kconfig dependency (at the pain point of having
> separate kernel binariees), but why not just do it at run time then if you
> maintain the list anyways. That's much easier and saner for everyone. In the
> past we usually always ended up with runtime mechanism for similar things
> anyways.
>
> Also it turns out that the filter mechanisms are needed for some arch
> drivers which are not even configurable, so alone it's probably not enough,
I guess they aren't really needed though right, or you won't try to
filter them? So make them configurable?
>
> > Anyone deviating from that better know what they are doing,
> > this API tweaking is just putting policy into the kernel ...
>
> Hardening drivers is kernel policy. It cannot be done anywhere else.
>
>
> -Andi
To clarify, the policy is which drivers to load into the kernel.
--
MST
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2021-10-11 12:00 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20211009003711.1390019-1-sathyanarayanan.kuppuswamy@linux.intel.com>
[not found] ` <20211009003711.1390019-17-sathyanarayanan.kuppuswamy@linux.intel.com>
2021-10-09 1:45 ` [PATCH v5 16/16] x86/tdx: Add cmdline option to force use of ioremap_host_shared Randy Dunlap
2021-10-09 11:04 ` Michael S. Tsirkin
2021-10-11 2:39 ` Andi Kleen
2021-10-11 12:04 ` Michael S. Tsirkin
2021-10-11 17:35 ` Andi Kleen
2021-10-11 18:28 ` Michael S. Tsirkin
2021-10-12 17:55 ` Andi Kleen
2021-10-12 20:59 ` Michael S. Tsirkin
2021-10-12 21:18 ` Andi Kleen
2021-10-12 21:30 ` Michael S. Tsirkin
2021-10-15 5:50 ` Andi Kleen
2021-10-15 6:57 ` Michael S. Tsirkin
[not found] ` <20211009003711.1390019-13-sathyanarayanan.kuppuswamy@linux.intel.com>
2021-10-09 9:53 ` [PATCH v5 12/16] PCI: Add pci_iomap_host_shared(), pci_iomap_host_shared_range() Michael S. Tsirkin
2021-10-09 20:39 ` Dan Williams
2021-10-10 22:11 ` Andi Kleen
2021-10-12 17:42 ` Dan Williams
2021-10-12 18:35 ` Andi Kleen
2021-10-12 21:14 ` Dan Williams
2021-10-12 21:18 ` Michael S. Tsirkin
2021-10-12 21:24 ` Andi Kleen
2021-10-12 21:28 ` Andi Kleen
2021-10-12 22:00 ` Dan Williams
2021-10-18 12:13 ` Greg KH
[not found] ` <DM8PR11MB57501C8F8F5C8B315726882EE7B69@DM8PR11MB5750.namprd11.prod.outlook.com>
2021-10-12 18:38 ` Andi Kleen
[not found] ` <DM8PR11MB57505C520763DF706309E177E7B69@DM8PR11MB5750.namprd11.prod.outlook.com>
2021-10-12 19:13 ` Dan Williams
2021-10-12 19:49 ` Andi Kleen
2021-10-12 21:11 ` Michael S. Tsirkin
[not found] ` <DM8PR11MB5750A40FAA6AFF6A29CF70DAE7B89@DM8PR11MB5750.namprd11.prod.outlook.com>
2021-10-14 6:57 ` Michael S. Tsirkin
[not found] ` <DM8PR11MB57500B2D821E8AAF93EB66CEE7B89@DM8PR11MB5750.namprd11.prod.outlook.com>
2021-10-14 9:26 ` Michael S. Tsirkin
[not found] ` <DM8PR11MB57505AAA1E1209F7FCA69C11E7B89@DM8PR11MB5750.namprd11.prod.outlook.com>
2021-10-17 22:17 ` Michael S. Tsirkin
2021-10-14 11:49 ` Michael S. Tsirkin
2021-10-17 21:52 ` Thomas Gleixner
2021-10-18 0:55 ` Thomas Gleixner
2021-10-18 1:10 ` Thomas Gleixner
2021-10-18 12:08 ` Greg KH
2021-10-10 22:22 ` Andi Kleen
2021-10-11 11:59 ` Michael S. Tsirkin [this message]
2021-10-11 17:32 ` Andi Kleen
2021-10-11 18:22 ` Michael S. Tsirkin
2021-10-18 12:15 ` Greg KH
2021-10-18 13:17 ` Michael S. Tsirkin
2021-10-11 7:58 ` Christoph Hellwig
2021-10-11 17:23 ` Andi Kleen
2021-10-11 19:09 ` Michael S. Tsirkin
2021-10-12 5:31 ` Christoph Hellwig
2021-10-12 18:37 ` Andi Kleen
[not found] ` <20211009003711.1390019-5-sathyanarayanan.kuppuswamy@linux.intel.com>
2021-10-20 16:03 ` [PATCH v5 04/16] x86/tdx: Make pages shared in ioremap() Tom Lendacky via Virtualization
[not found] ` <20211009003711.1390019-2-sathyanarayanan.kuppuswamy@linux.intel.com>
2021-10-20 16:11 ` [PATCH v5 01/16] x86/mm: Move force_dma_unencrypted() to common code Tom Lendacky via Virtualization
[not found] ` <20211009003711.1390019-7-sathyanarayanan.kuppuswamy@linux.intel.com>
2021-10-20 16:33 ` [PATCH v5 06/16] x86/tdx: Make DMA pages shared Tom Lendacky via Virtualization
[not found] ` <66acafb6-7659-7d76-0f52-d002cfae9cc8@linux.intel.com>
2021-10-20 17:22 ` Tom Lendacky via Virtualization
[not found] ` <20211009003711.1390019-8-sathyanarayanan.kuppuswamy@linux.intel.com>
2021-10-20 16:39 ` [PATCH v5 07/16] x86/kvm: Use bounce buffers for TD guest Tom Lendacky via Virtualization
[not found] ` <0a9c6485-74d8-e0fc-d261-097380272e07@linux.intel.com>
2021-10-20 17:26 ` Tom Lendacky via Virtualization
[not found] ` <20211009003711.1390019-4-sathyanarayanan.kuppuswamy@linux.intel.com>
[not found] ` <YYWsJFP31vpCAVFg@google.com>
2021-11-08 14:45 ` [PATCH v5 03/16] x86/tdx: Exclude Shared bit from physical_mask Kirill A. Shutemov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211011073614-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=aarcange@redhat.com \
--cc=ak@linux.intel.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@intel.com \
--cc=davem@davemloft.net \
--cc=deller@gmx.de \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=knsathya@kernel.org \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=rth@twiddle.net \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=seanjc@google.com \
--cc=sparclinux@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=tsbogend@alpha.franken.de \
--cc=virtualization@lists.linux-foundation.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).