From patchwork Mon Jul 22 07:48:24 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: 11051757 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 3A7621398 for ; Mon, 22 Jul 2019 07:48:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 252482837D for ; Mon, 22 Jul 2019 07:48:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13D5B284A3; Mon, 22 Jul 2019 07:48:34 +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 BD39D2837D for ; Mon, 22 Jul 2019 07:48:33 +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: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:In-Reply-To:References: List-Owner; bh=XraNed675hnoKorqj2JjkGCGOT7YHdqGuCNSYEpVt/U=; b=L80UFg8H/ndqdI 9+kJI+lxjzJSMpVPYgSS6wjNHsq269wD+ESM0oolGctFbCn/S5aToOXe6N4H8dXnPRdNdLNs9ynTp 9UTLQS8Q/6gK8HIO3eAvCze8WYiAXm+hloOgtjirgmYztoZmgruTYHyh5a43tQyJEmNLjvOPtRgMR tdfNi+r3c6XLljILudS3pwmWq0eCM3sDyozWMxyATs610+S/hIeImO6Hn+S0BhvT7eiOKpLMHr48a EweUXr4Gbbuf5D7bGSm/7/jrhluXAO8VWZCnmmgQ5XFi+mS8o8qGQ8UHoqyKRS2bOTHEl4h2BqUvz FqjPTQiW2MMee9l2m2Dg==; 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 1hpT3h-0008Vt-5i; Mon, 22 Jul 2019 07:48:33 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hpT3e-0008VT-IL for linux-arm-kernel@lists.infradead.org; Mon, 22 Jul 2019 07:48:31 +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 B96182199C; Mon, 22 Jul 2019 07:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563781710; bh=fCm+twhupd0sfoMKl3+oPJY6FX4/EFcymfZefTFmLO8=; h=From:To:Cc:Subject:Date:From; b=F8zFyZIrS/zpZQrHnC9mXaN0J0K7HeaiyybgnJ9mwyxw3fFiCElwLVA8qUy2OEfe+ OzJ+k34UT+jduVM2DYe4wVtgUGWd03QtNcjydt4XV7KxaZFh3kF2LOK6k2XcgI7cRj 37ibeZlJlREutUvtOi0ttksrQWxTXenUeUZysu+4= From: Masami Hiramatsu To: Catalin Marinas , Will Deacon Subject: [PATCH v2 0/4] arm64: kprobes: Fix some bugs in arm64 kprobes Date: Mon, 22 Jul 2019 16:48:24 +0900 Message-Id: <156378170297.12011.17385386326930403235.stgit@devnote2> X-Mailer: git-send-email 2.20.1 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_004830_629839_DA8912FE X-CRM114-Status: GOOD ( 10.35 ) 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 Hi, Here are the v2 patches which fixes kprobe bugs on arm64. Naresh reported that recently ftracetest crashes kernel, and I found there are 3 different bugs around the crash. In v1 thread, we found one another bug of RCU and debug exception. - Kprobes on arm64 doesn't recover pstate.D mask after single stepping. This causes a real kernel crash if a kprobe is unexpectedly nested. - Some symbols which are called from blacklisted function, are not blacklisted. - Debug exception is not visible to RCU, thus rcu_read_lock() cause a warning inside it. - Debug exception handlers on arm64 is using rcu_read_lock(), but that is not needed because interrupts are disabled. This series includes fixes for above bugs. Thank you, --- Masami Hiramatsu (4): arm64: kprobes: Recover pstate.D in single-step exception handler arm64: unwind: Prohibit probing on return_address() arm64: Make debug exception handlers visible from RCU arm64: Remove unneeded rcu_read_lock from debug handlers arch/arm64/kernel/debug-monitors.c | 14 +++++++----- arch/arm64/kernel/probes/kprobes.c | 41 ++++++------------------------------ arch/arm64/kernel/return_address.c | 4 +++- arch/arm64/kernel/stacktrace.c | 3 +++ arch/arm64/mm/fault.c | 40 +++++++++++++++++++++++++++++++++++ 5 files changed, 61 insertions(+), 41 deletions(-) -- Masami Hiramatsu (Linaro)