public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Kill off show_stack() NULL-implies-current idiom
@ 2016-09-26 15:16 Mark Rutland
  2016-09-26 15:16 ` [PATCH 1/3] sched: document that show_stack() should not be passed a NULL task Mark Rutland
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Mark Rutland @ 2016-09-26 15:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mark Rutland, Andrew Morton, Eric Dumazet, Greg Kroah-Hartman,
	Ingo Molnar, Jiri Slaby, Josh Poimboeuf, Peter Zijlstra

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(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-09-27 17:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-26 15:16 [PATCH 0/3] Kill off show_stack() NULL-implies-current idiom Mark Rutland
2016-09-26 15:16 ` [PATCH 1/3] sched: document that show_stack() should not be passed a NULL task Mark Rutland
2016-09-26 15:16 ` [PATCH 2/3] drivers/tty: Explicitly pass current to show_stack Mark Rutland
2016-09-26 15:16 ` [PATCH 3/3] lib: dump_stack: explicitly " Mark Rutland
2016-09-26 20:01 ` [PATCH 0/3] Kill off show_stack() NULL-implies-current idiom Josh Poimboeuf
2016-09-26 21:33   ` Mark Rutland
2016-09-27 17:57   ` Mark Rutland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox