[dpdk-dev] Having troubles binding an SR-IOV VF to uio_pci_generic on Amazon instance

Avi Kivity avi at scylladb.com
Thu Oct 1 11:38:51 CEST 2015



On 10/01/2015 12:29 PM, Michael S. Tsirkin wrote:
> On Thu, Oct 01, 2015 at 12:15:49PM +0300, Avi Kivity wrote:
>>      What userspace can't be allowed to do:
>>
>>              access BAR
>>              write rings
>>
>>
>>
>>
>> It can access the BAR by mmap()ing the resourceN files under sysfs.  You're not
>> denying userspace the ability to oops the kernel, just the ability to do useful
>> things with hardware.
>
> This interface has to stay there to support existing applications.  A
> variety of measures (selinux, secureboot) can be used to make sure
> modern ones to not get to touch it.

By all means, secure the driver with selinux as well.

>   Most distributions enable
> some or all of these by default.

There is no problem accessing the BARs on the most modern and secure 
enterprise distribution I am aware of (CentOS 7.1).

>
> And it doesn't mean modern drivers can do this kind of thing.
>
> Look, without an IOMMU, sysfs can not be used securely:
> you need some other interface. This is what this driver is missing.

What is this magical missing interface?

It simply cannot be done.  You either have an iommu, or you accept that 
userspace can access anything via DMA.

The sad thing is that you can do this since forever on a non-virtualized 
system, or on a virtualized system if you don't need interrupt support.  
All you're doing is blocking interrupt support on virtualized systems.


More information about the dev mailing list