android_kernel_oneplus_msm8998/arch
Will Deacon 07b1d60d79 arm64: spinlock: Fix theoretical trylock() A-B-A with LSE atomics
[ Upstream commit 202fb4ef81e3ec765c23bd1e6746a5c25b797d0e ]

If the spinlock "next" ticket wraps around between the initial LDR
and the cmpxchg in the LSE version of spin_trylock, then we can erroneously
think that we have successfuly acquired the lock because we only check
whether the next ticket return by the cmpxchg is equal to the owner ticket
in our updated lock word.

This patch fixes the issue by performing a full 32-bit check of the lock
word when trying to determine whether or not the CASA instruction updated
memory.

Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-30 07:48:56 +02:00
..
alpha futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
arc futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
arm ARM: 8772/1: kprobes: Prohibit kprobes on get_user functions 2018-05-26 08:48:57 +02:00
arm64 arm64: spinlock: Fix theoretical trylock() A-B-A with LSE atomics 2018-05-30 07:48:56 +02:00
avr32
blackfin pinctrl: adi2: Fix Kconfig build problem 2017-12-20 10:05:00 +01:00
c6x c6x/ptrace: Remove useless PTRACE_SETREGSET implementation 2017-03-31 09:49:53 +02:00
cris cris: Only build flash rescue image if CONFIG_ETRAX_AXISFLASHMAP is selected 2017-01-12 11:22:48 +01:00
frv futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
h8300 h8300/ptrace: Fix incorrect register transfer count 2017-03-31 09:49:53 +02:00
hexagon futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
ia64 futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
m32r
m68k m68k: Fix ndelay() macro 2016-12-15 08:49:23 -08:00
metag metag/uaccess: Check access_ok in strncpy_from_user 2017-05-25 14:30:16 +02:00
microblaze futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
mips MIPS: TXx9: use IS_BUILTIN() for CONFIG_LEDS_CLASS 2018-05-30 07:48:56 +02:00
mn10300 mn10300/misalignment: Use SIGSEGV SEGV_MAPERR to report a failed user copy 2018-02-16 20:09:47 +01:00
nios2 nios2: reserve boot memory for device tree 2017-04-12 12:38:34 +02:00
openrisc signal/openrisc: Fix do_unaligned_access to send the proper signal 2018-02-16 20:09:46 +01:00
parisc futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
powerpc powerpc/numa: Ensure nodes initialized for hotplug 2018-05-30 07:48:54 +02:00
s390 s390: use expoline thunks in the BPF JIT 2018-05-26 08:48:59 +02:00
score
sh futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
sparc futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
tile futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
um um: Use POSIX ucontext_t instead of struct ucontext 2018-04-24 09:32:08 +02:00
unicore32
x86 x86/power: Fix swsusp_arch_resume prototype 2018-05-30 07:48:55 +02:00
xtensa futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
.gitignore
Kconfig