/kernel/linux/linux-5.10/include/linux/ |
H A D | kprobes.h | 48 struct kprobe; 52 typedef int (*kprobe_pre_handler_t) (struct kprobe *, struct pt_regs *); 53 typedef void (*kprobe_post_handler_t) (struct kprobe *, struct pt_regs *, 55 typedef int (*kprobe_fault_handler_t) (struct kprobe *, struct pt_regs *, 60 struct kprobe { struct 98 * Protected by kprobe_mutex after this kprobe is registered. 113 /* Has this kprobe gone ? */ 114 static inline int kprobe_gone(struct kprobe *p) in kprobe_gone() 119 /* Is this kprobe disabled ? */ 120 static inline int kprobe_disabled(struct kprobe * [all...] |
/kernel/linux/linux-6.6/include/linux/ |
H A D | kprobes.h | 50 struct kprobe; 54 typedef int (*kprobe_pre_handler_t) (struct kprobe *, struct pt_regs *); 55 typedef void (*kprobe_post_handler_t) (struct kprobe *, struct pt_regs *, 60 struct kprobe { struct 92 * Protected by kprobe_mutex after this kprobe is registered. 108 /* Has this kprobe gone ? */ 109 static inline bool kprobe_gone(struct kprobe *p) in kprobe_gone() 114 /* Is this kprobe disabled ? */ 115 static inline bool kprobe_disabled(struct kprobe *p) in kprobe_disabled() 120 /* Is this kprobe reall [all...] |
/kernel/linux/linux-5.10/kernel/ |
H A D | kprobes.c | 64 static DEFINE_PER_CPU(struct kprobe *, kprobe_instance) = NULL; 85 * kprobe->ainsn.insn points to the copy of the instruction to be 290 * Check given address is on the page of kprobe instruction slots. 348 static inline void set_kprobe_instance(struct kprobe *kp) in set_kprobe_instance() 364 struct kprobe *get_kprobe(void *addr) in get_kprobe() 367 struct kprobe *p; in get_kprobe() 380 static int aggr_pre_handler(struct kprobe *p, struct pt_regs *regs); 382 /* Return true if the kprobe is an aggregator */ 383 static inline int kprobe_aggrprobe(struct kprobe *p) in kprobe_aggrprobe() 388 /* Return true(!0) if the kprobe i [all...] |
/kernel/linux/linux-6.6/kernel/ |
H A D | kprobes.c | 68 static DEFINE_PER_CPU(struct kprobe *, kprobe_instance); 84 * 'kprobe::ainsn.insn' points to the copy of the instruction to be 292 * Check given address is on the page of kprobe instruction slots. 360 static inline void set_kprobe_instance(struct kprobe *kp) in set_kprobe_instance() 376 struct kprobe *get_kprobe(void *addr) in get_kprobe() 379 struct kprobe *p; in get_kprobe() 392 static int aggr_pre_handler(struct kprobe *p, struct pt_regs *regs); 395 static inline bool kprobe_aggrprobe(struct kprobe *p) in kprobe_aggrprobe() 401 static inline bool kprobe_unused(struct kprobe *p) in kprobe_unused() 407 /* Keep all fields in the kprobe consisten [all...] |
/kernel/linux/linux-5.10/arch/parisc/kernel/ |
H A D | kprobes.c | 16 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 19 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 35 void __kprobes arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() 44 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 49 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 66 static inline void __kprobes set_current_kprobe(struct kprobe *p) in set_current_kprobe() 71 static void __kprobes setup_singlestep(struct kprobe *p, in setup_singlestep() 83 struct kprobe *p; in parisc_kprobe_break_handler() 98 * We have reentered the kprobe_handler, since another kprobe in parisc_kprobe_break_handler() 134 struct kprobe * in parisc_kprobe_ss_handler() [all...] |
/kernel/linux/linux-6.6/arch/parisc/kernel/ |
H A D | kprobes.c | 17 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 20 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 41 void __kprobes arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() 50 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 55 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 72 static inline void __kprobes set_current_kprobe(struct kprobe *p) in set_current_kprobe() 77 static void __kprobes setup_singlestep(struct kprobe *p, in setup_singlestep() 87 struct kprobe *p; in parisc_kprobe_break_handler() 102 * We have reentered the kprobe_handler, since another kprobe in parisc_kprobe_break_handler() 138 struct kprobe * in parisc_kprobe_ss_handler() [all...] |
/kernel/linux/linux-6.6/arch/loongarch/kernel/ |
H A D | kprobes.c | 10 DEFINE_PER_CPU(struct kprobe *, current_kprobe); 13 static void arch_prepare_ss_slot(struct kprobe *p) in arch_prepare_ss_slot() 21 static void arch_prepare_simulate(struct kprobe *p) in arch_prepare_simulate() 27 int arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 61 void arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 69 void arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 76 void arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() 99 static void set_current_kprobe(struct kprobe *p) in set_current_kprobe() 128 static void post_kprobe_handler(struct kprobe *cur, struct kprobe_ctlblk *kcb, in post_kprobe_handler() 135 /* restore back original saved kprobe variable in post_kprobe_handler() [all...] |
/kernel/linux/linux-6.6/arch/riscv/kernel/probes/ |
H A D | kprobes.c | 18 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 22 post_kprobe_handler(struct kprobe *, struct kprobe_ctlblk *, struct pt_regs *); 24 static void __kprobes arch_prepare_ss_slot(struct kprobe *p) in arch_prepare_ss_slot() 36 static void __kprobes arch_prepare_simulate(struct kprobe *p) in arch_prepare_simulate() 41 static void __kprobes arch_simulate_insn(struct kprobe *p, struct pt_regs *regs) in arch_simulate_insn() 52 static bool __kprobes arch_check_kprobe(struct kprobe *p) in arch_check_kprobe() 67 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 118 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 127 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 132 void __kprobes arch_remove_kprobe(struct kprobe * [all...] |
/kernel/linux/linux-6.6/arch/arm64/kernel/probes/ |
H A D | kprobes.c | 38 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 42 post_kprobe_handler(struct kprobe *, struct kprobe_ctlblk *, struct pt_regs *); 44 static void __kprobes arch_prepare_ss_slot(struct kprobe *p) in arch_prepare_ss_slot() 53 * *before* the kprobe BRK is written (and aarch64_insn_patch_text_nosync() in arch_prepare_ss_slot() 57 * - That the kprobe BRK results in an exception (and consequently a in arch_prepare_ss_slot() 77 static void __kprobes arch_prepare_simulate(struct kprobe *p) in arch_prepare_simulate() 83 static void __kprobes arch_simulate_insn(struct kprobe *p, struct pt_regs *regs) in arch_simulate_insn() 94 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 139 /* arm kprobe: install breakpoint in text */ 140 void __kprobes arch_arm_kprobe(struct kprobe * [all...] |
/kernel/linux/linux-5.10/arch/csky/kernel/probes/ |
H A D | kprobes.c | 14 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 52 static void __kprobes arch_prepare_ss_slot(struct kprobe *p) in arch_prepare_ss_slot() 61 static void __kprobes arch_prepare_simulate(struct kprobe *p) in arch_prepare_simulate() 66 static void __kprobes arch_simulate_insn(struct kprobe *p, struct pt_regs *regs) in arch_simulate_insn() 76 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 114 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 120 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 125 void __kprobes arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() 145 static void __kprobes set_current_kprobe(struct kprobe *p) in set_current_kprobe() 172 set_ss_context(struct kprobe_ctlblk *kcb, unsigned long addr, struct kprobe * [all...] |
/kernel/linux/linux-6.6/arch/csky/kernel/probes/ |
H A D | kprobes.c | 16 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 54 static void __kprobes arch_prepare_ss_slot(struct kprobe *p) in arch_prepare_ss_slot() 63 static void __kprobes arch_prepare_simulate(struct kprobe *p) in arch_prepare_simulate() 68 static void __kprobes arch_simulate_insn(struct kprobe *p, struct pt_regs *regs) in arch_simulate_insn() 78 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 114 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 120 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 125 void __kprobes arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() 145 static void __kprobes set_current_kprobe(struct kprobe *p) in set_current_kprobe() 172 set_ss_context(struct kprobe_ctlblk *kcb, unsigned long addr, struct kprobe * [all...] |
/kernel/linux/linux-5.10/arch/sh/kernel/ |
H A D | kprobes.c | 17 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 20 static DEFINE_PER_CPU(struct kprobe, saved_current_opcode); 21 static DEFINE_PER_CPU(struct kprobe, saved_next_opcode); 22 static DEFINE_PER_CPU(struct kprobe, saved_next_opcode2); 40 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 52 void __kprobes arch_copy_kprobe(struct kprobe *p) in arch_copy_kprobe() 58 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 65 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 72 int __kprobes arch_trampoline_kprobe(struct kprobe *p) in arch_trampoline_kprobe() 82 * containing a kprobe, remov [all...] |
/kernel/linux/linux-6.6/arch/sh/kernel/ |
H A D | kprobes.c | 17 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 20 static DEFINE_PER_CPU(struct kprobe, saved_current_opcode); 21 static DEFINE_PER_CPU(struct kprobe, saved_next_opcode); 22 static DEFINE_PER_CPU(struct kprobe, saved_next_opcode2); 40 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 52 void __kprobes arch_copy_kprobe(struct kprobe *p) in arch_copy_kprobe() 58 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 65 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 72 int __kprobes arch_trampoline_kprobe(struct kprobe *p) in arch_trampoline_kprobe() 82 * containing a kprobe, remov [all...] |
/kernel/linux/linux-5.10/arch/loongarch/kernel/ |
H A D | kprobes.c | 34 DEFINE_PER_CPU(struct kprobe *, current_kprobe); 64 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 93 * In the kprobe->ainsn.insn[] array we store the original in arch_prepare_kprobe() 106 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 112 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 118 void __kprobes arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() 144 static void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, in set_current_kprobe() 152 static int prepare_singlestep(struct kprobe *p, struct pt_regs *regs) in prepare_singlestep() 170 static void setup_singlestep(struct kprobe *p, struct pt_regs *regs, in setup_singlestep() 207 static int reenter_kprobe(struct kprobe * [all...] |
/kernel/linux/linux-5.10/arch/arm64/kernel/probes/ |
H A D | kprobes.c | 33 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 39 static void __kprobes arch_prepare_ss_slot(struct kprobe *p) in arch_prepare_ss_slot() 57 static void __kprobes arch_prepare_simulate(struct kprobe *p) in arch_prepare_simulate() 63 static void __kprobes arch_simulate_insn(struct kprobe *p, struct pt_regs *regs) in arch_simulate_insn() 74 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 119 /* arm kprobe: install breakpoint in text */ 120 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 128 /* disarm kprobe: remove breakpoint from text */ 129 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 136 void __kprobes arch_remove_kprobe(struct kprobe * [all...] |
/kernel/linux/linux-5.10/arch/mips/kernel/ |
H A D | kprobes.c | 42 DEFINE_PER_CPU(struct kprobe *, current_kprobe); 74 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 111 * In the kprobe->ainsn.insn[] array we store the original in arch_prepare_kprobe() 135 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 141 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 147 void __kprobes arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() 173 static void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, in set_current_kprobe() 188 * The result is also saved in the kprobe control block for later use, 192 * SKIP_DELAYSLOT in the kprobe control block 194 static int evaluate_branch_instruction(struct kprobe * [all...] |
/kernel/linux/linux-6.6/arch/mips/kernel/ |
H A D | kprobes.c | 44 DEFINE_PER_CPU(struct kprobe *, current_kprobe); 78 int arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 114 * In the kprobe->ainsn.insn[] array we store the original in arch_prepare_kprobe() 139 void arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 146 void arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 153 void arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() 180 static void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, in set_current_kprobe() 195 * The result is also saved in the kprobe control block for later use, 199 * SKIP_DELAYSLOT in the kprobe control block 201 static int evaluate_branch_instruction(struct kprobe * [all...] |
/kernel/linux/linux-5.10/arch/arc/kernel/ |
H A D | kprobes.c | 20 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 23 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 37 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 45 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 53 void __kprobes arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() 57 /* Can we remove the kprobe in the middle of kprobe handling? */ in arch_remove_kprobe() 91 static inline void __kprobes set_current_kprobe(struct kprobe *p) in set_current_kprobe() 96 static void __kprobes resume_execution(struct kprobe *p, unsigned long addr, in resume_execution() 125 static void __kprobes setup_singlestep(struct kprobe * [all...] |
/kernel/linux/linux-5.10/arch/sparc/kernel/ |
H A D | kprobes.c | 22 * In the kprobe->ainsn.insn[] array we store the original 26 * When we hit a kprobe we: 31 * - Set regs->tpc to point to kprobe->ainsn.insn[0] 32 * - Set regs->tnpc to point to kprobe->ainsn.insn[1] 33 * - Mark that we are actively in a kprobe 36 * kprobe->ainsn.insn[1] to hit. When it does we: 42 * - Mark that we are no longer actively in a kprobe. 45 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 50 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 65 void __kprobes arch_arm_kprobe(struct kprobe * [all...] |
/kernel/linux/linux-6.6/arch/arc/kernel/ |
H A D | kprobes.c | 20 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 23 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 37 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 45 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 53 void __kprobes arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() 57 /* Can we remove the kprobe in the middle of kprobe handling? */ in arch_remove_kprobe() 91 static inline void __kprobes set_current_kprobe(struct kprobe *p) in set_current_kprobe() 96 static void __kprobes resume_execution(struct kprobe *p, unsigned long addr, in resume_execution() 125 static void __kprobes setup_singlestep(struct kprobe * [all...] |
/kernel/linux/linux-6.6/arch/sparc/kernel/ |
H A D | kprobes.c | 22 * In the kprobe->ainsn.insn[] array we store the original 26 * When we hit a kprobe we: 31 * - Set regs->tpc to point to kprobe->ainsn.insn[0] 32 * - Set regs->tnpc to point to kprobe->ainsn.insn[1] 33 * - Mark that we are actively in a kprobe 36 * kprobe->ainsn.insn[1] to hit. When it does we: 42 * - Mark that we are no longer actively in a kprobe. 45 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 50 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 65 void __kprobes arch_arm_kprobe(struct kprobe * [all...] |
/kernel/linux/linux-5.10/arch/s390/kernel/ |
H A D | kprobes.c | 27 DEFINE_PER_CPU(struct kprobe *, current_kprobe); 72 static void copy_instruction(struct kprobe *p) in copy_instruction() 105 static int s390_get_insn_slot(struct kprobe *p) in s390_get_insn_slot() 121 static void s390_free_insn_slot(struct kprobe *p) in s390_free_insn_slot() 133 int arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 148 struct kprobe *p; 155 struct kprobe *p = args->p; in swap_instruction() 164 void arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() 172 void arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() 180 void arch_remove_kprobe(struct kprobe * [all...] |
/kernel/linux/linux-6.6/arch/s390/kernel/ |
H A D | kprobes.c | 30 DEFINE_PER_CPU(struct kprobe *, current_kprobe); 68 static void copy_instruction(struct kprobe *p) in copy_instruction() 96 static int s390_get_insn_slot(struct kprobe *p) in s390_get_insn_slot() 112 static void s390_free_insn_slot(struct kprobe *p) in s390_free_insn_slot() 129 struct kprobe *kp; in can_probe() 149 * instructions and prevent setting a kprobe. in can_probe() 155 * kprobe, in which case the original instruction is in can_probe() 160 /* not a kprobe */ in can_probe() 170 int arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() 185 struct kprobe * [all...] |
/kernel/linux/linux-5.10/arch/arm/probes/kprobes/ |
H A D | test-core.c | 40 * When the test case is run a kprobe is placed of each nop. The 48 * step a second time but with an additional kprobe on the test_case 172 * inserts a kprobe on the test case instruction 'test_insn' and returns a 177 * numbered run (the one without the kprobe on test_insn). These should be 178 * the same if the kprobe instruction simulation routine is correct. 310 static int __kprobes pre_handler(struct kprobe *p, struct pt_regs *regs) in pre_handler() 318 static void __kprobes post_handler(struct kprobe *p, struct pt_regs *regs, in post_handler() 326 static struct kprobe the_kprobe = { 351 pr_err("FAIL: kprobe pre_handler not called\n"); in test_kprobe() 355 pr_err("FAIL: kprobe post_handle in test_kprobe() 1161 struct kprobe kprobe; global() member [all...] |
/kernel/linux/linux-6.6/arch/arm/probes/kprobes/ |
H A D | test-core.c | 40 * When the test case is run a kprobe is placed of each nop. The 48 * step a second time but with an additional kprobe on the test_case 172 * inserts a kprobe on the test case instruction 'test_insn' and returns a 177 * numbered run (the one without the kprobe on test_insn). These should be 178 * the same if the kprobe instruction simulation routine is correct. 310 static int __kprobes pre_handler(struct kprobe *p, struct pt_regs *regs) in pre_handler() 318 static void __kprobes post_handler(struct kprobe *p, struct pt_regs *regs, in post_handler() 326 static struct kprobe the_kprobe = { 351 pr_err("FAIL: kprobe pre_handler not called\n"); in test_kprobe() 355 pr_err("FAIL: kprobe post_handle in test_kprobe() 1161 struct kprobe kprobe; global() member [all...] |