Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753956Ab3J3Kxw (ORCPT ); Wed, 30 Oct 2013 06:53:52 -0400 Received: from mail7.hitachi.co.jp ([133.145.228.42]:39509 "EHLO mail7.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753790Ab3J3Kxs (ORCPT ); Wed, 30 Oct 2013 06:53:48 -0400 X-AuditID: 85900ec0-d452db9000001514-8c-5270e53a7a43 Subject: [PATCH -tip 2/2] [BUGFIX] kprobes: Prohibit probing on func_ptr_is_kernel_text To: Ingo Molnar From: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli , x86@kernel.org, lkml , "Steven Rostedt (Red Hat)" , Uwe =?utf-8?q?Kleine-K=C3=B6nig?= , Andrew Morton , Borislav Petkov Date: Wed, 30 Oct 2013 10:53:43 +0000 Message-ID: <20131030105343.7997.5374.stgit@kbuild-fedora.novalocal> In-Reply-To: <20131030105334.7997.750.stgit@kbuild-fedora.novalocal> References: <20131030105334.7997.750.stgit@kbuild-fedora.novalocal> User-Agent: StGit/0.16 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1495 Lines: 44 Prohibit probing on func_ptr_is_kernel_text(). Since the func_ptr_is_kernel_text() is called from notifier_call_chain() which is called from int3 handler, probing it may cause double int3 fault and kernel will reboot. This happenes when the kernel built with CONFIG_DEBUG_NOTIFIERS=y. Signed-off-by: Masami Hiramatsu Cc: Andrew Morton Cc: "Uwe Kleine-König" Cc: Borislav Petkov Cc: Ingo Molnar --- kernel/extable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/extable.c b/kernel/extable.c index 832cb28..b3b8b6a 100644 --- a/kernel/extable.c +++ b/kernel/extable.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -129,7 +130,7 @@ int kernel_text_address(unsigned long addr) * pointer is part of the kernel text, we need to do some * special dereferencing first. */ -int func_ptr_is_kernel_text(void *ptr) +int __kprobes func_ptr_is_kernel_text(void *ptr) { unsigned long addr; addr = (unsigned long) dereference_function_descriptor(ptr); -- 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/