From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941555AbcIZPQe (ORCPT ); Mon, 26 Sep 2016 11:16:34 -0400 Received: from foss.arm.com ([217.140.101.70]:34146 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941501AbcIZPQ2 (ORCPT ); Mon, 26 Sep 2016 11:16:28 -0400 From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: Mark Rutland , Andrew Morton , Eric Dumazet , Ingo Molnar , Josh Poimboeuf Subject: [PATCH 3/3] lib: dump_stack: explicitly pass current to show_stack Date: Mon, 26 Sep 2016 16:16:19 +0100 Message-Id: <1474902979-18436-4-git-send-email-mark.rutland@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474902979-18436-1-git-send-email-mark.rutland@arm.com> References: <1474902979-18436-1-git-send-email-mark.rutland@arm.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Andrew Morton Cc: Eric Dumazet Cc: Ingo Molnar Cc: Josh Poimboeuf 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