Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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

parent 1f6fc2de
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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)