Skip to content

Commit b08a26b

Browse files
damien-lemoalgregkh
authored andcommitted
scsi: core: sysfs: Correct sysfs attributes access rights
[ Upstream commit a2f54ff ] The SCSI sysfs attributes "supported_mode" and "active_mode" do not define a store method and thus cannot be modified. Correct the DEVICE_ATTR() call for these two attributes to not include S_IWUSR to allow write access as they are read-only. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Link: https://lore.kernel.org/r/20250728041700.76660-1-dlemoal@kernel.org Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Johannes Thumshin <johannes.thumshirn@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 857eb3e commit b08a26b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/scsi/scsi_sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ show_shost_supported_mode(struct device *dev, struct device_attribute *attr,
265265
return show_shost_mode(supported_mode, buf);
266266
}
267267

268-
static DEVICE_ATTR(supported_mode, S_IRUGO | S_IWUSR, show_shost_supported_mode, NULL);
268+
static DEVICE_ATTR(supported_mode, S_IRUGO, show_shost_supported_mode, NULL);
269269

270270
static ssize_t
271271
show_shost_active_mode(struct device *dev,
@@ -279,7 +279,7 @@ show_shost_active_mode(struct device *dev,
279279
return show_shost_mode(shost->active_mode, buf);
280280
}
281281

282-
static DEVICE_ATTR(active_mode, S_IRUGO | S_IWUSR, show_shost_active_mode, NULL);
282+
static DEVICE_ATTR(active_mode, S_IRUGO, show_shost_active_mode, NULL);
283283

284284
static int check_reset_type(const char *str)
285285
{

0 commit comments

Comments
 (0)