From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1B6B0A00C5; Tue, 15 Feb 2022 13:10:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA03D410F3; Tue, 15 Feb 2022 13:10:32 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 1ABCD40E78; Tue, 15 Feb 2022 13:10:30 +0100 (CET) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Jyfyp34THzbkSG; Tue, 15 Feb 2022 20:09:22 +0800 (CST) Received: from dggpemm100015.china.huawei.com (7.185.36.61) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 15 Feb 2022 20:10:28 +0800 Received: from dggpemm500008.china.huawei.com (7.185.36.136) by dggpemm100015.china.huawei.com (7.185.36.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 15 Feb 2022 20:10:28 +0800 Received: from dggpemm500008.china.huawei.com ([7.185.36.136]) by dggpemm500008.china.huawei.com ([7.185.36.136]) with mapi id 15.01.2308.021; Tue, 15 Feb 2022 20:10:28 +0800 From: wangyunjian To: "Wang, Haiyue" , "dev@dpdk.org" CC: "Yigit, Ferruh" , "Wu, Jingjing" , "Xing, Beilei" , "jiawenwu@trustnetic.com" , "jianwang@trustnetic.com" , dingxiaoxiong , Huangshaozhang , "stable@dpdk.org" Subject: RE: [dpdk-dev] [PATCH 3/3] net/iavf: set pointer to NULL after free Thread-Topic: [dpdk-dev] [PATCH 3/3] net/iavf: set pointer to NULL after free Thread-Index: AQHYIlZNSGdyFvNkBUSbdV+XpOB9gKyT/PWAgACHYVA= Date: Tue, 15 Feb 2022 12:10:27 +0000 Message-ID: <0e5c424ea7b14fcf88bcc5c956a2d3fd@huawei.com> References: In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.242.157] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Wang, Haiyue [mailto:haiyue.wang@intel.com] > Sent: Tuesday, February 15, 2022 8:02 PM > To: wangyunjian ; dev@dpdk.org > Cc: Yigit, Ferruh ; Wu, Jingjing ; > Xing, Beilei ; jiawenwu@trustnetic.com; > jianwang@trustnetic.com; dingxiaoxiong ; > Huangshaozhang ; stable@dpdk.org > Subject: RE: [dpdk-dev] [PATCH 3/3] net/iavf: set pointer to NULL after f= ree >=20 > > -----Original Message----- > > From: Yunjian Wang > > Sent: Tuesday, February 15, 2022 18:25 > > To: dev@dpdk.org > > Cc: Yigit, Ferruh ; Wu, Jingjing > > ; Xing, Beilei ; Wang, > > Haiyue ; jiawenwu@trustnetic.com; > > jianwang@trustnetic.com; dingxiaoxiong@huawei.com; > > huangshaozhang@huawei.com; Yunjian Wang ; > > stable@dpdk.org > > Subject: [dpdk-dev] [PATCH 3/3] net/iavf: set pointer to NULL after > > free > > > > When iavf_security_ctx_destroy() is cleaning up, it does not correctly > > set the security_ctx variable to NULL, which will lead to wild pointer. > > > > Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto") > > Cc: stable@dpdk.org > > > > Signed-off-by: Yunjian Wang > > --- > > drivers/net/iavf/iavf_ipsec_crypto.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c > > b/drivers/net/iavf/iavf_ipsec_crypto.c > > index 6ac1b213db..f13849ca1c 100644 > > --- a/drivers/net/iavf/iavf_ipsec_crypto.c > > +++ b/drivers/net/iavf/iavf_ipsec_crypto.c > > @@ -1555,6 +1555,7 @@ iavf_security_ctx_destroy(struct iavf_adapter > > *adapter) > > > > iavf_sctx =3D NULL; > > sctx =3D NULL; >=20 > The above two lines can be removed, since it is local var. Agree, I will remove them. >=20 > > + adapter->vf.eth_dev->security_ctx =3D NULL; >=20 > Also, adapter->security_ctx =3D NULL ? OK, I will fix it in next version. >=20 > > > > return 0; > > } > > -- > > 2.27.0