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:   Tue, 9 Oct 2018 04:21:48 -0700
From:   tip-bot for Lance Roy <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     paulmck@...ux.ibm.com, ldr709@...il.com, dvhart@...radead.org,
        tglx@...utronix.de, linux-kernel@...r.kernel.org, mingo@...nel.org,
        hpa@...or.com, peterz@...radead.org
Subject: [tip:locking/core] futex: Replace spin_is_locked() with lockdep

Commit-ID:  4de1a293a08bdf8ec1530e02163930ac86f80ea2
Gitweb:     https://git.kernel.org/tip/4de1a293a08bdf8ec1530e02163930ac86f80ea2
Author:     Lance Roy <ldr709@...il.com>
AuthorDate: Tue, 2 Oct 2018 22:38:57 -0700
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Tue, 9 Oct 2018 13:19:28 +0200

futex: Replace spin_is_locked() with lockdep

lockdep_assert_held() is better suited for checking locking requirements,
since it won't get confused when the lock is held by some other task. This
is also a step towards possibly removing spin_is_locked().

Signed-off-by: Lance Roy <ldr709@...il.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: "Paul E. McKenney" <paulmck@...ux.ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Darren Hart <dvhart@...radead.org>
Link: https://lkml.kernel.org/r/20181003053902.6910-12-ldr709@gmail.com

---
 kernel/futex.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index 11fc3bb456d6..3e2de8fc1891 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1365,9 +1365,9 @@ static void __unqueue_futex(struct futex_q *q)
 {
 	struct futex_hash_bucket *hb;
 
-	if (WARN_ON_SMP(!q->lock_ptr || !spin_is_locked(q->lock_ptr))
-	    || WARN_ON(plist_node_empty(&q->list)))
+	if (WARN_ON_SMP(!q->lock_ptr) || WARN_ON(plist_node_empty(&q->list)))
 		return;
+	lockdep_assert_held(q->lock_ptr);
 
 	hb = container_of(q->lock_ptr, struct futex_hash_bucket, lock);
 	plist_del(&q->list, &hb->chain);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ