This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH 2/2] [BUGFIX] kprobes/mips: Fix to check double free of insn slot
- From: Masami Hiramatsu <masami dot hiramatsu dot pt at hitachi dot com>
- To: Ingo Molnar <mingo at redhat dot com>, linux-kernel at vger dot kernel dot org
- Cc: linux-mips at linux-mips dot org, Victor Kamensky <kamensky at cisco dot com>, David Daney <ddaney at caviumnetworks dot com>, Ralf Baechle <ralf at linux-mips dot org>, Maneesh Soni <manesoni at cisco dot com>, yrl dot pp-manager dot tt at hitachi dot com, systemtap at sourceware dot org
- Date: Wed, 22 May 2013 18:34:13 +0900
- Subject: [PATCH 2/2] [BUGFIX] kprobes/mips: Fix to check double free of insn slot
- References: <20130522093409 dot 9084 dot 63554 dot stgit at mhiramat-M0-7522>
Fix to check double free of insn_slot at arch_remove_kprobe
as other arches do.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: David Daney <ddaney@caviumnetworks.com>
Cc: Maneesh Soni <manesoni@cisco.com>
Cc: Victor Kamensky <kamensky@cisco.com>
Cc: linux-mips@linux-mips.org
---
arch/mips/kernel/kprobes.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/mips/kernel/kprobes.c b/arch/mips/kernel/kprobes.c
index 12bc4eb..1f8187a 100644
--- a/arch/mips/kernel/kprobes.c
+++ b/arch/mips/kernel/kprobes.c
@@ -207,7 +207,10 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
void __kprobes arch_remove_kprobe(struct kprobe *p)
{
- free_insn_slot(p->ainsn.insn, 0);
+ if (p->ainsn.insn) {
+ free_insn_slot(p->ainsn.insn, 0);
+ p->ainsn.insn = NULL;
+ }
}
static void save_previous_kprobe(struct kprobe_ctlblk *kcb)