public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/13] futex: Use smp_store_release() in mark_wake_futex()
@ 2021-03-28 20:40 Ben Hutchings
  2021-03-28 20:41 ` [PATCH 02/13] futex,rt_mutex: Introduce rt_mutex_init_waiter() Ben Hutchings
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Ben Hutchings @ 2021-03-28 20:40 UTC (permalink / raw)
  To: stable; +Cc: Lee Jones, Luis Claudio R. Goncalves, Florian Fainelli

[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]

From: Peter Zijlstra <peterz@infradead.org>

commit 1b367ece0d7e696cab1c8501bab282cc6a538b3f upstream.

Since the futex_q can dissapear the instruction after assigning NULL,
this really should be a RELEASE barrier. That stops loads from hitting
dead memory too.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: juri.lelli@arm.com
Cc: bigeasy@linutronix.de
Cc: xlpang@redhat.com
Cc: rostedt@goodmis.org
Cc: mathieu.desnoyers@efficios.com
Cc: jdesfossez@efficios.com
Cc: dvhart@infradead.org
Cc: bristot@redhat.com
Link: http://lkml.kernel.org/r/20170322104151.604296452@infradead.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 kernel/futex.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index 796b1c860839..e112a9d4c84f 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1565,8 +1565,7 @@ static void mark_wake_futex(struct wake_q_head *wake_q, struct futex_q *q)
 	 * memory barrier is required here to prevent the following
 	 * store to lock_ptr from getting ahead of the plist_del.
 	 */
-	smp_wmb();
-	q->lock_ptr = NULL;
+	smp_store_release(&q->lock_ptr, NULL);
 }
 
 /*


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-03-29  5:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-28 20:40 [PATCH 01/13] futex: Use smp_store_release() in mark_wake_futex() Ben Hutchings
2021-03-28 20:41 ` [PATCH 02/13] futex,rt_mutex: Introduce rt_mutex_init_waiter() Ben Hutchings
2021-03-28 20:41 ` [PATCH 03/13] futex: Rework futex_lock_pi() to use rt_mutex_*_proxy_lock() Ben Hutchings
2021-03-28 20:41 ` [PATCH 04/13] futex: Drop hb->lock before enqueueing on the rtmutex Ben Hutchings
2021-03-28 20:42 ` [PATCH 05/13] futex: Avoid freeing an active timer Ben Hutchings
2021-03-28 20:42 ` [PATCH 06/13] futex,rt_mutex: Fix rt_mutex_cleanup_proxy_lock() Ben Hutchings
2021-03-28 20:42 ` [PATCH 07/13] futex: Handle early deadlock return correctly Ben Hutchings
2021-03-28 20:42 ` [PATCH 08/13] futex: Fix (possible) missed wakeup Ben Hutchings
2021-03-28 20:42 ` [PATCH 09/13] locking/futex: Allow low-level atomic operations to return -EAGAIN Ben Hutchings
2021-03-28 20:42 ` [PATCH 10/13] arm64: futex: Bound number of LDXR/STXR loops in FUTEX_WAKE_OP Ben Hutchings
2021-03-28 20:42 ` [PATCH 11/13] futex: Prevent robust futex exit race Ben Hutchings
2021-03-28 20:43 ` [PATCH 12/13] futex: Fix incorrect should_fail_futex() handling Ben Hutchings
2021-03-28 20:43 ` [PATCH 13/13] futex: Handle transient "ownerless" rtmutex state correctly Ben Hutchings
2021-03-29  5:50 ` [PATCH 01/13] futex: Use smp_store_release() in mark_wake_futex() Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox