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] [day] [month] [year] [list]
Date:	Mon, 08 Jan 2007 15:50:14 -0700
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Andrew Morton <akpm@...l.org>
Cc:	"Linus Torvalds" <torvalds@...l.org>,
	"Tobias Diedrich" <ranma+kernel@...edrich.de>,
	"Adrian Bunk" <bunk@...sta.de>, "Andi Kleen" <ak@...e.de>,
	"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
	"Lu, Yinghai" <yinghai.lu@....com>
Subject: [PATCH] x86_64 ioapic: check_timer_pin Don't add_pin_to_irq if it is already there.

"Lu, Yinghai" <yinghai.lu@....com> writes:

>>Any updates to add_pin_to_irq are wrong.  It works fine.  If there
>>is something wrong we need to fix remove_pin_to_irq.
>
>>What is the problem you see?  Sorry I'm dense at the moment.

> In the check_timer_pin, irq_from_pin could return 0, it mean some entry
> is for IRQ0 already.
> The add_pin_to_irq could add another same entry for it again.

Yep.  My oversight.  Here is the trivial patch to fix it.  I don't
see how we could hit this case but if we are going to allow for it
we should handle it correctly.

Signed-off-by: Eric W. Biederman <ebiederm@...ssion.com>
---
 arch/x86_64/kernel/io_apic.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 4891959..cc8e9a4 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -1687,7 +1687,8 @@ static int check_timer_pin(int apic, int pin)
 	idx = update_irq0_entry(apic, pin);
 
 	/* Add an entry in irq_to_pin */
-	add_pin_to_irq(0, apic, pin);
+	if (irq != 0)
+		add_pin_to_irq(0, apic, pin);
 
 	/* Now setup the irq */
 	setup_IO_APIC_irq(apic, pin, idx, 0);
-- 
1.4.4.1.g278f


-
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