Message ID | aa61301ed2dfd079b74b37f7fede5f179ac3087a.1689616473.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1273493vqt; Mon, 17 Jul 2023 11:22:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlH73Y9ID4/VSNCP+StVq1SW/gY/Iqy6bQIglLGuYL1tM6B7lZqR9u1m2rA5EwNhuFw+3zYn X-Received: by 2002:a17:902:ee89:b0:1bb:2d0b:1a18 with SMTP id a9-20020a170902ee8900b001bb2d0b1a18mr3711636pld.50.1689618148189; Mon, 17 Jul 2023 11:22:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689618148; cv=none; d=google.com; s=arc-20160816; b=oW3M1FheIWOE42liyWa6RgfnbP5U7qlk3+n+HydQz06+9NP8iW5cA++RtjN9/l6mfc 6kyn91GUO2YgOYmQHhlKYWK3jvpK4D6JCvIbQYBpKF2qSFcWW/Ebu9DWty/gIhxXAPZ2 EehCc8DtIQPoMqQdb2N2+qJqT0alR2v24xOttOKY67GnGyakFPiR5OGjIXyurfUvUrXg xOz6yUHiLH2bfyEl5NlhrWvlbJu4Rj8Xh67e1gFAkiCFAKnK9oYoBYN0IV9dcjtl8zwp 5/Z5z8KyiXn2CPasOvmskkkDuhqalIAqdihdjDf+B5XDfXYigHZW5ycMhTBkvzaoylZK 5vdQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Fpk05MGU6nNGzQRzekEDu8vSE/s3ApjtFu1sQjrmUCg=; fh=9PzCOzaLTeDx/5089nUNFUnHZlK1qcYgr/v45Yt1FDk=; b=042j3d1T8+8kwM+AxFUUla6EtjBBtCxMZqHkotsMOZ0/A+vlPp0YuleRZf+FVzufYP z2ayjU82ZEF6ozbI3YydILdBev7wRVp1NzFwMAuMPV0y3UQT3YzXGWwh4a2rZN0YHznh 2S1JLrqkzCpKb7gamxBPI8xlVVNjhNS6j4tjxIbAS729rBae97hcsYzofAfTv8j/tKmR E+yTBIgngQBrzmXmxU8onRKgwGLv1Jx3XbfJ5gu/3J3K7Yiz5X+NRp/DkUYqA+5CIazr 4vreYjbm25t2wGQEIjGNeQddzR2ZKTT4zE/geUyqn4fLqfqB3H4i5jfUaTdRF0w8MXL9 8LZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=Hq9VMBES; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kl8-20020a170903074800b001b86c526fd8si184747plb.448.2023.07.17.11.22.15; Mon, 17 Jul 2023 11:22:28 -0700 (PDT) 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=@wanadoo.fr header.s=t20230301 header.b=Hq9VMBES; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbjGQRzQ (ORCPT <rfc822;hadasmailinglist@gmail.com> + 99 others); Mon, 17 Jul 2023 13:55:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbjGQRzP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Jul 2023 13:55:15 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 856D91A8 for <linux-kernel@vger.kernel.org>; Mon, 17 Jul 2023 10:55:13 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id LSRBqStkanCoyLSRBquzGy; Mon, 17 Jul 2023 19:55:10 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1689616511; bh=Fpk05MGU6nNGzQRzekEDu8vSE/s3ApjtFu1sQjrmUCg=; h=From:To:Cc:Subject:Date; b=Hq9VMBESswxqmkPDQDZwqnoyp75phIcB8PgZ5YKAqBrPnSxhj1oMThwXh3liI5+aL qaN069ATLkY7lVcTsRNKxp0nkHZXTQ7rRaA+3E7fqHcHjwVZdUzBa62tURVKrhmy/d Z6w/NiFpMqC/N9zcwky+sG04NQdboEa12mmPN5PmYSpTyq16xMbalOVU9dEsPGbKku XU+bIOYOzgs8ICIMcmMlzgbfC8FXPMUWUNtsOOvhWYo7pvSE63kKCqkn9l7HUaBEMj bnfF+yQhvcwDVnFMl6LGK8HRbud6Bj6M98Ulp2kDz/x8NehWq0/9c0Wyo/NAlav1F9 wx3vHkrLbSGcQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 17 Jul 2023 19:55:10 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: Oleg Nesterov <oleg@redhat.com>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Mark Brown <broonie@kernel.org> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm64/ptrace: Fix an error handling path in sve_set_common() Date: Mon, 17 Jul 2023 19:55:05 +0200 Message-Id: <aa61301ed2dfd079b74b37f7fede5f179ac3087a.1689616473.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: INBOX X-GMAIL-THRID: 1771692286069669773 X-GMAIL-MSGID: 1771693039215266543 |
Series |
arm64/ptrace: Fix an error handling path in sve_set_common()
|
|
Commit Message
Christophe JAILLET
July 17, 2023, 5:55 p.m. UTC
All error handling paths go to 'out', except this one. Be consistent and
also branch to 'out' here.
Fixes: e12310a0d30f ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
/!\ Speculative /!\
This patch is based on analysis of the surrounding code and should be
reviewed with care !
If the patch is wrong, maybe a comment in the code could explain why.
/!\ Speculative /!\
---
arch/arm64/kernel/ptrace.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On 7/17/23 23:38, Mark Brown wrote: > On Mon, Jul 17, 2023 at 07:55:05PM +0200, Christophe JAILLET wrote: >> All error handling paths go to 'out', except this one. Be consistent and >> also branch to 'out' here. > > This looks like a reasonable cleanup. > > Reviewed-by: Mark Brown <broonie@kernel.org> Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com> > >> Fixes: e12310a0d30f ("arm64/sme: Implement ptrace support for streaming mode SVE registers") > >> default: >> WARN_ON_ONCE(1); >> - return -EINVAL; >> + ret = -EINVAL; >> + goto out; >> } > > It's not exactly a fix though (probably not worth backporting for +1 > example, which tends to get keyed off the fixes tag) since something's > incredibly confused if this code path ever gets executed, we're setting > an unknown SVE vector type hence the WARN_ON() there. Agreed.
On Mon, 17 Jul 2023 19:55:05 +0200, Christophe JAILLET wrote: > All error handling paths go to 'out', except this one. Be consistent and > also branch to 'out' here. > > Applied to arm64 (for-next/misc), thanks! [1/1] arm64/ptrace: Fix an error handling path in sve_set_common() https://git.kernel.org/arm64/c/5f69ca4229c7 Cheers,
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index d7f4f0d1ae12..9bc23f1b499e 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -884,7 +884,8 @@ static int sve_set_common(struct task_struct *target, break; default: WARN_ON_ONCE(1); - return -EINVAL; + ret = -EINVAL; + goto out; } /*