linux-stable/drivers/pci
Bandan Das 8895d3bcb8 PCI: Fail new_id for vendor/device values already built into driver
While using the sysfs new_id interface, the user can unintentionally feed
incorrect values if the driver static table has a matching entry.  This is
possible since only the device and vendor fields are mandatory and the rest
are optional.  As a result, store_new_id() will fill in default values that
are then passed on to the driver and can have unintended consequences.

As an example, consider the ixgbe driver and the 82599EB network card:

  echo "8086 10fb" > /sys/bus/pci/drivers/ixgbe/new_id

This will pass a pci_device_id with driver_data = 0 to ixgbe_probe(), which
uses that zero to index a table of card operations.  The zeroth entry of
the table does *not* correspond to the 82599 operations.

This change returns an error if the user attempts to add a dynid for a
vendor/device combination for which a static entry already exists.
However, if the user intentionally wants a different set of values, she
must provide all the 7 fields and that will be accepted.

[bhelgaas: drop KVM text since the problem isn't KVM-specific]
Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
2014-04-29 17:36:44 -06:00
..
host PCI changes for the v3.15 merge window: 2014-04-01 15:14:04 -07:00
hotplug PCI: Remove unnecessary includes of <linux/init.h> 2014-04-14 16:12:37 -06:00
pcie Merge branch 'pci/dead-code' into next 2014-01-13 16:47:08 -07:00
access.c PCI: Remove unused pci_vpd_truncate() 2014-01-13 11:14:43 -07:00
ats.c PCI: Removed unused parts of Page Request Interface support 2014-01-10 14:00:47 -07:00
bus.c PCI: Remove unnecessary includes of <linux/init.h> 2014-04-14 16:12:37 -06:00
host-bridge.c PCI: Remove unnecessary includes of <linux/init.h> 2014-04-14 16:12:37 -06:00
hotplug-pci.c PCI: hotplug: remove pci_do_scan_bus() 2012-06-13 15:42:27 -06:00
htirq.c
ioapic.c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
iov.c PCI: Remove unused SR-IOV VF Migration support 2014-02-19 11:28:44 -07:00
irq.c PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
Kconfig PCI: Convert ioapic to be builtin only, not modular 2014-01-03 14:31:38 -07:00
Makefile Merge branch 'x86-nuke-platforms-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-04-02 13:15:58 -07:00
msi.c PCI: Remove unnecessary includes of <linux/init.h> 2014-04-14 16:12:37 -06:00
of.c
pci-acpi.c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
pci-driver.c PCI: Fail new_id for vendor/device values already built into driver 2014-04-29 17:36:44 -06:00
pci-label.c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
pci-stub.c PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
pci-sysfs.c pci: use device_remove_file_self() instead of device_schedule_callback() 2014-02-07 15:42:41 -08:00
pci.c PCI: Fix incorrect vgaarb conditional in WARN_ON() 2014-04-25 11:19:06 -06:00
pci.h PCI: Remove unused SR-IOV VF Migration support 2014-02-19 11:28:44 -07:00
probe.c Merge branch 'pci/resource' into next 2014-03-19 15:11:19 -06:00
proc.c PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
quirks.c PCI: Add new ID for Intel GPU "spurious interrupt" quirk 2014-04-28 17:39:58 -06:00
remove.c Revert "PCI: Remove from bus_list and release resources in pci_release_dev()" 2014-02-01 10:24:31 -08:00
rom.c PCI: Mark resources as IORESOURCE_UNSET if we can't assign them 2014-02-27 10:43:32 -07:00
search.c PCI: Remove unnecessary includes of <linux/init.h> 2014-04-14 16:12:37 -06:00
setup-bus.c Merge branch 'pci/resource' into next 2014-01-10 14:23:15 -07:00
setup-irq.c PCI: Remove unnecessary includes of <linux/init.h> 2014-04-14 16:12:37 -06:00
setup-res.c PCI: Remove unnecessary includes of <linux/init.h> 2014-04-14 16:12:37 -06:00
slot.c VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms. 2014-03-24 12:21:00 +10:30
syscall.c PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
vc.c PCI: Rename PCI_VC_PORT_REG1/2 to PCI_VC_PORT_CAP1/2 2013-12-17 17:49:39 -07:00
vpd.c
xen-pcifront.c Features: 2014-01-22 22:00:18 -08:00