From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x227Q6YzAUtWhKpmwjFWSp+zlM0uHoNiorYBy/rJ0uFZ030kErHn2woLbNHr5IS/u6ANtb6ba ARC-Seal: i=1; a=rsa-sha256; t=1516610865; cv=none; d=google.com; s=arc-20160816; b=CovyII1OugeNkSu7+RHYplNjf3GvS7fKgnBfTA9WD9Dinx1LJSfCJCzeTpOgRUSbqP dWpWUcM+cQnlzN8/HLQ4Vz088/M+bsDCYN2GURK1jfw5qdLHfGIbvcLOvIewDza2bfSn W6YG6hfXKzl7f2mneZwElThHJj11h0OOrYh4LwJ8/+oNCM2P84+iOWqcOkoW/GsMHfcx XB2GsA1nR6IzOIeT0qRHUZmD4HFPlq535HVkvhFRZsBVNH+MfdgCsWACR55p/MGDzgjQ utHzZAjIW3pIj3/391KSJdS05/AGeKf5Y4Pi52lxHkQUAzbCShWjko/gADkjl05ywxuF 1EGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=rbx2zS3HmuKbLV2D+HouE2ZECc0RfbBRA5q8ZhE+KA4=; b=0ZjI9vM2icV/OF93pRYxFUG3vHn2mdhqEqHQAXUxkTSipB6rTdOGWq21cmxQrofja0 Jkx1Mzc2eB5BfHGl6b5djD+SiPw1jQdotANaDZ8UHNWjjVOcP3gttxaRZUYfNSGzKMt5 A3aAruyZXL30xuELdwj4ww8lpY/epVfzW7lR6jdJ3HmGJq2pIcywHbaedNluXCdeFJAG x1IMYk7w8QYUYqP9XzqEk7V9K7isjAcEfq540Xht9M+A93bIH8WzOslE2Fzwq4TPKywD 8MHyTfs7BEpQphv58Z02ITgbfhfq9TfjfY7tMTEPEDvma3u/Xd1UBHBbiMs7qHCWjvg3 Hkag== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Amrani, Ram" , Sagi Grimberg , Doug Ledford Subject: [PATCH 4.9 11/47] iser-target: Fix possible use-after-free in connection establishment error Date: Mon, 22 Jan 2018 09:45:22 +0100 Message-Id: <20180122083926.487823166@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083925.568134913@linuxfoundation.org> References: <20180122083925.568134913@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590281754849813414?= X-GMAIL-MSGID: =?utf-8?q?1590281754849813414?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sagi Grimberg commit cd52cb26e7ead5093635e98e07e221e4df482d34 upstream. 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") Reported-by: Amrani, Ram Signed-off-by: Sagi Grimberg Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/ulp/isert/ib_isert.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -747,6 +747,7 @@ isert_connect_error(struct rdma_cm_id *c { struct isert_conn *isert_conn = cma_id->qp->qp_context; + ib_drain_qp(isert_conn->qp); list_del_init(&isert_conn->node); isert_conn->cm_id = NULL; isert_put_conn(isert_conn);