瀏覽代碼

iser-target: Fix possible use-after-free in connection establishment error

In case we fail to establish the connection we must drain our pre-posted
login recieve work request before continuing safely with connection
teardown.

Fixes: a060b5629ab0 ("IB/core: generic RDMA READ/WRITE API")
Cc: <stable@vger.kernel.org> # 4.7+
Reported-by: Amrani, Ram <Ram.Amrani@cavium.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Sagi Grimberg 7 年之前
父節點
當前提交
cd52cb26e7
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/infiniband/ulp/isert/ib_isert.c

+ 1 - 0
drivers/infiniband/ulp/isert/ib_isert.c

@@ -741,6 +741,7 @@ isert_connect_error(struct rdma_cm_id *cma_id)
 {
 {
 	struct isert_conn *isert_conn = cma_id->qp->qp_context;
 	struct isert_conn *isert_conn = cma_id->qp->qp_context;
 
 
+	ib_drain_qp(isert_conn->qp);
 	list_del_init(&isert_conn->node);
 	list_del_init(&isert_conn->node);
 	isert_conn->cm_id = NULL;
 	isert_conn->cm_id = NULL;
 	isert_put_conn(isert_conn);
 	isert_put_conn(isert_conn);