[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20130619114244.19843.90351.stgit@mhiramat-M0-7522>
Date: Wed, 19 Jun 2013 20:42:44 +0900
From: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To: linux-kernel@...r.kernel.org, linux-sh@...r.kernel.org
Cc: Sasha Levin <sasha.levin@...cle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Paul Mundt <lethal@...ux-sh.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
yrl.pp-manager.tt@...achi.com
Subject: [PATCH] sh/kprobes: Fix illslot handler not to unregister but disarm
kprobe
Fix illegal slot exception handler not to unregister the kprobe
but just to disarm it. Since the unregister_kprobe must sleep (by
synchronize_sched), it must not be called from any exception/
interrupt handlers. Disarming is safe because it just recovers
original instruction code.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc: Paul Mundt <lethal@...ux-sh.org>
Cc: Sasha Levin <sasha.levin@...cle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
---
arch/sh/kernel/kprobes.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/sh/kernel/kprobes.c b/arch/sh/kernel/kprobes.c
index 42b46e6..5ec8182 100644
--- a/arch/sh/kernel/kprobes.c
+++ b/arch/sh/kernel/kprobes.c
@@ -82,7 +82,7 @@ int __kprobes arch_trampoline_kprobe(struct kprobe *p)
/**
* If an illegal slot instruction exception occurs for an address
- * containing a kprobe, remove the probe.
+ * containing a kprobe, disarm the probe.
*
* Returns 0 if the exception was handled successfully, 1 otherwise.
*/
@@ -93,7 +93,7 @@ int __kprobes kprobe_handle_illslot(unsigned long pc)
if (p != NULL) {
printk("Warning: removing kprobe from delay slot: 0x%.8x\n",
(unsigned int)pc + 2);
- unregister_kprobe(p);
+ arch_disarm_kprobe(p);
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists