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: <20071221003035.GA10123@elte.hu>
Date:	Fri, 21 Dec 2007 01:30:35 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	trond.myklebust@....uio.no, tglx@...utronix.de, mingo@...hat.com,
	hpa@...or.com, linux-kernel@...r.kernel.org
Subject: Re: Linux 2.6.24-rc5 x86 architecture no longer Oopses...


* Andrew Morton <akpm@...ux-foundation.org> wrote:

> On Fri, 21 Dec 2007 00:47:59 +0100
> Ingo Molnar <mingo@...e.hu> wrote:
> 
> > >  		__raw_spin_lock(&die.lock);
> > >  		raw_local_save_flags(flags);
> > > -		die.lock_owner = smp_processor_id();
> > > +		die.lock_owner = raw_smp_processor_id();
> > 
> > we just disabled irqs with raw_local_save_flags().
> 
> <chases x86 spaghetti for a while>
> 
> raw_local_save_flags() doesn't disable interrupts?

argh. Indeed! (I wanted us to fix that misleading name eons ago, to 
*_save_flags_only(), but some stupid bikeshed painting discussion 
prevented it from ever happening.)

that should have been raw_local_irq_save(flags)!

but ... why is it done like that? Why do we first take the die.lock and 
disable interrupts afterwards? It's highly weird. 64-bit does it all 
correctly in traps_64.c, so unification will help us out - but so far 
perhaps the patch below we should do in 2.6.24?

	Ingo

------------>
Subject: x86: fix die() to not be preemptible
From: Ingo Molnar <mingo@...e.hu>

Andrew "Eagle Eye" Morton noticed that we use raw_local_save_flags()
instead of raw_local_irq_save(flags) in die().

do it correctly - and first disable interrupts, then take the spinlock.

Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
 arch/x86/kernel/traps_32.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Index: linux-x86.q/arch/x86/kernel/traps_32.c
===================================================================
--- linux-x86.q.orig/arch/x86/kernel/traps_32.c
+++ linux-x86.q/arch/x86/kernel/traps_32.c
@@ -373,14 +373,13 @@ void die(const char * str, struct pt_reg
 
 	if (die.lock_owner != raw_smp_processor_id()) {
 		console_verbose();
+		raw_local_irq_save(flags);
 		__raw_spin_lock(&die.lock);
-		raw_local_save_flags(flags);
 		die.lock_owner = smp_processor_id();
 		die.lock_owner_depth = 0;
 		bust_spinlocks(1);
-	}
-	else
-		raw_local_save_flags(flags);
+	} else
+		raw_local_irq_save(flags);
 
 	if (++die.lock_owner_depth < 3) {
 		unsigned long esp;
--
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