linux-stable/drivers/input
Evan Green b0dd6a2425 Input: synaptics-rmi4 - avoid processing unknown IRQs
commit 363c53875a upstream.

rmi_process_interrupt_requests() calls handle_nested_irq() for
each interrupt status bit it finds. If the irq domain mapping for
this bit had not yet been set up, then it ends up calling
handle_nested_irq(0), which causes a NULL pointer dereference.

There's already code that masks the irq_status bits coming out of the
hardware with current_irq_mask, presumably to avoid this situation.
However current_irq_mask seems to more reflect the actual mask set
in the hardware rather than the IRQs software has set up and registered
for. For example, in rmi_driver_reset_handler(), the current_irq_mask
is initialized based on what is read from the hardware. If the reset
value of this mask enables IRQs that Linux has not set up yet, then
we end up in this situation.

There appears to be a third unused bitmask that used to serve this
purpose, fn_irq_bits. Use that bitmask instead of current_irq_mask
to avoid calling handle_nested_irq() on IRQs that have not yet been
set up.

Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-by: Andrew Duggan <aduggan@synaptics.com>
Link: https://lore.kernel.org/r/20191008223657.163366-1-evgreen@chromium.org
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-29 09:19:51 +01:00
..
gameport Input: stop telling users to snail-mail Vojtech 2018-07-26 17:04:37 -07:00
joystick Input: iforce - add sanity checks 2019-08-25 10:47:49 +02:00
keyboard Input: imx_keypad - make sure keyboard can always wake up system 2019-07-14 08:11:09 +02:00
misc Input: da9063 - fix capability and drop KEY_SLEEP 2019-10-29 09:19:51 +01:00
mouse Input: elan_i2c - remove Lenovo Legion Y7000 PnpID 2019-09-21 07:16:41 +02:00
rmi4 Input: synaptics-rmi4 - avoid processing unknown IRQs 2019-10-29 09:19:51 +01:00
serio Input: hyperv-keyboard: Use in-place iterator API in the channel callback 2019-09-10 10:33:49 +01:00
tablet Input: kbtab - sanity check for endpoint type 2019-08-25 10:47:49 +02:00
touchscreen Input: usbtouchscreen - initialize PM mutex before using it 2019-08-16 10:12:39 +02:00
apm-power.c
evbug.c Input: stop telling users to snail-mail Vojtech 2018-07-26 17:04:37 -07:00
evdev.c Input: evdev - add a schedule point in evdev_write() 2018-10-05 11:42:31 -07:00
ff-core.c
ff-memless.c
input-compat.c
input-compat.h
input-leds.c treewide: Use struct_size() for kmalloc()-family 2018-06-06 11:15:43 -07:00
input-mt.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2018-06-27 09:16:53 -07:00
input-polldev.c
input.c Input: do not use WARN() in input_alloc_absinfo() 2018-08-08 11:23:47 -07:00
joydev.c
Kconfig docs: fix broken references with multiple hints 2018-06-15 18:10:01 -03:00
Makefile
matrix-keymap.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
mousedev.c Input: mousedev - add a schedule point in mousedev_write() 2018-10-04 17:42:26 -07:00
sparse-keymap.c