[PATCH v2] irqchip/gic-v3-its: Fix potential race condition in its_vlpi_prop_update()

Marc Zyngier maz at kernel.org
Fri May 31 02:27:04 PDT 2024


On Fri, 31 May 2024 08:43:02 +0100,
Hagar Hemdan <hagarhem at amazon.com> wrote:
> 
> 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. So instead of peppering the locking all over the
> place, we hoist the locking into its_irq_set_vcpu_affinity().
> 
> This bug was discovered and resolved using Coverity Static Analysis
> Security Testing (SAST) by Synopsys, Inc.
> 
> Fixes: 015ec0386ab6 ("irqchip/gic-v3-its: Add VLPI configuration handling")
> Signed-off-by: Hagar Hemdan <hagarhem at amazon.com>

Given that you have lifted both my proposed patch and part of my
reply as a commit message, you may at least credit me with a
Suggested-by: tag. Not to mention that the blatant advertising doesn't
really apply in this case.

> ---
> v2: moved the lock to its_irq_set_vcpu_affinity().
> Only compile-tested, no access to HW.

Was the initial patch tested at all?

	M.

-- 
Without deviation from the norm, progress is not possible.



More information about the linux-arm-kernel mailing list