Skip to content

Commit f140335

Browse files
committed
providers: Fix overrun-buffer-arg issues
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 <kheib@redhat.com>
1 parent 65bedad commit f140335

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

providers/hfi1verbs/verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ int hfi1_modify_srq(struct ibv_srq *ibsrq,
598598
}
599599
cmd.offset_addr = (uintptr_t) &offset;
600600
ret = ibv_cmd_modify_srq(ibsrq, attr, attr_mask,
601-
&cmd.ibv_cmd, sizeof cmd);
601+
&cmd.ibv_cmd, sizeof(cmd.ibv_cmd));
602602
if (ret) {
603603
if (attr_mask & IBV_SRQ_MAX_WR)
604604
pthread_spin_unlock(&srq->rq.lock);

providers/ipathverbs/verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ int ipath_modify_srq(struct ibv_srq *ibsrq,
574574
}
575575
cmd.offset_addr = (uintptr_t) &offset;
576576
ret = ibv_cmd_modify_srq(ibsrq, attr, attr_mask,
577-
&cmd.ibv_cmd, sizeof cmd);
577+
&cmd.ibv_cmd, sizeof(cmd.ibv_cmd));
578578
if (ret) {
579579
if (attr_mask & IBV_SRQ_MAX_WR)
580580
pthread_spin_unlock(&srq->rq.lock);

providers/rxe/rxe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ static int rxe_modify_srq(struct ibv_srq *ibsrq,
665665

666666
cmd.mmap_info_addr = (__u64)(uintptr_t) &mi;
667667
rc = ibv_cmd_modify_srq(ibsrq, attr, attr_mask,
668-
&cmd.ibv_cmd, sizeof(cmd));
668+
&cmd.ibv_cmd, sizeof(cmd.ibv_cmd));
669669
if (rc)
670670
goto out;
671671

0 commit comments

Comments
 (0)