Skip to content

Commit

Permalink
PCI: Restrict VPD read permission to root
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Hutchings authored and Jesse Barnes committed Jul 1, 2008
1 parent 543cf4c commit a94c248
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/pci-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
pdev->vpd->attr = attr;
attr->size = pdev->vpd->ops->get_size(pdev);
attr->attr.name = "vpd";
attr->attr.mode = S_IRUGO | S_IWUSR;
attr->attr.mode = S_IRUSR | S_IWUSR;
attr->read = pci_read_vpd;
attr->write = pci_write_vpd;
retval = sysfs_create_bin_file(&pdev->dev.kobj, attr);
Expand Down

0 comments on commit a94c248

Please sign in to comment.