linux/arch/x86/um
Mickaël Salaün ce29856a5e um/ptrace: Fix the syscall number update after a ptrace
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: 26703c636c ("um/ptrace: run seccomp after ptrace")

Signed-off-by: Mickaël Salaün <mic@digikod.net>
Acked-by: Kees 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: James Morris <james.l.morris@oracle.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
2016-09-07 09:25:04 -07:00
..
asm Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-03-19 10:05:34 -07:00
os-Linux um: add extended processor state save/restore support 2016-05-21 23:38:06 +02:00
shared/sysdep um: add extended processor state save/restore support 2016-05-21 23:38:06 +02:00
vdso um: Support kcov 2016-08-04 00:18:06 +02:00
Kconfig arch/um: make it work with defconfig and x86_64 2013-11-17 11:31:48 +01:00
Makefile um: Fix build error and kconfig for i386 2016-01-10 21:49:49 +01:00
bug.c um: take arch/um/sys-x86 to arch/x86/um 2011-11-02 14:15:05 +01:00
bugs_32.c um: get rid of pointless include "..." where include <...> will do 2012-10-09 22:28:45 +02:00
bugs_64.c um: get rid of pointless include "..." where include <...> will do 2012-10-09 22:28:45 +02:00
checksum_32.S um: remove csum_partial_copy_generic_i386 to clean up exception table 2014-10-13 17:15:02 +02:00
delay.c x86: Audit and remove any remaining unnecessary uses of module.h 2016-07-14 15:07:00 +02:00
elfcore.c switch elf_core_write_extra_data() to dump_emit() 2013-11-09 00:16:23 -05:00
fault.c um: don't compare a pointer to 0 2012-12-20 11:49:39 -08:00
ksyms.c um: take arch/um/sys-x86 to arch/x86/um 2011-11-02 14:15:05 +01:00
ldt.c um: Do not rely on libc to provide modify_ldt() 2015-10-19 22:53:37 +02:00
mem_32.c um: Cleanup mem_32/64.c headers 2015-05-31 17:31:42 +02:00
mem_64.c um: Cleanup mem_32/64.c headers 2015-05-31 17:31:42 +02:00
ptrace_32.c um/ptrace: Fix the syscall number update after a ptrace 2016-09-07 09:25:04 -07:00
ptrace_64.c um/ptrace: Fix the syscall number update after a ptrace 2016-09-07 09:25:04 -07:00
ptrace_user.c um: get rid of pointless include "..." where include <...> will do 2012-10-09 22:28:45 +02:00
setjmp_32.S um: take arch/um/sys-x86 to arch/x86/um 2011-11-02 14:15:05 +01:00
setjmp_64.S um: take arch/um/sys-x86 to arch/x86/um 2011-11-02 14:15:05 +01:00
signal.c um: extend fpstate to _xstate to support YMM registers 2016-05-21 23:37:40 +02: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 um: get rid of pointless include "..." where include <...> will do 2012-10-09 22:28:45 +02:00
sys_call_table_32.c x86/syscalls: Add syscall entry qualifiers 2016-01-29 09:46:38 +01:00
sys_call_table_64.c x86/syscalls: Add syscall entry qualifiers 2016-01-29 09:46:38 +01:00
syscalls_64.c um: Add uaccess.h to syscalls_64.c 2015-05-31 17:31:56 +02:00
sysrq_32.c um: Rewrite show_stack() 2013-11-17 11:27:25 +01:00
sysrq_64.c um: Rewrite show_stack() 2013-11-17 11:27:25 +01:00
tls_32.c um: Don't pollute kernel namespace with uapi 2015-06-25 22:44:11 +02:00
tls_64.c um: Don't pollute kernel namespace with uapi 2015-06-25 22:44:11 +02:00
user-offsets.c um: extend fpstate to _xstate to support YMM registers 2016-05-21 23:37:40 +02:00