hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/include/linux/ptrace.h
....@@ -9,6 +9,13 @@
99 #include <linux/bug.h> /* For BUG_ON. */
1010 #include <linux/pid_namespace.h> /* For task_active_pid_ns. */
1111 #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
+};
1219
1320 extern int ptrace_access_vm(struct task_struct *tsk, unsigned long addr,
1421 void *buf, int len, unsigned int gup_flags);
....@@ -23,7 +30,6 @@
2330
2431 #define PT_SEIZED 0x00010000 /* SEIZE used, enable new behavior */
2532 #define PT_PTRACED 0x00000001
26
-#define PT_DTRACE 0x00000002 /* delayed trace (used on m68k, i386) */
2733
2834 #define PT_OPT_FLAG_SHIFT 3
2935 /* PT_TRACE_* event enable flags */
....@@ -39,12 +45,6 @@
3945
4046 #define PT_EXITKILL (PTRACE_O_EXITKILL << PT_OPT_FLAG_SHIFT)
4147 #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)
4848
4949 extern long arch_ptrace(struct task_struct *child, long request,
5050 unsigned long addr, unsigned long data);
....@@ -336,14 +336,19 @@
336336 extern void user_enable_block_step(struct task_struct *);
337337 #endif /* arch_has_block_step */
338338
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);
342341 #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)
345343 {
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);
347352 }
348353 #endif
349354
....@@ -402,8 +407,7 @@
402407 #define current_user_stack_pointer() user_stack_pointer(current_pt_regs())
403408 #endif
404409
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);
408411
412
+extern void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact);
409413 #endif