Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753166AbZG1Xo2 (ORCPT ); Tue, 28 Jul 2009 19:44:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752853AbZG1Xo1 (ORCPT ); Tue, 28 Jul 2009 19:44:27 -0400 Received: from mx2.redhat.com ([66.187.237.31]:57449 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753099AbZG1Xo0 (ORCPT ); Tue, 28 Jul 2009 19:44:26 -0400 From: Masami Hiramatsu Subject: [BUGFIX PATCH] kprobes: Use kernel_text_address() for checking probe address To: Linus Torvalds , lkml , Ananth N Mavinakayanahalli Cc: systemtap , Masami Hiramatsu , Ananth N Mavinakayanahalli , Jim Keniston Date: Tue, 28 Jul 2009 19:47:23 -0400 Message-ID: <20090728234723.15708.54455.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1283 Lines: 41 Use kernel_text_address() for checking probe address instead of __kernel_text_address(), because __kernel_text_address() returns !0 for init functions even after relaseing those functions. That will hit a BUG() in text_poke(). Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Jim Keniston --- kernel/kprobes.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 16b5739..0540948 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -694,7 +694,7 @@ int __kprobes register_kprobe(struct kprobe *p) p->addr = addr; preempt_disable(); - if (!__kernel_text_address((unsigned long) p->addr) || + if (!kernel_text_address((unsigned long) p->addr) || in_kprobes_functions((unsigned long) p->addr)) { preempt_enable(); return -EINVAL; -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: mhiramat@redhat.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/