libata: don't allow sysfs read access to force param
authorTejun Heo <htejun@gmail.com>
Sun, 9 Mar 2008 11:21:53 +0000 (20:21 +0900)
committerJeff Garzik <jeff@garzik.org>
Tue, 11 Mar 2008 00:51:05 +0000 (20:51 -0400)
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.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/libata-core.c

index 5310513b757326e4b614911377ff785eff5fbc83..4bbe31f98ef8cffadb53a8c2b0962a8ac6f2c1bb 100644 (file)
@@ -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;