umber-kernel/drivers/input/keyboard
Minseong Kim cffc4e29b1 Input: lkkbd - disable pending work before freeing device
commit e58c88f0cb2d8ed89de78f6f17409d29cfab6c5c upstream.

lkkbd_interrupt() schedules lk->tq via schedule_work(), and the work
handler lkkbd_reinit() dereferences the lkkbd structure and its
serio/input_dev fields.

lkkbd_disconnect() and error paths in lkkbd_connect() free the lkkbd
structure without preventing the reinit work from being queued again
until serio_close() returns. This can allow the work handler to run
after the structure has been freed, leading to a potential use-after-free.

Use disable_work_sync() instead of cancel_work_sync() to ensure the
reinit work cannot be re-queued, and call it both in lkkbd_disconnect()
and in lkkbd_connect() error paths after serio_open().

Signed-off-by: Minseong Kim <ii4gsp@gmail.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251212052314.16139-1-ii4gsp@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-02 12:56:56 +01:00
..
Kconfig Immutable branch between MFD, GPIO, Input, Pinctrl and PWM due for the v6.18 merge window 2025-09-17 14:42:16 -07:00
Makefile Immutable branch between MFD, GPIO, Input, Pinctrl and PWM due for the v6.18 merge window 2025-09-17 14:42:16 -07:00
adc-keys.c
adp5520-keys.c
adp5585-keys.c Input: adp5585: Add Analog Devices ADP5585/89 support 2025-07-01 21:50:51 +01:00
adp5588-keys.c treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
amikbd.c
applespi.c Input updates for v6.13-rc0 2024-11-25 10:31:39 -08:00
applespi.h
applespi_trace.h
atakbd.c
atkbd.c Merge branch 'next' into for-linus 2025-08-06 10:08:54 -07:00
bcm-keypad.c
cap11xx.c
clps711x-keypad.c
cros_ec_keyb.c Linux 6.18-rc6 2025-11-17 23:16:55 -08:00
cypress-sf.c Input: cypress-sf - constify struct i2c_device_id 2024-11-18 19:35:24 -08:00
dlink-dir685-touchkeys.c Input: Use str_enable_disable-like helpers 2025-01-14 13:41:41 -08:00
ep93xx_keypad.c Input updates for v6.13-rc0 2024-11-25 10:31:39 -08:00
goldfish_events.c
gpio_keys.c Input: gpio-keys - fix possible concurrent access in gpio_keys_irq_timer() 2025-05-30 16:15:42 -07:00
gpio_keys_polled.c Input: gpio_keys_polled - avoid using GPIOF_ACTIVE_LOW 2024-11-09 14:55:33 +01:00
hil_kbd.c
hilkbd.c
hpps2atkbd.h
imx-sm-bbm-key.c
imx_keypad.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
imx_sc_key.c Input: imx_sc_key - fix memory corruption on unload 2025-11-04 10:57:36 -08:00
ipaq-micro-keys.c input: ipaq-micro-keys: use devm_kmemdup_array() 2025-02-24 12:08:52 +02:00
iqs62x-keys.c
jornada680_kbd.c
jornada720_kbd.c
lkkbd.c Input: lkkbd - disable pending work before freeing device 2026-01-02 12:56:56 +01:00
lm8323.c Input: Use str_enable_disable-like helpers 2025-01-14 13:41:41 -08:00
lm8333.c
locomokbd.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
lpc32xx-keys.c
maple_keyb.c Input: maple_keyb - use guard notation when acquiring mutex 2024-11-05 14:17:32 -08:00
matrix_keypad.c Input: matrix_keypad - detect change during scan 2025-04-09 14:21:46 -07:00
max7359_keypad.c
max7360-keypad.c input: keyboard: Add support for MAX7360 keypad 2025-09-16 15:24:48 +01:00
mpr121_touchkey.c Input: mpr121 - use devm_regulator_get_enable_read_voltage() 2024-11-19 21:37:41 -08:00
mt6779-keypad.c
mtk-pmic-keys.c Input: mtk-pmic-keys - MT6359 has a specific release irq 2025-09-06 09:24:14 -07:00
newtonkbd.c
nspire-keypad.c
omap-keypad.c
omap4-keypad.c
opencores-kbd.c
pinephone-keyboard.c
pmic8xxx-keypad.c
pxa27x_keypad.c Input: pxa27x-keypad - drop support for platform data 2025-09-08 06:35:37 -07:00
qt1050.c
qt1070.c
qt2160.c
samsung-keypad.c Input: samsung-keypad - use BIT() and GENMASK() where appropriate 2025-07-01 14:31:17 -07:00
sh_keysc.c
snvs_pwrkey.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
spear-keyboard.c Input: spear-keyboard - drop support for platform data 2025-09-08 06:38:01 -07:00
st-keyscan.c
stmpe-keypad.c
stowaway.c
sun4i-lradc-keys.c Input: sun4i-lradc-keys - don't include 'pm_wakeup.h' directly 2024-11-19 21:35:54 -08:00
sunkbd.c
tc3589x-keypad.c
tca8418_keypad.c Input: tca8418_keypad - switch to using module_i2c_driver() 2025-08-12 14:42:28 -07:00
tegra-kbc.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
tm2-touchkey.c
twl4030_keypad.c Input: twl4030_keypad - drop support for platform data 2025-09-17 15:00:02 -07:00
xtkbd.c