#include <linux/kprobes.h>
#include <linux/ptrace.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/hardirq.h>
#include <linux/preempt.h>
#include <linux/sched/debug.h>
#include <linux/perf_event.h>
#include <linux/extable.h>
#include <linux/kdebug.h>
#include <linux/kallsyms.h>
#include <linux/kgdb.h>
#include <linux/ftrace.h>
#include <linux/kasan.h>
#include <linux/objtool.h>
#include <linux/vmalloc.h>
#include <linux/pgtable.h>
#include <linux/set_memory.h>
#include <linux/cfi.h>
#include <linux/execmem.h>
#include <asm/text-patching.h>
#include <asm/cacheflush.h>
#include <asm/desc.h>
#include <linux/uaccess.h>
#include <asm/alternative.h>
#include <asm/insn.h>
#include <asm/debugreg.h>
#include <asm/ibt.h>
#include "common.h"
DEFINE_PER_CPU(struct kprobe *, current_kprobe) = …;
DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
#define W …
static volatile u32 twobyte_is_boostable[256 / 32] = …;
#undef W
struct kretprobe_blackpoint kretprobe_blacklist[] = …;
const int kretprobe_blacklist_size = …;
static nokprobe_inline void
__synthesize_relative_insn(void *dest, void *from, void *to, u8 op)
{ … }
void synthesize_reljump(void *dest, void *from, void *to)
{ … }
NOKPROBE_SYMBOL(synthesize_reljump);
void synthesize_relcall(void *dest, void *from, void *to)
{ … }
NOKPROBE_SYMBOL(synthesize_relcall);
bool can_boost(struct insn *insn, void *addr)
{ … }
static unsigned long
__recover_probed_insn(kprobe_opcode_t *buf, unsigned long addr)
{ … }
unsigned long recover_probed_instruction(kprobe_opcode_t *buf, unsigned long addr)
{ … }
static inline bool is_exception_insn(struct insn *insn)
{ … }
static bool can_probe(unsigned long paddr)
{ … }
kprobe_opcode_t *arch_adjust_kprobe_addr(unsigned long addr, unsigned long offset,
bool *on_func_entry)
{ … }
int __copy_instruction(u8 *dest, u8 *src, u8 *real, struct insn *insn)
{ … }
static int prepare_singlestep(kprobe_opcode_t *buf, struct kprobe *p,
struct insn *insn)
{ … }
void *alloc_insn_page(void)
{ … }
static void kprobe_emulate_ifmodifiers(struct kprobe *p, struct pt_regs *regs)
{ … }
NOKPROBE_SYMBOL(kprobe_emulate_ifmodifiers);
static void kprobe_emulate_ret(struct kprobe *p, struct pt_regs *regs)
{ … }
NOKPROBE_SYMBOL(kprobe_emulate_ret);
static void kprobe_emulate_call(struct kprobe *p, struct pt_regs *regs)
{ … }
NOKPROBE_SYMBOL(kprobe_emulate_call);
static void kprobe_emulate_jmp(struct kprobe *p, struct pt_regs *regs)
{ … }
NOKPROBE_SYMBOL(kprobe_emulate_jmp);
static void kprobe_emulate_jcc(struct kprobe *p, struct pt_regs *regs)
{ … }
NOKPROBE_SYMBOL(kprobe_emulate_jcc);
static void kprobe_emulate_loop(struct kprobe *p, struct pt_regs *regs)
{ … }
NOKPROBE_SYMBOL(kprobe_emulate_loop);
static const int addrmode_regoffs[] = …;
static void kprobe_emulate_call_indirect(struct kprobe *p, struct pt_regs *regs)
{ … }
NOKPROBE_SYMBOL(kprobe_emulate_call_indirect);
static void kprobe_emulate_jmp_indirect(struct kprobe *p, struct pt_regs *regs)
{ … }
NOKPROBE_SYMBOL(kprobe_emulate_jmp_indirect);
static int prepare_emulation(struct kprobe *p, struct insn *insn)
{ … }
static int arch_copy_kprobe(struct kprobe *p)
{ … }
int arch_prepare_kprobe(struct kprobe *p)
{ … }
void arch_arm_kprobe(struct kprobe *p)
{ … }
void arch_disarm_kprobe(struct kprobe *p)
{ … }
void arch_remove_kprobe(struct kprobe *p)
{ … }
static nokprobe_inline void
save_previous_kprobe(struct kprobe_ctlblk *kcb)
{ … }
static nokprobe_inline void
restore_previous_kprobe(struct kprobe_ctlblk *kcb)
{ … }
static nokprobe_inline void
set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
struct kprobe_ctlblk *kcb)
{ … }
static void kprobe_post_process(struct kprobe *cur, struct pt_regs *regs,
struct kprobe_ctlblk *kcb)
{ … }
NOKPROBE_SYMBOL(kprobe_post_process);
static void setup_singlestep(struct kprobe *p, struct pt_regs *regs,
struct kprobe_ctlblk *kcb, int reenter)
{ … }
NOKPROBE_SYMBOL(setup_singlestep);
static void resume_singlestep(struct kprobe *p, struct pt_regs *regs,
struct kprobe_ctlblk *kcb)
{ … }
NOKPROBE_SYMBOL(resume_singlestep);
static int reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
struct kprobe_ctlblk *kcb)
{ … }
NOKPROBE_SYMBOL(reenter_kprobe);
static nokprobe_inline int kprobe_is_ss(struct kprobe_ctlblk *kcb)
{ … }
int kprobe_int3_handler(struct pt_regs *regs)
{ … }
NOKPROBE_SYMBOL(kprobe_int3_handler);
int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
{ … }
NOKPROBE_SYMBOL(kprobe_fault_handler);
int __init arch_populate_kprobe_blacklist(void)
{ … }
int __init arch_init_kprobes(void)
{ … }
int arch_trampoline_kprobe(struct kprobe *p)
{ … }