linux/drivers/input/touchscreen
Dmitry Torokhov a5fd88a5d6 Input: atmel_mxt_ts - check mem_size before calculating config memory size
In mxt_update_cfg(), the driver calculates the memory size needed to store
the configuration as data->mem_size - cfg.start_ofs. If data->mem_size is
less than or equal to cfg.start_ofs, this calculation will underflow or
result in a zero-size buffer, neither of which is valid for a configuration
update.

Add a check to return -EINVAL if data->mem_size is too small. While at it,
change the types of start_ofs and mem_size in struct mxt_cfg to u16 to
match the device address space.

Assisted-by: Gemini:gemini-3.1-pro
Link: https://patch.msgid.link/20260504185448.4055973-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-05-07 10:09:54 -07:00
..
88pm860x-ts.c
Kconfig Input: mk712 - remove driver 2026-04-08 07:55:25 -07:00
Makefile Input: mk712 - remove driver 2026-04-08 07:55:25 -07:00
ad7877.c Input: ad7877 - use guard notation when acquiring mutexes/locks 2026-03-24 21:14:18 -07:00
ad7879-i2c.c
ad7879-spi.c
ad7879.c Input: ad7879 - use guard notation when acquiring mutexes 2026-03-24 21:14:19 -07:00
ad7879.h
ads7846.c Input: ads7846 - switch to using cleanup functions 2026-03-24 21:14:20 -07:00
apple_z2.c Input: apple_z2 - fix reading incorrect reports after exiting sleep 2025-12-18 12:17:10 -08:00
ar1021_i2c.c
atmel_mxt_ts.c Input: atmel_mxt_ts - check mem_size before calculating config memory size 2026-05-07 10:09:54 -07:00
auo-pixcir-ts.c Input: auo-pixcir-ts - use guard notation when acquiring mutexes 2026-03-24 21:14:21 -07:00
bcm_iproc_tsc.c
bu21013_ts.c
bu21029_ts.c Input: bu21029_ts - use guard notation when acquiring mutex 2026-03-24 21:14:21 -07:00
chipone_icn8318.c Input: chipone_icn8318 - use guard notation when acquiring mutex 2026-03-24 21:14:22 -07:00
chipone_icn8505.c
colibri-vf50-ts.c
cy8ctma140.c
cy8ctmg110_ts.c
cyttsp5.c
cyttsp_core.c Input: cyttsp - use guard notation when acquiring mutex 2026-03-24 21:14:23 -07:00
cyttsp_core.h
cyttsp_i2c.c
cyttsp_spi.c
da9034-ts.c
da9052_tsi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dynapro.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
edt-ft5x06.c Input: edt-ft5x06 - fix use-after-free in debugfs teardown 2026-04-19 17:54:06 -07:00
eeti_ts.c Input: eeti_ts - use guard notation when acquiring mutexes 2026-03-24 21:14:24 -07:00
egalax_ts.c
egalax_ts_serial.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ektf2127.c Input: ektf2127 - use guard notation when acquiring mutex 2026-03-24 21:14:24 -07:00
elants_i2c.c Input: elants_i2c - switch to using cleanup facilities 2026-03-24 21:14:25 -07:00
elo.c Input: elo - use guard notation when acquiring mutex 2026-03-24 21:14:26 -07:00
exc3000.c Input: exc3000 - use guard notation when acquiring mutex 2026-03-24 21:14:26 -07:00
fsl-imx25-tcq.c
fujitsu_ts.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
goodix.c
goodix.h
goodix_berlin.h
goodix_berlin_core.c Input: goodix-berlin - report a resolution of 10 units/mm 2026-03-25 09:08:17 -07:00
goodix_berlin_i2c.c
goodix_berlin_spi.c
goodix_fwupload.c Input: goodix - switch to using cleanup functions in firmware code 2026-03-24 21:14:27 -07:00
gunze.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hampshire.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hideep.c Input: hideep - switch to using cleanup functions 2026-03-24 21:14:49 -07:00
himax_hx852x.c
himax_hx83112b.c
hp680_ts_input.c
htcpen.c
hycon-hy46xx.c Input: hycon-hy46xx - use guard notation when acquiring mutex 2026-03-24 21:14:49 -07:00
hynitron-cst816x.c
hynitron_cstxxx.c
ili210x.c Input: ili210x - add support for polling mode 2026-01-21 16:17:51 -08:00
ilitek_ts_i2c.c Input: ilitek_ts_i2c - switch mdelay() to fsleep() 2025-12-18 21:46:55 -08:00
imagis.c Input: imagis - use guard notation when acquiring mutex 2026-03-24 21:14:50 -07:00
imx6ul_tsc.c Input: imx6ul_tsc - use guard notation when acquiring mutex 2026-03-24 21:14:50 -07:00
inexio.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ipaq-micro-ts.c Input: ipaq-micro-ts - use guard notation when acquiring mutex/spinlock 2026-03-24 21:14:51 -07:00
iqs5xx.c Input: iqs5xx - simplify parsing of firmware blob 2026-03-24 21:14:52 -07:00
iqs7211.c Input: iqs7211 - use cleanup facility for fwnodes 2026-03-24 21:14:53 -07:00
jornada720_ts.c
lpc32xx_ts.c Input: lpc32xx_ts - use guard notation when acquiring mutex 2026-03-24 21:14:53 -07:00
mainstone-wm97xx.c
max11801_ts.c
mc13783_ts.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
melfas_mip4.c Input: melfas_mip4 - switch to using cleanup functions 2026-03-24 21:14:54 -07:00
migor_ts.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mms114.c Input: mms114 - use guard notation when acquiring mutex 2026-03-24 21:14:55 -07:00
msg2638.c Input: msg2638 - use guard notation when acquiring mutex 2026-03-24 21:14:56 -07:00
mtouch.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mxs-lradc-ts.c Input: mxs-lradc-ts - use guard notation when acquiring spinlock 2026-03-25 07:53:57 -07:00
novatek-nvt-ts.c Input: novatek-nvt-ts - use guard notation when acquiring mutex 2026-03-25 07:53:58 -07:00
pcap_ts.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
penmount.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pixcir_i2c_ts.c Input: pixcir_i2c_ts - use guard notation when acquiring mutex 2026-03-25 07:53:58 -07:00
raspberrypi-ts.c
raydium_i2c_ts.c Input: raydium_i2c_ts - switch to using cleanup functions 2026-03-25 07:53:58 -07:00
resistive-adc-touch.c
rohm_bu21023.c
s6sy761.c
silead.c
sis_i2c.c
st1232.c Input: st1232 - expose firmware version via sysfs 2026-02-17 23:04:43 -08:00
stmfts.c Input: stmfts - use guard notation when acquiring mutex 2026-03-25 07:53:58 -07:00
stmpe-ts.c
sun4i-ts.c
sur40.c Input: sur40 - use guard notation when acquiring spinlock 2026-03-25 07:53:59 -07:00
surface3_spi.c
sx8654.c Input: sx8654 - use IRQF_NOAUTOEN when requesting interrupt 2026-03-25 07:53:59 -07:00
ti_am335x_tsc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
touchit213.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
touchright.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
touchwin.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tps6507x-ts.c
ts4800-ts.c
tsc40.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tsc200x-core.c
tsc200x-core.h
tsc2004.c
tsc2005.c
tsc2007.h
tsc2007_core.c Input: tsc2007 - use guard notation when acquiring mutexes 2026-03-25 07:53:59 -07:00
tsc2007_iio.c Input: tsc2007 - use guard notation when acquiring mutexes 2026-03-25 07:53:59 -07:00
usbtouchscreen.c Input: usbtouchscreen - clamp NEXIO data_len/x_len to URB buffer size 2026-04-26 21:00:25 -07:00
wacom_i2c.c
wacom_w8001.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
wdt87xx_i2c.c Input: wdt87xx_i2c - switch to using cleanup functions 2026-03-25 07:53:59 -07:00
wm97xx-core.c Input: wm97xx - use guard notation when acquiring mutex 2026-03-25 07:54:00 -07:00
wm831x-ts.c
wm9705.c
wm9712.c
wm9713.c
zet6223.c
zforce_ts.c
zinitix.c Input: zinitix - use guard notation when acquiring mutex 2026-03-25 07:54:00 -07:00