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-next>] [day] [month] [year] [list]
Date:	Mon, 10 Sep 2012 00:55:27 +0530
From:	raghu.prabhu13@...il.com
To:	jeremy@...p.org, mingo@...hat.com, x86@...nel.org
Cc:	Raghavendra D Prabhu <rprabhu@...hang.net>,
	Thomas Gleixner <tglx@...utronix.de> (maintainer:X86
	ARCHITECTURE...,commit_signer:2/11=18%),
	"H. Peter Anvin" <hpa@...or.com> (maintainer:X86 ARCHITECTURE...),
	liu chuansheng <chuansheng.liu@...el.com> (commit_signer:2/11=18%),
	Fernando Luis Vazquez Cao <fernando@....ntt.co.jp> (commit_signer:2/11=18%),
	Paul Gortmaker <paul.gortmaker@...driver.com> (commit_signer:1/11=9%),
	linux-kernel@...r.kernel.org (open list)
Subject: [PATCH] IRQ: Add a check for uninitialized irqs.

From: Raghavendra D Prabhu <rprabhu@...hang.net>

Errors like "do_IRQ: 0.84 No Irq handler for vector (irq -1)" have been reported
earlier filling up the console/logs. So this adds a condition to check for
uninitialized irqs so that it exits early and doesn't proceed further. Also, irq
is made a signed integer, since if it is not mapped to a vector, it will be
assigned -1 which will be UINT_MAX otherwise.

Signed-off-by: Raghavendra D Prabhu <rprabhu@...hang.net>
---
 arch/x86/kernel/irq.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index d44f782..ddba63a 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -184,21 +184,24 @@ unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
 
 	/* high bit used in ret_from_ code  */
 	unsigned vector = ~regs->orig_ax;
-	unsigned irq;
+	int irq;
 
 	irq_enter();
 	exit_idle();
 
-	irq = __this_cpu_read(vector_irq[vector]);
+	if (unlikely((irq = __this_cpu_read(vector_irq[vector])) == -1)) {
+		pr_emerg_ratelimited("IRQ handler not setup for vector %u", vector);
+		goto err_exit;
+	}
 
 	if (!handle_irq(irq, regs)) {
 		ack_APIC_irq();
 
-		if (printk_ratelimit())
-			pr_emerg("%s: %d.%d No irq handler for vector (irq %d)\n",
-				__func__, smp_processor_id(), vector, irq);
+		pr_emerg_ratelimited("%s: %d.%d No irq handler for vector (irq %u)\n",
+			__func__, smp_processor_id(), vector, irq);
 	}
 
+err_exit:
 	irq_exit();
 
 	set_irq_regs(old_regs);
-- 
1.7.12

--
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