Skip to content

prevent /proc/<pid>/stack garbage for running tasks

Josh Poimboeuf lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 82 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3sched: add sched_task_call()include/linux/sched.h kernel/sched/core.c+21 -080 replies
2/3stacktrace: add save_stack_trace_tsk_safe()include/linux/stacktrace.h kernel/stacktrace.c+24 -02 replies
3/3proc: fix /proc/<pid>/stack for running tasksfs/proc/base.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [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(-)
Signature · 1 line
2.1.0