linux/kernel/locking
Will Deacon 11dc13224c locking/qspinlock: Ensure node->count is updated before initialising node
When queuing on the qspinlock, the count field for the current CPU's head
node is incremented. This needn't be atomic because locking in e.g. IRQ
context is balanced and so an IRQ will return with node->count as it
found it.

However, the compiler could in theory reorder the initialisation of
node[idx] before the increment of the head node->count, causing an
IRQ to overwrite the initialised node and potentially corrupt the lock
state.

Avoid the potential for this harmful compiler reordering by placing a
barrier() between the increment of the head node->count and the subsequent
node initialisation.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1518528177-19169-3-git-send-email-will.deacon@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-02-13 14:50:14 +01:00
..
lockdep_internals.h
lockdep_proc.c
lockdep_states.h
lockdep.c Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-01-30 10:44:56 -08:00
locktorture.c torture: Eliminate torture_runnable and perf_runnable 2017-12-11 09:18:29 -08:00
Makefile
mcs_spinlock.h
mutex-debug.c
mutex-debug.h
mutex.c
mutex.h
osq_lock.c
percpu-rwsem.c
qrwlock.c
qspinlock_paravirt.h locking/pvqspinlock: Implement hybrid PV queued/unfair locks 2017-11-08 10:10:04 +01:00
qspinlock_stat.h
qspinlock.c locking/qspinlock: Ensure node->count is updated before initialising node 2018-02-13 14:50:14 +01:00
rtmutex_common.h futex: Avoid violating the 10th rule of futex 2018-01-14 18:49:16 +01:00
rtmutex-debug.c
rtmutex-debug.h
rtmutex.c futex: Avoid violating the 10th rule of futex 2018-01-14 18:49:16 +01:00
rtmutex.h
rwsem-spinlock.c
rwsem-xadd.c
rwsem.c
rwsem.h
semaphore.c
spinlock_debug.c
spinlock.c locking/core: Remove break_lock field when CONFIG_GENERIC_LOCKBREAK=y 2017-12-12 11:24:01 +01:00
test-ww_mutex.c