WSL2-Linux-Kernel/drivers/input
Dmitry Torokhov 9719687398 Input: uinput - reject requests with unreasonable number of slots
[ Upstream commit 206f533a0a7c683982af473079c4111f4a0f9f5e ]

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

When exercising uinput interface syzkaller may try setting up device
with a really large number of slots, which causes memory allocation
failure in input_mt_init_slots(). While this allocation failure is
handled properly and request is rejected, it results in syzkaller
reports. Additionally, such request may put undue burden on the
system which will try to free a lot of memory for a bogus request.

Fix it by limiting allowed number of slots to 100. This can easily
be extended if we see devices that can track more than 100 contacts.

Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reported-by: syzbot <syzbot+0122fa359a69694395d5@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=0122fa359a69694395d5
Link: https://lore.kernel.org/r/Zqgi7NYEbpRsJfa2@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-09-12 11:07:50 +02:00
..
gameport
joystick Input: xpad - add Lenovo Legion Go controllers 2024-03-01 13:21:45 +01:00
keyboard Input: qt1050 - handle CHIP_ID reading error 2024-08-19 05:45:05 +02:00
misc Input: uinput - reject requests with unreasonable number of slots 2024-09-12 11:07:50 +02:00
mouse Input: elan_i2c - do not leave interrupt disabled on suspend failure 2024-08-19 05:45:05 +02:00
rmi4 Input: synaptics-rmi4 - fail probing if memory allocation for "phys" fails 2024-04-13 13:01:44 +02:00
serio Input: i8042 - add Ayaneo Kun to i8042 quirk table 2024-07-27 10:46:11 +02:00
tablet Input: aiptek - properly check endpoint type 2022-03-23 09:16:43 +01:00
touchscreen Input: silead - Always support 10 fingers 2024-07-27 10:46:08 +02:00
Kconfig
Makefile
apm-power.c
evbug.c
evdev.c
ff-core.c Input: ff-core - prefer struct_size over open coded arithmetic 2024-07-18 13:07:28 +02:00
ff-memless.c
input-compat.c
input-compat.h
input-leds.c
input-mt.c Input: MT - limit max slots 2024-09-04 13:23:37 +02:00
input-poller.c
input-poller.h
input.c Input: try trimming too long modalias strings 2024-07-05 09:14:15 +02:00
joydev.c
matrix-keymap.c
mousedev.c
sparse-keymap.c
touchscreen.c