Skip to content

Commit

Permalink
prov/efa: Fix error handling in efa_rdm_cq_poll_ibv_cq
Browse files Browse the repository at this point in the history
When ibv_start_poll or ibv_next_poll return error, it may read
a cqe from a destroyed EP (QP). In this case we shouldn't call
efa_rdm_cq_get_prov_errno, which may use a freed EP from the
pkt_entry (wr_id) and cause segmentation fault.

Signed-off-by: Shi Jin <[email protected]>
  • Loading branch information
shijin-aws committed Apr 3, 2024
1 parent a358161 commit ce244a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prov/efa/src/rdm/efa_rdm_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ void efa_rdm_cq_poll_ibv_cq(ssize_t cqe_to_process, struct efa_ibv_cq *ibv_cq)

if (err && err != ENOENT) {
err = err > 0 ? err : -err;
prov_errno = efa_rdm_cq_get_prov_errno(ibv_cq->ibv_cq_ex);
prov_errno = ibv_wc_read_vendor_err(ibv_cq->ibv_cq_ex);
EFA_WARN(FI_LOG_CQ, "Unexpected error when polling ibv cq, err: %s (%zd) prov_errno: %s (%d)\n", fi_strerror(err), err, efa_strerror(prov_errno), prov_errno);
efa_show_help(prov_errno);
err_entry = (struct fi_cq_err_entry) {
Expand Down

0 comments on commit ce244a7

Please sign in to comment.