From patchwork Fri Dec 2 02:18:23 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: 13062075 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 8A313C4332F for ; Fri, 2 Dec 2022 02:19:50 +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=FzHPjGhDtiHAs3Vt/aFrPhlUnGx7yIrpk21N0jQ5ca0=; b=V2tgtfVJ2Vi96z KcohTElocARvLMwEx3Z9toBplYLpkJqQI8xNsjaGKN4wbbEJoAPfkUmL0sCIViHpTMie2IYbDnT8F yjkKp5vOMzzoGSG4bhmzphQUh76Bu85612sAJNSyjtvxusqpmw27NG0gJtwyqpS8Wri5cqoq4jU9t AcQIgYDd3iUA6WJlcTLUQeyU+7HN8f5frbW5Dgx+HFHoauejo5ISxBcbaZg7gW/5m8QxgVQhbceCa uC1d2fq4nLuuD7MGhoA9Cer9LoTJBHZyyxClCm8IYjCbmuH+SGCaHJQUVAHjfSFsDEwQ3eoUrWu4k y+Q7ddW/3W86/IdJtJTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0vdK-00CYEk-Co; Fri, 02 Dec 2022 02:18:34 +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 1p0vdG-00CYDA-Vy for linux-arm-kernel@lists.infradead.org; Fri, 02 Dec 2022 02:18:32 +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 965CEB81FBE; Fri, 2 Dec 2022 02:18:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FBF3C433D6; Fri, 2 Dec 2022 02:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669947508; bh=DHydDKMUem27kZ5bOGft5Frx5rmLAw4LuANPUEyn8V4=; h=From:To:Cc:Subject:Date:From; b=mJ7MQ6NapnVDpWe6ZcULZ7fHqlUe0RSULl2YIeysqqXwbVMdlqH7ERovHrYIQDfaU VTRkfs9WdrtGCd24XuRYGlUoqJtIacqVLsI8NxuxH1Po0qDGUORH/G3OII5kaopfl9 sl3iyETWDq2HcCXd5JiWp2vKl7wLdF90WNogS73nl06xeS//d+yAhJ8axnOuggc0Tl XP+HhKXBxqWYGv8ugQTVhErs24a31HLmy+nVN4Ld4AopgmnkH/fdyK8vaf/NjRqkwE tS4iDO+hA/mol8a2OZc1gbs6CD5X16D+5msDVJ3KFzlhakt/1MhV12MIz9cmoAZNMA IBGOIRKdCLw/w== 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 v2 0/3] arm64: kprobes: Fix bugs in kprobes for arm64 Date: Fri, 2 Dec 2022 11:18:23 +0900 Message-Id: <166994750386.439920.1754385804350980158.stgit@devnote3> X-Mailer: git-send-email 2.39.0.rc0.267.gcb52ba06e7-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_181831_194933_43B13C13 X-CRM114-Status: GOOD ( 11.22 ) 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, Here is the 2nd version of the kprobe bugfixes on arm64. The previous series is here; https://lore.kernel.org/all/166990553243.253128.13594802750635478633.stgit@devnote3/T/#u The first one is a critical issue, which will cause a kernel crach easily with lockdep[1/3]. Others are minor issues and rare cases. The [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.) In this version I update to use noinstr and __always_inline [1/3] and update comments[3/3]. Also add Mark's Ack (Thanks!) Thank you, --- Masami Hiramatsu (Google) (3): arm64: Prohibit instrumentation 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 | 86 +++++++++++++++--------------------- arch/arm64/kernel/stacktrace.c | 10 ++-- 2 files changed, 41 insertions(+), 55 deletions(-) -- Masami Hiramatsu (Google)