1
2 #ifndef _UAPI_LINUX_PTRACE_H
3 #define _UAPI_LINUX_PTRACE_H
4
5
6
7
8
9 #include <linux/types.h>
10
11 #define PTRACE_TRACEME 0
12 #define PTRACE_PEEKTEXT 1
13 #define PTRACE_PEEKDATA 2
14 #define PTRACE_PEEKUSR 3
15 #define PTRACE_POKETEXT 4
16 #define PTRACE_POKEDATA 5
17 #define PTRACE_POKEUSR 6
18 #define PTRACE_CONT 7
19 #define PTRACE_KILL 8
20 #define PTRACE_SINGLESTEP 9
21
22 #define PTRACE_ATTACH 16
23 #define PTRACE_DETACH 17
24
25 #define PTRACE_SYSCALL 24
26
27
28 #define PTRACE_SETOPTIONS 0x4200
29 #define PTRACE_GETEVENTMSG 0x4201
30 #define PTRACE_GETSIGINFO 0x4202
31 #define PTRACE_SETSIGINFO 0x4203
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 #define PTRACE_GETREGSET 0x4204
51 #define PTRACE_SETREGSET 0x4205
52
53 #define PTRACE_SEIZE 0x4206
54 #define PTRACE_INTERRUPT 0x4207
55 #define PTRACE_LISTEN 0x4208
56
57 #define PTRACE_PEEKSIGINFO 0x4209
58
59 struct ptrace_peeksiginfo_args {
60 __u64 off;
61 __u32 flags;
62 __s32 nr;
63 };
64
65 #define PTRACE_GETSIGMASK 0x420a
66 #define PTRACE_SETSIGMASK 0x420b
67
68 #define PTRACE_SECCOMP_GET_FILTER 0x420c
69 #define PTRACE_SECCOMP_GET_METADATA 0x420d
70
71 struct seccomp_metadata {
72 __u64 filter_off;
73 __u64 flags;
74 };
75
76 #define PTRACE_GET_SYSCALL_INFO 0x420e
77 #define PTRACE_SYSCALL_INFO_NONE 0
78 #define PTRACE_SYSCALL_INFO_ENTRY 1
79 #define PTRACE_SYSCALL_INFO_EXIT 2
80 #define PTRACE_SYSCALL_INFO_SECCOMP 3
81
82 struct ptrace_syscall_info {
83 __u8 op;
84 __u32 arch __attribute__((__aligned__(sizeof(__u32))));
85 __u64 instruction_pointer;
86 __u64 stack_pointer;
87 union {
88 struct {
89 __u64 nr;
90 __u64 args[6];
91 } entry;
92 struct {
93 __s64 rval;
94 __u8 is_error;
95 } exit;
96 struct {
97 __u64 nr;
98 __u64 args[6];
99 __u32 ret_data;
100 } seccomp;
101 };
102 };
103
104
105
106
107
108 #define PTRACE_EVENTMSG_SYSCALL_ENTRY 1
109 #define PTRACE_EVENTMSG_SYSCALL_EXIT 2
110
111
112 #define PTRACE_PEEKSIGINFO_SHARED (1 << 0)
113
114
115 #define PTRACE_EVENT_FORK 1
116 #define PTRACE_EVENT_VFORK 2
117 #define PTRACE_EVENT_CLONE 3
118 #define PTRACE_EVENT_EXEC 4
119 #define PTRACE_EVENT_VFORK_DONE 5
120 #define PTRACE_EVENT_EXIT 6
121 #define PTRACE_EVENT_SECCOMP 7
122
123 #define PTRACE_EVENT_STOP 128
124
125
126 #define PTRACE_O_TRACESYSGOOD 1
127 #define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK)
128 #define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK)
129 #define PTRACE_O_TRACECLONE (1 << PTRACE_EVENT_CLONE)
130 #define PTRACE_O_TRACEEXEC (1 << PTRACE_EVENT_EXEC)
131 #define PTRACE_O_TRACEVFORKDONE (1 << PTRACE_EVENT_VFORK_DONE)
132 #define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT)
133 #define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP)
134
135
136 #define PTRACE_O_EXITKILL (1 << 20)
137 #define PTRACE_O_SUSPEND_SECCOMP (1 << 21)
138
139 #define PTRACE_O_MASK (\
140 0x000000ff | PTRACE_O_EXITKILL | PTRACE_O_SUSPEND_SECCOMP)
141
142 #include <asm/ptrace.h>
143
144
145 #endif