aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPrasanna S Panchamukhi <prasanna@in.ibm.com>2005-05-05 16:15:41 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-05 16:36:39 -0700
commit04dea5f93231204cc3ca0ab793ce76dbb10c86ba (patch)
treeb47e20371a62b46bedea4337f191d245b44b097f /kernel
parent[PATCH] Kprobes: Incorrect handling of probes on ret/lret instruction (diff)
downloadlinux-dev-04dea5f93231204cc3ca0ab793ce76dbb10c86ba.tar.xz
linux-dev-04dea5f93231204cc3ca0ab793ce76dbb10c86ba.zip
[PATCH] Kprobes: Oops! in unregister_kprobe()
kernel oops! when unregister_kprobe() is called on a non-registered kprobe. This patch fixes the above problem by checking if the probe exists before unregistering. Signed-off-by: Prasanna S Panchamukhi <prasanna@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/kprobes.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 1d5dd1337bd1..d8903e60c99a 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -107,13 +107,17 @@ rm_kprobe:
void unregister_kprobe(struct kprobe *p)
{
unsigned long flags;
- arch_remove_kprobe(p);
spin_lock_irqsave(&kprobe_lock, flags);
+ if (!get_kprobe(p->addr)) {
+ spin_unlock_irqrestore(&kprobe_lock, flags);
+ return;
+ }
*p->addr = p->opcode;
hlist_del(&p->hlist);
flush_icache_range((unsigned long) p->addr,
(unsigned long) p->addr + sizeof(kprobe_opcode_t));
spin_unlock_irqrestore(&kprobe_lock, flags);
+ arch_remove_kprobe(p);
}
static struct notifier_block kprobe_exceptions_nb = {