linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI/sysfs: Fix read permissions for VPD attributes
@ 2024-10-28  8:05 Leon Romanovsky
  2024-10-30  0:04 ` Bjorn Helgaas
  0 siblings, 1 reply; 13+ messages in thread
From: Leon Romanovsky @ 2024-10-28  8:05 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Leon Romanovsky, Krzysztof Wilczyński, linux-pci,
	Ariel Almog, Aditya Prabhune

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 --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,
-- 
2.46.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-11-07 16:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-28  8:05 [PATCH] PCI/sysfs: Fix read permissions for VPD attributes Leon Romanovsky
2024-10-30  0:04 ` Bjorn Helgaas
2024-10-31 23:22   ` Bjorn Helgaas
2024-11-01 14:33     ` Leon Romanovsky
2024-11-01 16:47       ` Bjorn Helgaas
2024-11-03 12:33         ` Leon Romanovsky
2024-11-05  0:10           ` Bjorn Helgaas
2024-11-05  7:51             ` Leon Romanovsky
2024-11-05 15:24               ` Bjorn Helgaas
2024-11-05 16:26                 ` Leon Romanovsky
2024-11-07 11:31                   ` Leon Romanovsky
2024-11-07 14:59                     ` Bjorn Helgaas
2024-11-07 16:15                       ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).