kernel_samsung_a53x/drivers/input/rmi4
Mathias Krause 382027a63c Input: synaptics-rmi4 - fix UAF of IRQ domain on driver removal
commit fbf8d71742557abaf558d8efb96742d442720cc2 upstream.

Calling irq_domain_remove() will lead to freeing the IRQ domain
prematurely. The domain is still referenced and will be attempted to get
used via rmi_free_function_list() -> rmi_unregister_function() ->
irq_dispose_mapping() -> irq_get_irq_data()'s ->domain pointer.

With PaX's MEMORY_SANITIZE this will lead to an access fault when
attempting to dereference embedded pointers, as in Torsten's report that
was faulting on the 'domain->ops->unmap' test.

Fix this by releasing the IRQ domain only after all related IRQs have
been deactivated.

Fixes: 24d28e4f1271 ("Input: synaptics-rmi4 - convert irq distribution to irq_domain")
Reported-by: Torsten Hilbrich <torsten.hilbrich@secunet.com>
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Link: https://lore.kernel.org/r/20240222142654.856566-1-minipli@grsecurity.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:21:49 +01:00
..
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_2d_sensor.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_2d_sensor.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_bus.c Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() 2024-11-18 11:43:07 +01:00
rmi_bus.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_driver.c Input: synaptics-rmi4 - fix UAF of IRQ domain on driver removal 2024-11-23 23:21:49 +01:00
rmi_driver.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_f01.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_f03.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_f3a.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_f11.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_f12.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_f30.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_f34.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_f34.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_f34v7.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_f54.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_f55.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_i2c.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rmi_smbus.c Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport 2024-11-18 10:58:46 +01:00
rmi_spi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00