Skip to content

Commit

Permalink
prov/efa: Zero the cq entry array in dgram ep progress
Browse files Browse the repository at this point in the history
In efa_dgram_ep_progress_internal, cq_entry was declared without
initializing as 0. It casts this array's pointer into smaller structs
like `fi_cq_entry` during the cq->read_entry call, which doesn't have
the flags member, and then cast it back to fi_cq_tagged_entry which has flags.
This finally makes the finally temp_cq_entry struct has a flags from
uninitialized values and can cause illegal flags to be used in the cq write.
This patch fixes issue by initializing the cq entry array as 0.

Signed-off-by: Shi Jin <sjina@amazon.com>
  • Loading branch information
shijin-aws committed Aug 29, 2024
1 parent fe1bf36 commit b514863
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prov/efa/src/dgram/efa_dgram_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ static struct fi_ops efa_dgram_ep_ops = {
static void efa_dgram_ep_progress_internal(struct efa_dgram_ep *ep, struct efa_dgram_cq *efa_dgram_cq)
{
struct util_cq *cq;
struct fi_cq_tagged_entry cq_entry[efa_dgram_cq_PROGRESS_ENTRIES];
struct fi_cq_tagged_entry cq_entry[efa_dgram_cq_PROGRESS_ENTRIES] = {0};
struct fi_cq_tagged_entry *temp_cq_entry;
struct fi_cq_err_entry cq_err_entry = {0};
fi_addr_t src_addr[efa_dgram_cq_PROGRESS_ENTRIES];
Expand Down

0 comments on commit b514863

Please sign in to comment.