.. | .. |
---|
9 | 9 | #include <linux/bug.h> /* For BUG_ON. */ |
---|
10 | 10 | #include <linux/pid_namespace.h> /* For task_active_pid_ns. */ |
---|
11 | 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 */ |
---|
| 15 | +struct syscall_info { |
---|
| 16 | + __u64 sp; |
---|
| 17 | + struct seccomp_data data; |
---|
| 18 | +}; |
---|
12 | 19 | |
---|
13 | 20 | extern int ptrace_access_vm(struct task_struct *tsk, unsigned long addr, |
---|
14 | 21 | void *buf, int len, unsigned int gup_flags); |
---|
.. | .. |
---|
23 | 30 | |
---|
24 | 31 | #define PT_SEIZED 0x00010000 /* SEIZE used, enable new behavior */ |
---|
25 | 32 | #define PT_PTRACED 0x00000001 |
---|
26 | | -#define PT_DTRACE 0x00000002 /* delayed trace (used on m68k, i386) */ |
---|
27 | 33 | |
---|
28 | 34 | #define PT_OPT_FLAG_SHIFT 3 |
---|
29 | 35 | /* PT_TRACE_* event enable flags */ |
---|
.. | .. |
---|
39 | 45 | |
---|
40 | 46 | #define PT_EXITKILL (PTRACE_O_EXITKILL << PT_OPT_FLAG_SHIFT) |
---|
41 | 47 | #define PT_SUSPEND_SECCOMP (PTRACE_O_SUSPEND_SECCOMP << PT_OPT_FLAG_SHIFT) |
---|
42 | | - |
---|
43 | | -/* single stepping state bits (used on ARM and PA-RISC) */ |
---|
44 | | -#define PT_SINGLESTEP_BIT 31 |
---|
45 | | -#define PT_SINGLESTEP (1<<PT_SINGLESTEP_BIT) |
---|
46 | | -#define PT_BLOCKSTEP_BIT 30 |
---|
47 | | -#define PT_BLOCKSTEP (1<<PT_BLOCKSTEP_BIT) |
---|
48 | 48 | |
---|
49 | 49 | extern long arch_ptrace(struct task_struct *child, long request, |
---|
50 | 50 | unsigned long addr, unsigned long data); |
---|
.. | .. |
---|
336 | 336 | extern void user_enable_block_step(struct task_struct *); |
---|
337 | 337 | #endif /* arch_has_block_step */ |
---|
338 | 338 | |
---|
339 | | -#ifdef ARCH_HAS_USER_SINGLE_STEP_INFO |
---|
340 | | -extern void user_single_step_siginfo(struct task_struct *tsk, |
---|
341 | | - struct pt_regs *regs, siginfo_t *info); |
---|
| 339 | +#ifdef ARCH_HAS_USER_SINGLE_STEP_REPORT |
---|
| 340 | +extern void user_single_step_report(struct pt_regs *regs); |
---|
342 | 341 | #else |
---|
343 | | -static inline void user_single_step_siginfo(struct task_struct *tsk, |
---|
344 | | - struct pt_regs *regs, siginfo_t *info) |
---|
| 342 | +static inline void user_single_step_report(struct pt_regs *regs) |
---|
345 | 343 | { |
---|
346 | | - info->si_signo = SIGTRAP; |
---|
| 344 | + kernel_siginfo_t info; |
---|
| 345 | + clear_siginfo(&info); |
---|
| 346 | + info.si_signo = SIGTRAP; |
---|
| 347 | + info.si_errno = 0; |
---|
| 348 | + info.si_code = SI_USER; |
---|
| 349 | + info.si_pid = 0; |
---|
| 350 | + info.si_uid = 0; |
---|
| 351 | + force_sig_info(&info); |
---|
347 | 352 | } |
---|
348 | 353 | #endif |
---|
349 | 354 | |
---|
.. | .. |
---|
402 | 407 | #define current_user_stack_pointer() user_stack_pointer(current_pt_regs()) |
---|
403 | 408 | #endif |
---|
404 | 409 | |
---|
405 | | -extern int task_current_syscall(struct task_struct *target, long *callno, |
---|
406 | | - unsigned long args[6], unsigned int maxargs, |
---|
407 | | - unsigned long *sp, unsigned long *pc); |
---|
| 410 | +extern int task_current_syscall(struct task_struct *target, struct syscall_info *info); |
---|
408 | 411 | |
---|
| 412 | +extern void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact); |
---|
409 | 413 | #endif |
---|