• Thomas Gleixner's avatar
    x86/entry: Unbreak 32bit fast syscall · 4facb95b
    Thomas Gleixner authored
    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: 27d6b4d1 ("x86/entry: Use generic syscall entry function")
    Reported-by: default avatarAndy Lutomirski <luto@kernel.org>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Link: https://lore.kernel.org/r/87k0xdjbtt.fsf@nanos.tec.linutronix.de
    4facb95b
common.c 8.26 KB