summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-04-27 11:01:21 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-27 11:01:21 -0700
commit7b87308e710858e95729b9e33c8b79e2a1564d37 (patch)
treec0d9510ac19c1d2931ae784e63981da98773a817 /kernel
parent64ebe3126cefa45d7b97a6fc4de846285a55321f (diff)
parentbe71eda5383faa663efdba9ef54a6b8255e3c7f0 (diff)
downloadlinux-7b87308e710858e95729b9e33c8b79e2a1564d37.tar.bz2
Merge tag 'modules-for-v4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux
Pull modules fix from Jessica Yu: "Fix display of module section addresses in sysfs, which were getting hashed with %pK and breaking tools like perf" * tag 'modules-for-v4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux: module: Fix display of wrong module .text address
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/module.c b/kernel/module.c
index a6e43a5806a1..ce8066b88178 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1472,7 +1472,8 @@ static ssize_t module_sect_show(struct module_attribute *mattr,
{
struct module_sect_attr *sattr =
container_of(mattr, struct module_sect_attr, mattr);
- return sprintf(buf, "0x%pK\n", (void *)sattr->address);
+ return sprintf(buf, "0x%px\n", kptr_restrict < 2 ?
+ (void *)sattr->address : NULL);
}
static void free_sect_attrs(struct module_sect_attrs *sect_attrs)