lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220711120626.11492-2-pali@kernel.org>
Date:   Mon, 11 Jul 2022 14:06:25 +0200
From:   Pali Rohár <pali@...nel.org>
To:     Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        Lorenzo Pieralisi <lpieralisi@...nel.org>,
        Rob Herring <robh@...nel.org>,
        Krzysztof Wilczyński <kw@...ux.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Marek Behún <kabel@...nel.org>
Cc:     linux-pci@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] PCI: aardvark: Dispose bridge irq prior to removing bridge domain

Documentation for irq_domain_remove() says that all mapping within the
domain must be disposed prior to domain remove.

Currently bridge irq is not disposed in pci-aardvark.c device unbind callback
which cause that kernel crashes after unloading driver and trying to read
/sys/kernel/debug/irq/irqs/<num> or /proc/interrupts.

Fixes: 815bc3136867 ("PCI: aardvark: Use separate INTA interrupt for emulated root bridge")
Signed-off-by: Pali Rohár <pali@...nel.org>
---
 drivers/pci/controller/pci-aardvark.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
index 6cb65e64859d..8bea5801d50a 100644
--- a/drivers/pci/controller/pci-aardvark.c
+++ b/drivers/pci/controller/pci-aardvark.c
@@ -1479,6 +1479,12 @@ static int advk_pcie_init_rp_irq_domain(struct advk_pcie *pcie)
 
 static void advk_pcie_remove_rp_irq_domain(struct advk_pcie *pcie)
 {
+	int virq;
+
+	virq = irq_find_mapping(pcie->rp_irq_domain, 0);
+	if (virq > 0)
+		irq_dispose_mapping(virq);
+
 	irq_domain_remove(pcie->rp_irq_domain);
 }
 
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ