History

Merge tag 'trace-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull syscall-get-arguments cleanup and fixes from Steven Rostedt: "Andy Lutomirski approached me to tell me that the syscall_get_arguments() implementation in x86 was horrible and gcc certainly gets it wrong. He said that since the tracepoints only pass in 0 and 6 for i and n repectively, it should be optimized for that case. Inspecting the kernel, I discovered that all users pass in 0 for i and only one file passing in something other than 6 for the number of arguments. That code happens to be my own code used for the special syscall tracing. That can easily be converted to just using 0 and 6 as well, and only copying what is needed. Which is probably the faster path anyway for that case. Along the way, a couple of real fixes came from this as the syscall_get_arguments() function was incorrect for csky and riscv. x86 has been optimized to for the new interface that removes the variable number of arguments, but the other architectures could still use some loving and take more advantage of the simpler interface" * tag 'trace-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: syscalls: Remove start and number from syscall_set_arguments() args syscalls: Remove start and number from syscall_get_arguments() args csky: Fix syscall_get_arguments() and syscall_set_arguments() riscv: Fix syscall_get_arguments() and syscall_set_arguments() tracing/syscalls: Pass in hardcoded 6 into syscall_get_arguments() ptrace: Remove maxargs from task_current_syscall()

Linus Torvalds committed 7 years ago

Commit 970b7662 parents 7f46774 32d925832 files · +247 −722Browse files

Showing the changes to include/linux (1 of 32 files). Show all

Unified · Split

include/linux/ptrace.h+8−3
@@ -9,6 +9,13 @@ · 8 unmodified lines
9#include <linux/bug.h> /* For BUG_ON. */9#include <linux/bug.h> /* For BUG_ON. */
10#include <linux/pid_namespace.h> /* For task_active_pid_ns. */10#include <linux/pid_namespace.h> /* For task_active_pid_ns. */
11#include <uapi/linux/ptrace.h>11#include <uapi/linux/ptrace.h>
12#include <linux/seccomp.h>
13
14/* Add sp to seccomp_data, as seccomp is user API, we don't want to modify it */
15struct syscall_info {
16 __u64 sp;
17 struct seccomp_data data;
18};
12 19
13extern int ptrace_access_vm(struct task_struct *tsk, unsigned long addr,20extern int ptrace_access_vm(struct task_struct *tsk, unsigned long addr,
14 void *buf, int len, unsigned int gup_flags);21 void *buf, int len, unsigned int gup_flags);
@@ -407,9 +414,7 @@ static inline void user_single_step_report(struct pt_regs *regs) · 392 unmodified lines
407#define current_user_stack_pointer() user_stack_pointer(current_pt_regs())414#define current_user_stack_pointer() user_stack_pointer(current_pt_regs())
408#endif415#endif
409 416
410extern int task_current_syscall(struct task_struct *target, long *callno,417extern int task_current_syscall(struct task_struct *target, struct syscall_info *info);
411 unsigned long args[6], unsigned int maxargs,
412 unsigned long *sp, unsigned long *pc);
413 418
414extern void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact);419extern void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact);
415#endif420#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t