]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ptrace: Remove maxargs from task_current_syscall()
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Mon, 7 Nov 2016 21:26:35 +0000 (16:26 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 4 Apr 2019 13:17:15 +0000 (09:17 -0400)
commit631b7abacd02b88f4b0795c08b54ad4fc3e7c7c0
treeb014cc81ce32ca7e3fb05bf5d90d35737fa56cc2
parent79a3aaa7b82e3106be97842dedfd8429248896e6
ptrace: Remove maxargs from task_current_syscall()

task_current_syscall() has a single user that passes in 6 for maxargs, which
is the maximum arguments that can be used to get system calls from
syscall_get_arguments(). Instead of passing in a number of arguments to
grab, just get 6 arguments. The args argument even specifies that it's an
array of 6 items.

This will also allow changing syscall_get_arguments() to not get a variable
number of arguments, but always grab 6.

Linus also suggested not passing in a bunch of arguments to
task_current_syscall() but to instead pass in a pointer to a structure, and
just fill the structure. struct seccomp_data has almost all the parameters
that is needed except for the stack pointer (sp). As seccomp_data is part of
uapi, and I'm afraid to change it, a new structure was created
"syscall_info", which includes seccomp_data and adds the "sp" field.

Link: http://lkml.kernel.org/r/20161107213233.466776454@goodmis.org
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
fs/proc/base.c
include/linux/ptrace.h
lib/syscall.c