This series include three fixes patches for ixgbe/txgbe/iavf. Yunjian Wang (3): net/ixgbe: set pointer to NULL after free net/txgbe: set pointer to NULL after free net/iavf: set pointer to NULL after free drivers/net/iavf/iavf_ipsec_crypto.c | 1 + drivers/net/ixgbe/ixgbe_ethdev.c | 1 + drivers/net/txgbe/txgbe_ethdev.c | 1 + 3 files changed, 3 insertions(+) -- 2.27.0
When ixgbe_dev_close() is cleaning up, it does not correctly set the security_ctx variable to NULL, which will lead to wild pointer. Fixes: 9a0752f498d2 ("net/ixgbe: enable inline IPsec") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> --- drivers/net/ixgbe/ixgbe_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 3d799d2187..7643842560 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -3038,6 +3038,7 @@ ixgbe_dev_close(struct rte_eth_dev *dev) #ifdef RTE_LIB_SECURITY rte_free(dev->security_ctx); + dev->security_ctx = NULL; #endif return ret; -- 2.27.0
When txgbe_dev_close() is cleaning up, it does not correctly set the security_ctx variable to NULL, which will lead to wild pointer. Fixes: f437d97c3df1 ("net/txgbe: add IPsec context creation") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> --- drivers/net/txgbe/txgbe_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index 7b42285b9e..19d4444748 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -2032,6 +2032,7 @@ txgbe_dev_close(struct rte_eth_dev *dev) #ifdef RTE_LIB_SECURITY rte_free(dev->security_ctx); + dev->security_ctx = NULL; #endif return ret; -- 2.27.0
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 <wangyunjian@huawei.com> --- 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 = NULL; sctx = NULL; + adapter->vf.eth_dev->security_ctx = NULL; return 0; } -- 2.27.0
> -----Original Message----- > From: Yunjian Wang <wangyunjian@huawei.com> > Sent: Tuesday, February 15, 2022 18:25 > To: dev@dpdk.org > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei > <beilei.xing@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>; jiawenwu@trustnetic.com; > jianwang@trustnetic.com; dingxiaoxiong@huawei.com; huangshaozhang@huawei.com; Yunjian Wang > <wangyunjian@huawei.com>; stable@dpdk.org > Subject: [dpdk-dev] [PATCH 1/3] net/ixgbe: set pointer to NULL after free > > When ixgbe_dev_close() is cleaning up, it does not correctly set > the security_ctx variable to NULL, which will lead to wild pointer. > > Fixes: 9a0752f498d2 ("net/ixgbe: enable inline IPsec") > Cc: stable@dpdk.org > > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> > --- > drivers/net/ixgbe/ixgbe_ethdev.c | 1 + > 1 file changed, 1 insertion(+) > Acked-by: Haiyue Wang <haiyue.wang@intel.com> > -- > 2.27.0
> -----Original Message----- > From: Yunjian Wang <wangyunjian@huawei.com> > Sent: Tuesday, February 15, 2022 18:25 > To: dev@dpdk.org > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei > <beilei.xing@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>; jiawenwu@trustnetic.com; > jianwang@trustnetic.com; dingxiaoxiong@huawei.com; huangshaozhang@huawei.com; Yunjian Wang > <wangyunjian@huawei.com>; 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 <wangyunjian@huawei.com> > --- > 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 = NULL; > sctx = NULL; The above two lines can be removed, since it is local var. > + adapter->vf.eth_dev->security_ctx = NULL; Also, adapter->security_ctx = NULL ? > > return 0; > } > -- > 2.27.0
> -----Original Message----- > From: Wang, Haiyue [mailto:haiyue.wang@intel.com] > Sent: Tuesday, February 15, 2022 8:02 PM > To: wangyunjian <wangyunjian@huawei.com>; dev@dpdk.org > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; > Xing, Beilei <beilei.xing@intel.com>; jiawenwu@trustnetic.com; > jianwang@trustnetic.com; dingxiaoxiong <dingxiaoxiong@huawei.com>; > Huangshaozhang <huangshaozhang@huawei.com>; stable@dpdk.org > Subject: RE: [dpdk-dev] [PATCH 3/3] net/iavf: set pointer to NULL after free > > > -----Original Message----- > > From: Yunjian Wang <wangyunjian@huawei.com> > > Sent: Tuesday, February 15, 2022 18:25 > > To: dev@dpdk.org > > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Wu, Jingjing > > <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Wang, > > Haiyue <haiyue.wang@intel.com>; jiawenwu@trustnetic.com; > > jianwang@trustnetic.com; dingxiaoxiong@huawei.com; > > huangshaozhang@huawei.com; Yunjian Wang <wangyunjian@huawei.com>; > > 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 <wangyunjian@huawei.com> > > --- > > 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 = NULL; > > sctx = NULL; > > The above two lines can be removed, since it is local var. Agree, I will remove them. > > > + adapter->vf.eth_dev->security_ctx = NULL; > > Also, adapter->security_ctx = NULL ? OK, I will fix it in next version. > > > > > return 0; > > } > > -- > > 2.27.0
This series include three fixes patches for ixgbe/txgbe/iavf. --- v2: * update patch 1/3 code styles suggested by Haiyue Wang Yunjian Wang (3): net/ixgbe: set pointer to NULL after free net/txgbe: set pointer to NULL after free net/iavf: set pointer to NULL after free drivers/net/iavf/iavf_ipsec_crypto.c | 4 ++-- drivers/net/ixgbe/ixgbe_ethdev.c | 1 + drivers/net/txgbe/txgbe_ethdev.c | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) -- 2.27.0
When ixgbe_dev_close() is cleaning up, it does not correctly set the security_ctx variable to NULL, which will lead to wild pointer. Fixes: 9a0752f498d2 ("net/ixgbe: enable inline IPsec") Cc: stable@dpdk.org Acked-by: Haiyue Wang <haiyue.wang@intel.com> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> --- drivers/net/ixgbe/ixgbe_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 3d799d2187..7643842560 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -3038,6 +3038,7 @@ ixgbe_dev_close(struct rte_eth_dev *dev) #ifdef RTE_LIB_SECURITY rte_free(dev->security_ctx); + dev->security_ctx = NULL; #endif return ret; -- 2.27.0
When txgbe_dev_close() is cleaning up, it does not correctly set the security_ctx variable to NULL, which will lead to wild pointer. Fixes: f437d97c3df1 ("net/txgbe: add IPsec context creation") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> --- drivers/net/txgbe/txgbe_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index 7b42285b9e..19d4444748 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -2032,6 +2032,7 @@ txgbe_dev_close(struct rte_eth_dev *dev) #ifdef RTE_LIB_SECURITY rte_free(dev->security_ctx); + dev->security_ctx = NULL; #endif return ret; -- 2.27.0
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 <wangyunjian@huawei.com> --- drivers/net/iavf/iavf_ipsec_crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c b/drivers/net/iavf/iavf_ipsec_crypto.c index 6ac1b213db..a63e42f29a 100644 --- a/drivers/net/iavf/iavf_ipsec_crypto.c +++ b/drivers/net/iavf/iavf_ipsec_crypto.c @@ -1553,8 +1553,8 @@ iavf_security_ctx_destroy(struct iavf_adapter *adapter) rte_free(iavf_sctx); rte_free(sctx); - iavf_sctx = NULL; - sctx = NULL; + adapter->security_ctx = NULL; + adapter->vf.eth_dev->security_ctx = NULL; return 0; } -- 2.27.0
On 2/15/2022 1:01 PM, Yunjian Wang wrote:
> This series include three fixes patches for ixgbe/txgbe/iavf.
> ---
> v2:
> * update patch 1/3 code styles suggested by Haiyue Wang
>
> Yunjian Wang (3):
> net/ixgbe: set pointer to NULL after free
> net/txgbe: set pointer to NULL after free
> net/iavf: set pointer to NULL after free
>
For series,
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
On 2/15/2022 2:27 PM, Ferruh Yigit wrote:
> On 2/15/2022 1:01 PM, Yunjian Wang wrote:
>> This series include three fixes patches for ixgbe/txgbe/iavf.
>> ---
>> v2:
>> * update patch 1/3 code styles suggested by Haiyue Wang
>>
>> Yunjian Wang (3):
>> net/ixgbe: set pointer to NULL after free
>> net/txgbe: set pointer to NULL after free
>> net/iavf: set pointer to NULL after free
>>
>
> For series,
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Series applied to dpdk-next-net/main, thanks.