From: Bryn M. Reeves Date: Thu, 12 Nov 2009 18:31:54 +0000 (+0000) Subject: [SCSI] megaraid_sas: remove sysfs poll_mode_io world writeable permissions X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bb7d3f24c71e528989501617651b669fbed798cb;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [SCSI] megaraid_sas: remove sysfs poll_mode_io world writeable permissions /sys/bus/pci/drivers/megaraid_sas/poll_mode_io defaults to being world-writable, which seems bad (letting any user affect kernel driver behavior). This turns off group and user write permissions, so that on typical production systems only root can write to it. Signed-off-by: Bryn M. Reeves Signed-off-by: Linus Torvalds --- diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index 99ff99e45be..708ea3157b6 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c @@ -4046,7 +4046,7 @@ megasas_aen_polling(struct work_struct *work) } -static DRIVER_ATTR(poll_mode_io, S_IRUGO|S_IWUGO, +static DRIVER_ATTR(poll_mode_io, S_IRUGO|S_IWUSR, megasas_sysfs_show_poll_mode_io, megasas_sysfs_set_poll_mode_io);