Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp545377pxj; Tue, 18 May 2021 08:59:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8zVRkZLmMhkYJ1lOPypzhfQ5/3waJSvc2CBaCxdHtyuMOqhUF3rV0yIDYjEVFAQ52J5V6 X-Received: by 2002:a05:6402:110b:: with SMTP id u11mr8166524edv.356.1621353574924; Tue, 18 May 2021 08:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621353574; cv=none; d=google.com; s=arc-20160816; b=YfkwLDuuCRFwu+Wr6Y2ENtUv69Hw3b1fxYUsYkThL4RpPhjgNhV1AirzgwIKdnKjJD G4zH7K+bJpnU6/I+FRyuzt88Wq3w7PcLolEVcFAi/+HyqAWMbH1I1FQ1GkHLfJn75RzP 4+vKfs2+fXXBgNmBZAfRYWW0T04gspaDN6VCZd7jQsJrFSED15J3bvw5OS6Em+CvnWIL LtuMUWmHoYql02LI3x+HVsLoeKSj5Q+BKGFxEMMIN1vV88ukM77Mr4gUvhYFS4YU7frV 0vbWSGLbYRsgitE4PBNaxX/YDhRmN2C8lELfLf/JR+naz0JDe2DIqLRIyCfkwj9Tzwd/ 042Q== 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=SKXc2dgNwg9yNzuJgqZNlALiLU7qA7gucbkiSRd+krAv8yNL3U5g/4yhMHy+mH1oiV L6SgJ/U1G/FbPEBwC8KlrLWgmNn9n+ie8xCHJRBG7cE3DLcIWKjVnaHC74FEnR4n0gEz fwJY+vgJLpacRatP7SxRHKZ64iy/3mfom4C83t/nm/8vM8JUHD8tECky2YOsrw9QrFdX g0RLs2WpEVGKIQiS3FhkatHX011UOiu2o9zHPaCG7bVQE4URKDJlKgTshhbfePGSHuFi xAYcPsvzRFaszet5PObu1vJpMMIMjjoaEk6emTHpMYkZQaSV5nW/X52y8F3r0j41lpsa oY8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Bl4oz8a/"; 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 cc18si13943202edb.583.2021.05.18.08.58.45; Tue, 18 May 2021 08:59:34 -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="Bl4oz8a/"; 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 S1345773AbhEQP5V (ORCPT + 99 others); Mon, 17 May 2021 11:57:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:39558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244908AbhEQPiR (ORCPT ); Mon, 17 May 2021 11:38:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 12E0C61CF8; Mon, 17 May 2021 14:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262446; bh=InQ/DaQMQc5IC6GQp9VEPqpCpjRgNmmJMdj9NHRkRrI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bl4oz8a/EEKfxOJdR+54wyVtaDmtiLG3x/mbuKKoW3hqGSeCbsPf15I5r2k5jTgqC A+XdSsIYBhcdaA3KM56u9spjCCZWed6OhydlQf3zHILrtLNsP0PcMkyhia04r3qnoA i0qL2knygqkElvkNacp6bRqV17s5VIkZwBdtc88k= 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.10 189/289] i40e: Fix use-after-free in i40e_client_subtask() Date: Mon, 17 May 2021 16:01:54 +0200 Message-Id: <20210517140311.475914844@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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