Skip to content

Commit

Permalink
thinkpad-acpi: restrict procfs count value to sane upper limit
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Michael Buesch authored and Len Brown committed Aug 2, 2009
1 parent 1f6fc2d commit 5b05d46
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,8 @@ static int dispatch_procfs_write(struct file *file,

if (!ibm || !ibm->write)
return -EINVAL;
if (count > PAGE_SIZE - 2)
return -EINVAL;

kernbuf = kmalloc(count + 2, GFP_KERNEL);
if (!kernbuf)
Expand Down

0 comments on commit 5b05d46

Please sign in to comment.