* [dpdk-dev] [PATCH 1/3] net/ixgbe: set pointer to NULL after free [not found] <cover.1644842271.git.wangyunjian@huawei.com> @ 2022-02-15 10:24 ` Yunjian Wang 2022-02-15 12:00 ` Wang, Haiyue 2022-02-15 10:24 ` [dpdk-dev] [PATCH 2/3] net/txgbe: " Yunjian Wang 2022-02-15 10:25 ` [dpdk-dev] [PATCH 3/3] net/iavf: " Yunjian Wang 2 siblings, 1 reply; 6+ messages in thread From: Yunjian Wang @ 2022-02-15 10:24 UTC (permalink / raw) To: dev Cc: ferruh.yigit, jingjing.wu, beilei.xing, haiyue.wang, jiawenwu, jianwang, dingxiaoxiong, huangshaozhang, Yunjian Wang, stable 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [dpdk-dev] [PATCH 1/3] net/ixgbe: set pointer to NULL after free 2022-02-15 10:24 ` [dpdk-dev] [PATCH 1/3] net/ixgbe: set pointer to NULL after free Yunjian Wang @ 2022-02-15 12:00 ` Wang, Haiyue 0 siblings, 0 replies; 6+ messages in thread From: Wang, Haiyue @ 2022-02-15 12:00 UTC (permalink / raw) To: Yunjian Wang, dev Cc: Yigit, Ferruh, Wu, Jingjing, Xing, Beilei, jiawenwu, jianwang, dingxiaoxiong, huangshaozhang, stable > -----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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH 2/3] net/txgbe: set pointer to NULL after free [not found] <cover.1644842271.git.wangyunjian@huawei.com> 2022-02-15 10:24 ` [dpdk-dev] [PATCH 1/3] net/ixgbe: set pointer to NULL after free Yunjian Wang @ 2022-02-15 10:24 ` Yunjian Wang 2022-02-15 10:25 ` [dpdk-dev] [PATCH 3/3] net/iavf: " Yunjian Wang 2 siblings, 0 replies; 6+ messages in thread From: Yunjian Wang @ 2022-02-15 10:24 UTC (permalink / raw) To: dev Cc: ferruh.yigit, jingjing.wu, beilei.xing, haiyue.wang, jiawenwu, jianwang, dingxiaoxiong, huangshaozhang, Yunjian Wang, stable 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH 3/3] net/iavf: set pointer to NULL after free [not found] <cover.1644842271.git.wangyunjian@huawei.com> 2022-02-15 10:24 ` [dpdk-dev] [PATCH 1/3] net/ixgbe: set pointer to NULL after free Yunjian Wang 2022-02-15 10:24 ` [dpdk-dev] [PATCH 2/3] net/txgbe: " Yunjian Wang @ 2022-02-15 10:25 ` Yunjian Wang 2022-02-15 12:02 ` Wang, Haiyue 2 siblings, 1 reply; 6+ messages in thread From: Yunjian Wang @ 2022-02-15 10:25 UTC (permalink / raw) To: dev Cc: ferruh.yigit, jingjing.wu, beilei.xing, haiyue.wang, jiawenwu, jianwang, dingxiaoxiong, huangshaozhang, Yunjian Wang, stable 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [dpdk-dev] [PATCH 3/3] net/iavf: set pointer to NULL after free 2022-02-15 10:25 ` [dpdk-dev] [PATCH 3/3] net/iavf: " Yunjian Wang @ 2022-02-15 12:02 ` Wang, Haiyue 2022-02-15 12:10 ` wangyunjian 0 siblings, 1 reply; 6+ messages in thread From: Wang, Haiyue @ 2022-02-15 12:02 UTC (permalink / raw) To: Yunjian Wang, dev Cc: Yigit, Ferruh, Wu, Jingjing, Xing, Beilei, jiawenwu, jianwang, dingxiaoxiong, huangshaozhang, stable > -----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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [dpdk-dev] [PATCH 3/3] net/iavf: set pointer to NULL after free 2022-02-15 12:02 ` Wang, Haiyue @ 2022-02-15 12:10 ` wangyunjian 0 siblings, 0 replies; 6+ messages in thread From: wangyunjian @ 2022-02-15 12:10 UTC (permalink / raw) To: Wang, Haiyue, dev Cc: Yigit, Ferruh, Wu, Jingjing, Xing, Beilei, jiawenwu, jianwang, dingxiaoxiong, Huangshaozhang, stable > -----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 ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-02-15 12:10 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <cover.1644842271.git.wangyunjian@huawei.com> 2022-02-15 10:24 ` [dpdk-dev] [PATCH 1/3] net/ixgbe: set pointer to NULL after free Yunjian Wang 2022-02-15 12:00 ` Wang, Haiyue 2022-02-15 10:24 ` [dpdk-dev] [PATCH 2/3] net/txgbe: " Yunjian Wang 2022-02-15 10:25 ` [dpdk-dev] [PATCH 3/3] net/iavf: " Yunjian Wang 2022-02-15 12:02 ` Wang, Haiyue 2022-02-15 12:10 ` wangyunjian
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).