From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x227G8stnemJsqDf3+/GYATzLi/UKLG72ZvK6ya74sNe/0oDQx5yFtaBpMAcy+1xDHQTxrmSj ARC-Seal: i=1; a=rsa-sha256; t=1516611157; cv=none; d=google.com; s=arc-20160816; b=oCZOyKYhO/zI3p9TK5BA1o5/vMNSzsN/EGcIp+niW0H6ig4/8zyrQZWzlufqYLNS7p 11ACS2Iwy5jgOv96NbcWLCoPlYT7VhN6/wqoyyzmyWfgCvdeoatctzWLbN3aT4o+UWGB DQxtG9PTSSOzXzhdQtnyND+rg5se/S7SpcraZoRBaqTPGRLHPHCMhVsC3o4oUmgXkd4w zkA5zyQZWhR9Sir3DJn1LS6pypCz23p2yqkfpJdAxhdzKRwiW515tsS5VGTxVi2jzek8 +aBEqwYGgVSlpTGm68Id2hwgRKWzV5JlZgQGQbs6tHIHOvkGUHcSkuCRNbSqF7KFq/hI FuQQ== 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=0qYPrIDYHFZ7p/xywKLBM++aN8oK9Kcnri5lhWo4C4A=; b=0Kg5x7iIP9GOYihT7dgpLzcv2Sn8uYBYVa6jmBGb9sFSw4FOSVfYTAx/FfQXd9OMnb vpXuNc06d0WfM9g5Dh7DSC+Ye3zR3OS8Zw5p3XdOsANCddSBlxPpSBymMecsDCQxue8U JnoV8bZ7bKpHityXq6RA9r+SmQ81895CgQSqw5eeXpiv02VT5JmwZwPRh1dNcy/XiE3g qeDx73LP+vSfSUR54r/IIy2jO61kKtM1vLXnrc2SSLTFAkca80WHp4dj20hOXc188Wl8 jU9EhYuiv1wl2rjip/oHyWQ2jcEpOGQ52WRIEmBR9RPpX96QNwyq3m9sctejqo30jWCu bQAA== 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.14 27/89] iser-target: Fix possible use-after-free in connection establishment error Date: Mon, 22 Jan 2018 09:45:07 +0100 Message-Id: <20180122083957.405376867@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083954.683903493@linuxfoundation.org> References: <20180122083954.683903493@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?1590282060678712674?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.14-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 @@ -741,6 +741,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);