/* * The actual disarming is done here on each CPU and synchronized using * stop_machine. This synchronization is necessary on SMP to avoid removing * a probe between the moment the 'Undefined Instruction' exception is raised * and the moment the exception handler reads the faulting instruction from * memory. It is also needed to atomically set the two half-words of a 32-bit * Thumb breakpoint. */ int __kprobes __arch_disarm_kprobe(void *p) { struct kprobe *kp = p; void *addr = (void *)((uintptr_t)kp->addr & ~1); __patch_text(addr, kp->opcode); return 0; }
static int __kprobes_remove_breakpoint(void *data) { struct patch *p = data; __patch_text(p->addr, p->insn); return 0; }