Mathias Krause fbf8d71742 Input: synaptics-rmi4 - fix UAF of IRQ domain on driver removal
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>
2024-03-07 15:29:52 -08:00
..
2023-06-29 11:00:17 -07:00
2023-08-19 17:31:46 +02:00
2023-06-29 08:09:31 -06:00
2023-08-12 02:36:28 +03:00
2023-08-07 00:01:41 +05:30
2023-07-12 11:56:22 -07:00
2023-08-24 19:10:53 -07:00
2023-07-03 10:55:04 -07:00
2023-08-11 12:14:08 -07:00
2023-06-15 13:42:18 +02:00
2023-08-11 09:39:17 -07:00
2023-07-05 12:55:06 -07:00
2023-07-03 17:03:05 -07:00
2023-06-29 15:22:19 -07:00
2023-07-03 10:43:10 -07:00
2023-08-27 07:33:54 -07:00
2023-07-30 11:47:56 -07:00
2023-07-08 12:35:18 -07:00
2023-06-29 15:22:19 -07:00
2023-06-30 15:22:09 -07:00
2023-07-27 07:53:12 +02:00