Exemplo n.º 1
0
void __kprobes arch_remove_kprobe(struct kprobe *p)
{
	if (saved_next_opcode.addr != 0x0) {
		arch_disarm_kprobe(p);
		arch_disarm_kprobe(&saved_next_opcode);
		saved_next_opcode.addr = 0x0;
		saved_next_opcode.opcode = 0x0;

		if (saved_next_opcode2.addr != 0x0) {
			arch_disarm_kprobe(&saved_next_opcode2);
			saved_next_opcode2.addr = 0x0;
			saved_next_opcode2.opcode = 0x0;
		}
	}
}
Exemplo n.º 2
0
void __kprobes arch_remove_kprobe(struct kprobe *p)
{
	struct kprobe *saved = &__get_cpu_var(saved_next_opcode);

	if (saved->addr) {
		arch_disarm_kprobe(p);
		arch_disarm_kprobe(saved);

		saved->addr = NULL;
		saved->opcode = 0;

		saved = &__get_cpu_var(saved_next_opcode2);
		if (saved->addr) {
			arch_disarm_kprobe(saved);

			saved->addr = NULL;
			saved->opcode = 0;
		}
	}
}
Exemplo n.º 3
0
/*
 * Singlestep is implemented by disabling the current kprobe and setting one
 * on the next instruction, following branches. Two probes are set if the
 * branch is conditional.
 */
static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
{
	kprobe_opcode_t *addr = NULL;
	saved_current_opcode.addr = (kprobe_opcode_t *) (regs->pc);
	addr = saved_current_opcode.addr;

	if (p != NULL) {
		arch_disarm_kprobe(p);

		if (OPCODE_JSR(p->opcode) || OPCODE_JMP(p->opcode)) {
			unsigned int reg_nr = ((p->opcode >> 8) & 0x000F);
			saved_next_opcode.addr =
			    (kprobe_opcode_t *) regs->regs[reg_nr];
		} else if (OPCODE_BRA(p->opcode) || OPCODE_BSR(p->opcode)) {
Exemplo n.º 4
0
static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
{
	__get_cpu_var(saved_current_opcode).addr = (kprobe_opcode_t *)regs->pc;

	if (p != NULL) {
		struct kprobe *op1, *op2;

		arch_disarm_kprobe(p);

		op1 = &__get_cpu_var(saved_next_opcode);
		op2 = &__get_cpu_var(saved_next_opcode2);

		if (OPCODE_JSR(p->opcode) || OPCODE_JMP(p->opcode)) {
			unsigned int reg_nr = ((p->opcode >> 8) & 0x000F);
			op1->addr = (kprobe_opcode_t *) regs->regs[reg_nr];
		} else if (OPCODE_BRA(p->opcode) || OPCODE_BSR(p->opcode)) {