Skip to content

Commit

Permalink
providers: Fix overrun-buffer-arg issues
Browse files Browse the repository at this point in the history
Fix the following issue:
overrun-buffer-arg: Overrunning struct type ibv_modify_srq of 24 bytes by
passing it to a function which accesses it at byte offset 31 using argument "32UL".

Signed-off-by: Kamal Heib <[email protected]>
  • Loading branch information
Kamalheib committed Feb 12, 2025
1 parent 65bedad commit f140335
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion providers/hfi1verbs/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ int hfi1_modify_srq(struct ibv_srq *ibsrq,
}
cmd.offset_addr = (uintptr_t) &offset;
ret = ibv_cmd_modify_srq(ibsrq, attr, attr_mask,
&cmd.ibv_cmd, sizeof cmd);
&cmd.ibv_cmd, sizeof(cmd.ibv_cmd));
if (ret) {
if (attr_mask & IBV_SRQ_MAX_WR)
pthread_spin_unlock(&srq->rq.lock);
Expand Down
2 changes: 1 addition & 1 deletion providers/ipathverbs/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ int ipath_modify_srq(struct ibv_srq *ibsrq,
}
cmd.offset_addr = (uintptr_t) &offset;
ret = ibv_cmd_modify_srq(ibsrq, attr, attr_mask,
&cmd.ibv_cmd, sizeof cmd);
&cmd.ibv_cmd, sizeof(cmd.ibv_cmd));
if (ret) {
if (attr_mask & IBV_SRQ_MAX_WR)
pthread_spin_unlock(&srq->rq.lock);
Expand Down
2 changes: 1 addition & 1 deletion providers/rxe/rxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ static int rxe_modify_srq(struct ibv_srq *ibsrq,

cmd.mmap_info_addr = (__u64)(uintptr_t) &mi;
rc = ibv_cmd_modify_srq(ibsrq, attr, attr_mask,
&cmd.ibv_cmd, sizeof(cmd));
&cmd.ibv_cmd, sizeof(cmd.ibv_cmd));
if (rc)
goto out;

Expand Down

0 comments on commit f140335

Please sign in to comment.