Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3115535pxj; Mon, 17 May 2021 18:10:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh2Wc1gkUg/ANWSFuary5Stz13aXOCqMhF0pt4BNuLtqYm4rmlqrVI0jVxcRtnRqTQ3PA6 X-Received: by 2002:a05:6402:1649:: with SMTP id s9mr3692371edx.35.1621300214209; Mon, 17 May 2021 18:10:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621300214; cv=none; d=google.com; s=arc-20160816; b=GW0FZPXxv7mOgStAM+pgEoqFDu1tv/6/uQspDWHasyP53u6KCSifYlmCLQ8ETu06rS A4b7H8pmWG23ncqhQXWoRODRfmfSgXeoybmKpPn+fy/K486uBEHh7ZY+s1lSgPEPLzVs xvhjFTuzNBOtyskTAhpdl7uSJzc3bAO+/EOoWzzKN1jTZOS5HM+UASyRvmOE9PAmfArB L8EPnDAgvvE5iLKhWFkvh5HaWivF3ftdP+jiS3EMXrmbEmLGXBuWb4vVyRnBIg3bEPEp yHn5WSfNKikcChbHbVMiVEHIUhzmX4TG9ADGpLr0EGuXkiH9YhQCInUXmPXX681l/vqG shLQ== 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=WpLgOkDtX2ztLfA6P0+Mz+pIg/T7swmZ5yCoxFpTVZI=; b=ketmsYF4KkKb6oz5UrOTNKRKSbPPC+VjUCVBmie+7443sD2XkJ2zpDhenubM7MTl1c t4jzEjodawcGSGvabe3R5092qwSDX8329Mo5njKrBDFjN3WVeJhnL63clJ0C6jovI4HG GmIvdYt1c/LIaJpbyauOqmY2tZxCItyNzPEV7QsxwBZF2rfHf3vaouH+6HzCBWfHTL5q Tia+Lg/sctO0e4bcQbaUM1wOtMmr40tvkvK2ER9beeZr0PZckEd7JB5K7TLOX+gSJKLS wPv9TzSmXOrTgr0d07xp5H75boe0tofQNGofCyrcjWy05vsvi0ttvg7VHjCG76TrnD2c S7aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="NMN/x5Ri"; 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 m19si10709699edd.348.2021.05.17.18.09.51; Mon, 17 May 2021 18:10:14 -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="NMN/x5Ri"; 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 S240177AbhEQObr (ORCPT + 99 others); Mon, 17 May 2021 10:31:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:48432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237939AbhEQO0a (ORCPT ); Mon, 17 May 2021 10:26:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4214A61361; Mon, 17 May 2021 14:13:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260821; bh=InQ/DaQMQc5IC6GQp9VEPqpCpjRgNmmJMdj9NHRkRrI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NMN/x5RiIThSZFP0TK3v/Q2C18kIxyjf2u04JHX9SPhZ6+xSG9gLIys2SPhSnfoUf NbHXUcqIsvkvwsL1WXDD3kf3iNktI1dtWHV/s/McO/IvNC5ENm0R/gd6kdmwQCXm7u 26AxGp/Ex5M47L3zE6bLvPK0pqTQH7oIWFkxcLCc= 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 5.12 243/363] i40e: Fix use-after-free in i40e_client_subtask() Date: Mon, 17 May 2021 16:01:49 +0200 Message-Id: <20210517140310.798574833@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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 a2dba32383f6..32f3facbed1a 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_client.c +++ b/drivers/net/ethernet/intel/i40e/i40e_client.c @@ -375,6 +375,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