From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:42258 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbdJSNOr (ORCPT ); Thu, 19 Oct 2017 09:14:47 -0400 Subject: Patch "locking/lockdep: Add nest_lock integrity test" has been added to the 4.9-stable tree To: peterz@infradead.org, Nicolai.Haehnle@amd.com, akpm@linux-foundation.org, alexander.levin@verizon.com, boqun.feng@gmail.com, chris@chris-wilson.co.uk, gregkh@linuxfoundation.org, mingo@kernel.org, paulmck@linux.vnet.ibm.com, tglx@linutronix.de, torvalds@linux-foundation.org Cc: , From: Date: Thu, 19 Oct 2017 15:14:25 +0200 Message-ID: <15084188656043@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled locking/lockdep: Add nest_lock integrity test to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: locking-lockdep-add-nest_lock-integrity-test.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Thu Oct 19 15:04:02 CEST 2017 From: Peter Zijlstra Date: Wed, 1 Mar 2017 16:23:30 +0100 Subject: locking/lockdep: Add nest_lock integrity test From: Peter Zijlstra [ Upstream commit 7fb4a2cea6b18dab56d609530d077f168169ed6b ] Boqun reported that hlock->references can overflow. Add a debug test for that to generate a clear error when this happens. Without this, lockdep is likely to report a mysterious failure on unlock. Reported-by: Boqun Feng Signed-off-by: Peter Zijlstra (Intel) Cc: Andrew Morton Cc: Chris Wilson Cc: Linus Torvalds Cc: Nicolai Hähnle Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- kernel/locking/lockdep.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -3260,10 +3260,17 @@ static int __lock_acquire(struct lockdep if (depth) { hlock = curr->held_locks + depth - 1; if (hlock->class_idx == class_idx && nest_lock) { - if (hlock->references) + if (hlock->references) { + /* + * Check: unsigned int references:12, overflow. + */ + if (DEBUG_LOCKS_WARN_ON(hlock->references == (1 << 12)-1)) + return 0; + hlock->references++; - else + } else { hlock->references = 2; + } return 1; } Patches currently in stable-queue which might be from peterz@infradead.org are queue-4.9/sched-fair-update-rq-clock-before-changing-a-task-s-cpu-affinity.patch queue-4.9/locking-lockdep-add-nest_lock-integrity-test.patch