Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6436598rwp; Mon, 17 Jul 2023 23:36:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlHV/zz9Y4cF2JRBhuJYOz7SskIdQ2IHtgYNzVIdXMDqlfcQJlrVxKTeR3ubEpTnXQdfMjN8 X-Received: by 2002:aa7:d64c:0:b0:51b:ebd7:641a with SMTP id v12-20020aa7d64c000000b0051bebd7641amr12720726edr.7.1689662219010; Mon, 17 Jul 2023 23:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689662218; cv=none; d=google.com; s=arc-20160816; b=GWAn+yhibhYuzYVy9UbGkXwOQRPA63gTR4wZ7ZezuCOEkXa9uNO70Y0xB+TK0XcTpP NWXec4341ueR+GbcbE6BhREyyY7qir93NLsf4saksLVZ9TxL6frQjM3ywLtsFSn/Gv6I XX/LfKGS+mEI6lY1Whkc6PF8O2QcWqILHzwT/80HkfPVswGXmPZNJpucF2/hB6vqlGc5 Me3oQAgPpdFeOqErScE6bEF8mqm5zU8Rx+nJTQmrV77p48oK1erBNUOoldZHhYk2N6aX P4FVLO8TcyA379oNnWXvSPFR5RYPEHsR5B9+OSroX0dyGK5R7wjr/ReU6sUnb5zypj9B eUYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=juCd43W15t/hltNaIUxT7L9adap73zML2AUXnWqjLNI=; fh=mSkloaycaWf9v3Ce3503jrqLmf4HTmFbsmjsyt4mN70=; b=gJPWfm4lgeAPk6+NcoPEWl6nos0CngF0SnsavZlCpCmMcdzDwzfu1HMalzYR/GaTxR Wue8x+Tcv4x9mP9DlWQqtk2l5YtzTNW+CgGte+HmtLX3vO8BtmPz3D70+CRxeHbUiCJr /aD9VixGylwD6r16WUiJk3qSVfbAQKPQN5sCKUdTvn+Dgc7NpaN2RIUY8Q1B89wOgFBE T3hH1JDhGV2oRUdOu6rSTCrQjv6p+PgDhHEHrFuDpCY3o329bCTEusxHICNpJPn3YvY9 1xRfM+IHfycfMlNClrZbD4hCOWHwt4P0sQStb3eE436Mvo46SGBzrge+1G5mZ4KeQ9Ww 24jw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a19-20020aa7cf13000000b0051e0599bcfbsi769344edy.111.2023.07.17.23.36.33; Mon, 17 Jul 2023 23:36:58 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230295AbjGRG24 (ORCPT + 99 others); Tue, 18 Jul 2023 02:28:56 -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 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,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: 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.