diff options
author | Ananth N Mavinakayanahalli | 2006-04-20 11:43:11 +0200 |
---|---|---|
committer | Linus Torvalds | 2006-04-20 16:54:03 +0200 |
commit | 7522a8423bed9931cbac5502b9c0657bde2700ea (patch) | |
tree | 8729269696269cba4ca477d711490a6c89c20cda /kernel/kprobes.c | |
parent | [PATCH] Add more prevent_tail_call() (diff) | |
download | kernel-qcow2-linux-7522a8423bed9931cbac5502b9c0657bde2700ea.tar.gz kernel-qcow2-linux-7522a8423bed9931cbac5502b9c0657bde2700ea.tar.xz kernel-qcow2-linux-7522a8423bed9931cbac5502b9c0657bde2700ea.zip |
[PATCH] kprobes: NULL out non-relevant fields in struct kretprobe
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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/kprobes.c')
-rw-r--r-- | kernel/kprobes.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 1156eb0977d0..1fbf466a29aa 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -585,6 +585,9 @@ int __kprobes register_kretprobe(struct kretprobe *rp) 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) { |