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_...@kernel-bugs.osdl.org
        ReportedBy: ve...@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.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to