android_kernel_oneplus_msm8998/arch
Thomas Garnier a8368c9815 BACKPORT: arm/syscalls: Optimize address limit check
(cherry-picked from e33f8d32677fa4f4f8996ef46748f86aac81ccff)

Disable the generic address limit check in favor of an architecture
specific optimized implementation. The generic implementation using
pending work flags did not work well with ARM and alignment faults.

The address limit is checked on each syscall return path to user-mode
path as well as the irq user-mode return function. If the address limit
was changed, a function is called to report data corruption (stopping
the kernel or process based on configuration).

The address limit check has to be done before any pending work because
they can reset the address limit and the process is killed using a
SIGKILL signal. For example the lkdtm address limit check does not work
because the signal to kill the process will reset the user-mode address
limit.

Change-Id: Ic61ba05961ad1dcf10c48040427d92bd650616af
Signed-off-by: Thomas Garnier <thgarnie@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Tested-by: Kees Cook <keescook@chromium.org>
Tested-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Pratyush Anand <panand@redhat.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: Will Drewry <wad@chromium.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: David Howells <dhowells@redhat.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-api@vger.kernel.org
Cc: Yonghong Song <yhs@fb.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1504798247-48833-4-git-send-email-keescook@chromium.org
Signed-off-by: Satya Tangirala <satyat@google.com>
2018-09-21 14:51:55 -07:00
..
alpha This is the 4.4.155 stable release 2018-09-10 09:19:25 +02:00
arc This is the 4.4.157 stable release 2018-09-20 11:14:55 +02:00
arm BACKPORT: arm/syscalls: Optimize address limit check 2018-09-21 14:51:55 -07:00
arm64 BACKPORT: arm64/syscalls: Check address limit on user-mode return 2018-09-21 14:51:42 -07:00
avr32 BACKPORT: exit_thread: accept a task parameter to be exited 2018-02-05 08:58:29 -08:00
blackfin BACKPORT: exit_thread: remove empty bodies 2018-02-05 08:58:29 -08:00
c6x BACKPORT: exit_thread: remove empty bodies 2018-02-05 08:58:29 -08:00
cris BACKPORT: exit_thread: accept a task parameter to be exited 2018-02-05 08:58:29 -08:00
frv This is the 4.4.133 stable release 2018-05-26 10:12:26 +02:00
h8300 BACKPORT: exit_thread: remove empty bodies 2018-02-05 08:58:29 -08:00
hexagon This is the 4.4.133 stable release 2018-05-26 10:12:26 +02:00
ia64 This is the 4.4.133 stable release 2018-05-26 10:12:26 +02:00
m32r BACKPORT: exit_thread: remove empty bodies 2018-02-05 08:58:29 -08:00
m68k This is the 4.4.152 stable release 2018-08-24 13:37:12 +02:00
metag BACKPORT: exit_thread: accept a task parameter to be exited 2018-02-05 08:58:29 -08:00
microblaze This is the 4.4.146 stable release 2018-08-06 19:12:19 +02:00
mips This is the 4.4.157 stable release 2018-09-20 11:14:55 +02:00
mn10300 This is the 4.4.116 stable release 2018-02-20 16:23:06 +01:00
nios2 BACKPORT: exit_thread: remove empty bodies 2018-02-05 08:58:29 -08:00
openrisc This is the 4.4.157 stable release 2018-09-20 11:14:55 +02:00
parisc This is the 4.4.152 stable release 2018-08-24 13:37:12 +02:00
powerpc This is the 4.4.156 stable release 2018-09-15 12:08:41 +02:00
s390 This is the 4.4.156 stable release 2018-09-15 12:08:41 +02:00
score BACKPORT: exit_thread: remove empty bodies 2018-02-05 08:58:29 -08:00
sh This is the 4.4.136 stable release 2018-06-06 18:53:06 +02:00
sparc This is the 4.4.155 stable release 2018-09-10 09:19:25 +02:00
tile This is the 4.4.133 stable release 2018-05-26 10:12:26 +02:00
um This is the 4.4.129 stable release 2018-04-24 10:42:34 +02:00
unicore32 BACKPORT: exit_thread: remove empty bodies 2018-02-05 08:58:29 -08:00
x86 BACKPORT: x86/syscalls: Check address limit on user-mode return 2018-09-21 14:51:35 -07:00
xtensa This is the 4.4.139 stable release 2018-07-03 18:23:34 +02:00
.gitignore
Kconfig BACKPORT: exit_thread: remove empty bodies 2018-02-05 08:58:29 -08:00