lkml.org 
[lkml]   [2016]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3/3] lib: dump_stack: explicitly pass current to show_stack
    Date
    As noted in 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,
    have the dump_stack code explicitly pass current to show_stack.

    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Eric Dumazet <edumazet@google.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Josh Poimboeuf <jpoimboe@redhat.com>
    Cc: linux-kernel@vger.kernel.org
    ---
    lib/dump_stack.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/lib/dump_stack.c b/lib/dump_stack.c
    index c30d07e..7296b63 100644
    --- a/lib/dump_stack.c
    +++ b/lib/dump_stack.c
    @@ -12,7 +12,7 @@
    static void __dump_stack(void)
    {
    dump_stack_print_info(KERN_DEFAULT);
    - show_stack(NULL, NULL);
    + show_stack(current, NULL);
    }

    /**
    --
    2.7.4
    \
     
     \ /
      Last update: 2016-09-26 17:17    [W:3.487 / U:0.284 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site