Commit 5b05d469 authored by Michael Buesch's avatar Michael Buesch Committed by Len Brown

thinkpad-acpi: restrict procfs count value to sane upper limit

Signed-off-by: default avatarMichael Buesch <mb@bu3sch.de>
Acked-by: default avatarHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 1f6fc2de
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment