kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bug 43339] New: Wrong Pci-Bridge Header Type check.
@ 2012-06-04 14:28 bugzilla-daemon
  2012-06-05 18:33 ` [Bug 43339] " bugzilla-daemon
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bugzilla-daemon @ 2012-06-04 14:28 UTC (permalink / raw)
  To: kvm

https://bugzilla.kernel.org/show_bug.cgi?id=43339

           Summary: Wrong Pci-Bridge Header Type check.
           Product: Virtualization
           Version: unspecified
    Kernel Version: 3.4
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: kvm
        AssignedTo: virtualization_kvm@kernel-bugs.osdl.org
        ReportedBy: vedun@ispras.ru
        Regression: No


I have found bug in file virt/kvm/assigned-device.c

670         /* Don't allow bridges to be assigned */
671         pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type);
672         if ((header_type & PCI_HEADER_TYPE) != PCI_HEADER_TYPE_NORMAL) {
673                 r = -EPERM;
674                 goto out_put;
675         }

This code doesn't check that device is PCI-Bridge. In my case

header_type is 1,  default value for PCI-Bridge
PCI_HEADER_TYPE is 14(0xE)
PCI_HEADER_TYPE_NORMAL is 0

So, 1 & 0xE == 0 thus KVM assigns pci-bridge device to VM successfully.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 43339] Wrong Pci-Bridge Header Type check.
  2012-06-04 14:28 [Bug 43339] New: Wrong Pci-Bridge Header Type check bugzilla-daemon
@ 2012-06-05 18:33 ` bugzilla-daemon
  2012-06-05 19:43 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2012-06-05 18:33 UTC (permalink / raw)
  To: kvm

https://bugzilla.kernel.org/show_bug.cgi?id=43339


Alex Williamson <alex.williamson@redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alex.williamson@redhat.com




--- Comment #1 from Alex Williamson <alex.williamson@redhat.com>  2012-06-05 18:33:46 ---
(In reply to comment #0)
> 
> So, 1 & 0xE == 0 thus KVM assigns pci-bridge device to VM successfully.

Have you found this to be true in practice?  The test here is clearly wrong,
but immediately after this we test pci-sysfs resource permissions.  We only
test standard device resources, as we're not expecting a bridge to get through,
but I believe those should all be zero for a bridge, which will result in
denying assignment of the device because it has no resources.  If you have a
pci-bridge that actually makes it through that test, please include lspci -vvv
for it here.  Thanks

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 43339] Wrong Pci-Bridge Header Type check.
  2012-06-04 14:28 [Bug 43339] New: Wrong Pci-Bridge Header Type check bugzilla-daemon
  2012-06-05 18:33 ` [Bug 43339] " bugzilla-daemon
@ 2012-06-05 19:43 ` bugzilla-daemon
  2012-07-01  9:40 ` bugzilla-daemon
  2012-08-15 22:00 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2012-06-05 19:43 UTC (permalink / raw)
  To: kvm

https://bugzilla.kernel.org/show_bug.cgi?id=43339





--- Comment #2 from Alex Williamson <alex.williamson@redhat.com>  2012-06-05 19:43:18 ---
Follow-up; I guess a bridge implementing BARs is not that unique.  Many bridges
do not have BARs, which should be rejected from assignment outright.  Those
with BARs will still fall into the requirement that the user will require
permission to the pci-sysfs resource files, so a privileged entity still has to
grant access to the device.  Let me know if you find differently.  Thanks

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 43339] Wrong Pci-Bridge Header Type check.
  2012-06-04 14:28 [Bug 43339] New: Wrong Pci-Bridge Header Type check bugzilla-daemon
  2012-06-05 18:33 ` [Bug 43339] " bugzilla-daemon
  2012-06-05 19:43 ` bugzilla-daemon
@ 2012-07-01  9:40 ` bugzilla-daemon
  2012-08-15 22:00 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2012-07-01  9:40 UTC (permalink / raw)
  To: kvm

https://bugzilla.kernel.org/show_bug.cgi?id=43339


Florian Mickler <florian@mickler.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |florian@mickler.org




--- Comment #3 from Florian Mickler <florian@mickler.org>  2012-07-01 09:40:03 ---
A patch referencing this bug report has been merged in Linux v3.5-rc4:

commit f961f72836eb6c0fd76201f6f6b2fafff93c4cea
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Fri Jun 15 07:56:20 2012 -0600

    KVM: Fix PCI header check on device assignment

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 43339] Wrong Pci-Bridge Header Type check.
  2012-06-04 14:28 [Bug 43339] New: Wrong Pci-Bridge Header Type check bugzilla-daemon
                   ` (2 preceding siblings ...)
  2012-07-01  9:40 ` bugzilla-daemon
@ 2012-08-15 22:00 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2012-08-15 22:00 UTC (permalink / raw)
  To: kvm

https://bugzilla.kernel.org/show_bug.cgi?id=43339


Alan <alan@lxorguk.ukuu.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |alan@lxorguk.ukuu.org.uk
         Resolution|                            |CODE_FIX




-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-15 22:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-04 14:28 [Bug 43339] New: Wrong Pci-Bridge Header Type check bugzilla-daemon
2012-06-05 18:33 ` [Bug 43339] " bugzilla-daemon
2012-06-05 19:43 ` bugzilla-daemon
2012-07-01  9:40 ` bugzilla-daemon
2012-08-15 22:00 ` bugzilla-daemon

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).