From bc7c4b744b16639ee2fd12df4c68ee524e1c0aba Mon Sep 17 00:00:00 2001 From: Shunfeng Yang Date: Thu, 2 Sep 2021 21:27:12 +0800 Subject: [PATCH] RDMA/hns: Add interception for resizing SRQs mainline inclusion from mainline-v5.9 commit 221109e64316 category: bugfix bugzilla: NA CVE: NA HIP08 doesn't support modifying the maximum number of outstanding WR in an SRQ. However, the driver does not return a failure message, and users may mistakenly think that the resizing is executed successfully. So the driver needs to intercept this operation. Signed-off-by: Shunfeng Yang Signed-off-by: Yangyang Li Reviewed-by: chunzhi hu Signed-off-by: Yang Yingliang --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 52f95ec85e87..3c3b1a2e275a 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -6920,6 +6920,10 @@ static int hns_roce_v2_modify_srq(struct ib_srq *ibsrq, struct hns_roce_cmd_mailbox *mailbox; int ret; + /* Resizing SRQs is not supported yet */ + if (srq_attr_mask & IB_SRQ_MAX_WR) + return -EINVAL; + if (srq_attr_mask & IB_SRQ_LIMIT) { if (srq_attr->srq_limit >= srq->max) { dev_err(hr_dev->dev, -- GitLab