From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masami Hiramatsu Subject: [PATCH -tip v5 04/18] [BUGFIX] x86: Prohibit probing on native_set_debugreg Date: Mon, 09 Dec 2013 10:47:27 +0000 Message-ID: <20131209104727.13397.43886.stgit@kbuild-fedora.novalocal> References: <20131209104717.13397.8864.stgit@kbuild-fedora.novalocal> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20131209104717.13397.8864.stgit@kbuild-fedora.novalocal> Sender: linux-kernel-owner@vger.kernel.org To: Ingo Molnar Cc: linux-arch@vger.kernel.org, Jeremy Fitzhardinge , Rusty Russell , Ananth N Mavinakayanahalli , Sandeepa Prabhu , x86@kernel.org, lkml , "Steven Rostedt (Red Hat)" , Chris Wright , Ingo Molnar , Thomas Gleixner , systemtap@sourceware.org, "H. Peter Anvin" , Alok Kataria , "David S. Miller" List-Id: linux-arch.vger.kernel.org Since the kprobes uses do_debug for single stepping, functions called from do_debug before notify_die must not be probed. This prohibits probing on native_set_debugreg which is used in do_debug. Signed-off-by: Masami Hiramatsu Cc: Jeremy Fitzhardinge Cc: Chris Wright Cc: Alok Kataria Cc: Rusty Russell Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" --- arch/x86/kernel/paravirt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 4c785fd..108e685 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -390,8 +390,9 @@ __visible struct pv_cpu_ops pv_cpu_ops = { .end_context_switch = paravirt_nop, }; -/* At this point, native_get_debugreg has real function entry */ +/* At this point, native_get/set_debugreg has real function entry */ NOKPROBE_SYMBOL(native_get_debugreg); +NOKPROBE_SYMBOL(native_set_debugreg); struct pv_apic_ops pv_apic_ops = { #ifdef CONFIG_X86_LOCAL_APIC From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail9.hitachi.co.jp ([133.145.228.44]:53952 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932526Ab3LIKxK (ORCPT ); Mon, 9 Dec 2013 05:53:10 -0500 Subject: [PATCH -tip v5 04/18] [BUGFIX] x86: Prohibit probing on native_set_debugreg From: Masami Hiramatsu Date: Mon, 09 Dec 2013 10:47:27 +0000 Message-ID: <20131209104727.13397.43886.stgit@kbuild-fedora.novalocal> In-Reply-To: <20131209104717.13397.8864.stgit@kbuild-fedora.novalocal> References: <20131209104717.13397.8864.stgit@kbuild-fedora.novalocal> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Ingo Molnar Cc: linux-arch@vger.kernel.org, Jeremy Fitzhardinge , Rusty Russell , Ananth N Mavinakayanahalli , Sandeepa Prabhu , x86@kernel.org, lkml , "Steven Rostedt (Red Hat)" , Chris Wright , Ingo Molnar , Thomas Gleixner , systemtap@sourceware.org, "H. Peter Anvin" , Alok Kataria , "David S. Miller" Message-ID: <20131209104727.BYZtNvMyQdT30YLO6tXeBLwn8bS8dympcCRxH_bV3d4@z> Since the kprobes uses do_debug for single stepping, functions called from do_debug before notify_die must not be probed. This prohibits probing on native_set_debugreg which is used in do_debug. Signed-off-by: Masami Hiramatsu Cc: Jeremy Fitzhardinge Cc: Chris Wright Cc: Alok Kataria Cc: Rusty Russell Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" --- arch/x86/kernel/paravirt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 4c785fd..108e685 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -390,8 +390,9 @@ __visible struct pv_cpu_ops pv_cpu_ops = { .end_context_switch = paravirt_nop, }; -/* At this point, native_get_debugreg has real function entry */ +/* At this point, native_get/set_debugreg has real function entry */ NOKPROBE_SYMBOL(native_get_debugreg); +NOKPROBE_SYMBOL(native_set_debugreg); struct pv_apic_ops pv_apic_ops = { #ifdef CONFIG_X86_LOCAL_APIC