[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c7add816-853a-c31d-6425-464512a2de61@linux.intel.com>
Date: Tue, 16 Nov 2021 14:05:27 +0800
From: Lu Baolu <baolu.lu@...ux.intel.com>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: baolu.lu@...ux.intel.com,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Joerg Roedel <joro@...tes.org>,
Alex Williamson <alex.williamson@...hat.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Jason Gunthorpe <jgg@...dia.com>,
Kevin Tian <kevin.tian@...el.com>,
Ashok Raj <ashok.raj@...el.com>, Will Deacon <will@...nel.org>,
rafael@...nel.org, Diana Craciun <diana.craciun@....nxp.com>,
Cornelia Huck <cohuck@...hat.com>,
Eric Auger <eric.auger@...hat.com>,
Liu Yi L <yi.l.liu@...el.com>,
Jacob jun Pan <jacob.jun.pan@...el.com>,
Chaitanya Kulkarni <kch@...dia.com>,
iommu@...ts.linux-foundation.org, linux-pci@...r.kernel.org,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 03/11] PCI: pci_stub: Suppress kernel DMA ownership
auto-claiming
Hi Bjorn,
On 11/16/21 6:17 AM, Bjorn Helgaas wrote:
> On Mon, Nov 15, 2021 at 10:05:44AM +0800, Lu Baolu wrote:
>> pci_stub allows the admin to block driver binding on a device and make
>> it permanently shared with userspace. Since pci_stub does not do DMA,
>> it is safe. However the admin must understand that using pci_stub allows
>> userspace to attack whatever device it was bound to.
> This commit log doesn't say what the patch does. I think it tells us
> something about what pci-stub*already* does ("allows admin to block
> driver binding") and something about why that is safe ("does not do
> DMA").
Yes, you are right. This patch is to keep the pci_stub's existing use
case ("allows admin to block driver binding") after moving the viable
check from the vfio to iommu layer (done by this series).
About "safe" (should not be part of this description), there are two
sides from my understanding:
#1) The pci_stub driver itself doesn't control the device to do any DMA.
So it won't interfere the user space through device DMA.
#2) The pci_stub driver doesn't access the PCI bar and doesn't build any
device driver state around any value in the bar. So other devices
in the same iommu group (assigned to user space) have no means to
change the kernel driver consistency via p2p access.
>
> But it doesn't say what this patch changes. Based on the subject
> line, I expected something like:
>
> As of ("<commit subject>"), <some function>() marks the iommu_group
> as containing only devices with kernel drivers that manage DMA.
>
> Avoid this default behavior for pci-stub because it does not program
> any DMA itself. This allows <some desirable behavior>.
>
Sure. I will rephrase the description like above.
Best regards,
baolu
Powered by blists - more mailing lists