1
0

x86/dumpstack: Remove NULL task pointer convention

show_stack_log_lvl() and friends allow a NULL pointer for the
task_struct to indicate the current task.  This creates confusion and
can cause sneaky bugs.

Instead require the caller to pass 'current' directly.

This only changes the internal workings of the dumpstack code.  The
dump_trace() and show_stack() interfaces still allow a NULL task
pointer.  Those interfaces should also probably be fixed as well.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Este cometimento está contido em:
Josh Poimboeuf
2016-09-16 08:05:20 -05:00
cometido por Ingo Molnar
ascendente ac496bf48d
cometimento 81539169f2
4 ficheiros modificados com 7 adições e 5 eliminações

Ver ficheiro

@@ -94,7 +94,7 @@ get_frame_pointer(struct task_struct *task, struct pt_regs *regs)
if (regs)
return (unsigned long *)regs->bp;
if (!task || task == current)
if (task == current)
return __builtin_frame_address(0);
return (unsigned long *)((struct inactive_task_frame *)task->thread.sp)->bp;
@@ -113,7 +113,7 @@ get_stack_pointer(struct task_struct *task, struct pt_regs *regs)
if (regs)
return (unsigned long *)kernel_stack_pointer(regs);
if (!task || task == current)
if (task == current)
return __builtin_frame_address(0);
return (unsigned long *)task->thread.sp;