• Mickaël Salaün's avatar
    um/ptrace: Fix the syscall number update after a ptrace · ce29856a
    Mickaël Salaün authored
    Update the syscall number after each PTRACE_SETREGS on ORIG_*AX.
    
    This is needed to get the potentially altered syscall number in the
    seccomp filters after RET_TRACE.
    
    This fix four seccomp_bpf tests:
    > [ RUN      ] TRACE_syscall.skip_after_RET_TRACE
    > seccomp_bpf.c:1560:TRACE_syscall.skip_after_RET_TRACE:Expected -1 (18446744073709551615) == syscall(39) (26)
    > seccomp_bpf.c:1561:TRACE_syscall.skip_after_RET_TRACE:Expected 1 (1) == (*__errno_location ()) (22)
    > [     FAIL ] TRACE_syscall.skip_after_RET_TRACE
    > [ RUN      ] TRACE_syscall.kill_after_RET_TRACE
    > TRACE_syscall.kill_after_RET_TRACE: Test exited normally instead of by signal (code: 1)
    > [     FAIL ] TRACE_syscall.kill_after_RET_TRACE
    > [ RUN      ] TRACE_syscall.skip_after_ptrace
    > seccomp_bpf.c:1622:TRACE_syscall.skip_after_ptrace:Expected -1 (18446744073709551615) == syscall(39) (26)
    > seccomp_bpf.c:1623:TRACE_syscall.skip_after_ptrace:Expected 1 (1) == (*__errno_location ()) (22)
    > [     FAIL ] TRACE_syscall.skip_after_ptrace
    > [ RUN      ] TRACE_syscall.kill_after_ptrace
    > TRACE_syscall.kill_after_ptrace: Test exited normally instead of by signal (code: 1)
    > [     FAIL ] TRACE_syscall.kill_after_ptrace
    
    Fixes: 26703c63 ("um/ptrace: run seccomp after ptrace")
    Signed-off-by: default avatarMickaël Salaün <mic@digikod.net>
    Acked-by: default avatarKees Cook <keescook@chromium.org>
    Cc: Jeff Dike <jdike@addtoit.com>
    Cc: Richard Weinberger <richard@nod.at>
    Cc: James Morris <jmorris@namei.org>
    Cc: user-mode-linux-devel@lists.sourceforge.net
    Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
    Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    ce29856a
Name
Last commit
Last update
..
configs Loading commit data...
drivers Loading commit data...
include Loading commit data...
kernel Loading commit data...
os-Linux Loading commit data...
scripts Loading commit data...
.gitignore Loading commit data...
Kconfig.char Loading commit data...
Kconfig.common Loading commit data...
Kconfig.debug Loading commit data...
Kconfig.net Loading commit data...
Kconfig.rest Loading commit data...
Kconfig.um Loading commit data...
Makefile Loading commit data...
Makefile-os-Linux Loading commit data...
Makefile-skas Loading commit data...