aboutsummaryrefslogtreecommitdiff
path: root/fs/proc/array.c
diff options
context:
space:
mode:
authorGary S. Robertson <gary.robertson@linaro.org>2016-01-20 15:45:29 -0600
committerGary S. Robertson <gary.robertson@linaro.org>2016-01-20 15:45:29 -0600
commit1d10e9e61dedad92bcf380a421d08f021e62ff1b (patch)
tree8e7641caa0710f4eba713a7f25de5eb314720993 /fs/proc/array.c
parentd532db8c82faef41ad16e6db7a8459aa21f4a822 (diff)
parent9f41e6b222c4a04c7b46068df82842a6188b4a57 (diff)
Merge tag 'lsk-v4.1-15.12' of http://git.linaro.org/kernel/linux-linaro-stable into linux-linaro-lng-v4.1linux-lng-4.1.14-2016.03linux-lng-4.1.14-2016.02linux-lng-4.1.14-2016.01linux-linaro-lng-v4.1
LSK 15.12 v4.1
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r--fs/proc/array.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index fd02a9ebfc30..70f9c4cba31f 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -364,7 +364,7 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
struct pid *pid, struct task_struct *task, int whole)
{
- unsigned long vsize, eip, esp, wchan = ~0UL;
+ unsigned long vsize, eip, esp, wchan = 0;
int priority, nice;
int tty_pgrp = -1, tty_nr = 0;
sigset_t sigign, sigcatch;
@@ -496,7 +496,19 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
seq_put_decimal_ull(m, ' ', task->blocked.sig[0] & 0x7fffffffUL);
seq_put_decimal_ull(m, ' ', sigign.sig[0] & 0x7fffffffUL);
seq_put_decimal_ull(m, ' ', sigcatch.sig[0] & 0x7fffffffUL);
- seq_put_decimal_ull(m, ' ', wchan);
+
+ /*
+ * We used to output the absolute kernel address, but that's an
+ * information leak - so instead we show a 0/1 flag here, to signal
+ * to user-space whether there's a wchan field in /proc/PID/wchan.
+ *
+ * This works with older implementations of procps as well.
+ */
+ if (wchan)
+ seq_puts(m, " 1");
+ else
+ seq_puts(m, " 0");
+
seq_put_decimal_ull(m, ' ', 0);
seq_put_decimal_ull(m, ' ', 0);
seq_put_decimal_ll(m, ' ', task->exit_signal);