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]
Date:	Fri, 15 Jun 2012 23:01:34 -0600
From:	Grant Likely <grant.likely@...retlab.ca>
To:	linux-kernel@...r.kernel.org
Cc:	Milton Miller <miltonm@....com>,
	Grant Likely <grant.likely@...retlab.ca>
Subject: [PATCH 09/12] irqdomain: Reserve IRQs for legacy domain

It is really important to make sure irqs used by the legacy domain are
still reserved in the irq_desc subsystem so they don't get allocated
for some other purpose.  Without SPARSE_IRQ, this generally isn't a
problem because it is assumed that all irqs have static assignments
(which isn't actually true, and is part of the reason why SPARSE_IRQ
should really be turned on these days).  However, when SPARSE_IRQs is
turned on, the irq range passed to irq_domain_add_legacy() is not
guaranteed to be reserved.

This patch fixes the problem by unconditionally reserving any irqs
passed into irq_domain_add_legacy().  The irqs may have already been
reserved, so the return code on irq_reserve_irqs() may report a
failure, but it should still be safe.

Signed-off-by: Grant Likely <grant.likely@...retlab.ca>
---
 kernel/irq/irqdomain.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index d6d0de0..c0a00de 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -151,6 +151,13 @@ struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
 	if (!domain)
 		return NULL;
 
+	/*
+	 * Do our best to reserve the irq descs; but this overlaps with the nr_irqs setting
+	 * from the platform code
+	 */
+	if (irq_reserve_irqs(first_irq, size))
+		pr_info("IRQs %i..%i already reserved, overlapping with nr_irqs?\n",
+			first_irq, first_irq + size - 1);
 	WARN_ON(irq_domain_associate_many(domain, first_irq, first_hwirq, size));
 
 	return domain;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ