android_kernel_motorola_sm6225/drivers/input/rmi4
Evan Green b0dd6a2425 Input: synaptics-rmi4 - avoid processing unknown IRQs
commit 363c53875aef8fce69d4a2d0873919ccc7d9e2ad 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
..
Kconfig Input: synaptics-rmi4 - convert irq distribution to irq_domain 2018-06-05 10:33:35 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rmi_2d_sensor.c Input: synaptics-rmi4 - fix axis-swap behavior 2018-06-11 10:20:16 -07:00
rmi_2d_sensor.h Input: synaptics-rmi4 - add parameters for dribble packets and palm detect gesture 2016-11-08 17:12:07 -08:00
rmi_bus.c Input: synaptics-rmi4 - convert irq distribution to irq_domain 2018-06-05 10:33:35 -07:00
rmi_bus.h Input: synaptics-rmi4 - convert irq distribution to irq_domain 2018-06-05 10:33:35 -07:00
rmi_driver.c Input: synaptics-rmi4 - avoid processing unknown IRQs 2019-10-29 09:19:51 +01:00
rmi_driver.h Input: synaptics_rmi4 - remove unneeded MODULE_VERSION() usage 2018-01-16 16:48:20 -08:00
rmi_f01.c Input: synaptics-rmi4 - convert irq distribution to irq_domain 2018-06-05 10:33:35 -07:00
rmi_f03.c Input: synaptics-rmi4 - convert irq distribution to irq_domain 2018-06-05 10:33:35 -07:00
rmi_f11.c Input: synaptics-rmi4 - write config register values to the right offset 2019-05-02 09:58:55 +02:00
rmi_f12.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
rmi_f30.c Input: synaptics-rmi4 - convert irq distribution to irq_domain 2018-06-05 10:33:35 -07:00
rmi_f34.c Input: synaptics-rmi4 - convert irq distribution to irq_domain 2018-06-05 10:33:35 -07:00
rmi_f34.h Input: synaptics-rmi4 - enable IRQ operation in F34 V7 2017-04-14 14:52:32 -07:00
rmi_f34v7.c Input: synaptics-rmi4 - use %phN to form F34 configuration ID 2017-06-01 22:11:23 -07:00
rmi_f54.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
rmi_f55.c Input: synaptics-rmi4 - propagate correct number of rx and tx electrodes to F54 2016-11-22 17:59:25 -08:00
rmi_i2c.c Input: synaptics_rmi4 - remove unneeded MODULE_VERSION() usage 2018-01-16 16:48:20 -08:00
rmi_smbus.c Input: synaptics-rmi4 - RMI4 can also use SMBUS version 3 2017-11-07 17:45:07 -08:00
rmi_spi.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00