#include <linux/capability.h>
#include <linux/export.h>
#include <linux/sched.h>
#include <linux/sched/mm.h>
#include <linux/sched/coredump.h>
#include <linux/sched/task.h>
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/highmem.h>
#include <linux/pagemap.h>
#include <linux/ptrace.h>
#include <linux/security.h>
#include <linux/signal.h>
#include <linux/uio.h>
#include <linux/audit.h>
#include <linux/pid_namespace.h>
#include <linux/syscalls.h>
#include <linux/uaccess.h>
#include <linux/regset.h>
#include <linux/hw_breakpoint.h>
#include <linux/cn_proc.h>
#include <linux/compat.h>
#include <linux/sched/signal.h>
#include <linux/minmax.h>
#include <linux/syscall_user_dispatch.h>
#include <asm/syscall.h>
int ptrace_access_vm(struct task_struct *tsk, unsigned long addr,
void *buf, int len, unsigned int gup_flags)
{ … }
void __ptrace_link(struct task_struct *child, struct task_struct *new_parent,
const struct cred *ptracer_cred)
{ … }
static void ptrace_link(struct task_struct *child, struct task_struct *new_parent)
{ … }
void __ptrace_unlink(struct task_struct *child)
{ … }
static bool looks_like_a_spurious_pid(struct task_struct *task)
{ … }
static bool ptrace_freeze_traced(struct task_struct *task)
{ … }
static void ptrace_unfreeze_traced(struct task_struct *task)
{ … }
static int ptrace_check_attach(struct task_struct *child, bool ignore_state)
{ … }
static bool ptrace_has_cap(struct user_namespace *ns, unsigned int mode)
{ … }
static int __ptrace_may_access(struct task_struct *task, unsigned int mode)
{ … }
bool ptrace_may_access(struct task_struct *task, unsigned int mode)
{ … }
static int check_ptrace_options(unsigned long data)
{ … }
static inline void ptrace_set_stopped(struct task_struct *task, bool seize)
{ … }
static int ptrace_attach(struct task_struct *task, long request,
unsigned long addr,
unsigned long flags)
{ … }
static int ptrace_traceme(void)
{ … }
static int ignoring_children(struct sighand_struct *sigh)
{ … }
static bool __ptrace_detach(struct task_struct *tracer, struct task_struct *p)
{ … }
static int ptrace_detach(struct task_struct *child, unsigned int data)
{ … }
void exit_ptrace(struct task_struct *tracer, struct list_head *dead)
{ … }
int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len)
{ … }
int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len)
{ … }
static int ptrace_setoptions(struct task_struct *child, unsigned long data)
{ … }
static int ptrace_getsiginfo(struct task_struct *child, kernel_siginfo_t *info)
{ … }
static int ptrace_setsiginfo(struct task_struct *child, const kernel_siginfo_t *info)
{ … }
static int ptrace_peek_siginfo(struct task_struct *child,
unsigned long addr,
unsigned long data)
{ … }
#ifdef CONFIG_RSEQ
static long ptrace_get_rseq_configuration(struct task_struct *task,
unsigned long size, void __user *data)
{ … }
#endif
#define is_singlestep(request) …
#ifdef PTRACE_SINGLEBLOCK
#define is_singleblock(request) …
#else
#define is_singleblock …
#endif
#ifdef PTRACE_SYSEMU
#define is_sysemu_singlestep(request) …
#else
#define is_sysemu_singlestep …
#endif
static int ptrace_resume(struct task_struct *child, long request,
unsigned long data)
{ … }
#ifdef CONFIG_HAVE_ARCH_TRACEHOOK
static const struct user_regset *
find_regset(const struct user_regset_view *view, unsigned int type)
{ … }
static int ptrace_regset(struct task_struct *task, int req, unsigned int type,
struct iovec *kiov)
{ … }
EXPORT_SYMBOL_GPL(…);
static unsigned long
ptrace_get_syscall_info_entry(struct task_struct *child, struct pt_regs *regs,
struct ptrace_syscall_info *info)
{ … }
static unsigned long
ptrace_get_syscall_info_seccomp(struct task_struct *child, struct pt_regs *regs,
struct ptrace_syscall_info *info)
{ … }
static unsigned long
ptrace_get_syscall_info_exit(struct task_struct *child, struct pt_regs *regs,
struct ptrace_syscall_info *info)
{ … }
static int
ptrace_get_syscall_info(struct task_struct *child, unsigned long user_size,
void __user *datavp)
{ … }
#endif
int ptrace_request(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ … }
SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr,
unsigned long, data)
{ … }
int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr,
unsigned long data)
{ … }
int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
unsigned long data)
{ … }
#if defined CONFIG_COMPAT
int compat_ptrace_request(struct task_struct *child, compat_long_t request,
compat_ulong_t addr, compat_ulong_t data)
{ … }
COMPAT_SYSCALL_DEFINE4(ptrace, compat_long_t, request, compat_long_t, pid,
compat_long_t, addr, compat_long_t, data)
{ … }
#endif