Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp382331pxj; Thu, 20 May 2021 11:30:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5mfjN4Itxse7cAw8PUdYAbSpR0vaeu+vLd2lrtEMg7QNPKJmWrqqEMSt1Ji7kH/eCkilx X-Received: by 2002:a17:906:2a46:: with SMTP id k6mr5817047eje.406.1621535415516; Thu, 20 May 2021 11:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621535415; cv=none; d=google.com; s=arc-20160816; b=tHa/NgyTjslVb2lmfrhkmxY8kDoqnNpm/pwvu8Ff85/t4JD6xrDMV67+EP52aln08n v/qX0tI6t8BR3YlfD4Z/RwO500vpKRULwuLkV2APWimeXEDDLTIojEu53GM28u65kHUy 0xk4HvVG/pv6xPvIFmOl6sq6G4EV2dWGzKkPMvstmMlh8s8kpIWwCFyFWtPILYG7b49q U6SmOW4xQOmrSFt+1L9H6sKO9ntdsWSXh/pLtz9zLbVpZJJAZKW9maTFMG7GbjF4eKpI N69y8/mfE9CEVGz4Qjx2/nV/2OKtHX4jaHGVOtcgl8S9rOk1/1uR+cQ0Tp3LyRMJaBr1 DOnA== 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=KR8uGBBdB1w79t65Wm2nBgV6Pt/1mBWX+uKBJbOcdlk=; b=xGlQRgqnyGCG2iyDrFqJvXLRr2AbNFCdW8r+FjJ2u3xQYwf+LClzWp894VC0vz4TXD Ba9FkbH5Vrj6ZDYr5GJjFuYCzpCvB+xgsWtVO2CDgn28dCB2fC3sXg2X2c+ocnq8vCRS HEn0W6YXAl/10qaT4j7z1lZEmrQmwDYoYjIWv/pOgNpa4dT1PoHAcyrphL4Cp8pSKrnP uhe2UfMh+/Z4OD7vKa4VF2XHNYrNbc86jywc0woopykchW28peM8sCyrfFWQtC5EpENQ cCHW17wKe+euP3qrGM7ER4wqFrQu2TXPOVh9xLKSMDj+/X162ULEyEA+nCmLNcMSYbk5 HlnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Mvg0NaCr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si3265869ejo.39.2021.05.20.11.29.52; Thu, 20 May 2021 11:30:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Mvg0NaCr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236153AbhETKSR (ORCPT + 99 others); Thu, 20 May 2021 06:18:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:42286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235826AbhETKJ1 (ORCPT ); Thu, 20 May 2021 06:09:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E153061954; Thu, 20 May 2021 09:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503749; bh=Kj4HbNKnJggx//K0o2PWTc0JJc/yOjHg4wctrBeg3yE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mvg0NaCrHehyZFsrO5pUGRrqrtDp8AMh93hIviaCMYZ9ZOYhG6nwO7h5a8chg80yM gtckJouEQb3oDB6fJv1kujdA1l4As3XtwwLhmeTyk6hRevg2MSQ1LGd4NWr2y9LXtN BRbqtIKBHLTF/Qv0pIPvL7lbkO37uN+oaYZ0t4rc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yunjian Wang , Tony Nguyen , Sasha Levin Subject: [PATCH 4.19 361/425] i40e: Fix use-after-free in i40e_client_subtask() Date: Thu, 20 May 2021 11:22:10 +0200 Message-Id: <20210520092143.268323885@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunjian Wang [ Upstream commit 38318f23a7ef86a8b1862e5e8078c4de121960c3 ] Currently the call to i40e_client_del_instance frees the object pf->cinst, however pf->cinst->lan_info is being accessed after the free. Fix this by adding the missing return. Addresses-Coverity: ("Read from pointer after free") Fixes: 7b0b1a6d0ac9 ("i40e: Disable iWARP VSI PETCP_ENA flag on netdev down events") Signed-off-by: Yunjian Wang Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/i40e/i40e_client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c index 5f3b8b9ff511..c1832a848714 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_client.c +++ b/drivers/net/ethernet/intel/i40e/i40e_client.c @@ -377,6 +377,7 @@ void i40e_client_subtask(struct i40e_pf *pf) clear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state); i40e_client_del_instance(pf); + return; } } } -- 2.30.2