summaryrefslogtreecommitdiff
path: root/fs/proc/base.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-04 02:04:04 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-04 02:04:04 +0300
commit7eeef2abe87dc0d8c276f97ccfdb1f42d9d1e4d8 (patch)
tree69141bc10fab1bb9b8aaa94f87c617b9c813155c /fs/proc/base.c
parent6aa2fdb87cf01d7746955c600cbac352dc04d451 (diff)
parentb2f73922d119686323f14fbbe46587f863852328 (diff)
downloadlinux-7eeef2abe87dc0d8c276f97ccfdb1f42d9d1e4d8.tar.xz
Merge branch 'core-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull wchan kernel address hiding from Ingo Molnar: "This fixes a wchan related information leak in /proc/PID/stat. There's a bit of an ABI twist to it: instead of setting the wchan field to 0 (which is our usual technique) we set it conditionally to a 0/1 flag to keep ABI compatibility with older procps versions that only fetches /proc/PID/wchan (symbolic names) if the absolute wchan address is nonzero" * 'core-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: fs/proc, core/debug: Don't expose absolute kernel addresses via wchan
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r--fs/proc/base.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index b25eee4cead5..29595af32866 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -430,13 +430,10 @@ static int proc_pid_wchan(struct seq_file *m, struct pid_namespace *ns,
wchan = get_wchan(task);
- if (lookup_symbol_name(wchan, symname) < 0) {
- if (!ptrace_may_access(task, PTRACE_MODE_READ))
- return 0;
- seq_printf(m, "%lu", wchan);
- } else {
+ if (wchan && ptrace_may_access(task, PTRACE_MODE_READ) && !lookup_symbol_name(wchan, symname))
seq_printf(m, "%s", symname);
- }
+ else
+ seq_putc(m, '0');
return 0;
}