diff options
-rw-r--r-- | arch/i386/kernel/kprobes.c | 5 | ||||
-rw-r--r-- | include/linux/kprobes.h | 3 | ||||
-rw-r--r-- | kernel/kprobes.c | 5 |
3 files changed, 6 insertions, 7 deletions
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c index 2314d8d306fd..b8e2bae0ab4f 100644 --- a/arch/i386/kernel/kprobes.c +++ b/arch/i386/kernel/kprobes.c | |||
@@ -138,17 +138,14 @@ void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs) | |||
138 | } | 138 | } |
139 | } | 139 | } |
140 | 140 | ||
141 | void arch_kprobe_flush_task(struct task_struct *tk, spinlock_t *kp_lock) | 141 | void arch_kprobe_flush_task(struct task_struct *tk) |
142 | { | 142 | { |
143 | unsigned long flags = 0; | ||
144 | struct kretprobe_instance *ri; | 143 | struct kretprobe_instance *ri; |
145 | spin_lock_irqsave(kp_lock, flags); | ||
146 | while ((ri = get_rp_inst_tsk(tk)) != NULL) { | 144 | while ((ri = get_rp_inst_tsk(tk)) != NULL) { |
147 | *((unsigned long *)(ri->stack_addr)) = | 145 | *((unsigned long *)(ri->stack_addr)) = |
148 | (unsigned long) ri->ret_addr; | 146 | (unsigned long) ri->ret_addr; |
149 | recycle_rp_inst(ri); | 147 | recycle_rp_inst(ri); |
150 | } | 148 | } |
151 | spin_unlock_irqrestore(kp_lock, flags); | ||
152 | } | 149 | } |
153 | 150 | ||
154 | /* | 151 | /* |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 0f90466fb8b0..461391decc46 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/list.h> | 33 | #include <linux/list.h> |
34 | #include <linux/notifier.h> | 34 | #include <linux/notifier.h> |
35 | #include <linux/smp.h> | 35 | #include <linux/smp.h> |
36 | #include <linux/spinlock.h> | ||
37 | 36 | ||
38 | #include <asm/kprobes.h> | 37 | #include <asm/kprobes.h> |
39 | 38 | ||
@@ -101,7 +100,7 @@ extern void trampoline_post_handler(struct kprobe *p, struct pt_regs *regs, | |||
101 | unsigned long flags); | 100 | unsigned long flags); |
102 | extern struct task_struct *arch_get_kprobe_task(void *ptr); | 101 | extern struct task_struct *arch_get_kprobe_task(void *ptr); |
103 | extern void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs); | 102 | extern void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs); |
104 | extern void arch_kprobe_flush_task(struct task_struct *tk, spinlock_t *kp_lock); | 103 | extern void arch_kprobe_flush_task(struct task_struct *tk); |
105 | #else /* ARCH_SUPPORTS_KRETPROBES */ | 104 | #else /* ARCH_SUPPORTS_KRETPROBES */ |
106 | static inline void kretprobe_trampoline(void) | 105 | static inline void kretprobe_trampoline(void) |
107 | { | 106 | { |
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index e8e0ae8a6e14..dd42e717dd35 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -229,7 +229,10 @@ struct kretprobe_instance *get_rp_inst_tsk(struct task_struct *tk) | |||
229 | */ | 229 | */ |
230 | void kprobe_flush_task(struct task_struct *tk) | 230 | void kprobe_flush_task(struct task_struct *tk) |
231 | { | 231 | { |
232 | arch_kprobe_flush_task(tk, &kprobe_lock); | 232 | unsigned long flags = 0; |
233 | spin_lock_irqsave(&kprobe_lock, flags); | ||
234 | arch_kprobe_flush_task(tk); | ||
235 | spin_unlock_irqrestore(&kprobe_lock, flags); | ||
233 | } | 236 | } |
234 | 237 | ||
235 | /* | 238 | /* |