Thread (38 messages) 38 messages, 7 authors, 2016-04-20

[PATCH v11 8/9] arm64: Add kernel return probes support (kretprobes)

From: 平松雅巳 / HIRAMATU,MASAMI <hidden>
Date: 2016-03-17 12:22:38
Also in: lkml

Hi,
From: Sandeepa Prabhu <redacted>

The pre-handler of this special 'trampoline' kprobe executes the return
probe handler functions and restores original return address in ELR_EL1.
This way the saved pt_regs still hold the original register context to be
carried back to the probed kernel function.
This patch seems not well separated.
quoted hunk ↗ jump to hunk
diff --git a/arch/arm64/kernel/kprobes.c b/arch/arm64/kernel/kprobes.c
index bd3f233..13d3333 100644
--- a/arch/arm64/kernel/kprobes.c
+++ b/arch/arm64/kernel/kprobes.c
[snip]
+void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
+				      struct pt_regs *regs)
+{
+	ri->ret_addr = (kprobe_opcode_t *)regs->regs[30];
+
+	/* replace return addr (x30) with trampoline */
+	regs->regs[30] = (long)&kretprobe_trampoline;
So, where is the kretprobe_trampoline? It seems that function is
defined in other patch.
+}
+
+int __kprobes arch_trampoline_kprobe(struct kprobe *p)
+{
+	return 0;
}
And what this function is for??

Thank you,
int __init arch_init_kprobes(void)
--
2.5.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help