diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-27 21:01:21 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-27 21:01:21 +0300 |
commit | 7b87308e710858e95729b9e33c8b79e2a1564d37 (patch) | |
tree | c0d9510ac19c1d2931ae784e63981da98773a817 | |
parent | 64ebe3126cefa45d7b97a6fc4de846285a55321f (diff) | |
parent | be71eda5383faa663efdba9ef54a6b8255e3c7f0 (diff) | |
download | linux-7b87308e710858e95729b9e33c8b79e2a1564d37.tar.xz |
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
-rw-r--r-- | kernel/module.c | 3 |
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) |