android_kernel_oneplus_msm8998/arch/x86/um
Dave Hansen c2e1be1448 x86/entry: Use SYSCALL_DEFINE() macros for sys_modify_ldt()
[ Upstream commit da20ab35180780e4a6eadc804544f1fa967f3567 ]

We do not have tracepoints for sys_modify_ldt() because we define
it directly instead of using the normal SYSCALL_DEFINEx() macros.

However, there is a reason sys_modify_ldt() does not use the macros:
it has an 'int' return type instead of 'unsigned long'.  This is
a bug, but it's a bug cemented in the ABI.

What does this mean?  If we return -EINVAL from a function that
returns 'int', we have 0x00000000ffffffea in %rax.  But, if we
return -EINVAL from a function returning 'unsigned long', we end
up with 0xffffffffffffffea in %rax, which is wrong.

To work around this and maintain the 'int' behavior while using
the SYSCALL_DEFINEx() macros, so we add a cast to 'unsigned int'
in both implementations of sys_modify_ldt().

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Reviewed-by: Brian Gerst <brgerst@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20171018172107.1A79C532@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-09 18:42:40 +01:00
..
asm um/x86: Fix build after x86 syscall changes 2015-10-14 16:56:28 +02:00
os-Linux
shared/sysdep
vdso
bug.c
bugs_32.c
bugs_64.c
checksum_32.S
delay.c
elfcore.c
fault.c
Kconfig
ksyms.c
ldt.c x86/entry: Use SYSCALL_DEFINE() macros for sys_modify_ldt() 2017-12-09 18:42:40 +01:00
Makefile
mem_32.c
mem_64.c
ptrace_32.c
ptrace_64.c um: Fix PTRACE_POKEUSER on x86_64 2017-05-20 14:27:00 +02:00
ptrace_user.c
setjmp_32.S
setjmp_64.S
signal.c um: Fix pointer cast 2015-12-22 15:31:51 -08:00
stub_32.S um: Remove dead symbol from i386 syscall stub 2015-11-06 22:49:11 +01:00
stub_64.S um: Simplify STUB_DATA loading 2015-11-06 22:49:11 +01:00
stub_segv.c
sys_call_table_32.c
sys_call_table_64.c
syscalls_64.c
sysrq_32.c
sysrq_64.c
tls_32.c
tls_64.c
user-offsets.c