Skip to content
Commit fbf8d717 authored by Mathias Krause's avatar Mathias Krause Committed by Dmitry Torokhov
Browse files

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: 24d28e4f

 ("Input: synaptics-rmi4 - convert irq distribution to irq_domain")
Reported-by: default avatarTorsten Hilbrich <torsten.hilbrich@secunet.com>
Signed-off-by: default avatarMathias Krause <minipli@grsecurity.net>
Link: https://lore.kernel.org/r/20240222142654.856566-1-minipli@grsecurity.net
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 963465a3
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment