Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 505545f7 authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Greg Kroah-Hartman
Browse files

Revert "ia64: kprobes: Fix to pass correct trampoline address to the handler"



This reverts commit f5f96e36.

The commit f5f96e36 ("ia64: kprobes: Fix to pass correct trampoline
address to the handler") was wrongly backported. It involves another
commit which is a part of another bigger series, so it should not be
backported to the stable tree.

Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bf1b11ac
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -411,8 +411,7 @@ static void kretprobe_trampoline(void)

int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
{
	regs->cr_iip = __kretprobe_trampoline_handler(regs,
		dereference_function_descriptor(kretprobe_trampoline), NULL);
	regs->cr_iip = __kretprobe_trampoline_handler(regs, kretprobe_trampoline, NULL);
	/*
	 * By returning a non-zero value, we are telling
	 * kprobe_handler() that we don't want the post_handler
@@ -428,7 +427,7 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
	ri->fp = NULL;

	/* Replace the return addr with trampoline addr */
	regs->b0 = (unsigned long)dereference_function_descriptor(kretprobe_trampoline);
	regs->b0 = ((struct fnptr *)kretprobe_trampoline)->ip;
}

/* Check the instruction in the slot is break */
@@ -958,14 +957,14 @@ static struct kprobe trampoline_p = {
int __init arch_init_kprobes(void)
{
	trampoline_p.addr =
		dereference_function_descriptor(kretprobe_trampoline);
		(kprobe_opcode_t *)((struct fnptr *)kretprobe_trampoline)->ip;
	return register_kprobe(&trampoline_p);
}

int __kprobes arch_trampoline_kprobe(struct kprobe *p)
{
	if (p->addr ==
		dereference_function_descriptor(kretprobe_trampoline))
		(kprobe_opcode_t *)((struct fnptr *)kretprobe_trampoline)->ip)
		return 1;

	return 0;