lkml.org 
[lkml]   [2015]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] proc: fix /proc/<pid>/stack for running tasks
Date
Reading /proc/<pid>/stack for a running task can show garbage.  Use the
new safe version of the stack saving interface. For running tasks
(other than current) it won't show anything.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
fs/proc/base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 3f3d7ae..4c3f5d5 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -288,7 +288,7 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,

err = lock_trace(task);
if (!err) {
- save_stack_trace_tsk(task, &trace);
+ save_stack_trace_tsk_safe(task, &trace);

for (i = 0; i < trace.nr_entries; i++) {
seq_printf(m, "[<%pK>] %pS\n",
--
2.1.0


\
 
 \ /
  Last update: 2015-02-16 20:21    [W:0.854 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site