dapl: Fix segfault while freeing qp
PATCH 1/1 dapl: Fix segfault while freeing qp
In function dapls_ib_qp_free(), pointers qp and cm_ptr->cm_id->qp are pointing to the same qp structure, initialized in function dapls_ib_qp_alloc(). The memory pointed by these pointers are freed twice in function dapls_ib_qp_free(), using rdma_destroy_qp() for the case _OPENIB_CMA defined and then further using ibv_destroy_qp(), causing a segmentation fault while freeing the qp. Therefore assigned NULL value to qp to avoid freeing illegal memory.
and proper protection during destruction")
--- dapl/openib_common/qp.c | 1 + 1 file changed, 1 insertion(+)
dapl/openib_common/qp.c +1 -0
@@ -397,6 +397,7 @@ DAT_RETURN dapls_ib_qp_free(IN DAPL_IA * ia_ptr, IN DAPL_EP * ep_ptr)#ifdef _OPENIB_CMA_rdma_destroy_qp (cm_ptr->cm_id); cm_ptr->cm_id->qp =NULL ; + qp =NULL ;#endif #ifdef _OPENIB_MCM_
Signature · 6 lines
2.5.3 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1443529774-26431-1-git-send-email-bharat-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org
Davis, Arlin R
AppliedThanks, applied.
Quoted 37 lines
-----Original Message-----
From: Bharat Potnuri [mailto:[email protected]]
Sent: Tuesday, September 29, 2015 5:30 AM
To: Davis, Arlin R
Cc: [email protected]; [email protected]; [email protected]; Bharat Potnuri
Subject: [PATCH] dapl: Fix segfault while freeing qpIn function
dapls_ib_qp_free(), pointers qp andcm_ptr->cm_id->qpare pointing to the same qp structure, initialized in functiondapls_ib_qp_alloc(). The memory pointed by these pointers are freed twice in functiondapls_ib_qp_free(), usingrdma_destroy_qp()for the case_OPENIB_CMAdefined and then further usingibv_destroy_qp(), causing a segmentation fault while freeing the qp. Therefore assigned NULL value to qp to avoid freeing illegal memory.Fixes 7ff4f840bf11 ("common: add CM-EP linking to support mutiple CM's andproper protection during destruction")
Signed-off-by Bharat Potnuri <[email protected]>--- dapl/openib_common/qp.c | 1 + 1 file changed, 1 insertion(+)dapl/openib_common/qp.c index renamed from dapl/openib_common/qp.c +0
-0
527fc1d4c46b..01f91ca2bd83100644dapl/openib_common/qp.c +0
-0@@ -397,6 +397,7 @@ DAT_RETURN dapls_ib_qp_free(IN DAPL_IA * ia_ptr,IN
DAPL_EP*ep_ptr) #ifdef _OPENIB_CMA_dapl/openib_common/qp.c +1
-1rdma_destroy_qp (cm_ptr->cm_id); cm_ptr->cm_id->qp =NULL ; + qp =NULL ;#endif #ifdef _OPENIB_MCM_ --
Quoted 1 line
2.5.3
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html