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

BugLink: https://bugs.launchpad.net/bugs/2011425
commit b06730a571a9ff1ba5bd6b20bf9e50e5a12f1ec6 upstream.

The sanity check for an already mapped virq is done outside of the
irq_domain_mutex-protected section which means that an (unlikely) racing
association may not be detected.

Fix this by factoring out the association implementation, which will
also be used in a follow-on change to fix a shared-interrupt mapping
race.

Fixes: ddaf144c61da ("irqdomain: Refactor irq_domain_associate_many()")
Cc: stable@vger.kernel.org # 3.11
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-2-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