Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b367ece authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Thomas Gleixner
Browse files

futex: Use smp_store_release() in mark_wake_futex()



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: default avatarPeter 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: default avatarThomas Gleixner <tglx@linutronix.de>
parent 499f5aca
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1290,8 +1290,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);
}

static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *top_waiter,