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>
This commit is contained in:
parent
1f6fc2de95
commit
5b05d4696d
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue