Skip to content

Commit

Permalink
Merge tag 'modules-for-v4.17-rc3' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/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
  • Loading branch information
torvalds committed Apr 27, 2018
2 parents 64ebe31 + be71eda commit 7b87308
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7b87308

Please sign in to comment.