Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: evdev - limit amount of data for writes

Limit amount of data that can be written into an evdev instance at
a given time to 4096 bytes (170 input events) to avoid holding
evdev->mutex for too long and starving other users.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Link: https://lore.kernel.org/r/Zr5L8TUzkJcB9HcF@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+7
+7
drivers/input/evdev.c
··· 498 498 struct input_event event; 499 499 int retval = 0; 500 500 501 + /* 502 + * Limit amount of data we inject into the input subsystem so that 503 + * we do not hold evdev->mutex for too long. 4096 bytes corresponds 504 + * to 170 input events. 505 + */ 506 + count = min(count, 4096); 507 + 501 508 if (count != 0 && count < input_event_size()) 502 509 return -EINVAL; 503 510