Skip to content

Commit

Permalink
libata: don't allow sysfs read access to force param
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Mar 11, 2008
1 parent 70d562c commit 7afb422
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7afb422

Please sign in to comment.