From patchwork Mon Sep 26 15:16:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 77036 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp1233001qgf; Mon, 26 Sep 2016 08:16:52 -0700 (PDT) X-Received: by 10.98.141.146 with SMTP id p18mr38835198pfk.17.1474903012381; Mon, 26 Sep 2016 08:16:52 -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.52; Mon, 26 Sep 2016 08:16:52 -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 S941524AbcIZPQa (ORCPT + 27 others); Mon, 26 Sep 2016 11:16:30 -0400 Received: from foss.arm.com ([217.140.101.70]:34132 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941496AbcIZPQ1 (ORCPT ); Mon, 26 Sep 2016 11:16:27 -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 0A48E22E; 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 B9C103F251; Mon, 26 Sep 2016 08:16:26 -0700 (PDT) From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: Mark Rutland , Greg Kroah-Hartman , Ingo Molnar , Jiri Slaby , Josh Poimboeuf Subject: [PATCH 2/3] drivers/tty: Explicitly pass current to show_stack Date: Mon, 26 Sep 2016 16:16:18 +0100 Message-Id: <1474902979-18436-3-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 sysrq code explicitly pass current to show_stack. Signed-off-by: Mark Rutland Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: Jiri Slaby Cc: Josh Poimboeuf Cc: linux-kernel@vger.kernel.org --- drivers/tty/sysrq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index 52bbd27..5b1e0ed 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -224,7 +224,7 @@ static void showacpu(void *dummy) spin_lock_irqsave(&show_lock, flags); pr_info("CPU%d:\n", smp_processor_id()); - show_stack(NULL, NULL); + show_stack(current, NULL); spin_unlock_irqrestore(&show_lock, flags); }