From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941494AbcIZPQZ (ORCPT ); Mon, 26 Sep 2016 11:16:25 -0400 Received: from foss.arm.com ([217.140.101.70]:34090 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935159AbcIZPQY (ORCPT ); Mon, 26 Sep 2016 11:16:24 -0400 From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: Mark Rutland , Andrew Morton , Eric Dumazet , Greg Kroah-Hartman , Ingo Molnar , Jiri Slaby , Josh Poimboeuf , Peter Zijlstra Subject: [PATCH 0/3] Kill off show_stack() NULL-implies-current idiom Date: Mon, 26 Sep 2016 16:16:16 +0100 Message-Id: <1474902979-18436-1-git-send-email-mark.rutland@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Today, show_stack() accepts a NULL task parameter, which it takes to mean the current task. However, as noted in tip/x86/asm 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, these patches ensure that generic code explictly passes current to show_stack(), rather than relying on arch code to handle NULL. Thanks, Mark. Mark Rutland (3): sched: document that show_stack() should not be passed a NULL task drivers/tty: Explicitly pass current to show_stack lib: dump_stack: explicitly pass current to show_stack drivers/tty/sysrq.c | 2 +- include/linux/sched.h | 3 +++ lib/dump_stack.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) -- 2.7.4