]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
irqdomain: Fix disassociation race
authorJohan Hovold <johan+linaro@kernel.org>
Mon, 13 Feb 2023 10:42:44 +0000 (11:42 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:47:31 +0000 (16:47 +0100)
commitf1cb74d2024e1d2602e31f7e44a6d7b6c12ceacd
tree50ead20c2f13ff5098869ed11ba02b3612c7736e
parent4c49a5674f02b42f7fb3f4a0db9907b6175aa1a2
irqdomain: Fix disassociation race

BugLink: https://bugs.launchpad.net/bugs/2011425
commit 3f883c38f5628f46b30bccf090faec054088e262 upstream.

The global irq_domain_mutex is held when mapping interrupts from
non-hierarchical domains but currently not when disposing them.

This specifically means that updates of the domain mapcount is racy
(currently only used for statistics in debugfs).

Make sure to hold the global irq_domain_mutex also when disposing
mappings from non-hierarchical domains.

Fixes: 9dc6be3d4193 ("genirq/irqdomain: Add map counter")
Cc: stable@vger.kernel.org # 4.13
Tested-by: Hsin-Yi Wang <hsinyi@chromium.org>
Tested-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230213104302.17307-3-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
kernel/irq/irqdomain.c