From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E61C2EB64DD for ; Tue, 18 Jul 2023 06:28:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229887AbjGRG26 (ORCPT ); Tue, 18 Jul 2023 02:28:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230076AbjGRG2w (ORCPT ); Tue, 18 Jul 2023 02:28:52 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7CB55100; Mon, 17 Jul 2023 23:28:36 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AB5D4D75; Mon, 17 Jul 2023 23:29:19 -0700 (PDT) Received: from [10.163.50.249] (unknown [10.163.50.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5E0393F6C4; Mon, 17 Jul 2023 23:28:20 -0700 (PDT) Message-ID: <5f7841ad-6bb5-dffd-b1ac-e6d198933075@arm.com> Date: Tue, 18 Jul 2023 11:58:13 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] arm64/ptrace: Fix an error handling path in sve_set_common() Content-Language: en-US To: Mark Brown , Christophe JAILLET Cc: Oleg Nesterov , Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <3f78a04c-bafe-4def-8eeb-734589fdaaa0@sirena.org.uk> From: Anshuman Khandual In-Reply-To: <3f78a04c-bafe-4def-8eeb-734589fdaaa0@sirena.org.uk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Anshuman Khandual > >> 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.