kernel_samsung_a53x/drivers/input/misc
Dmitry Torokhov 5bf3db8b83 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-11-23 23:21:06 +01:00
..
hall
88pm80x_onkey.c
88pm860x_onkey.c
ab8500-ponkey.c
ad714x-i2c.c
ad714x-spi.c
ad714x.c
ad714x.h
adxl34x-i2c.c
adxl34x-spi.c
adxl34x.c
adxl34x.h
apanel.c
arizona-haptics.c
ati_remote2.c
atlas_btns.c
atmel_captouch.c
axp20x-pek.c
bma150.c
cm109.c
cma3000_d0x.c
cma3000_d0x.h
cma3000_d0x_i2c.c
cobalt_btns.c
cpcap-pwrbutton.c
da9052_onkey.c
da9055_onkey.c
da9063_onkey.c
dm355evm_keys.c
drv260x.c
drv2665.c
drv2667.c
e3x0-button.c
gpio-beeper.c
gpio-vibra.c
gpio_decoder.c
hisi_powerkey.c
hp_sdc_rtc.c
ideapad_slidebar.c
ims-pcu.c
iqs269a.c
ixp4xx-beeper.c
Kconfig
keyspan_remote.c
kxtj9.c
m68kspkr.c
Makefile
max8925_onkey.c
max8997_haptic.c
max77650-onkey.c
max77693-haptic.c
mc13783-pwrbutton.c
mma8450.c
palmas-pwrbutton.c
pcap_keys.c
pcf8574_keypad.c
pcf50633-input.c
pcspkr.c
pm8xxx-vibrator.c Input: pm8xxx-vibrator - correct VIB_MAX_LEVELS calculation 2024-11-19 12:27:05 +01:00
pm8941-pwrkey.c
pmic8xxx-pwrkey.c
powermate.c
pwm-beeper.c
pwm-vibra.c
rave-sp-pwrbutton.c
rb532_button.c
regulator-haptic.c
retu-pwrbutton.c
rk805-pwrkey.c
rotary_encoder.c
sc27xx-vibra.c
sgi_btns.c
sirfsoc-onkey.c
soc_button_array.c
sparcspkr.c
stpmic1_onkey.c
tps65218-pwrbutton.c
twl4030-pwrbutton.c
twl4030-vibra.c
twl6040-vibra.c
uinput.c Input: uinput - reject requests with unreasonable number of slots 2024-11-23 23:21:06 +01:00
wistron_btns.c
wm831x-on.c
xen-kbdfront.c
yealink.c
yealink.h