提交 6a1b9631 编写于 作者: Z Zhao Weibo 提交者: Yang Yingliang

RDMA/hns: fix the bug of out-of-bonds-read in post send

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

----------------------------------------

There may be a out-of-bonds-read if qp type is RC in post send.
Reviewed-by: NHu Chunzhi <huchunzhi@huawei.com>
Signed-off-by: NZhao Weibo <zhaoweibo3@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 d8f4442b
...@@ -334,13 +334,13 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, ...@@ -334,13 +334,13 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
#endif #endif
{ {
struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device);
struct hns_roce_ah *ah = to_hr_ah(ud_wr(wr)->ah);
struct hns_roce_v2_ud_send_wqe *ud_sq_wqe; struct hns_roce_v2_ud_send_wqe *ud_sq_wqe;
struct hns_roce_v2_rc_send_wqe *rc_sq_wqe; struct hns_roce_v2_rc_send_wqe *rc_sq_wqe;
struct hns_roce_qp *qp = to_hr_qp(ibqp); struct hns_roce_qp *qp = to_hr_qp(ibqp);
struct hns_roce_v2_wqe_data_seg *dseg; struct hns_roce_v2_wqe_data_seg *dseg;
struct hns_roce_wqe_frmr_seg *fseg; struct hns_roce_wqe_frmr_seg *fseg;
struct device *dev = hr_dev->dev; struct device *dev = hr_dev->dev;
struct hns_roce_ah *ah = NULL;
struct hns_roce_v2_db sq_db; struct hns_roce_v2_db sq_db;
unsigned int sge_ind; unsigned int sge_ind;
unsigned int owner_bit; unsigned int owner_bit;
...@@ -414,6 +414,7 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, ...@@ -414,6 +414,7 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
/* Corresponding to the QP type, wqe process separately */ /* Corresponding to the QP type, wqe process separately */
if (ibqp->qp_type == IB_QPT_GSI || ibqp->qp_type == IB_QPT_UD) { if (ibqp->qp_type == IB_QPT_GSI || ibqp->qp_type == IB_QPT_UD) {
ah = to_hr_ah(ud_wr(wr)->ah);
ud_sq_wqe = wqe; ud_sq_wqe = wqe;
memset(ud_sq_wqe, 0, sizeof(*ud_sq_wqe)); memset(ud_sq_wqe, 0, sizeof(*ud_sq_wqe));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册