Skip to content

Commit a94c248

Browse files
Ben Hutchingsjbarnes993
authored andcommitted
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>
1 parent 543cf4c commit a94c248

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/pci/pci-sysfs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
738738
pdev->vpd->attr = attr;
739739
attr->size = pdev->vpd->ops->get_size(pdev);
740740
attr->attr.name = "vpd";
741-
attr->attr.mode = S_IRUGO | S_IWUSR;
741+
attr->attr.mode = S_IRUSR | S_IWUSR;
742742
attr->read = pci_read_vpd;
743743
attr->write = pci_write_vpd;
744744
retval = sysfs_create_bin_file(&pdev->dev.kobj, attr);

0 commit comments

Comments
 (0)