linux-stable/arch/arc
Peter Zijlstra e8708786d4 ARC: Improve cmpxchg syscall implementation
This is used in configs lacking hardware atomics to emulate atomic r-m-w
for user space, implemented by disabling preemption in kernel.

However there are issues in current implementation:

1. Process not terminated if invalid user pointer passed:
   i.e. __get_user() failed.

2. The reason for this patch was __put_user() failure not being handled
   either, specifically for the COW break scenario.
   The zero page is initially wired up and read from __get_user()
   succeeds. A subsequent write by __put_user() induces a
   Protection Violation, but COW can't finish as Linux page fault
   handler is disabled due to preempt disable.
   And what's worse is we silently return the stale value to user space.
   Fix this specific case by re-enabling preemption and explicitly
   fixing up the fault and retrying the whole sequence over.

Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
[vgupta: rewrote the changelog]
2018-07-09 11:22:05 -07:00
..
boot kbuild: mark $(targets) as .SECONDARY and remove .PRECIOUS markers 2018-04-07 19:04:02 +09:00
configs Driver Core updates for 4.16-rc1 2018-02-01 10:00:28 -08:00
include ARC: Enable machine_desc->init_per_cpu for !CONFIG_SMP 2018-06-20 16:12:06 -07:00
kernel ARC: Improve cmpxchg syscall implementation 2018-07-09 11:22:05 -07:00
lib ARC: dw2 unwind: enable cfi pseudo ops in string lib 2016-09-30 14:48:22 -07:00
mm mm: fix races between swapoff and flush dcache 2018-04-05 21:36:26 -07:00
oprofile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
plat-axs10x ARC: [plat-axs103] refactor the quad core DT quirk code 2017-12-20 12:41:45 -08:00
plat-eznps License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
plat-hsdk ARC: [plat-hsdk]: Configure APB GPIO controller on ARC HSDK platform 2018-07-09 11:21:21 -07:00
plat-sim ARC: [plat-sim] Include this platform unconditionally 2017-08-04 13:49:47 +05:30
plat-tb10x arc: select GPIOLIB directly 2016-04-26 14:07:59 +02:00
Kbuild
Kconfig ARC fixes for 4.16-rc4 2018-03-01 14:32:23 -08:00
Kconfig.debug License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile ARC: Explicitly add -mmedium-calls to CFLAGS 2018-06-13 17:46:34 -07:00