]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
genirq/msi: Take the per-device MSI lock before validating the control structure
authorMarc Zyngier <maz@kernel.org>
Mon, 20 Feb 2023 19:01:01 +0000 (19:01 +0000)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:47:37 +0000 (16:47 +0100)
commit2e2e3e3efa2ec8b9cd9c2f43c84574617049c9eb
tree47b3f9f7e63737a3022b80d9b08fbd01e248347a
parent866f59c2e7caa3af6b7c796438166b31b434bfbb
genirq/msi: Take the per-device MSI lock before validating the control structure

BugLink: https://bugs.launchpad.net/bugs/2011425
commit 0af2795f936f1ea1f9f1497447145dfcc7ed2823 upstream.

Calling msi_ctrl_valid() ultimately results in calling
msi_get_device_domain(), which requires holding the device MSI lock.

However, in msi_domain_populate_irqs() the lock is taken right after having
called msi_ctrl_valid(), which is just a tad too late.

Take the lock before invoking msi_ctrl_valid().

Fixes: 40742716f294 ("genirq/msi: Make msi_add_simple_msi_descs() device domain aware")
Reported-by: "Russell King (Oracle)" <linux@armlinux.org.uk>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/Y/Opu6ETe3ZzZ/8E@shell.armlinux.org.uk
Link: https://lore.kernel.org/r/20230220190101.314446-1-maz@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
kernel/irq/msi.c