Bug 510805 - PCI FLR support needed for secure device assignment to KVM guests
Summary: PCI FLR support needed for secure device assignment to KVM guests
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Don Dutile (Red Hat)
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks: 510806 512913
TreeView+ depends on / blocked
 
Reported: 2009-07-10 21:01 UTC by Don Dutile (Red Hat)
Modified: 2009-09-03 13:52 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-02 08:44:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1243 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.4 kernel security and bug fix update 2009-09-01 08:53:34 UTC

Description Don Dutile (Red Hat) 2009-07-10 21:01:01 UTC
Description of problem:
KVM guests can be given control of PCI devices via
the device assignment support in qemu-kvm, KVM & VT-d in the kernel.
VT-d provides security by isolating device DMA to only
be directed to guest memory, while the guest owns the device.

But prior to the guest gaining control of the device,
and after the guest is shutdown and the device is assumed
to be owned by the host, the PCI(e) device may still
be DMA-ing to memory under a couple of conditions:
(a) driver error, crashing the guest, but leaving the device
    DMA-ing to memory.
(b) guest is 'destroyed' by controlling host, but a 
    clean (driver) shutdown of the device is not implemented.

Once the memory associated with the guest is given back
to the host, the still (badly) running DMA engine could
corrupt host memory, and cause a host crash.

PCI FLR provides a standard method for hosts to
reset a PCI device ensuring it is in a quiesced 
state.  This ensures errors and/or sudden guest
shutdowns with PCI devices assigned to the guests
don't cause an ensuing host crash.


Version-Release number of selected component (if applicable):


How reproducible:
Only in device error cases, or
sudden guest shutdowns that don't invoke assigned device
driver shutdowns (that are 100% complete), 
or badly written/behaving guest drivers (that don't
shutdown their device DMA and/or interrupts).

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:
Repeatable, secure addition and removal of PCI devices
to KVM guests.

Additional info:
Another patch to KVM is needed to invoke the pci_reset_function()
during device assignment and de-assignment.

The support is provided via 5 patches that are in upstream linux:
8dd7f8036c123296fc4214f9d8810eb485570422  
      PCI: add support for function level reset
1df8fb3d5f078f9cab901b6106ef2c9b74eef7df  
      PCI: Fix disable IRQ 0 in pci_reset_function()
d91cdc745524a1b1ff537712a62803b8413c12d6  
      PCI: refactor pci_reset_function() 
f7b7baae6b30ff04124259ff8d7c0c0d281320e6  
      PCI: add PCI Advanced Feature Capability defines
1ca887970a3971a22e4875b7c6ad5ae3ce49f61a  
      PCI: Extend pci_reset_function() to support PCI Advanced Features

Comment 2 RHEL Program Management 2009-07-12 12:43:02 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 6 Don Zickus 2009-07-21 19:37:19 UTC
in kernel-2.6.18-159.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so.  However feel free
to provide a comment indicating that this fix has been verified.

Comment 10 errata-xmlrpc 2009-09-02 08:44:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2009-1243.html


Note You need to log in before you can comment on or make changes to this bug.