Skip to contentSkip to conversation

libata: don't allow sysfs read access to force param

PATCH Applied Tejun Heo 2 participants 2 messages Mar 9, 2008 – Mar 11, 2008 libata

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 libata: don't allow sysfs read access to force param

Buffer for force param is deallocated after initialization, so trying to read it via sysfs results in oops. Don't allow read access to the param node.

Spotted by Eric Sesterhenn.

Cc Eric Sesterhenn <[email protected]>
---
 drivers/ata/libata-core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ata/libata-core.c +2 -1
index 4fbcce7..e399eaa 100644
@@ -106,7 +106,8 @@ static struct ata_force_ent *ata_force_tbl;
 static int ata_force_tbl_size;
 
 static char ata_force_param_buf[PAGE_SIZE] __initdata;
-module_param_string(force, ata_force_param_buf, sizeof(ata_force_param_buf), 0444);
+/* param_buf is thrown away after initialization, disallow read */
+module_param_string(force, ata_force_param_buf, sizeof(ata_force_param_buf), 0);
 MODULE_PARM_DESC(force, "Force ATA configurations including cable type, link speed and transfer mode (see Documentation/kernel-parameters.txt for details)");
 
 int atapi_enabled = 1;
Applied
#1 lore raw
Quoted 11 lines · Tejun Heo

Buffer for force param is deallocated after initialization, so trying to read it via sysfs results in oops. Don't allow read access to the param node.

Spotted by Eric Sesterhenn.

Cc Eric Sesterhenn <[email protected]>
---
 drivers/ata/libata-core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

applied