ANDROID: Revert "module: Do not expose section addresses to non-CAP_SYSLOG"

This reverts commit 314ac273f0 as it
breaks ramdump debug tools. Will bring this back in after resolving
those issues.

Bug: 163100336
Change-Id: Ibf46f6db0fa2bf9cc9e7121115889e15ca07cdab
Signed-off-by: Saravana Kannan <saravanak@google.com>
Git-commit: d837f090a6
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
This commit is contained in:
Saravana Kannan 2020-08-07 13:12:18 -07:00 • committed by Prasad Sodagudi
commit fc7972f8db

View file

@ -1526,8 +1526,8 @@ static ssize_t module_sect_read(struct file *file, struct kobject *kobj,
if (pos != 0)
return -EINVAL;
return sprintf(buf, "0x%px\n",
kallsyms_show_value(file->f_cred) ? (void *)sattr->address : NULL);
return sprintf(buf, "0x%px\n", kptr_restrict < 2 ?
(void *)sattr->address : NULL);
}
static void free_sect_attrs(struct module_sect_attrs *sect_attrs)
@ -4420,7 +4420,7 @@ static int modules_open(struct inode *inode, struct file *file)
if (!err) {
struct seq_file *m = file->private_data;
m->private = kallsyms_show_value(file->f_cred) ? NULL : (void *)8ul;
m->private = kallsyms_show_value(current_cred()) ? NULL : (void *)8ul;
}
return err;