[v2,2/3] arm64: kprobes: Let arch do_page_fault() fix up page fault in user handler
Message ID | 166994752269.439920.4801339965959400456.stgit@devnote3 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp603476wrr; Thu, 1 Dec 2022 18:23:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf4QLydSpgZaUv3/t8oq1y71sqmSn45PbOKX4Aqgc4AWpkQUqfwlGmGYPOQ9BM83fmAMgVO6 X-Received: by 2002:a17:907:8749:b0:7c0:7c6c:d484 with SMTP id qo9-20020a170907874900b007c07c6cd484mr275442ejc.752.1669947824708; Thu, 01 Dec 2022 18:23:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669947824; cv=none; d=google.com; s=arc-20160816; b=Ih2SIFvQyhKML87gbYe3iUp+3NclDdW5Cx/I0Ezknd6G2bJdPxFqlaRSvfmMoWMxPr lyNCzk/R2H67qCN1uXEoE3pwmtpsseQdQetv+59msJvNn+KyxbYrMcrMjKn8n9qJpVlF Jw1soBhG8m5zafBZ0t7EKpgdAaYRmvTvN3fwnG1i24DpPZ/+jcd/dHzK6EtKVMfU96Qv gMXW8Ej3gcadsf3tfAnRhFyBRBnKrZ7FxWtlRI9/ar6i+ixouROV1mxNhut/yQ8edZ1l 6+CJFeFo98vb+PM3by0MsIHWbBjf6UoGUh7h3mVKJ6hVJTOcCtSwxQIWllpA3OSKahD3 YzHw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OJ0r/EV0Br2UhnYdbzWlVIdW3+DP7insZFToSGKec+w=; b=b/AgyjqBa8YY90Eh4hf9QLVobnHGvNMVzyh5EDaqG7f6brmhgCErDa2+xP1F1mmUvN vpGFYmv/vZBFLRv77apQQanFwupgVpyrXAwBFYDJq2KfJdGvwvQrckgijc3/hlz+SnH2 +002mpxxKf5drabkAWV5eYIaUWoYXeLgLclo5emzqlFc6FLsMB+jyoJv8Jml+IxozQgB SIW0kTILBhkHTGr+KyMpSYLo1qL8MTQbUDgIPZT3JtvpPtWU5uWOmoXDWoQYG4mvaozj XGKq0jJpM/rTRZx9grV4hCuYkEQOD/2xagT4rrX51XLKv4fBagI/IrjcKsCb0hds61l2 /52Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Zii/5dPf"; 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 eb10-20020a0564020d0a00b00468ccfbba7asi5317782edb.387.2022.12.01.18.23.17; Thu, 01 Dec 2022 18:23:44 -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="Zii/5dPf"; 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 S232039AbiLBCS5 (ORCPT <rfc822;heyuhang3455@gmail.com> + 99 others); Thu, 1 Dec 2022 21:18:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231989AbiLBCSt (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 1 Dec 2022 21:18:49 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B196CAF8A for <linux-kernel@vger.kernel.org>; Thu, 1 Dec 2022 18:18:48 -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 dfw.source.kernel.org (Postfix) with ESMTPS id DFE21620DF for <linux-kernel@vger.kernel.org>; Fri, 2 Dec 2022 02:18:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B914C433D6; Fri, 2 Dec 2022 02:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669947527; bh=l+zSv5Pd3wyhqUmwoKQIAVoeZtKtlu6AJ8Bvwt0QiX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zii/5dPf7Jv4cEPjUQA2jGVbRF1TX6Q20gJvpJPtsZ7BYH8G7nNgi7RcAYXTs9O2W 42eQmwYyhdB9miTrO9IVQve1gUnMi9vyD7xZOdQPsOPcbVIrcJRoXnsesxyGPjnSFR VMmi1WME5mYK5YaxnFORjAEp5hsm/FQ5rBBNylZaRq8BKDeXTzJ+ozojWnzpVn9ry/ OrmAQHUXvtvwo6mhuvCtoOQEt4s2qJ5ge36PdYyhOIpCJF3fG04uO9Ejhnw+V4KsI+ 6mrCVeNVyRTWq9wGLL7j5Z6SfHrLB7Csjq+ZfUFRWrWoLxtO5MiHURjGNZjoP85lkY pSGk+ZKaIAG9A== From: "Masami Hiramatsu (Google)" <mhiramat@kernel.org> To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com>, Mark Brown <broonie@kernel.org>, Kalesh Singh <kaleshsingh@google.com>, Masami Hiramatsu <mhiramat@kernel.org>, Marc Zyngier <maz@kernel.org>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sandeepa Prabhu <sandeepa.s.prabhu@gmail.com> Subject: [PATCH v2 2/3] arm64: kprobes: Let arch do_page_fault() fix up page fault in user handler Date: Fri, 2 Dec 2022 11:18:42 +0900 Message-Id: <166994752269.439920.4801339965959400456.stgit@devnote3> X-Mailer: git-send-email 2.39.0.rc0.267.gcb52ba06e7-goog In-Reply-To: <166994750386.439920.1754385804350980158.stgit@devnote3> References: <166994750386.439920.1754385804350980158.stgit@devnote3> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751067210441060376?= X-GMAIL-MSGID: =?utf-8?q?1751067210441060376?= |
Series |
arm64: kprobes: Fix bugs in kprobes for arm64
|
|
Commit Message
Masami Hiramatsu (Google)
Dec. 2, 2022, 2:18 a.m. UTC
From: Masami Hiramatsu (Google) <mhiramat@kernel.org> Since arm64's do_page_fault() can handle the page fault correctly than kprobe_fault_handler() according to the context, let it handle the page fault instead of simply call fixup_exception() in the kprobe_fault_handler(). Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Acked-by: Mark Rutland <mark.rutland@arm.com> --- arch/arm64/kernel/probes/kprobes.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c index c9e4d0720285..d2ae37f89774 100644 --- a/arch/arm64/kernel/probes/kprobes.c +++ b/arch/arm64/kernel/probes/kprobes.c @@ -294,14 +294,6 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr) } break; - case KPROBE_HIT_ACTIVE: - case KPROBE_HIT_SSDONE: - /* - * In case the user-specified fault handler returned - * zero, try to fix up. - */ - if (fixup_exception(regs)) - return 1; } return 0; }