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:	Sat, 21 Mar 2009 16:18:38 GMT
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
	a.p.zijlstra@...llo.nl, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:core/locking] lockdep: fix deadlock in lockdep_trace_alloc, take 2

Commit-ID:  da40a037c5ed51693e739ff9b21e013414244644
Gitweb:     http://git.kernel.org/tip/da40a037c5ed51693e739ff9b21e013414244644
Author:     Peter Zijlstra <a.p.zijlstra@...llo.nl>
AuthorDate: Sat, 21 Mar 2009 13:33:08 +0100
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Sat, 21 Mar 2009 17:15:42 +0100

lockdep: fix deadlock in lockdep_trace_alloc, take 2

Since we now disabled IRQs, checking for IRQs disabled is a bit
pointless, check for it in the saved flags.

Also, add the missing check_flags() check for completeness.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: npiggin@...e.de
Cc: heiko.carstens@...ibm.com
LKML-Reference: <1237638788.4667.263.camel@...top>
Signed-off-by: Ingo Molnar <mingo@...e.hu>


---
 kernel/lockdep.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index c750038..a288ae1 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -2257,7 +2257,7 @@ void trace_softirqs_off(unsigned long ip)
 		debug_atomic_inc(&redundant_softirqs_off);
 }
 
-static void __lockdep_trace_alloc(gfp_t gfp_mask)
+static void __lockdep_trace_alloc(gfp_t gfp_mask, unsigned long flags)
 {
 	struct task_struct *curr = current;
 
@@ -2276,12 +2276,14 @@ static void __lockdep_trace_alloc(gfp_t gfp_mask)
 	if (!(gfp_mask & __GFP_FS))
 		return;
 
-	if (DEBUG_LOCKS_WARN_ON(irqs_disabled()))
+	if (DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags)))
 		return;
 
 	mark_held_locks(curr, RECLAIM_FS);
 }
 
+static void check_flags(unsigned long flags);
+
 void lockdep_trace_alloc(gfp_t gfp_mask)
 {
 	unsigned long flags;
@@ -2290,8 +2292,9 @@ void lockdep_trace_alloc(gfp_t gfp_mask)
 		return;
 
 	raw_local_irq_save(flags);
+	check_flags(flags);
 	current->lockdep_recursion = 1;
-	__lockdep_trace_alloc(gfp_mask);
+	__lockdep_trace_alloc(gfp_mask, flags);
 	current->lockdep_recursion = 0;
 	raw_local_irq_restore(flags);
 }
--
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