[lkml]   [2015]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH 0/3] prevent /proc/<pid>/stack garbage for running tasks
Reading /proc/<pid>/stack for a running task (other than current) can print
garbage because the saved stack pointer is no longer accurate and the stack
itself can be inconsistent.

Add new sched and stacktrace functions so that /proc/<pid>/stack only walks the
stack for sleeping tasks and the current task.

The new sched_task_call() function will also be useful for future live patching
code which will need to atomically examine a task's stack before patching it.

Josh Poimboeuf (3):
sched: add sched_task_call()
stacktrace: add save_stack_trace_tsk_safe()
proc: fix /proc/<pid>/stack for running tasks

fs/proc/base.c | 2 +-
include/linux/sched.h | 4 ++++
include/linux/stacktrace.h | 2 ++
kernel/sched/core.c | 17 +++++++++++++++++
kernel/stacktrace.c | 22 ++++++++++++++++++++++
5 files changed, 46 insertions(+), 1 deletion(-)


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