* [PATCH] kprobes: NULL out non-relevant fields in struct kretprobe
@ 2006-04-18 9:09 Ananth N Mavinakayanahalli
0 siblings, 0 replies; only message in thread
From: Ananth N Mavinakayanahalli @ 2006-04-18 9:09 UTC (permalink / raw)
To: lkml
Cc: Andrew Morton, Anil S Keshavamurthy, Prasanna S Panchamukhi,
SystemTAP, Jim Keniston
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) {
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-04-18 9:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-18 9:09 [PATCH] kprobes: NULL out non-relevant fields in struct kretprobe Ananth N Mavinakayanahalli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox