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: <tip-523b113bace5e64e860d8c61d7aa25057d274753@git.kernel.org>
Date:   Wed, 27 Feb 2019 23:04:39 -0800
From:   tip-bot for Bart Van Assche <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     johannes@...solutions.net, longman@...hat.com,
        linux-kernel@...r.kernel.org, hpa@...or.com,
        paulmck@...ux.vnet.ibm.com, mingo@...nel.org, peterz@...radead.org,
        tglx@...utronix.de, torvalds@...ux-foundation.org,
        will.deacon@....com, akpm@...ux-foundation.org, bvanassche@....org
Subject: [tip:locking/core] locking/lockdep: Avoid that add_chain_cache()
 adds an invalid chain to the cache

Commit-ID:  523b113bace5e64e860d8c61d7aa25057d274753
Gitweb:     https://git.kernel.org/tip/523b113bace5e64e860d8c61d7aa25057d274753
Author:     Bart Van Assche <bvanassche@....org>
AuthorDate: Thu, 14 Feb 2019 15:00:39 -0800
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 28 Feb 2019 07:55:40 +0100

locking/lockdep: Avoid that add_chain_cache() adds an invalid chain to the cache

Make sure that add_chain_cache() returns 0 and does not modify the
chain hash if nr_chain_hlocks == MAX_LOCKDEP_CHAIN_HLOCKS before this
function is called.

Signed-off-by: Bart Van Assche <bvanassche@....org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Johannes Berg <johannes@...solutions.net>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Waiman Long <longman@...hat.com>
Cc: Will Deacon <will.deacon@....com>
Cc: johannes.berg@...el.com
Cc: tj@...nel.org
Link: https://lkml.kernel.org/r/20190214230058.196511-5-bvanassche@acm.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 kernel/locking/lockdep.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index ec6f6aff4d8d..21d84510e28f 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -2195,16 +2195,8 @@ static inline int add_chain_cache(struct task_struct *curr,
 			chain_hlocks[chain->base + j] = lock_id;
 		}
 		chain_hlocks[chain->base + j] = class - lock_classes;
-	}
-
-	if (nr_chain_hlocks < MAX_LOCKDEP_CHAIN_HLOCKS)
 		nr_chain_hlocks += chain->depth;
-
-#ifdef CONFIG_DEBUG_LOCKDEP
-	/*
-	 * Important for check_no_collision().
-	 */
-	if (unlikely(nr_chain_hlocks > MAX_LOCKDEP_CHAIN_HLOCKS)) {
+	} else {
 		if (!debug_locks_off_graph_unlock())
 			return 0;
 
@@ -2212,7 +2204,6 @@ static inline int add_chain_cache(struct task_struct *curr,
 		dump_stack();
 		return 0;
 	}
-#endif
 
 	hlist_add_head_rcu(&chain->entry, hash_head);
 	debug_atomic_inc(chain_lookup_misses);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ