Re: [Bugfix v2 3/5] x86/irq: Fix a race window in x86_vector_free_irqs()
From: Thomas Gleixner
Date: Tue Dec 29 2015 - 08:41:12 EST
On Wed, 23 Dec 2015, Jiang Liu wrote:
> void init_irq_alloc_info(struct irq_alloc_info *info,
> @@ -279,18 +272,21 @@ static void x86_vector_free_irqs(struct irq_domain *domain,
> unsigned int virq, unsigned int nr_irqs)
> {
> struct irq_data *irq_data;
> + unsigned long flags;
> int i;
>
> for (i = 0; i < nr_irqs; i++) {
> irq_data = irq_domain_get_irq_data(x86_vector_domain, virq + i);
> if (irq_data && irq_data->chip_data) {
> + raw_spin_lock_irqsave(&vector_lock, flags);
> clear_irq_vector(virq + i, irq_data->chip_data);
> free_apic_chip_data(irq_data->chip_data);
> + irq_domain_reset_irq_data(irq_data);
> + raw_spin_unlock_irqrestore(&vector_lock, flags);
We really do not need to free stuff under the vector lock.
lock();
data = irq_data->chip_data;
irq_domain_reset_irq_data(irq_data);
unlock();
free_apic_chip_data(data);
Hmm?
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/