Skip to content

Commit c8b1f34

Browse files
bharatpotnurijgunthorpe
authored andcommitted
RDMA/iw_cxgb4: Fix incorrect function parameters
While reading the TCB field in t4_tcb_get_field32() the wrong mask is passed as a parameter which leads the driver eventually to a kernel panic/app segfault from access to an illegal SRQ index while flushing the SRQ completions during connection teardown. Fixes: 11a27e2 ("iw_cxgb4: complete the cached SRQ buffers") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Potnuri Bharat Teja <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 50bbe3d commit c8b1f34

File tree

1 file changed

+3
-4
lines changed
  • drivers/infiniband/hw/cxgb4

1 file changed

+3
-4
lines changed

drivers/infiniband/hw/cxgb4/cm.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2891,8 +2891,7 @@ static int peer_abort(struct c4iw_dev *dev, struct sk_buff *skb)
28912891
srqidx = ABORT_RSS_SRQIDX_G(
28922892
be32_to_cpu(req->srqidx_status));
28932893
if (srqidx) {
2894-
complete_cached_srq_buffers(ep,
2895-
req->srqidx_status);
2894+
complete_cached_srq_buffers(ep, srqidx);
28962895
} else {
28972896
/* Hold ep ref until finish_peer_abort() */
28982897
c4iw_get_ep(&ep->com);
@@ -3878,8 +3877,8 @@ static int read_tcb_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
38783877
return 0;
38793878
}
38803879

3881-
ep->srqe_idx = t4_tcb_get_field32(tcb, TCB_RQ_START_W, TCB_RQ_START_W,
3882-
TCB_RQ_START_S);
3880+
ep->srqe_idx = t4_tcb_get_field32(tcb, TCB_RQ_START_W, TCB_RQ_START_M,
3881+
TCB_RQ_START_S);
38833882
cleanup:
38843883
pr_debug("ep %p tid %u %016x\n", ep, ep->hwtid, ep->srqe_idx);
38853884

0 commit comments

Comments
 (0)