From 29b6cd794e73eea7600541d06288a09861ffecb0 Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Tue, 18 Dec 2007 18:05:58 +0100 Subject: x86: jprobe bugfix jprobe for x86-64 may cause kernel page fault when the jprobe_return() is called from incorrect function. - Use jprobe_saved_regs instead getting it from stack. (Especially on x86-64, it may get incorrect data, because pt_regs can not be get by using container_of(rsp)) - Change the type of stack pointer to unsigned long *. Signed-off-by: Masami Hiramatsu Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/kprobes_32.h | 2 +- include/asm-x86/kprobes_64.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/kprobes_32.h b/include/asm-x86/kprobes_32.h index b772d5b3868..9fe8f3bddfd 100644 --- a/include/asm-x86/kprobes_32.h +++ b/include/asm-x86/kprobes_32.h @@ -73,7 +73,7 @@ struct kprobe_ctlblk { unsigned long kprobe_status; unsigned long kprobe_old_eflags; unsigned long kprobe_saved_eflags; - long *jprobe_saved_esp; + unsigned long *jprobe_saved_esp; struct pt_regs jprobe_saved_regs; kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE]; struct prev_kprobe prev_kprobe; diff --git a/include/asm-x86/kprobes_64.h b/include/asm-x86/kprobes_64.h index 53f4d850735..743d76218fc 100644 --- a/include/asm-x86/kprobes_64.h +++ b/include/asm-x86/kprobes_64.h @@ -66,7 +66,7 @@ struct kprobe_ctlblk { unsigned long kprobe_status; unsigned long kprobe_old_rflags; unsigned long kprobe_saved_rflags; - long *jprobe_saved_rsp; + unsigned long *jprobe_saved_rsp; struct pt_regs jprobe_saved_regs; kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE]; struct prev_kprobe prev_kprobe; -- cgit v1.2.3-70-g09d2