[PATCH] kprobes: bugfix: try_module_get even if calling_mod is NULL

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Masami Hiramatsu
Date: Wednesday, November 5, 2008 - 5:06 pm

Get probed module even if the caller is in the kernel core code.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
---


Thank you so much. So here is the additional bugfix patch.

 kernel/kprobes.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: 2.6.28-rc3/kernel/kprobes.c
===================================================================
--- 2.6.28-rc3.orig/kernel/kprobes.c
+++ 2.6.28-rc3/kernel/kprobes.c
@@ -634,7 +634,7 @@ static int __kprobes __register_kprobe(s
 		 * avoid incrementing the module refcount, so as to allow
 		 * unloading of self probing modules.
 		 */
-		if (calling_mod && calling_mod != probed_mod) {
+		if (calling_mod != probed_mod) {
 			if (unlikely(!try_module_get(probed_mod))) {
 				preempt_enable();
 				return -EINVAL;

-- 
Masami Hiramatsu

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

e-mail: mhiramat@redhat.com

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] kprobes: disable preempt for module_text_address(), Ananth N Mavinakayan ..., (Tue Nov 4, 7:28 am)
Re: [PATCH] kprobes: disable preempt for module_text_address(), Hiroshi Shimamoto, (Wed Nov 5, 12:30 pm)
[PATCH] kprobes: bugfix: try_module_get even if calling_mo ..., Masami Hiramatsu, (Wed Nov 5, 5:06 pm)
Re: [PATCH] kprobes: bugfix: try_module_get even if callin ..., Ananth N Mavinakayan ..., (Thu Nov 6, 9:46 pm)