diff mbox series

PCI/sysfs: Fix read permissions for VPD attributes

Message ID 65791906154e3e5ea12ea49127cf7c707325ca56.1730102428.git.leonro@nvidia.com (mailing list archive)
State New
Headers show
Series PCI/sysfs: Fix read permissions for VPD attributes | expand

Commit Message

Leon Romanovsky Oct. 28, 2024, 8:05 a.m. UTC
From: Leon Romanovsky <leonro@nvidia.com>

The Virtual Product Data (VPD) attribute is not readable by regular
user without root permissions. Such restriction is not really needed,
as data presented in that VPD is not sensitive at all.

This change aligns the permissions of the VPD attribute to be accessible
for read by all users, while write being restricted to root only.

Cc: stable@vger.kernel.org
Fixes: d93f8399053d ("PCI/sysfs: Convert "vpd" to static attribute")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
I added stable@ as it was discovered during our hardware ennoblement
and it is important to be picked by distributions too.
---
 drivers/pci/vpd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
index e4300f5f304f..2537685cac90 100644
--- a/drivers/pci/vpd.c
+++ b/drivers/pci/vpd.c
@@ -317,7 +317,7 @@  static ssize_t vpd_write(struct file *filp, struct kobject *kobj,
 
 	return ret;
 }
-static BIN_ATTR(vpd, 0600, vpd_read, vpd_write, 0);
+static BIN_ATTR_RW(vpd, 0);
 
 static struct bin_attribute *vpd_attrs[] = {
 	&bin_attr_vpd,