From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12182 invoked by alias); 28 Jul 2009 23:44:28 -0000 Received: (qmail 12173 invoked by uid 22791); 28 Jul 2009 23:44:28 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Jul 2009 23:44:21 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n6SNiHaE027439 for ; Tue, 28 Jul 2009 19:44:17 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6SNiHIv011671 for ; Tue, 28 Jul 2009 19:44:17 -0400 Received: from localhost.localdomain (dhcp-100-3-156.bos.redhat.com [10.16.3.156]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6SNiG4R022075; Tue, 28 Jul 2009 19:44:16 -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 23:44:00 -0000 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 X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00223.txt.bz2 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