Skip to content

Kill off show_stack() NULL-implies-current idiom

Mark Rutland lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3sched: document that show_stack() should not be passed a NULL taskinclude/linux/sched.h+3 -00 replies
2/3drivers/tty: Explicitly pass current to show_stackdrivers/tty/sysrq.c+1 -10 replies
3/3lib: dump_stack: explicitly pass current to show_stacklib/dump_stack.c+1 -10 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJosh Poimboeuf
SeriesR-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] Kill off show_stack() NULL-implies-current idiom

Today, show_stack() accepts a NULL task parameter, which it takes to mean the current task. However, as noted in tip/x86/asm commit:

81539169f283329f ("x86/dumpstack: Remove NULL task pointer convention")

... having a NULL task parameter imply current leads to subtle bugs in stack walking code (so far seen on both 86 and arm64), makes callsites harder to read, and is unnecessary as all callers have access to current.

As a step towards removing the problematic NULL-implies-current idiom entirely, these patches ensure that generic code explictly passes current to show_stack(), rather than relying on arch code to handle NULL.

Thanks,
Mark.

Mark Rutland (3):
sched: document that show_stack() should not be passed a NULL task drivers/tty: Explicitly pass current to show_stack
lib: dump_stack: explicitly pass current to show_stack

 drivers/tty/sysrq.c   | 2 +-
 include/linux/sched.h | 3 +++
 lib/dump_stack.c      | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)
Signature · 1 line
2.7.4