From: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>,
Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
Prasanna S Panchamukhi <prasanna@in.ibm.com>,
SystemTAP <systemtap@sources.redhat.com>,
Jim Keniston <jkenisto@us.ibm.com>
Subject: [PATCH] kprobes: NULL out non-relevant fields in struct kretprobe
Date: Tue, 18 Apr 2006 14:39:50 +0530 [thread overview]
Message-ID: <20060418090950.GA5461@in.ibm.com> (raw)
From: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
In cases where a struct kretprobe's *_handler fields are non-NULL, it
is possible to cause a system crash, due to the possibility of calls
ending up in zombie functions. Documentation clearly states that unused
*_handlers should be set to NULL, but kprobe users sometimes fail to
do so.
Fix it by setting the non-relevant fields of the struct kretprobe to NULL.
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: Jim Keniston <jkenisto@us.ibm.com>
---
kernel/kprobes.c | 3 +++
1 files changed, 3 insertions(+)
Index: linux-2.6.17-rc1/kernel/kprobes.c
===================================================================
--- linux-2.6.17-rc1.orig/kernel/kprobes.c
+++ linux-2.6.17-rc1/kernel/kprobes.c
@@ -585,6 +585,9 @@ int __kprobes register_kretprobe(struct
int i;
rp->kp.pre_handler = pre_handler_kretprobe;
+ rp->kp.post_handler = NULL;
+ rp->kp.fault_handler = NULL;
+ rp->kp.break_handler = NULL;
/* Pre-allocate memory for max kretprobe instances */
if (rp->maxactive <= 0) {
reply other threads:[~2006-04-18 9:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20060418090950.GA5461@in.ibm.com \
--to=ananth@in.ibm.com \
--cc=akpm@osdl.org \
--cc=anil.s.keshavamurthy@intel.com \
--cc=jkenisto@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=prasanna@in.ibm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox