[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-83ff56f46a8532488ee364bb93a9cb2a59490d33@git.kernel.org>
Date: Thu, 11 Mar 2010 14:39:40 GMT
From: tip-bot for Masami Hiramatsu <mhiramat@...hat.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
sachinp@...ibm.com, ananth@...ibm.com, heiko.carstens@...ibm.com,
tglx@...utronix.de, mhiramat@...hat.com, mingo@...e.hu
Subject: [tip:perf/urgent] kprobes: Calculate the index correctly when freeing the out-of-line execution slot
Commit-ID: 83ff56f46a8532488ee364bb93a9cb2a59490d33
Gitweb: http://git.kernel.org/tip/83ff56f46a8532488ee364bb93a9cb2a59490d33
Author: Masami Hiramatsu <mhiramat@...hat.com>
AuthorDate: Tue, 9 Mar 2010 10:22:19 -0500
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Thu, 11 Mar 2010 14:06:16 +0100
kprobes: Calculate the index correctly when freeing the out-of-line execution slot
>From : Ananth N Mavinakayanahalli <ananth@...ibm.com>
When freeing the instruction slot, the arithmetic to calculate
the index of the slot in the page needs to account for the total
size of the instruction on the various architectures.
Calculate the index correctly when freeing the out-of-line
execution slot.
Reported-by: Sachin Sant <sachinp@...ibm.com>
Reported-by: Heiko Carstens <heiko.carstens@...ibm.com>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@...ibm.com>
Signed-off-by: Masami Hiramatsu <mhiramat@...hat.com>
LKML-Reference: <4B9667AB.9050507@...hat.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/kprobes.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index fa034d2..0ed46f3 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -259,7 +259,8 @@ static void __kprobes __free_insn_slot(struct kprobe_insn_cache *c,
struct kprobe_insn_page *kip;
list_for_each_entry(kip, &c->pages, list) {
- long idx = ((long)slot - (long)kip->insns) / c->insn_size;
+ long idx = ((long)slot - (long)kip->insns) /
+ (c->insn_size * sizeof(kprobe_opcode_t));
if (idx >= 0 && idx < slots_per_page(c)) {
WARN_ON(kip->slot_used[idx] != SLOT_USED);
if (dirty) {
--
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