diff options
Diffstat (limited to 'arch/x86_64/kernel/kprobes.c')
-rw-r--r-- | arch/x86_64/kernel/kprobes.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86_64/kernel/kprobes.c index 5841ba5f479b..f995bea6e2c1 100644 --- a/arch/x86_64/kernel/kprobes.c +++ b/arch/x86_64/kernel/kprobes.c | |||
@@ -266,23 +266,14 @@ static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) | |||
266 | } | 266 | } |
267 | 267 | ||
268 | /* Called with kretprobe_lock held */ | 268 | /* Called with kretprobe_lock held */ |
269 | void __kprobes arch_prepare_kretprobe(struct kretprobe *rp, | 269 | void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri, |
270 | struct pt_regs *regs) | 270 | struct pt_regs *regs) |
271 | { | 271 | { |
272 | unsigned long *sara = (unsigned long *)regs->rsp; | 272 | unsigned long *sara = (unsigned long *)regs->rsp; |
273 | struct kretprobe_instance *ri; | ||
274 | 273 | ||
275 | if ((ri = get_free_rp_inst(rp)) != NULL) { | 274 | ri->ret_addr = (kprobe_opcode_t *) *sara; |
276 | ri->rp = rp; | 275 | /* Replace the return addr with trampoline addr */ |
277 | ri->task = current; | 276 | *sara = (unsigned long) &kretprobe_trampoline; |
278 | ri->ret_addr = (kprobe_opcode_t *) *sara; | ||
279 | |||
280 | /* Replace the return addr with trampoline addr */ | ||
281 | *sara = (unsigned long) &kretprobe_trampoline; | ||
282 | add_rp_inst(ri); | ||
283 | } else { | ||
284 | rp->nmissed++; | ||
285 | } | ||
286 | } | 277 | } |
287 | 278 | ||
288 | int __kprobes kprobe_handler(struct pt_regs *regs) | 279 | int __kprobes kprobe_handler(struct pt_regs *regs) |