From patchwork Mon Sep 26 15:16:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 77038 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp1233013qgf; Mon, 26 Sep 2016 08:16:53 -0700 (PDT) X-Received: by 10.66.120.69 with SMTP id la5mr39780793pab.65.1474903013755; Mon, 26 Sep 2016 08:16:53 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w64si25439518pfd.144.2016.09.26.08.16.53; Mon, 26 Sep 2016 08:16:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941556AbcIZPQe (ORCPT + 27 others); 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 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D07ACD43; Mon, 26 Sep 2016 08:16:27 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8B3333F251; Mon, 26 Sep 2016 08:16:27 -0700 (PDT) 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 Precedence: bulk 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(-) -- 2.7.4 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); } /**