Received: by 10.223.176.5 with SMTP id f5csp944943wra; Sat, 3 Feb 2018 14:07:08 -0800 (PST) X-Google-Smtp-Source: AH8x224lOOETwvHGtNP5XlpdWXeWDx93+WNaluPogvQ9f5mYXfj1mprd2zAAUxNMlwkozhmToEhB X-Received: by 2002:a17:902:74c9:: with SMTP id f9-v6mr8660751plt.89.1517695628043; Sat, 03 Feb 2018 14:07:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517695628; cv=none; d=google.com; s=arc-20160816; b=Sjlvyma66363E/2FqrYnB9V4ZVyuC/C867SPrC63WnkDL3umyLrGjUPcwSKjdHpbD2 L8EgYaXiVaMB1PGYm6kWsGicku7efRXgo3Uhax2pKtb8r8f/Zq6Z4RiM1xqi48gCxTEh mEtuv6kbfAYTlOus3fRhAApsWWiTkN2puqKr0Yd7s/lKfdJftbkhDlp6WTyH6h7Ype63 t1l6R/fHe+DGq7ut0H2AVHGDTvaWauzqJpD5OaCduPx4un+NZZjR77Z09wikNgec26Da pVvzpw9Oyeav1KQ88OZTKK/CuRZIt6lv83ZeZhUCaHZ854VZe/In4EyglWTC7toRs2sO l6gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=QXRNGV++h/YKwaXzYF1LVBDgAtAwBoKBrWtOAy1LkdA=; b=h5r9y5ocFY7QFRdnnab/aW0a7e5wIa1inQIYiGQWw9+H9dw+JaR96uR9XW1/gxb8NV WIUqF6JXkWvS9QxPLuKr+NNeqSYuQOjoa6ZQA5T0jv68FLYI5s3rkhPvTmebkIV7cnZD 1ntvLC6SfbiAkDN6QGncr/RTRD+X2XEaO7Ky3eVZfI4B/8cbyadZPUY1LkccdkGZlYL7 6Jrv/7q9Yy3uPY0NXvRMix8U853O/QxHvBy9lum/Pu1iLgjpe9iiDhLDug2nwx5LDR8f juYIGhpWanjMi7BCvVApK48AUVMdFou3C25GTwR9krLwuCR8y5smcaUaW4OWXvDabes1 whRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=oUs8BDho; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si1681097plr.247.2018.02.03.14.06.53; Sat, 03 Feb 2018 14:07:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=oUs8BDho; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755239AbeBCSoL (ORCPT + 99 others); Sat, 3 Feb 2018 13:44:11 -0500 Received: from mail-co1nam03on0092.outbound.protection.outlook.com ([104.47.40.92]:4928 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753176AbeBCSC5 (ORCPT ); Sat, 3 Feb 2018 13:02:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=QXRNGV++h/YKwaXzYF1LVBDgAtAwBoKBrWtOAy1LkdA=; b=oUs8BDhop8tbl3zfMpYUJbEcDFeMDPCkaT+cSAeVYN+aW1QyDtXFvP1/YwTjlfiuwvvFechEdjarE/1EW8ZR+8i8rXh1TroH/asA2SRJ6rzHffabXZ8LkJMtyBX76t+fSiDNi6aElHG3TVkK9bur97KQebTQ8jc3cl4pvoUe4Kc= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1092.namprd21.prod.outlook.com (52.132.24.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.485.4; Sat, 3 Feb 2018 18:01:27 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:01:27 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Bryan Tan , Jason Gunthorpe , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 050/110] RDMA/vmw_pvrdma: Call ib_umem_release on destroy QP path Thread-Topic: [PATCH AUTOSEL for 4.14 050/110] RDMA/vmw_pvrdma: Call ib_umem_release on destroy QP path Thread-Index: AQHTnRjuk6YgTj1zikyn1nBzTRHqww== Date: Sat, 3 Feb 2018 18:00:52 +0000 Message-ID: <20180203180015.29073-50-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BL0PR2101MB1092;7:LZIUlp5tEv5wf84DBQs3vxtvKRhnrJytVvdkXvv+j7DllpXjbGH7wRLtQXudPFrU3K7CgtTL0myuYV45R+OEk2D7H0HRDu6wrtsOtfhKzKGG+RnWRn+gF+J+FcVMJBUXd4FXZ4BtS5JSMHdMfpE/yNNh7/yL3KcVP+sFjox4vsYyl3frkdNHAmMPi1xd6UEFXzuDuibs44Vb3/XWwm2fyXK87d/Vo2fJLjsMzE5eQAqjZ7zP5wKdbAujHsz4ouSh x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 49d17e2e-8381-4479-3b82-08d56b30253b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1092; x-ms-traffictypediagnostic: BL0PR2101MB1092: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(61668805478150)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231101)(2400082)(944501161)(6055026)(61426038)(61427038)(6041288)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:BL0PR2101MB1092;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1092; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(39380400002)(376002)(346002)(396003)(366004)(189003)(199004)(3280700002)(14454004)(3660700001)(105586002)(3846002)(6666003)(22452003)(6116002)(99286004)(305945005)(7736002)(2950100002)(66066001)(478600001)(54906003)(110136005)(68736007)(316002)(86362001)(106356001)(186003)(26005)(6506007)(76176011)(6346003)(10090500001)(102836004)(6436002)(4326008)(8936002)(2501003)(53936002)(86612001)(2900100001)(6486002)(2906002)(6512007)(25786009)(97736004)(72206003)(1076002)(107886003)(36756003)(5660300001)(5250100002)(8676002)(81156014)(81166006)(10290500003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1092;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: /zFVB71lWby4xXumEyr6R4FAgXjKCJP4ZYsF3CfcyBHoBw0J0Nl2qF29XTPuh9/jOTtPba6bN2Q9vpb82vVeDA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49d17e2e-8381-4479-3b82-08d56b30253b X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:00:52.4878 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1092 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bryan Tan [ Upstream commit 17748056ce123ee37fb7382bc698fc721e3c4a09 ] The QP cleanup did not previously call ib_umem_release, resulting in a user-triggerable kernel resource leak. Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver") Reviewed-by: Adit Ranadive Reviewed-by: Aditya Sarwade Reviewed-by: Jorgen Hansen Signed-off-by: Bryan Tan Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c b/drivers/infinib= and/hw/vmw_pvrdma/pvrdma_qp.c index ed34d5a581fa..d7162f2b7979 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c @@ -406,6 +406,13 @@ static void pvrdma_free_qp(struct pvrdma_qp *qp) atomic_dec(&qp->refcnt); wait_event(qp->wait, !atomic_read(&qp->refcnt)); =20 + if (!qp->is_kernel) { + if (qp->rumem) + ib_umem_release(qp->rumem); + if (qp->sumem) + ib_umem_release(qp->sumem); + } + pvrdma_page_dir_cleanup(dev, &qp->pdir); =20 kfree(qp); --=20 2.11.0