Browse Source

IB/ipath: Check that a UD work request's address handle is valid

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Robert Walsh 18 năm trước cách đây
mục cha
commit
6ce73b07db
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      drivers/infiniband/hw/ipath/ipath_ud.c

+ 5 - 0
drivers/infiniband/hw/ipath/ipath_ud.c

@@ -308,6 +308,11 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr)
 		goto bail;
 	}
 
+	if (wr->wr.ud.ah->pd != qp->ibqp.pd) {
+		ret = -EPERM;
+		goto bail;
+	}
+
 	/* IB spec says that num_sge == 0 is OK. */
 	if (wr->num_sge > qp->s_max_sge) {
 		ret = -EINVAL;