From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753938Ab3KTEYQ (ORCPT ); Tue, 19 Nov 2013 23:24:16 -0500 Received: from mail7.hitachi.co.jp ([133.145.228.42]:41144 "EHLO mail7.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753915Ab3KTEYJ (ORCPT ); Tue, 19 Nov 2013 23:24:09 -0500 Subject: [PATCH -tip v3 19/23] [BUGFIX] kprobes/x86: Prohibit probing on debug_stack_* To: Ingo Molnar From: Masami Hiramatsu Cc: linux-arch@vger.kernel.org, Fenghua Yu , Seiji Aguchi , Ananth N Mavinakayanahalli , Sandeepa Prabhu , x86@kernel.org, lkml , "Steven Rostedt (Red Hat)" , virtualization@lists.linux-foundation.org, Ingo Molnar , systemtap@sourceware.org, "H. Peter Anvin" , Thomas Gleixner , Borislav Petkov , "David S. Miller" Date: Wed, 20 Nov 2013 04:22:36 +0000 Message-ID: <20131120042236.15296.74140.stgit@kbuild-fedora.novalocal> In-Reply-To: <20131120042148.15296.88360.stgit@kbuild-fedora.novalocal> References: <20131120042148.15296.88360.stgit@kbuild-fedora.novalocal> User-Agent: StGit/0.16 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Prohibit probing on debug_stack_reset and debug_stack_set_zero. Since the both functions are called from TRACE_IRQS_ON/OFF_DEBUG macros which run in int3 ist entry, probing it may cause a soft lockup. This happens when the kernel built with CONFIG_DYNAMIC_FTRACE=y and CONFIG_TRACE_IRQFLAGS=y. Signed-off-by: Masami Hiramatsu Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Borislav Petkov Cc: Fenghua Yu Cc: Seiji Aguchi --- arch/x86/kernel/cpu/common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 1789b06..d0a802a 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -1163,6 +1164,7 @@ int is_debug_stack(unsigned long addr) (addr <= __get_cpu_var(debug_stack_addr) && addr > (__get_cpu_var(debug_stack_addr) - DEBUG_STKSZ)); } +NOKPROBE_SYMBOL(is_debug_stack); DEFINE_PER_CPU(u32, debug_idt_ctr); @@ -1171,6 +1173,7 @@ void debug_stack_set_zero(void) this_cpu_inc(debug_idt_ctr); load_current_idt(); } +NOKPROBE_SYMBOL(debug_stack_set_zero); void debug_stack_reset(void) { @@ -1179,6 +1182,7 @@ void debug_stack_reset(void) if (this_cpu_dec_return(debug_idt_ctr) == 0) load_current_idt(); } +NOKPROBE_SYMBOL(debug_stack_reset); #else /* CONFIG_X86_64 */