From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935813AbcJ0Hkn (ORCPT ); Thu, 27 Oct 2016 03:40:43 -0400 Received: from terminus.zytor.com ([198.137.202.10]:54756 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933572AbcJ0Hkl (ORCPT ); Thu, 27 Oct 2016 03:40:41 -0400 Date: Thu, 27 Oct 2016 00:38:11 -0700 From: tip-bot for Josh Poimboeuf Message-ID: Cc: torvalds@linux-foundation.org, bp@alien8.de, tglx@linutronix.de, mingo@kernel.org, luto@kernel.org, peterz@infradead.org, jpoimboe@redhat.com, linux-kernel@vger.kernel.org, brgerst@gmail.com, dvlasenk@redhat.com, hpa@zytor.com Reply-To: bp@alien8.de, luto@kernel.org, mingo@kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org, hpa@zytor.com, dvlasenk@redhat.com, peterz@infradead.org, brgerst@gmail.com, linux-kernel@vger.kernel.org, jpoimboe@redhat.com In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/dumpstack: Warn on stack recursion Git-Commit-ID: 0d2b8579add41e08aa1110da864f1071d58e6048 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 0d2b8579add41e08aa1110da864f1071d58e6048 Gitweb: http://git.kernel.org/tip/0d2b8579add41e08aa1110da864f1071d58e6048 Author: Josh Poimboeuf AuthorDate: Wed, 26 Oct 2016 10:41:50 -0500 Committer: Ingo Molnar CommitDate: Thu, 27 Oct 2016 08:32:38 +0200 x86/dumpstack: Warn on stack recursion Print a warning if stack recursion is detected. Use printk_deferred_once() because the unwinder can be called with the console lock by lockdep via save_stack_trace(). Signed-off-by: Josh Poimboeuf Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/def18247aafaab480844484398e793f552b79bda.1477496147.git.jpoimboe@redhat.com [ Unbroke the lines. ] Signed-off-by: Ingo Molnar --- arch/x86/kernel/dumpstack_32.c | 4 +++- arch/x86/kernel/dumpstack_64.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c index 90cf460..d7d20999 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c @@ -109,8 +109,10 @@ recursion_check: * just break out and report an unknown stack type. */ if (visit_mask) { - if (*visit_mask & (1UL << info->type)) + if (*visit_mask & (1UL << info->type)) { + printk_deferred_once(KERN_WARNING "WARNING: stack recursion on stack type %d\n", info->type); goto unknown; + } *visit_mask |= 1UL << info->type; } diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index 310abf4..ab0f8b9 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c @@ -128,8 +128,10 @@ recursion_check: * just break out and report an unknown stack type. */ if (visit_mask) { - if (*visit_mask & (1UL << info->type)) + if (*visit_mask & (1UL << info->type)) { + printk_deferred_once(KERN_WARNING "WARNING: stack recursion on stack type %d\n", info->type); goto unknown; + } *visit_mask |= 1UL << info->type; }