[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1502760820.4493.40.camel@kernel.crashing.org>
Date: Tue, 15 Aug 2017 11:33:40 +1000
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: Jike Song <jike.song@...el.com>,
Robin Murphy <robin.murphy@....com>
Cc: Alexey Kardashevskiy <aik@...abs.ru>,
linuxppc-dev@...ts.ozlabs.org,
David Gibson <david@...son.dropbear.id.au>,
kvm-ppc@...r.kernel.org, kvm@...r.kernel.org,
Yongji Xie <elohimes@...il.com>,
Eric Auger <eric.auger@...hat.com>,
Kyle Mahlkuch <Kyle.Mahlkuch@....com>,
Alex Williamson <alex.williamson@...hat.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Arvind Yadav <arvind.yadav.cs@...il.com>,
David Woodhouse <dwmw2@...radead.org>,
Kirti Wankhede <kwankhede@...dia.com>,
Mauricio Faria de Oliveira <mauricfo@...ux.vnet.ibm.com>,
Neo Jia <cjia@...dia.com>, Paul Mackerras <paulus@...ba.org>,
Vlad Tsyrklevich <vlad@...rklevich.net>,
iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v5 0/5] vfio-pci: Add support for mmapping MSI-X
table
On Tue, 2017-08-15 at 09:16 +0800, Jike Song wrote:
> > Taking a step back, though, why does vfio-pci perform this check in the
> > first place? If a malicious guest already has control of a device, any
> > kind of interrupt spoofing it could do by fiddling with the MSI-X
> > message address/data it could simply do with a DMA write anyway, so the
> > security argument doesn't stand up in general (sure, not all PCIe
> > devices may be capable of arbitrary DMA, but that seems like more of a
> > tenuous security-by-obscurity angle to me).
I tried to make that point for years, thanks for re-iterating it :-)
> Hi Robin,
>
> DMA writes will be translated (thereby censored) by DMA Remapping hardware,
> while MSI/MSI-X will not. Is this different for non-x86?
There is no way your DMA remapping HW can differenciate. The only
difference between a DMA write and an MSI is ... the address. So if I
can make my device DMA to the MSI address range, I've defeated your
security.
The table obfuscating in qemu is only useful as an insecure way of
"making things sort-of-work" for HW that doesnt have proper remapping
or filtering.
On pseries we don't have that problem because:
1) Our hypervisor (which is qemu) provide the DMA address for MSIs/X
so there is no need for "magic remapping" to give the guest a value
that works.
2) Our HW (configured by VFIO/KVM) filters which device can DMA to
what address (including which MSIs/X) thus even if the guest doesn't
use the address passed and messes around, it can only shoot itself in
the foot.
So all we need is a way to tell qemu to stop doing that filtering on
our platform. This is *one bit* of information, it's taken 3 years of
arguments and we still don't have a solution. In the meantime,
workloads *are* being hurt by significant performance degradation due
to the MSI-X table sharing a 64K page (our page size) with other MMIOs.
Yay !
Ben.
Powered by blists - more mailing lists