From: Sebastian Andrzej Siewior <bige...@linutronix.de>

v4.14.137-rt65-rc1 stable review patch.
If anyone has any objections, please let me know.

-----------


[ Upstream commit 978315462d3ea3cf6cfacd34c563ec1eb02a3aa5 ]

It is possible to ignore the validation for a certain lock by using:

        lockdep_set_novalidate_class()

on it. Each invocation will assign a new name to the class it created
for created __lockdep_no_validate__. That means that once
lockdep_set_novalidate_class() has been used on two locks then
class->name won't match lock->name for the first lock triggering the
warning.

So ignore changed non-matching ->name pointer for the special
__lockdep_no_validate__ class.

Signed-off-by: Sebastian Andrzej Siewior <bige...@linutronix.de>
Cc: Linus Torvalds <torva...@linux-foundation.org>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Thomas Gleixner <t...@linutronix.de>
Cc: Will Deacon <will.dea...@arm.com>
Link: http://lkml.kernel.org/r/20190517212234.32611-1-bige...@linutronix.de
Signed-off-by: Ingo Molnar <mi...@kernel.org>
Signed-off-by: Tom Zanussi <zanu...@kernel.org>
---
 kernel/locking/lockdep.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index e576d234f3ea..f194de27123d 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -719,7 +719,8 @@ look_up_lock_class(struct lockdep_map *lock, unsigned int 
subclass)
                         * Huh! same key, different name? Did someone trample
                         * on some memory? We're most confused.
                         */
-                       WARN_ON_ONCE(class->name != lock->name);
+                       WARN_ON_ONCE(class->name != lock->name &&
+                                    lock->key != &__lockdep_no_validate__);
                        return class;
                }
        }
-- 
2.14.1

Reply via email to