public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH resend] Update num_symtab, symtab and strtab right after setup of core_num_syms, core_symtab and core_strtab.
@ 2010-09-28  1:06 Hu Tao
  2010-09-28  6:01 ` Hu Tao
  2010-10-05  0:09 ` Rusty Russell
  0 siblings, 2 replies; 3+ messages in thread
From: Hu Tao @ 2010-09-28  1:06 UTC (permalink / raw)
  To: lkml; +Cc: Rusty Russell, Tejun Heo, Andrew Morton,
	Am��rico Wang

symtab/strtab refer to memory that will be vfreed when load_module() is
done. So update them early.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
 kernel/module.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index d0b5f8d..d5dc98b 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2029,6 +2029,10 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
 	for (*s = 0, i = 1; i < info->sechdrs[info->index.str].sh_size; ++i)
 		if (test_bit(i, info->strmap))
 			*++s = mod->strtab[i];
+
+	mod->num_symtab = mod->core_num_syms;
+	mod->symtab = mod->core_symtab;
+	mod->strtab = mod->core_strtab;
 }
 #else
 static inline void layout_symtab(struct module *mod, struct load_info *info)
@@ -2738,11 +2742,6 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
 	/* Drop initial reference. */
 	module_put(mod);
 	trim_init_extable(mod);
-#ifdef CONFIG_KALLSYMS
-	mod->num_symtab = mod->core_num_syms;
-	mod->symtab = mod->core_symtab;
-	mod->strtab = mod->core_strtab;
-#endif
 	module_free(mod, mod->module_init);
 	mod->module_init = NULL;
 	mod->init_size = 0;
-- 
1.7.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH resend] Update num_symtab, symtab and strtab right after setup of core_num_syms, core_symtab and core_strtab.
  2010-09-28  1:06 [PATCH resend] Update num_symtab, symtab and strtab right after setup of core_num_syms, core_symtab and core_strtab Hu Tao
@ 2010-09-28  6:01 ` Hu Tao
  2010-10-05  0:09 ` Rusty Russell
  1 sibling, 0 replies; 3+ messages in thread
From: Hu Tao @ 2010-09-28  6:01 UTC (permalink / raw)
  To: lkml; +Cc: Rusty Russell, Tejun Heo, Andrew Morton, Americo Wang

Negative. Sorry for noise.

On Tue, Sep 28, 2010 at 09:06:28AM +0800, Hu Tao wrote:
> symtab/strtab refer to memory that will be vfreed when load_module() is
> done. So update them early.
> 
> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
> ---
>  kernel/module.c |    9 ++++-----
>  1 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/kernel/module.c b/kernel/module.c
> index d0b5f8d..d5dc98b 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -2029,6 +2029,10 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
>  	for (*s = 0, i = 1; i < info->sechdrs[info->index.str].sh_size; ++i)
>  		if (test_bit(i, info->strmap))
>  			*++s = mod->strtab[i];
> +
> +	mod->num_symtab = mod->core_num_syms;
> +	mod->symtab = mod->core_symtab;
> +	mod->strtab = mod->core_strtab;
>  }
>  #else
>  static inline void layout_symtab(struct module *mod, struct load_info *info)
> @@ -2738,11 +2742,6 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
>  	/* Drop initial reference. */
>  	module_put(mod);
>  	trim_init_extable(mod);
> -#ifdef CONFIG_KALLSYMS
> -	mod->num_symtab = mod->core_num_syms;
> -	mod->symtab = mod->core_symtab;
> -	mod->strtab = mod->core_strtab;
> -#endif
>  	module_free(mod, mod->module_init);
>  	mod->module_init = NULL;
>  	mod->init_size = 0;
> -- 
> 1.7.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH resend] Update num_symtab, symtab and strtab right after setup of core_num_syms, core_symtab and core_strtab.
  2010-09-28  1:06 [PATCH resend] Update num_symtab, symtab and strtab right after setup of core_num_syms, core_symtab and core_strtab Hu Tao
  2010-09-28  6:01 ` Hu Tao
@ 2010-10-05  0:09 ` Rusty Russell
  1 sibling, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2010-10-05  0:09 UTC (permalink / raw)
  To: Hu Tao; +Cc: lkml, Tejun Heo, Andrew Morton, Am��rico Wang

On Tue, 28 Sep 2010 10:36:28 am Hu Tao wrote:
> symtab/strtab refer to memory that will be vfreed when load_module() is
> done. So update them early.

I don't think so.  See layout_symtab which moves these into the init
section of the module.

Your change would make us unable to see init section symbols; if you
crash during module init, you really want to see these symbols.

Hope that helps,
Rusty.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-05  0:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-28  1:06 [PATCH resend] Update num_symtab, symtab and strtab right after setup of core_num_syms, core_symtab and core_strtab Hu Tao
2010-09-28  6:01 ` Hu Tao
2010-10-05  0:09 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox