From: Jessica Yu <jeyu@kernel.org>
To: Vincent Whitchurch <vincent.whitchurch@axis.com>
Cc: Vincent Whitchurch <rabinv@axis.com>,
linux-kernel@vger.kernel.org, linux@armlinux.org.uk,
Miroslav Benes <mbenes@suse.cz>,
dave.martin@arm.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v6 modules-next 1/2] module: Overwrite st_size instead of st_info
Date: Fri, 14 Dec 2018 21:59:25 +0100 [thread overview]
Message-ID: <20181214205925.GA9656@linux-8ccs> (raw)
In-Reply-To: <20181214160555.9980-1-vincent.whitchurch@axis.com>
+++ Vincent Whitchurch [14/12/18 17:05 +0100]:
>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: Miroslav Benes <mbenes@suse.cz>
>Reviewed-by: Dave Martin <Dave.Martin@arm.com>
>Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Applied both. (Thanks for rebasing!)
Thanks,
Jessica
>---
>v6: Add Miroslav Benes' Reviewed-by
>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 1b5edf78694c..b36ff8a3d562 100644
>--- a/kernel/module.c
>+++ b/kernel/module.c
>@@ -2684,7 +2684,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. */
>@@ -4070,7 +4070,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, kallsyms_symbol_name(kallsyms, symnum), KSYM_NAME_LEN);
> strlcpy(module_name, mod->name, MODULE_NAME_LEN);
> *exported = is_exported(name, *value, mod);
>--
>2.11.0
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Jessica Yu <jeyu@kernel.org>
To: Vincent Whitchurch <vincent.whitchurch@axis.com>
Cc: linux@armlinux.org.uk, dave.martin@arm.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Vincent Whitchurch <rabinv@axis.com>,
Miroslav Benes <mbenes@suse.cz>
Subject: Re: [PATCH v6 modules-next 1/2] module: Overwrite st_size instead of st_info
Date: Fri, 14 Dec 2018 21:59:25 +0100 [thread overview]
Message-ID: <20181214205925.GA9656@linux-8ccs> (raw)
In-Reply-To: <20181214160555.9980-1-vincent.whitchurch@axis.com>
+++ Vincent Whitchurch [14/12/18 17:05 +0100]:
>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: Miroslav Benes <mbenes@suse.cz>
>Reviewed-by: Dave Martin <Dave.Martin@arm.com>
>Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Applied both. (Thanks for rebasing!)
Thanks,
Jessica
>---
>v6: Add Miroslav Benes' Reviewed-by
>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 1b5edf78694c..b36ff8a3d562 100644
>--- a/kernel/module.c
>+++ b/kernel/module.c
>@@ -2684,7 +2684,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. */
>@@ -4070,7 +4070,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, kallsyms_symbol_name(kallsyms, symnum), KSYM_NAME_LEN);
> strlcpy(module_name, mod->name, MODULE_NAME_LEN);
> *exported = is_exported(name, *value, mod);
>--
>2.11.0
>
next prev parent reply other threads:[~2018-12-14 20:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-14 16:05 [PATCH v6 modules-next 1/2] module: Overwrite st_size instead of st_info Vincent Whitchurch
2018-12-14 16:05 ` Vincent Whitchurch
2018-12-14 16:05 ` [PATCH v6 modules-next 2/2] ARM: module: Fix function kallsyms on Thumb-2 Vincent Whitchurch
2018-12-14 16:05 ` Vincent Whitchurch
2018-12-14 20:59 ` Jessica Yu [this message]
2018-12-14 20:59 ` [PATCH v6 modules-next 1/2] module: Overwrite st_size instead of st_info Jessica Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181214205925.GA9656@linux-8ccs \
--to=jeyu@kernel.org \
--cc=dave.martin@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mbenes@suse.cz \
--cc=rabinv@axis.com \
--cc=vincent.whitchurch@axis.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.