Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2495610rwi; Fri, 21 Oct 2022 04:40:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ZrC9zB+/LfbdfD+5yWsVVn1LBtx+Nxf0GFI5u7IM0cDLq5Jk/u7Md77ymRAGhI+iqiiaD X-Received: by 2002:a05:6402:847:b0:453:944a:ba8e with SMTP id b7-20020a056402084700b00453944aba8emr16702244edz.326.1666352435149; Fri, 21 Oct 2022 04:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666352435; cv=none; d=google.com; s=arc-20160816; b=G1rgDzdMce7kHHboQMCqSOTs6Wj+BrkTvOZvvcWlIVVxfPQ+rvVxcTbFeyQbZFC6gY Pdxr+GmvM3ZVkDGZbLxypliT+IfdEMVrEf4Qx5WgQ8PktINVRN2mR637xMhb/Wxwml1Q +dO1sMSw4siLXJNFer5jJR2izdakWxaHwEZyDRkpZQBjEwOVRUuQdmSOxX56Ne1ZbDJx X4TOPGiPUhRf0EtJUsHB2LS6b/wph5RjytKmIUCz4vKBccmnh6ZTbTM/H+x3pH5021l/ 7WLO64lKI29YdkA+jc/mxtE2XaBAwus0eBEBwvbhrYyS5WrTVQp9IunFIJgc9WHewAiM Bymw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=qjPFzJMK1f0R6f/75Agws5yt8k0LPLz/u9jn5Pn2Its=; b=kB126GaYkMlBLSD0xDzqHVaQ9f1d7kAL6HlAITqn3y/fFXfsQyhHFYqYdQhyhgoBZY 1hz5HRu75QfNPm4QSKFcuOVeH91ZM/VG1/EH4Vedbo/tMqAEOtFEpY6gV1r2ta3FMNAU TNZmontzlRMsth+DK84efz7YmGY1VD20z0IETDQR5XIvQLnPiC9Wu/YIaOdaXQ3kuw85 9Fb32RkHg0blbaLYmqqQo8ZOONjRjtsdIZ+t6B86CR0tGLb09n/3fDmtgxeneQsnLhQq 2MsID1HLKn/qj5lxMFQ+IXOuB5I9noXNvjRjdzgr/5tiuEEBvw+/enf683gDsEwEFhpC dQug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a170906500500b0078255525a6fsi18263254ejj.671.2022.10.21.04.40.10; Fri, 21 Oct 2022 04:40:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229484AbiJULev (ORCPT + 99 others); Fri, 21 Oct 2022 07:34:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230289AbiJULe3 (ORCPT ); Fri, 21 Oct 2022 07:34:29 -0400 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E7725599; Fri, 21 Oct 2022 04:34:22 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1olqHQ-004dk4-PE; Fri, 21 Oct 2022 19:34:14 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 21 Oct 2022 19:34:13 +0800 Date: Fri, 21 Oct 2022 19:34:13 +0800 From: Herbert Xu To: Natalia Petrova Cc: "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org, Alexey Khoroshilov Subject: Re: [PATCH] nitrox: avoid double free on error path in nitrox_sriov_init() Message-ID: References: <20220928102505.39709-1-n.petrova@fintech.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220928102505.39709-1-n.petrova@fintech.ru> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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-crypto@vger.kernel.org On Wed, Sep 28, 2022 at 01:25:05PM +0300, Natalia Petrova wrote: > If alloc_workqueue() fails in nitrox_mbox_init() it deallocates > ndev->iov.vfdev and returns error code, but then nitrox_sriov_init() > calls nitrox_sriov_cleanup() where ndev->iov.vfdev is deallocated > again. > > Fix this by nulling ndev->iov.vfdev after the first deallocation. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Signed-off-by: Natalia Petrova > Signed-off-by: Alexey Khoroshilov > --- > drivers/crypto/cavium/nitrox/nitrox_mbx.c | 1 + > 1 file changed, 1 insertion(+) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt