[PATCH 028/190] Revert "RDMA/rvt: Fix potential memory leak caused by rvt_alloc_rq"

From: Greg Kroah-Hartman
Date: Wed Apr 21 2021 - 09:02:43 EST


This reverts commit 90a239ee25fa3a483facec3de7c144361a3d3a51.

Commits from @umn.edu addresses have been found to be submitted in "bad
faith" to try to test the kernel community's ability to review "known
malicious" changes. The result of these submissions can be found in a
paper published at the 42nd IEEE Symposium on Security and Privacy
entitled, "Open Source Insecurity: Stealthily Introducing
Vulnerabilities via Hypocrite Commits" written by Qiushi Wu (University
of Minnesota) and Kangjie Lu (University of Minnesota).

Because of this, all submissions from this group must be reverted from
the kernel tree and will need to be re-reviewed again to determine if
they actually are a valid fix. Until that work is complete, remove this
change to ensure that no problems are being introduced into the
codebase.

Cc: https
Cc: Aditya Pakki <pakki001@xxxxxxx>
Cc: Dennis Dalessandro <dennis.dalessandro@xxxxxxxxx>
Cc: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/infiniband/sw/rdmavt/qp.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index 9d13db68283c..5476dd37e421 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -1207,7 +1207,7 @@ struct ib_qp *rvt_create_qp(struct ib_pd *ibpd,
err = alloc_ud_wq_attr(qp, rdi->dparms.node);
if (err) {
ret = (ERR_PTR(err));
- goto bail_rq_rvt;
+ goto bail_driver_priv;
}

if (init_attr->create_flags & IB_QP_CREATE_NETDEV_USE)
@@ -1317,10 +1317,8 @@ struct ib_qp *rvt_create_qp(struct ib_pd *ibpd,
rvt_free_qpn(&rdi->qp_dev->qpn_table, qp->ibqp.qp_num);

bail_rq_wq:
- free_ud_wq_attr(qp);
-
-bail_rq_rvt:
rvt_free_rq(&qp->r_rq);
+ free_ud_wq_attr(qp);

bail_driver_priv:
rdi->driver_f.qp_priv_free(rdi, qp);
--
2.31.1