Skip to contentSkip to conversation

megaraid_sas dbg_lvl permissions

PATCH Joe Malicki 2 participants 2 messages Aug 14, 2008 – Aug 15, 2008 1 message not in the archive SCSI

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

/sys/bus/pci/drivers/megaraid_sas/dbg_lvl defaults to being world-writable, which seems bad (letting any user affect kernel driver behavior and logging level).

This turns off group and user write permissions, so that on typical production systems only root can write to it.

--

scsi/megaraid/megaraid_sas.c renamed from scsi/megaraid/megaraid_sas.c.orig +1 -1
@@ -3044,7 +3044,7 @@
 	return retval;
 }
 
-static DRIVER_ATTR(dbg_lvl, S_IRUGO|S_IWUGO, megasas_sysfs_show_dbg_lvl,
+static DRIVER_ATTR(dbg_lvl, S_IRUGO|S_IWUSR, megasas_sysfs_show_dbg_lvl,
 		   megasas_sysfs_set_dbg_lvl);
 
 /**

--

#2 lore raw

ACK.

Thanks,

Bo Yang

-----Original Message-----
From: Joe Malicki [mailto:[email protected]]
Sent: Thursday, August 14, 2008 5:15 PM
To: Yang, Bo
Cc: [email protected]
Subject: megaraid_sas dbg_lvl permissions

/sys/bus/pci/drivers/megaraid_sas/dbg_lvl defaults to being world-writable, which seems bad (letting any user affect kernel driver behavior and logging level).

This turns off group and user write permissions, so that on typical production systems only root can write to it.

--

scsi/megaraid/megaraid_sas.c 2008-01-31 10:52:10.000000000 -0500 renamed from scsi/megaraid/megaraid_sas.c.orig 2008-01-31 10:49:57.000000000 -0500 +2 -1
@@ -3044,7 +3044,7 @@
        return retval;
 }
 
-static DRIVER_ATTR(dbg_lvl, S_IRUGO|S_IWUGO, megasas_sysfs_show_dbg_lvl,
+static DRIVER_ATTR(dbg_lvl, S_IRUGO|S_IWUSR,
+megasas_sysfs_show_dbg_lvl,
                   megasas_sysfs_set_dbg_lvl);
 

/**
--