summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-08-01 17:04:19 +0200
committerLen Brown <len.brown@intel.com>2009-08-02 05:50:40 +0200
commit5b05d4696d38c3172e79e855cc1e2ed044589508 (patch)
tree63a23cbb029bd0cac3e7b4f4863f996664afbd26 /drivers/platform/x86
parentthinkpad-acpi: remove dock and bay subdrivers (diff)
downloadlinux-5b05d4696d38c3172e79e855cc1e2ed044589508.tar.xz
linux-5b05d4696d38c3172e79e855cc1e2ed044589508.zip
thinkpad-acpi: restrict procfs count value to sane upper limit
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>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 27d68e719e90..18f9ee63c50a 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -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)