From patchwork Thu Dec 1 14:38:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 13061389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F898C43217 for ; Thu, 1 Dec 2022 14:40:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=zdvw5FxvB04NfIhN2UonerJM5K4RBFryw25daAc/hpA=; b=AqTOJgMrEQK8D4 P8n/GVXdXVjhlDF55Iet229/UWK+nVjNe5b7OxC5TQU+ZNuzZzcV0TFgGMhUKdqaRDZ7zDhhRrrBK 9kJ/ctFJObWT/eEOrtbQu5EhnEumhhU7JDoHry2mLowqyhsM/FYx7KOA53d2l2l/jToynsmG9sE6q 0mT5ndi/e8T6a1/XDK5tJpvfx586hOeBV6v5ohB/47aoBN8qXTTCMZPVfFqL45yQPZ/vV25P16yYV WWTHJA65iJmHGr+hya+t9smN3VtqzDdLy27pniVTcBBL9AOYL0lrJl+5i2MuKDDWg8mpGZ23da710 HzEHy9BzZL7T4hJZRPxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0kiO-007y5z-PX; Thu, 01 Dec 2022 14:39:04 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0kiM-007y3a-9w for linux-arm-kernel@lists.infradead.org; Thu, 01 Dec 2022 14:39:03 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 019A9B81F57; Thu, 1 Dec 2022 14:38:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0151AC433D6; Thu, 1 Dec 2022 14:38:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669905536; bh=zjg9hqyT/cvW+xoLTuMA96NteGmgZ6jPNBUY+Kiab1s=; h=From:To:Cc:Subject:Date:From; b=LptiEmZWEYpFEm+OjQAbOIb9Nkdoc9xQrQqR0Xmc42JD7Ql2j0ejidB+Ri1/jWPSM XvU3HdECIe2WbTuIibMcmo5hDFiwCipgyyemKBTjjSVBhxelQPMZgimOqtNdPcVJed U+RT2jOTRKFaWHnw2Z/SwFz2xr29Wc+8Tx8K9FN/fFqmjLfPX3IW0L63y7CDU9Qr3N PCw8V2be87+djYeRst4QZ6LZlOr0qFO7zPoftndI2IsFAKoQ9oeVBh89GRbj2FdxpW 8QeqGBmrnxCQ41sT6lh6npE89dI04VmDE4EsZeQIPyne0vR3NC8T85pfeDlpK2FusG b6JLucNxahpbQ== From: "Masami Hiramatsu (Google)" To: Catalin Marinas , Will Deacon Cc: Mark Rutland , Mark Brown , Kalesh Singh , Masami Hiramatsu , Marc Zyngier , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sandeepa Prabhu Subject: [PATCH 0/3] arm64: kprobes: Fix bugs in kprobes for arm64 Date: Thu, 1 Dec 2022 23:38:52 +0900 Message-Id: <166990553243.253128.13594802750635478633.stgit@devnote3> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog User-Agent: StGit/0.19 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221201_063902_528128_E6011D29 X-CRM114-Status: GOOD ( 10.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, I found some bugs in kprobes for arm64. One is a critical issue, which will cause a kernel crach easily with lockdep[1/3]. Others are minor issues and rare cases. [2/3] let do_page_fault() fixup the page fault in kprobes user handler, and [3/3] is more like code cleanup and returns DBG_HOOK_ERROR if it can not handle kprobe's BRK (but that should not happen.) Thank you, --- Masami Hiramatsu (Google) (3): arm64: Prohibit probing on arch_stack_walk() arm64: kprobes: Let arch do_page_fault() fix up page fault in user handler arm64: kprobes: Return DBG_HOOK_ERROR if kprobes can not handle a BRK arch/arm64/kernel/probes/kprobes.c | 87 +++++++++++++++--------------------- arch/arm64/kernel/stacktrace.c | 7 ++- 2 files changed, 41 insertions(+), 53 deletions(-) -- Masami Hiramatsu (Google)