aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2008-07-01 12:18:17 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-07-01 12:51:53 -0400
commita94c248113b86bbbc47d027a4004b70f2be298b1 (patch)
treeb33c29082b1294287bb45f95730f87db002fba98 /drivers/pci
parent543cf4cb3fe6f6cae3651ba918b9c56200b257d0 (diff)
PCI: Restrict VPD read permission to root
Some PCI devices will lock up if we attempt to read from VPD addresses beyond some device-dependent limit. Until we can identify these devices and adjust the file size accordingly, only let root read VPD through sysfs to prevent a DoS by normal users. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci-sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 6f3c7446c329..1f855f028e92 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -738,7 +738,7 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
738 pdev->vpd->attr = attr; 738 pdev->vpd->attr = attr;
739 attr->size = pdev->vpd->ops->get_size(pdev); 739 attr->size = pdev->vpd->ops->get_size(pdev);
740 attr->attr.name = "vpd"; 740 attr->attr.name = "vpd";
741 attr->attr.mode = S_IRUGO | S_IWUSR; 741 attr->attr.mode = S_IRUSR | S_IWUSR;
742 attr->read = pci_read_vpd; 742 attr->read = pci_read_vpd;
743 attr->write = pci_write_vpd; 743 attr->write = pci_write_vpd;
744 retval = sysfs_create_bin_file(&pdev->dev.kobj, attr); 744 retval = sysfs_create_bin_file(&pdev->dev.kobj, attr);