OpenCloudOS-Kernel/arch/x86/entry
Thomas Gleixner 4facb95b7a x86/entry: Unbreak 32bit fast syscall
Andy reported that the syscall treacing for 32bit fast syscall fails:

# ./tools/testing/selftests/x86/ptrace_syscall_32
...
[RUN] SYSEMU
[FAIL] Initial args are wrong (nr=224, args=10 11 12 13 14 4289172732)
...
[RUN] SYSCALL
[FAIL] Initial args are wrong (nr=29, args=0 0 0 0 0 4289172732)
 
The eason is that the conversion to generic entry code moved the retrieval
of the sixth argument (EBP) after the point where the syscall entry work
runs, i.e. ptrace, seccomp, audit...

Unbreak it by providing a split up version of syscall_enter_from_user_mode().

- syscall_enter_from_user_mode_prepare() establishes state and enables
  interrupts

- syscall_enter_from_user_mode_work() runs the entry work

Replace the call to syscall_enter_from_user_mode() in the 32bit fast
syscall C-entry with the split functions and stick the EBP retrieval
between them.

Fixes: 27d6b4d14f ("x86/entry: Use generic syscall entry function")
Reported-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/87k0xdjbtt.fsf@nanos.tec.linutronix.de
2020-09-04 15:50:14 +02:00
..
syscalls all arch: remove system call sys_sysctl 2020-08-14 19:56:56 -07:00
vdso xen: branch for v5.9-rc1b 2020-08-14 13:34:37 -07:00
vsyscall y2038: syscall implementation cleanups 2019-12-01 14:00:59 -08:00
Makefile x86/entry: Actually disable stack protector 2020-07-19 13:07:10 +02:00
calling.h x86/entry/64: Do not use RDPID in paranoid entry to accomodate KVM 2020-08-21 16:15:27 +02:00
common.c x86/entry: Unbreak 32bit fast syscall 2020-09-04 15:50:14 +02:00
entry_32.S xen: branch for v5.9-rc1b 2020-08-14 13:34:37 -07:00
entry_64.S Support for FSGSBASE. Almost 5 years after the first RFC to support it, 2020-08-04 21:16:22 -07:00
entry_64_compat.S x86/entry/compat: Clear RAX high bits on Xen PV SYSENTER 2020-07-04 19:47:25 +02:00
syscall_32.c x86/entry: Drop asmlinkage from syscalls 2020-03-21 16:03:25 +01:00
syscall_64.c x86/entry: Drop asmlinkage from syscalls 2020-03-21 16:03:25 +01:00
syscall_x32.c net: remove compat_sys_{get,set}sockopt 2020-07-19 18:16:40 -07:00
thunk_32.S x86/entry: Remove unused THUNKs 2020-08-26 12:41:54 +02:00
thunk_64.S x86/entry: Remove the TRACE_IRQS cruft 2020-06-11 15:15:19 +02:00