diff options
author | Tejun Heo <htejun@gmail.com> | 2008-03-09 07:21:53 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-03-10 20:51:05 -0400 |
commit | 7afb42226a8eaa9ae3f6b9917ffb16902358e749 (patch) | |
tree | c5f75a6297cdb6d4f7e753a2a7849bcb8d1f6237 | |
parent | 70d562cf7853ea1bb53c1007075c5df958f11c90 (diff) |
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.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/ata/libata-core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 5310513b7573..4bbe31f98ef8 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -106,7 +106,8 @@ static struct ata_force_ent *ata_force_tbl; | |||
106 | static int ata_force_tbl_size; | 106 | static int ata_force_tbl_size; |
107 | 107 | ||
108 | static char ata_force_param_buf[PAGE_SIZE] __initdata; | 108 | static char ata_force_param_buf[PAGE_SIZE] __initdata; |
109 | module_param_string(force, ata_force_param_buf, sizeof(ata_force_param_buf), 0444); | 109 | /* param_buf is thrown away after initialization, disallow read */ |
110 | module_param_string(force, ata_force_param_buf, sizeof(ata_force_param_buf), 0); | ||
110 | MODULE_PARM_DESC(force, "Force ATA configurations including cable type, link speed and transfer mode (see Documentation/kernel-parameters.txt for details)"); | 111 | MODULE_PARM_DESC(force, "Force ATA configurations including cable type, link speed and transfer mode (see Documentation/kernel-parameters.txt for details)"); |
111 | 112 | ||
112 | int atapi_enabled = 1; | 113 | int atapi_enabled = 1; |