Patch "irqdomain: Fix disassociation race" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    irqdomain: Fix disassociation race

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     irqdomain-fix-disassociation-race.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 3f883c38f5628f46b30bccf090faec054088e262 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan+linaro@xxxxxxxxxx>
Date: Mon, 13 Feb 2023 11:42:44 +0100
Subject: irqdomain: Fix disassociation race

From: Johan Hovold <johan+linaro@xxxxxxxxxx>

commit 3f883c38f5628f46b30bccf090faec054088e262 upstream.

The global irq_domain_mutex is held when mapping interrupts from
non-hierarchical domains but currently not when disposing them.

This specifically means that updates of the domain mapcount is racy
(currently only used for statistics in debugfs).

Make sure to hold the global irq_domain_mutex also when disposing
mappings from non-hierarchical domains.

Fixes: 9dc6be3d4193 ("genirq/irqdomain: Add map counter")
Cc: stable@xxxxxxxxxxxxxxx      # 4.13
Tested-by: Hsin-Yi Wang <hsinyi@xxxxxxxxxxxx>
Tested-by: Mark-PK Tsai <mark-pk.tsai@xxxxxxxxxxxx>
Signed-off-by: Johan Hovold <johan+linaro@xxxxxxxxxx>
Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20230213104302.17307-3-johan+linaro@xxxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 kernel/irq/irqdomain.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -538,6 +538,9 @@ static void irq_domain_disassociate(stru
 		return;
 
 	hwirq = irq_data->hwirq;
+
+	mutex_lock(&irq_domain_mutex);
+
 	irq_set_status_flags(irq, IRQ_NOREQUEST);
 
 	/* remove chip and handler */
@@ -557,6 +560,8 @@ static void irq_domain_disassociate(stru
 
 	/* Clear reverse map for this hwirq */
 	irq_domain_clear_mapping(domain, hwirq);
+
+	mutex_unlock(&irq_domain_mutex);
 }
 
 static int irq_domain_associate_locked(struct irq_domain *domain, unsigned int virq,


Patches currently in stable-queue which might be from johan+linaro@xxxxxxxxxx are

queue-6.1/rtc-pm8xxx-fix-set-alarm-race.patch
queue-6.1/irqdomain-fix-association-race.patch
queue-6.1/pci-qcom-fix-host-init-error-handling.patch
queue-6.1/irqdomain-fix-domain-registration-race.patch
queue-6.1/irqdomain-drop-bogus-fwspec-mapping-error-handling.patch
queue-6.1/irqdomain-fix-mapping-creation-race.patch
queue-6.1/drm-panel-edp-fix-name-for-ivo-product-id-854b.patch
queue-6.1/irqdomain-refactor-__irq_domain_alloc_irqs.patch
queue-6.1/irqdomain-fix-disassociation-race.patch
queue-6.1/irqdomain-look-for-existing-mapping-only-once.patch
queue-6.1/arm64-dts-qcom-sc8280xp-correct-spmi-bus-address-cel.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux