]> www.infradead.org Git - users/dwmw2/linux.git/commit
irqchip/gic-v3-its: Fix potential race condition in its_vlpi_prop_update()
authorHagar Hemdan <hagarhem@amazon.com>
Fri, 31 May 2024 16:21:44 +0000 (16:21 +0000)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 3 Jun 2024 16:20:00 +0000 (18:20 +0200)
commitb97e8a2f7130a4b30d1502003095833d16c028b3
tree1b8acf9649f7886913a32c9ed40fbb28576c3598
parente306a894bd511804ba9db7c00ca9cc05b55df1f2
irqchip/gic-v3-its: Fix potential race condition in its_vlpi_prop_update()

its_vlpi_prop_update() calls lpi_write_config() which obtains the
mapping information for a VLPI without lock held. So it could race
with its_vlpi_unmap().

Since all calls from its_irq_set_vcpu_affinity() require the same
lock to be held, hoist the locking there instead of sprinkling the
locking all over the place.

This bug was discovered using Coverity Static Analysis Security Testing
(SAST) by Synopsys, Inc.

[ tglx: Use guard() instead of goto ]

Fixes: 015ec0386ab6 ("irqchip/gic-v3-its: Add VLPI configuration handling")
Suggested-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Hagar Hemdan <hagarhem@amazon.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240531162144.28650-1-hagarhem@amazon.com
drivers/irqchip/irq-gic-v3-its.c