ARM: remove user cmpxchg syscall
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 21 Sep 2015 18:34:28 +0000 (19:34 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 3 Oct 2015 15:36:45 +0000 (16:36 +0100)
commitdb695c0509d6ec9046ee5e4c520a19fa17d9fce2
tree450931f1b93e62351049933a916ed5ac1037d236
parent6f56a68d0bed16c13e9ec958cd28acbc2991d495
ARM: remove user cmpxchg syscall

Mark Brand reports that a NEEDS_SYSCALL_FOR_CMPXCHG enabled kernel would
open a security hole in the ghost syscall used to implement cmpxchg, as
it fails to validate the user pointer.

However, in order for this option to be enabled, you'd need to be
building a pre-ARMv6 kernel with SMP support.  There is only one system
known which fits that, which is an early ARM SMP FPGA implementation
based on the ARM926T.

In any case, the Kconfig does not allow SMP to be enabled for pre-ARMv6
systems.

Moreover, even if NEEDS_SYSCALL_FOR_CMPXCHG were to be enabled, the
kernel would not build as __ARM_NR_cmpxchg64 is not defined.

The simple answer is to remove the buggy code.

Reported-by: Mark Brand <markbrand@google.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/unistd.h
arch/arm/kernel/entry-armv.S
arch/arm/kernel/traps.c
arch/arm/mm/Kconfig