Skip to content

Commit 3fc07d0

Browse files
damien-lemoalopsiff
authored andcommitted
scsi: core: sysfs: Correct sysfs attributes access rights
[ Upstream commit a2f54ff15c3bdc0132e20aae041607e2320dbd73 ] 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: John Garry <[email protected]> Reviewed-by: Johannes Thumshin <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 43662b846c7a22ffc368502ab39e8caaaf4d111e)
1 parent 176a413 commit 3fc07d0

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)