From patchwork Mon Jul 22 07:48:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 11051761 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B18401398 for ; Mon, 22 Jul 2019 07:49:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A074E2837D for ; Mon, 22 Jul 2019 07:49:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94445284A3; Mon, 22 Jul 2019 07:49:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3F42C2837D for ; Mon, 22 Jul 2019 07:49:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=M5tWcUT/ZAvFIBVsXTFpgVDaYlVq3NGOx580EavPyA8=; b=G8pe/QuUFKQk0R VdIGw5ZTJAObxjQmn42Q0MpSYHflAN6clKM0bJ4nROxsSIWkb5BSWFkJ1W80Tst5S3ewuYeFkEqPh 8NgZA6yx0Cmo+zrc22c6habIQH4UdrhDK9ObtJhXxaCV/AZWgdiKp0+S3dWxHEIs54osazhnOcrsz gHC/HBh1/ZIKERhFdg6Yl5/f6Z0EuSZqnEB6DTrDE4Jgpz492rFhePv7qGUcqdgz8UCZujRJhP5ot 2RiNC7skvc1GzggffkuAy1/lG93Y093aviqiIO2JxAXf5mn91dH0kksjX/U17vnm4vVTVlH0GNqCK XNYHZbChIgcwo97txeMg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hpT4J-0000ZR-ID; Mon, 22 Jul 2019 07:49:11 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hpT40-0000Kx-MO for linux-arm-kernel@lists.infradead.org; Mon, 22 Jul 2019 07:48:54 +0000 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 37CEA2199C; Mon, 22 Jul 2019 07:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563781732; bh=d2K631q1iz4c8zbaSDa5ag8ChRtWqT8DbZvzcJhGp9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w81PoW6MwyECbd2TTy5PRj1Ackc3EGzTbwwzyZ4/qk5SvwfWbiAnsaPPjJrmXgY1u jhbfidnmkbwNquWIPG6/GTz7+fjsxSOVmWZ+3F4k92Ou80g5P3DL+UdSvMgCYqYtLc 1OlgcNAAxqm5a5q8K5U6Wn2+W0xjC4x0HpsBDDoo= From: Masami Hiramatsu To: Catalin Marinas , Will Deacon Subject: [PATCH v2 2/4] arm64: unwind: Prohibit probing on return_address() Date: Mon, 22 Jul 2019 16:48:48 +0900 Message-Id: <156378172702.12011.1144595747474511323.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <156378170297.12011.17385386326930403235.stgit@devnote2> References: <156378170297.12011.17385386326930403235.stgit@devnote2> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190722_004852_826913_F0969AA1 X-CRM114-Status: GOOD ( 12.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dan Rue , Daniel Diaz , Anders Roxell , Naresh Kamboju , linux-kernel@vger.kernel.org, Matt Hart , linux-arm-kernel@lists.infradead.org, mhiramat@kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Prohibit probing on return_address() and subroutines which is called from return_address(), since the it is invoked from trace_hardirqs_off() which is also kprobe blacklisted. Reported-by: Naresh Kamboju Signed-off-by: Masami Hiramatsu --- arch/arm64/kernel/return_address.c | 4 +++- arch/arm64/kernel/stacktrace.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/return_address.c b/arch/arm64/kernel/return_address.c index b21cba90f82d..7f8a143268b0 100644 --- a/arch/arm64/kernel/return_address.c +++ b/arch/arm64/kernel/return_address.c @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -17,7 +18,7 @@ struct return_address_data { void *addr; }; -static int save_return_addr(struct stackframe *frame, void *d) +static nokprobe_inline int save_return_addr(struct stackframe *frame, void *d) { struct return_address_data *data = d; @@ -52,3 +53,4 @@ void *return_address(unsigned int level) return NULL; } EXPORT_SYMBOL_GPL(return_address); +NOKPROBE_SYMBOL(return_address); diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c index 62d395151abe..cd7dab54d17b 100644 --- a/arch/arm64/kernel/stacktrace.c +++ b/arch/arm64/kernel/stacktrace.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -73,6 +74,7 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) return 0; } +NOKPROBE_SYMBOL(unwind_frame); void notrace walk_stackframe(struct task_struct *tsk, struct stackframe *frame, int (*fn)(struct stackframe *, void *), void *data) @@ -87,6 +89,7 @@ void notrace walk_stackframe(struct task_struct *tsk, struct stackframe *frame, break; } } +NOKPROBE_SYMBOL(walk_stackframe); #ifdef CONFIG_STACKTRACE struct stack_trace_data {