Skip to content

Commit

Permalink
proc: don't report kernel addresses in /proc/<pid>/stack
Browse files Browse the repository at this point in the history
This just changes the file to report them as zero, although maybe even
that could be removed.  I checked, and at least procps doesn't actually
seem to parse the 'stack' file at all.

And since the file doesn't necessarily even exist (it requires
CONFIG_STACKTRACE), possibly other tools don't really use it either.

That said, in case somebody parses it with tools, just having that zero
there should keep such tools happy.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Linus Torvalds committed Nov 28, 2017
1 parent 1751e8a commit 8f5abe8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,7 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,
save_stack_trace_tsk(task, &trace);

for (i = 0; i < trace.nr_entries; i++) {
seq_printf(m, "[<%pK>] %pB\n",
(void *)entries[i], (void *)entries[i]);
seq_printf(m, "[<0>] %pB\n", (void *)entries[i]);
}
unlock_trace(task);
}
Expand Down

0 comments on commit 8f5abe8

Please sign in to comment.