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: 2511 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp611517wrr; Thu, 1 Dec 2022 18:53:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf4EtGIth3Bo+mfaq4bDmXZla5/6xgCXAi437cmGiCaNG5mu3KYTW31QaFHTA3C4FpWKQQvf X-Received: by 2002:a17:902:be18:b0:188:b6e0:6a96 with SMTP id r24-20020a170902be1800b00188b6e06a96mr49849030pls.167.1669949585765; Thu, 01 Dec 2022 18:53:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669949585; cv=none; d=google.com; s=arc-20160816; b=nxopuj8NCrV04vZs2nD0daJ4C1dx3NPPkmcamz41FyiP2CDazNezMhDnNlgXZRX89a IdVOWTTk+dObA/R4ReNMKWIah2V0E5c7FS/zuD4f/b+Warg0U6v5D1AKG3oA8cFhZUU9 gduacbTnRxsZrTvR0fZX/nYO6SeHS6ukYD433CiYwSLgeT+R5uSiMVrX/sQvWKWuS1ed 8FBmtl7k48dZjJmuPr31kxseL/GcZ2N2xESIO6xpC16Wqh8gQDDnhwR043XL/VP/h1Qr 3qHrmS0qK2aMF/rey4ma4qxAZ/wkstyY/Pf7CmGEUCz8Q3J4eFGoYnYpxjFYz0O30QDn oTJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:subject:cc:to:from:dkim-signature; bh=qNB/kTm+IGnTIkg11OJ0J5Jd1xQ6tNAl3lpEbqw8/aA=; b=bfH8+31/sxTzfp52XBn1OLIoS+L35JeiE6lR+3ZjFaDMh09o8z+5PmlOlghtiAbYGT rRbQlc9+p/DmrVD1zhED0Yh5p1z1/bV6UJSgwvUoRT2jZksnp6cBav36NlCjk7sVwL1t 3aOjrZHlaze6oKUA3ht/+RBxnd/hjFzl2M+tIH8itJTC3YQuzXg4CiPWGL1vWGnrNUXk IPUGUUm9Q7pJBXWP/5GsjaV0Py+V8FiC1dV32y8Eu0aw90Zx1SSqXZeYM23KNTPzhLxm pLNfGrMzUTs5HULXBNOsTwzGoWUyyWuiSX3uonJKT2s9r16/3eGgLaBiEwQBrlfiw+CU Nt0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mJ7MQ6Na; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p21-20020a170902b09500b0018863e1bc39si5771507plr.248.2022.12.01.18.52.52; Thu, 01 Dec 2022 18:53:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mJ7MQ6Na; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231965AbiLBCSd (ORCPT + 99 others); Thu, 1 Dec 2022 21:18:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230170AbiLBCSb (ORCPT ); Thu, 1 Dec 2022 21:18:31 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3F17C936F for ; Thu, 1 Dec 2022 18:18:30 -0800 (PST) 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 9AF2CB81F90 for ; 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-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751023787252023533?= X-GMAIL-MSGID: =?utf-8?q?1751069056915653562?= 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)