[<prev] [next>] [day] [month] [year] [list]
Message-ID: <49249B05.9080305@redhat.com>
Date: Wed, 19 Nov 2008 18:02:29 -0500
From: Masami Hiramatsu <mhiramat@...hat.com>
To: akpm@...ux-foundation.org
CC: mm-commits@...r.kernel.org, ananth@...ibm.com,
anil.s.keshavamurthy@...el.com, Jim Keniston <jkenisto@...ibm.com>,
LKML <linux-kernel@...r.kernel.org>,
systemtap-ml <systemtap@...rces.redhat.com>
Subject: [PATCH -mm] bugfix: release old_p's insn_slot before error return
Hi Andrew,
akpm@...ux-foundation.org wrote:
> The patch titled
> bugfix: pass aggr_kprobe to arch_remove_kprobe
> has been added to the -mm tree. Its filename is
> kprobes-support-probing-module-__exit-function-fix-2.patch
Oops, sorry, I found one another bug...
Release old_p->ainsn.insn_slot before error return, if the memory
allocation of new aggr_kprobe is failed.
Signed-off-by: Masami Hiramatsu <mhiramat@...hat.com>
Cc: Ananth N Mavinakayanahalli <ananth@...ibm.com>
---
kernel/kprobes.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Index: 2.6.28-rc4/kernel/kprobes.c
===================================================================
--- 2.6.28-rc4.orig/kernel/kprobes.c
+++ 2.6.28-rc4/kernel/kprobes.c
@@ -584,8 +584,11 @@ static int __kprobes register_aggr_kprob
ap = old_p;
} else {
ap = kzalloc(sizeof(struct kprobe), GFP_KERNEL);
- if (!ap)
+ if (!ap) {
+ if (kprobe_gone(old_p))
+ arch_remove_kprobe(old_p);
return -ENOMEM;
+ }
add_aggr_kprobe(ap, old_p);
copy_kprobe(ap, p);
ret = add_new_kprobe(ap, p);
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@...hat.com
--
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