diff options
author | Peter Zijlstra <peterz@infradead.org> | 2019-07-18 15:03:15 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-16 10:13:55 +0200 |
commit | f5aa36e425fbb6dd9a4e1a05ca1a2e0d4652a5ac (patch) | |
tree | dbdce4c96d1c84015369e0a03974cb84ae71811f /kernel | |
parent | 8d4611f342c9ab6341fff0bb4f822f5cde00d6a1 (diff) | |
download | linux-stable-f5aa36e425fbb6dd9a4e1a05ca1a2e0d4652a5ac.tar.gz linux-stable-f5aa36e425fbb6dd9a4e1a05ca1a2e0d4652a5ac.tar.bz2 linux-stable-f5aa36e425fbb6dd9a4e1a05ca1a2e0d4652a5ac.zip |
tty/ldsem, locking/rwsem: Add missing ACQUIRE to read_failed sleep loop
[ Upstream commit 952041a8639a7a3a73a2b6573cb8aa8518bc39f8 ]
While reviewing rwsem down_slowpath, Will noticed ldsem had a copy of
a bug we just found for rwsem.
X = 0;
CPU0 CPU1
rwsem_down_read()
for (;;) {
set_current_state(TASK_UNINTERRUPTIBLE);
X = 1;
rwsem_up_write();
rwsem_mark_wake()
atomic_long_add(adjustment, &sem->count);
smp_store_release(&waiter->task, NULL);
if (!waiter.task)
break;
...
}
r = X;
Allows 'r == 0'.
Reported-by: Will Deacon <will@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Will Deacon <will@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 4898e640caf0 ("tty: Add timed, writer-prioritized rw semaphore")
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions