From patchwork Sun Nov 26 13:31:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 10075373 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4F8E3602BD for ; Sun, 26 Nov 2017 13:31:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43E1E27D4A for ; Sun, 26 Nov 2017 13:31:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3869F28E05; Sun, 26 Nov 2017 13:31:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 194BD28E0B for ; Sun, 26 Nov 2017 13:31:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752070AbdKZNb3 (ORCPT ); Sun, 26 Nov 2017 08:31:29 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:39223 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751175AbdKZNb3 (ORCPT ); Sun, 26 Nov 2017 08:31:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Message-Id:Date:Subject:To:From: Sender:Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gB1bEWsZy/hVH84fndGr8DAlFEmuJxoERO88WJ64BAs=; b=oyt8fjPKP+w5PyWqNK3DUR3fC mzAzYYDIDQedALJukocfyOxUdVvFxlp1tcmvns/3mKd3knjRsqXp5sJxN1Khf4oiEbv5ErPini8eI 8AvNbG6/NkHcLxV1VoYv6HP8axHTHul8I2Gmk6PuTRK5I+X8jJ4VMfHyEdLFuMZVe3rubZHpPjqXk id38z+SOv8JMCODBt8ciHGrUJgJNzXWKbtIa2PxDwHDrpa/ZTfWagLThfEy5kIUSNjzYYbIc4AWjy AFMLvkgqsAMMLIPRltUTQaQ1bo65Lpmf6ZRXZR7BLPjjkPt7XCGDA+O3uRT66WR9Hdhim4oB55xdQ 0n33UqkCg==; Received: from bzq-82-81-101-184.red.bezeqint.net ([82.81.101.184] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1eIx1s-0005fb-AK; Sun, 26 Nov 2017 13:31:28 +0000 From: Sagi Grimberg To: Doug Ledford , linux-rdma@vger.kernel.org Subject: [PATCH] iser-target: Fix possible use-after-free in connection establishment error Date: Sun, 26 Nov 2017 15:31:04 +0200 Message-Id: <20171126133104.22710-1-sagi@grimberg.me> X-Mailer: git-send-email 2.14.1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In case we fail to establish the connection we must drain our pre-posted login recieve work request before continuing safely with connection teardown. Reported-by: Amrani, Ram Signed-off-by: Sagi Grimberg Reported-by: Amrani, Ram Signed-off-by: Sagi Grimberg Signed-off-by: Doug Ledford --- drivers/infiniband/ulp/isert/ib_isert.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index ceabdb85df8b..9d4785ba24cb 100644 --- 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 *cma_id) { 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);