0001
0002 #ifndef _UAPI_LINUX_PTRACE_H
0003 #define _UAPI_LINUX_PTRACE_H
0004
0005
0006
0007
0008
0009 #include <linux/types.h>
0010
0011 #define PTRACE_TRACEME 0
0012 #define PTRACE_PEEKTEXT 1
0013 #define PTRACE_PEEKDATA 2
0014 #define PTRACE_PEEKUSR 3
0015 #define PTRACE_POKETEXT 4
0016 #define PTRACE_POKEDATA 5
0017 #define PTRACE_POKEUSR 6
0018 #define PTRACE_CONT 7
0019 #define PTRACE_KILL 8
0020 #define PTRACE_SINGLESTEP 9
0021
0022 #define PTRACE_ATTACH 16
0023 #define PTRACE_DETACH 17
0024
0025 #define PTRACE_SYSCALL 24
0026
0027
0028 #define PTRACE_SETOPTIONS 0x4200
0029 #define PTRACE_GETEVENTMSG 0x4201
0030 #define PTRACE_GETSIGINFO 0x4202
0031 #define PTRACE_SETSIGINFO 0x4203
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 #define PTRACE_GETREGSET 0x4204
0051 #define PTRACE_SETREGSET 0x4205
0052
0053 #define PTRACE_SEIZE 0x4206
0054 #define PTRACE_INTERRUPT 0x4207
0055 #define PTRACE_LISTEN 0x4208
0056
0057 #define PTRACE_PEEKSIGINFO 0x4209
0058
0059 struct ptrace_peeksiginfo_args {
0060 __u64 off;
0061 __u32 flags;
0062 __s32 nr;
0063 };
0064
0065 #define PTRACE_GETSIGMASK 0x420a
0066 #define PTRACE_SETSIGMASK 0x420b
0067
0068 #define PTRACE_SECCOMP_GET_FILTER 0x420c
0069 #define PTRACE_SECCOMP_GET_METADATA 0x420d
0070
0071 struct seccomp_metadata {
0072 __u64 filter_off;
0073 __u64 flags;
0074 };
0075
0076 #define PTRACE_GET_SYSCALL_INFO 0x420e
0077 #define PTRACE_SYSCALL_INFO_NONE 0
0078 #define PTRACE_SYSCALL_INFO_ENTRY 1
0079 #define PTRACE_SYSCALL_INFO_EXIT 2
0080 #define PTRACE_SYSCALL_INFO_SECCOMP 3
0081
0082 struct ptrace_syscall_info {
0083 __u8 op;
0084 __u8 pad[3];
0085 __u32 arch;
0086 __u64 instruction_pointer;
0087 __u64 stack_pointer;
0088 union {
0089 struct {
0090 __u64 nr;
0091 __u64 args[6];
0092 } entry;
0093 struct {
0094 __s64 rval;
0095 __u8 is_error;
0096 } exit;
0097 struct {
0098 __u64 nr;
0099 __u64 args[6];
0100 __u32 ret_data;
0101 } seccomp;
0102 };
0103 };
0104
0105 #define PTRACE_GET_RSEQ_CONFIGURATION 0x420f
0106
0107 struct ptrace_rseq_configuration {
0108 __u64 rseq_abi_pointer;
0109 __u32 rseq_abi_size;
0110 __u32 signature;
0111 __u32 flags;
0112 __u32 pad;
0113 };
0114
0115
0116
0117
0118
0119 #define PTRACE_EVENTMSG_SYSCALL_ENTRY 1
0120 #define PTRACE_EVENTMSG_SYSCALL_EXIT 2
0121
0122
0123 #define PTRACE_PEEKSIGINFO_SHARED (1 << 0)
0124
0125
0126 #define PTRACE_EVENT_FORK 1
0127 #define PTRACE_EVENT_VFORK 2
0128 #define PTRACE_EVENT_CLONE 3
0129 #define PTRACE_EVENT_EXEC 4
0130 #define PTRACE_EVENT_VFORK_DONE 5
0131 #define PTRACE_EVENT_EXIT 6
0132 #define PTRACE_EVENT_SECCOMP 7
0133
0134 #define PTRACE_EVENT_STOP 128
0135
0136
0137 #define PTRACE_O_TRACESYSGOOD 1
0138 #define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK)
0139 #define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK)
0140 #define PTRACE_O_TRACECLONE (1 << PTRACE_EVENT_CLONE)
0141 #define PTRACE_O_TRACEEXEC (1 << PTRACE_EVENT_EXEC)
0142 #define PTRACE_O_TRACEVFORKDONE (1 << PTRACE_EVENT_VFORK_DONE)
0143 #define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT)
0144 #define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP)
0145
0146
0147 #define PTRACE_O_EXITKILL (1 << 20)
0148 #define PTRACE_O_SUSPEND_SECCOMP (1 << 21)
0149
0150 #define PTRACE_O_MASK (\
0151 0x000000ff | PTRACE_O_EXITKILL | PTRACE_O_SUSPEND_SECCOMP)
0152
0153 #include <asm/ptrace.h>
0154
0155
0156 #endif