Re: [PATCH 3/3] genirq/irqdomain: Detect type race in irq_create_fwspec_mapping()

From: Marc Zyngier
Date: Fri Sep 20 2019 - 12:07:31 EST


On 12/09/2019 10:44, Sverdlin, Alexander (Nokia - DE/Ulm) wrote:
> From: Alexander Sverdlin <alexander.sverdlin@xxxxxxxxx>
>
> irq_create_fwspec_mapping() can race with itself during IRQ trigger type
> configuration. Possible scenarios include:
>
> - Mapping exists, two irq_create_fwspec_mapping() running in parallel do
> not detect type mismatch, IRQ remains configured with one of the
> different trigger types randomly
> - Second call to irq_create_fwspec_mapping() sees existing mapping just
> created by first call, but earlier irqd_set_trigger_type() call races
> with later irqd_set_trigger_type() => totally undetected, IRQ type
> is being set randomly to either one or another type

Is that an actual thing? Frankly, the scenario you're describing here
seems to carry the hallmarks of a completely broken system. Can you
point at a system supported in mainline that would behave as such?

Thanks,

M.
--
Jazz is not dead, it just smells funny...