diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2007-12-18 12:05:58 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-12-18 12:05:58 -0500 |
commit | 29b6cd794e73eea7600541d06288a09861ffecb0 (patch) | |
tree | 7f915b756058acc89cf3e85b75dcce0ec60a9e12 /include/asm-x86 | |
parent | b4be625852618636a6b54908c4f9d90fb29dc549 (diff) |
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 <mhiramat@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/kprobes_32.h | 2 | ||||
-rw-r--r-- | include/asm-x86/kprobes_64.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-x86/kprobes_32.h b/include/asm-x86/kprobes_32.h index b772d5b38685..9fe8f3bddfd5 100644 --- a/include/asm-x86/kprobes_32.h +++ b/include/asm-x86/kprobes_32.h | |||
@@ -73,7 +73,7 @@ struct kprobe_ctlblk { | |||
73 | unsigned long kprobe_status; | 73 | unsigned long kprobe_status; |
74 | unsigned long kprobe_old_eflags; | 74 | unsigned long kprobe_old_eflags; |
75 | unsigned long kprobe_saved_eflags; | 75 | unsigned long kprobe_saved_eflags; |
76 | long *jprobe_saved_esp; | 76 | unsigned long *jprobe_saved_esp; |
77 | struct pt_regs jprobe_saved_regs; | 77 | struct pt_regs jprobe_saved_regs; |
78 | kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE]; | 78 | kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE]; |
79 | struct prev_kprobe prev_kprobe; | 79 | struct prev_kprobe prev_kprobe; |
diff --git a/include/asm-x86/kprobes_64.h b/include/asm-x86/kprobes_64.h index 53f4d8507354..743d76218fc9 100644 --- a/include/asm-x86/kprobes_64.h +++ b/include/asm-x86/kprobes_64.h | |||
@@ -66,7 +66,7 @@ struct kprobe_ctlblk { | |||
66 | unsigned long kprobe_status; | 66 | unsigned long kprobe_status; |
67 | unsigned long kprobe_old_rflags; | 67 | unsigned long kprobe_old_rflags; |
68 | unsigned long kprobe_saved_rflags; | 68 | unsigned long kprobe_saved_rflags; |
69 | long *jprobe_saved_rsp; | 69 | unsigned long *jprobe_saved_rsp; |
70 | struct pt_regs jprobe_saved_regs; | 70 | struct pt_regs jprobe_saved_regs; |
71 | kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE]; | 71 | kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE]; |
72 | struct prev_kprobe prev_kprobe; | 72 | struct prev_kprobe prev_kprobe; |