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  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:   Tue, 26 Mar 2019 15:30:36 +0900
From:   Greg Kroah-Hartman <>
Cc:     Greg Kroah-Hartman <>,,
        Tetsuo Handa <>,,
        Waiman Long <>,
        "Peter Zijlstra (Intel)" <>,
        Andrew Morton <>,
        Linus Torvalds <>,
        "Paul E. McKenney" <>,
        Thomas Gleixner <>,
        Will Deacon <>,
        Ingo Molnar <>
Subject: [PATCH 5.0 49/52] locking/lockdep: Add debug_locks check in __lock_downgrade()

5.0-stable review patch.  If anyone has any objections, please let me know.


From: Waiman Long <>

commit 71492580571467fb7177aade19c18ce7486267f5 upstream.

Tetsuo Handa had reported he saw an incorrect "downgrading a read lock"
warning right after a previous lockdep warning. It is likely that the
previous warning turned off lock debugging causing the lockdep to have
inconsistency states leading to the lock downgrade warning.

Fix that by add a check for debug_locks at the beginning of

Debugged-by: Tetsuo Handa <>
Reported-by: Tetsuo Handa <>
Signed-off-by: Waiman Long <>
Signed-off-by: Peter Zijlstra (Intel) <>
Cc: Andrew Morton <>
Cc: Linus Torvalds <>
Cc: Paul E. McKenney <>
Cc: Peter Zijlstra <>
Cc: Thomas Gleixner <>
Cc: Will Deacon <>
Signed-off-by: Ingo Molnar <>
Signed-off-by: Greg Kroah-Hartman <>

 kernel/locking/lockdep.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -3535,6 +3535,9 @@ static int __lock_downgrade(struct lockd
 	unsigned int depth;
 	int i;
+	if (unlikely(!debug_locks))
+		return 0;
 	depth = curr->lockdep_depth;
 	 * This function is about (re)setting the class of a held lock,

Powered by blists - more mailing lists