From patchwork Thu Jul 25 08:15:44 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: 11058197 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 AD4376C5 for ; Thu, 25 Jul 2019 08:16:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BDA1287E2 for ; Thu, 25 Jul 2019 08:16:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E975287FB; Thu, 25 Jul 2019 08:16:03 +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 BC4452881D for ; Thu, 25 Jul 2019 08:16:01 +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=LsJWdB3qPKYnu8vuo7JXVaGtaLKBQRZxGEpwC9FV3+w=; b=mWaP+PmicjbLHG D16y/K6nnokFQHnF7Vhx6UG9ln3IXT+LCS2vOlPDP8qqbnRk2ePRBOPetp9ENICKMC0esf9mH6PDw YcTS14vuTUY1Eul8Sir6SUUkvp0Z2LRUxk5vhDNZFeMlDBBo6UCIm0obS0M1qpuOsBepcMDuiYHYA Xl5vDuUgnnYAi6uxqqT/DT3rSbrT8O9P0ZzYRAuidH3bCcx1J4bPsvOPvr0Rm1v88G95jLQUPXlh9 Bq58ssDM5H7xZyZqITsZ2y0WaovldUAF+OBZNZnB6cGk+x1dM1F2JzfGbjGfHs+/lE720nxqKNx+1 NRyXvOZgxIsCyuvGWgIA==; 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 1hqYun-0003ma-3y; Thu, 25 Jul 2019 08:15:53 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hqYuk-0003mC-HC for linux-arm-kernel@lists.infradead.org; Thu, 25 Jul 2019 08:15:51 +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 B487322BEF; Thu, 25 Jul 2019 08:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564042549; bh=uoAtSZJrQlX16jfIHQB3k0UtB6VPqRtrikHODc87HA0=; h=From:To:Cc:Subject:Date:From; b=TWgihOkdvlV5beZAg9dXWD+REvK4U7QROtCGNlgzoN4k6bkl65mhIE/R0LE9SClGp l9fx5+EFHylIdeaatd+v4lvFk1//NlSB4VABecBla5CWxXVhs7yZPezY1fqxtTgBeY zcUGM6ZOJg717D8lJPWXWUlPmeL2axadLOfdUyWw= From: Masami Hiramatsu To: Catalin Marinas , Will Deacon Subject: [PATCH v3 0/4] arm64: kprobes: Fix some bugs in arm64 kprobes Date: Thu, 25 Jul 2019 17:15:44 +0900 Message-Id: <156404254387.2020.886452004489353899.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-20190725_011550_593176_1DA8E3EC X-CRM114-Status: GOOD ( 10.08 ) 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 v3 patches which fixes kprobe bugs on arm64. In this version I fixed some issues pointed by James and add Reviewed-by and Acked-bys. Background: 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. So after hitting kprobes, the debug flag status is changed. - 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/include/asm/daifflags.h | 2 ++ arch/arm64/kernel/debug-monitors.c | 14 +++++++------ arch/arm64/kernel/probes/kprobes.c | 39 +++++------------------------------ arch/arm64/kernel/return_address.c | 3 +++ arch/arm64/kernel/stacktrace.c | 3 +++ arch/arm64/mm/fault.c | 40 ++++++++++++++++++++++++++++++++++++ 6 files changed, 61 insertions(+), 40 deletions(-) -- Masami Hiramatsu (Linaro)