linux-imx/drivers/input
Dmitry Torokhov a4858b00a1 Input: uinput - reject requests with unreasonable number of slots
[ Upstream commit 206f533a0a ]

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:11:39 +02:00
..
gameport
joystick Input: xpad - add support for ASUS ROG RAIKIRI PRO 2024-07-25 09:50:49 +02:00
keyboard Input: qt1050 - handle CHIP_ID reading error 2024-08-03 08:53:58 +02:00
misc Input: uinput - reject requests with unreasonable number of slots 2024-09-12 11:11:39 +02:00
mouse Revert "Input: bcm5974 - check endpoint type before starting traffic" 2024-08-19 06:04:31 +02:00
rmi4 Input: synaptics-rmi4 - fail probing if memory allocation for "phys" fails 2024-04-13 13:07:33 +02:00
serio Input: i8042 - use new forcenorestore quirk to replace old buggy quirk combination 2024-08-29 17:33:53 +02:00
tablet
tests
touchscreen Input: ili210x - use kvmalloc() to allocate buffer for firmware update 2024-09-12 11:11:31 +02:00
apm-power.c
evbug.c
evdev.c
ff-core.c Input: ff-core - prefer struct_size over open coded arithmetic 2024-07-11 12:49:06 +02:00
ff-memless.c
input-compat.c
input-compat.h
input-core-private.h
input-leds.c
input-mt.c Input: MT - limit max slots 2024-08-29 17:33:59 +02:00
input-poller.c
input-poller.h
input.c Input: try trimming too long modalias strings 2024-06-12 11:11:18 +02:00
joydev.c
Kconfig
Makefile
matrix-keymap.c
mousedev.c
sparse-keymap.c
touchscreen.c
vivaldi-fmap.c