linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 1/2] module: Overwrite st_size instead of st_info
@ 2018-12-04 14:14 Vincent Whitchurch
  2018-12-04 14:14 ` [PATCH v5 2/2] ARM: module: Fix function kallsyms on Thumb-2 Vincent Whitchurch
  2018-12-06  9:45 ` [PATCH v5 1/2] module: Overwrite st_size instead of st_info Miroslav Benes
  0 siblings, 2 replies; 5+ messages in thread
From: Vincent Whitchurch @ 2018-12-04 14:14 UTC (permalink / raw)
  To: linux, jeyu
  Cc: dave.martin, linux-arm-kernel, linux-kernel, Vincent Whitchurch

st_info is currently overwritten after relocation and used to store the
elf_type().  However, we're going to need it fix kallsyms on ARM's
Thumb-2 kernels, so preserve st_info and overwrite the st_size field
instead.  st_size is neither used by the module core nor by any
architecture.

Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
---
v5: Add Dave Martin's Reviewed-by
v4: Split out to separate patch.  Use st_size instead of st_other.
v1-v3: See PATCH 2/2

 kernel/module.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index 49a405891587..3d86a38b580c 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2682,7 +2682,7 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
 
 	/* Set types up while we still have access to sections. */
 	for (i = 0; i < mod->kallsyms->num_symtab; i++)
-		mod->kallsyms->symtab[i].st_info
+		mod->kallsyms->symtab[i].st_size
 			= elf_type(&mod->kallsyms->symtab[i], info);
 
 	/* Now populate the cut down core kallsyms for after init. */
@@ -4061,7 +4061,7 @@ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
 		kallsyms = rcu_dereference_sched(mod->kallsyms);
 		if (symnum < kallsyms->num_symtab) {
 			*value = kallsyms->symtab[symnum].st_value;
-			*type = kallsyms->symtab[symnum].st_info;
+			*type = kallsyms->symtab[symnum].st_size;
 			strlcpy(name, symname(kallsyms, symnum), KSYM_NAME_LEN);
 			strlcpy(module_name, mod->name, MODULE_NAME_LEN);
 			*exported = is_exported(name, *value, mod);
-- 
2.11.0


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

end of thread, other threads:[~2018-12-14 16:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-04 14:14 [PATCH v5 1/2] module: Overwrite st_size instead of st_info Vincent Whitchurch
2018-12-04 14:14 ` [PATCH v5 2/2] ARM: module: Fix function kallsyms on Thumb-2 Vincent Whitchurch
2018-12-06 17:29   ` Jessica Yu
2018-12-14 16:07     ` Vincent Whitchurch
2018-12-06  9:45 ` [PATCH v5 1/2] module: Overwrite st_size instead of st_info Miroslav Benes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).