anolis-cloud-kernel/drivers/input
shaomingyin 4674a988c2 Input: uinput - reject requests with unreasonable number of slots
ANBZ: #20944

[ 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.

Fixes: CVE-2024-46745
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>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Reviewed-by: Guixin Liu <kanie@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/5253
2025-05-15 02:16:46 +00:00
..
gameport
joystick Input: spaceball - fix parsing of movement data packets 2022-01-05 12:40:33 +01:00
keyboard anolis: keypad: Driver for the Phytium keypad port. 2023-10-07 04:33:07 +00:00
misc Input: uinput - reject requests with unreasonable number of slots 2025-05-15 02:16:46 +00:00
mouse Input: bcm5974 - set missing URB_NO_TRANSFER_DMA_MAP urb flag 2022-06-14 18:32:46 +02:00
rmi4 Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() 2023-12-18 09:43:16 +00:00
serio anolis: input: add phytium ps-2 controller support 2023-10-07 04:37:43 +00:00
tablet Input: aiptek - properly check endpoint type 2022-03-23 09:13:29 +01:00
touchscreen Input: stmfts - do not leave device disabled in stmfts_input_open 2022-06-09 10:21:18 +02:00
Kconfig
Makefile
apm-power.c
evbug.c
evdev.c
ff-core.c
ff-memless.c
input-compat.c
input-compat.h
input-leds.c
input-mt.c
input-polldev.c
input-poller.c
input-poller.h
input.c Input: add bounds checking to input_set_capability() 2022-05-25 09:17:52 +02:00
joydev.c Input: joydev - prevent use of not validated data in JSIOCSBTNMAP ioctl 2021-07-14 16:55:39 +02:00
matrix-keymap.c
mousedev.c
sparse-keymap.c