All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@redhat.com>
To: akpm@linux-foundation.org
Cc: mm-commits@vger.kernel.org, ananth@in.ibm.com,
	anil.s.keshavamurthy@intel.com,
	Jim Keniston <jkenisto@us.ibm.com>,
	systemtap-ml <systemtap@sources.redhat.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH -mm] bugfix: pass aggr_kprobe to arch_remove_kprobe
Date: Tue, 18 Nov 2008 11:29:01 -0500	[thread overview]
Message-ID: <4922ED4D.8070201@redhat.com> (raw)
In-Reply-To: <200811140028.mAE0SppC021444@imap1.linux-foundation.org>

Hi Andrew,

akpm@linux-foundation.org wrote:
> The patch titled
>      kprobes: support probing module __exit function
> has been added to the -mm tree.  Its filename is
>      kprobes-support-probing-module-__exit-function.patch

I found that one bug was still alive. Here is the bugfix.

Thank you,

Call arch_remove_kprobe() with aggr_kprobe instead of user specific kprobe,
because the user specific kprobe on the gone or reused aggr_kprobe may have
invalid arch_specific_insn.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
---
 kernel/kprobes.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Index: 2.6-rc/kernel/kprobes.c
===================================================================
--- 2.6-rc.orig/kernel/kprobes.c
+++ 2.6-rc/kernel/kprobes.c
@@ -766,14 +766,14 @@ static void __kprobes __unregister_kprob
 {
 	struct kprobe *old_p;

-	if (list_empty(&p->list) || list_is_singular(&p->list)) {
-		if (!list_empty(&p->list)) {
-			/* "p" is the last child of an aggr_kprobe */
-			old_p = list_entry(p->list.next, struct kprobe, list);
-			list_del(&p->list);
-			kfree(old_p);
-		}
+	if (list_empty(&p->list))
 		arch_remove_kprobe(p);
+	else if (list_is_singular(&p->list)) {
+		/* "p" is the last child of an aggr_kprobe */
+		old_p = list_entry(p->list.next, struct kprobe, list);
+		list_del(&p->list);
+		arch_remove_kprobe(old_p);
+		kfree(old_p);
 	}
 }


-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com



  reply	other threads:[~2008-11-18 16:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-14  0:28 + kprobes-support-probing-module-__exit-function.patch added to -mm tree akpm
2008-11-18 16:29 ` Masami Hiramatsu [this message]
2008-11-19  4:31   ` [PATCH -mm] bugfix: pass aggr_kprobe to arch_remove_kprobe Ananth N Mavinakayanahalli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4922ED4D.8070201@redhat.com \
    --to=mhiramat@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=ananth@in.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=jkenisto@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.