Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751539AbaB0Hdg (ORCPT ); Thu, 27 Feb 2014 02:33:36 -0500 Received: from mail7.hitachi.co.jp ([133.145.228.42]:51150 "EHLO mail7.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751457AbaB0Hde (ORCPT ); Thu, 27 Feb 2014 02:33:34 -0500 Subject: [PATCH -tip v7 06/26] [BUGFIX] x86: Prohibit probing on native_set_debugreg/load_idt From: Masami Hiramatsu To: linux-kernel@vger.kernel.org, Ingo Molnar Cc: Jeremy Fitzhardinge , x86@kernel.org, Ananth N Mavinakayanahalli , Sandeepa Prabhu , Frederic Weisbecker , Rusty Russell , Steven Rostedt , Chris Wright , fche@redhat.com, mingo@redhat.com, systemtap@sourceware.org, "H. Peter Anvin" , Thomas Gleixner , Alok Kataria Date: Thu, 27 Feb 2014 16:33:30 +0900 Message-ID: <20140227073330.20992.38095.stgit@ltc230.yrl.intra.hitachi.co.jp> In-Reply-To: <20140227073315.20992.6174.stgit@ltc230.yrl.intra.hitachi.co.jp> References: <20140227073315.20992.6174.stgit@ltc230.yrl.intra.hitachi.co.jp> User-Agent: StGit/0.17-dirty 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 native_set_debugreg and native_load_idt. Since the kprobes uses do_debug for single stepping, functions called from do_debug before notify_die must not be probed. And also native_load_idt is called from paranoid_exit when returning int3, this also must not be probed. 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 4c785fd..abff75f 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -390,8 +390,10 @@ __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); +NOKPROBE_SYMBOL(native_load_idt); struct pv_apic_ops pv_apic_ops = { #ifdef CONFIG_X86_LOCAL_APIC -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/