From patchwork Wed Nov 18 23:00:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 7653311 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7726D9F392 for ; Wed, 18 Nov 2015 23:00:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E9D2204E0 for ; Wed, 18 Nov 2015 23:00:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 21C0F20382 for ; Wed, 18 Nov 2015 23:00:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757348AbbKRXAL (ORCPT ); Wed, 18 Nov 2015 18:00:11 -0500 Received: from mail-bn1on0097.outbound.protection.outlook.com ([157.56.110.97]:19680 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757345AbbKRXAI (ORCPT ); Wed, 18 Nov 2015 18:00:08 -0500 Received: from BLUPR02CA032.namprd02.prod.outlook.com (10.160.23.150) by CY1PR0201MB0764.namprd02.prod.outlook.com (10.160.141.154) with Microsoft SMTP Server (TLS) id 15.1.312.18; Wed, 18 Nov 2015 23:00:05 +0000 Received: from BN1BFFO11FD013.protection.gbl (2a01:111:f400:7c10::1:180) by BLUPR02CA032.outlook.office365.com (2a01:111:e400:8ad::22) with Microsoft SMTP Server (TLS) id 15.1.331.20 via Frontend Transport; Wed, 18 Nov 2015 23:00:05 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.173) smtp.mailfrom=sandisk.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.173 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.173; helo=milsmgep12.sandisk.com; Received: from milsmgep12.sandisk.com (63.163.107.173) by BN1BFFO11FD013.mail.protection.outlook.com (10.58.144.76) with Microsoft SMTP Server id 15.1.325.5 via Frontend Transport; Wed, 18 Nov 2015 23:00:04 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep12.sandisk.com (Symantec Messaging Gateway) with SMTP id 95.BA.32178.3F20D465; Wed, 18 Nov 2015 15:00:03 -0800 (PST) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.248.2; Wed, 18 Nov 2015 15:00:02 -0800 X-AuditID: ac160a69-f79f76d000007db2-f1-564d02f396db Received: from [10.60.52.33] ( [10.177.8.100]) by milsmgip12.sandisk.com (Symantec Messaging Gateway) with SMTP id 54.41.04661.2F20D465; Wed, 18 Nov 2015 15:00:02 -0800 (PST) To: Doug Ledford CC: Sagi Grimberg , Sebastian Parschauer , Christoph Hellwig , "linux-rdma@vger.kernel.org" , "linux-scsi@vger.kernel.org" From: Bart Van Assche Subject: [PATCH] IB/srp: Fix a memory leak Message-ID: <564D02F2.5080200@sandisk.com> Date: Wed, 18 Nov 2015 15:00:02 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPLMWRmVeSWpSXmKPExsWyRoxnke5nJt8wg5MbWC1env/AarFy9VEm i2eHelksuq/vYLO40faAzeLkbX4HNo/dNxvYPJ5NP8zk8efPZ2aP9/uusnl83iQXwBrFZZOS mpNZllqkb5fAlXH1ZyNLwRnpiqY13UwNjL9Euxg5OSQETCR+HpjHCmGLSVy4t56ti5GLQ0jg BKPEh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tZNjO/FN9Ue1HE2 qJnTde31e4NtMcqpyVWTC3KdL7MkHLH1te1j540+/O5dgdnaBifrfH4zLbnD91ovKr/443B7 kl63yMIPxTGsFktvha8RXp5ityfrruS5qBsMSizFGYmGWsxFxYkAW8b70/oBAAA= X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD013; 1:R6YkomuhIfuCcFYKEbtIsYueu79Oyy7h17YThptH7XJHTUAgOyIkW05Yt+iVuB3EITAVVedPy1yHQayyxK6ZVy09Q1liW1VAPTJ7OR45wfAbd5UuOYV53oDLb5oXkKNjuKQnNCovLu+GEcdMr0G3GCDxx/P0dqbC4vF9MX/U6aNy2fJ40gRZkNUprbuVUrwl8tsuJtia3AeceJ7tK3kkM2AGQ3yc3FwW/6Yw5jkunuLurvJEtv9RAf04jqXecsXkJpgxmqQHmNeiFxplJM9EQFQIJhoXYcYjcwlP6zPzsdIpbswxtQmnW0FBCaVXnj7rAaA3dyCc7ARlhYQd4oH/SgaKkb2X4e8L7hD/jAwk+hqNDLiXVE7KKaMG2P3MQ6HE X-Forefront-Antispam-Report: CIP:63.163.107.173; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(65806001)(23676002)(5001960100002)(86362001)(33656002)(36756003)(110136002)(5008740100001)(586003)(92566002)(106466001)(19580405001)(65956001)(47776003)(11100500001)(189998001)(50466002)(83506001)(229853001)(87936001)(230700001)(59896002)(97736004)(69596002)(50986999)(81156007)(65816999)(77096005)(87266999)(54356999)(5007970100001)(575784001)(64126003)(19580395003)(4001350100001)(80316001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB0764; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0764; 2:rIFkBb450aDmCWEQz/E8pZrTi6h7+k9hLbNmEsngDcgPylPrKF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69asL19nquPaG9k67RAZOvx/nn0mc+LAMJNdI822g/UVe44qOU1u0eJDb3Xw6+PzxCcK2yPKe9aWrcTyYdcVrwjDluQNb7aR7bGORaGbyPLx9mowyH58GQqQvu1Zkg7F3ndTUruSwVTWfAjOTTBO0GE2vWLZB7UjXiGunUjl7ClMZSiCJ4me+U9tUEGRkNZSFfYesEE057syaT+97+WDooLJYseXG0ZDx+wk9NLV+5+bXkVC; 4:0GCUdNA+bJ3q4KwFdRB2kjShFK6r4y5uLiJS8Trt4K3XDDAmJy7TPcCBb2arFAoQKMldt7UnhuvXzv/rf/18BbhM8USnLx0nSAyiUfQdwsFmOQDn/+QpKoUxiBPNfknSQ59MyO5K6U/wnvWAT0myeQwhwrukuEsfZoTq+zfJSbXKo4LU5FcZvNjwFS3PW6mZ4lQMy3JOCC7eb4nKzFSdqHiOlCwAn1ygyNH4bTOPD9VCPPfYQAd8t0G3HrNYonziWMvI1gdgZwEPZF3NpYav/2EAS5MXM0L947Rax89JDfZWuLNLtHSLj2y6F0H0GnN7GjrinPyGI4OZwsTAub7APg0QJCX4d48Smu/Nof45A+ZI8KJ0mSuTKd3pwFGR9Zee X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(34787635062028)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001); SRVR:CY1PR0201MB0764; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB0764; X-Forefront-PRVS: 0764C4A8CD X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjAyMDFNQjA3NjQ7MjM6amFDVW1pYkdyWU1VNnRram9CTkFMcjdO?= =?utf-8?B?djFHRWh2a1pMYVVFcE1MQXhrZVNMbVo1N1RPMDNPUUJWS2MrOXVIYW9nVmV1?= =?utf-8?B?TDB6UmtvTVk1bGRlbElPS052dXdPcTk0ZWJZQmx1cFl1TzlxUUs1STU5a2VK?=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dnHkkmu4Ip3gPiciTd/vufkldjGaarq7P6LYHXSVpxFzEQrF5qAS SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2015 23:00:04.4355 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.173]; Helo=[milsmgep12.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB0764 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If srp_connect_ch() returns a positive value then that is considered by its caller as a connection failure but this does not result in a scsi_host_put() call and additionally causes the srp_create_target() function to return a positive value while it should return a negative value. Avoid all this confusion and additionally fix a memory leak by ensuring that srp_connect_ch() always returns a value that is <= 0. This patch avoids that a rejected login triggers the following memory leak: unreferenced object 0xffff88021b24a220 (size 8): comm "srp_daemon", pid 56421, jiffies 4295006762 (age 4240.750s) hex dump (first 8 bytes): 68 6f 73 74 35 38 00 a5 host58.. backtrace: [] kmemleak_alloc+0x7a/0xc0 [] __kmalloc_track_caller+0xfe/0x160 [] kvasprintf+0x5b/0x90 [] kvasprintf_const+0x8d/0xb0 [] kobject_set_name_vargs+0x3c/0xa0 [] dev_set_name+0x3c/0x40 [] scsi_host_alloc+0x327/0x4b0 [] srp_create_target+0x4e/0x8a0 [ib_srp] [] dev_attr_store+0x1b/0x20 [] sysfs_kf_write+0x4a/0x60 [] kernfs_fop_write+0x14e/0x180 [] __vfs_write+0x2f/0xf0 [] vfs_write+0xa4/0x100 [] SyS_write+0x54/0xc0 [] entry_SYSCALL_64_fastpath+0x12/0x6f Signed-off-by: Bart Van Assche Cc: Sagi Grimberg Cc: Sebastian Parschauer Cc: Christoph Hellwig Cc: stable Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg --- drivers/infiniband/ulp/srp/ib_srp.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index eda427f8..3f4786a 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -993,16 +993,16 @@ static int srp_connect_ch(struct srp_rdma_ch *ch, bool multich) ret = srp_lookup_path(ch); if (ret) - return ret; + goto out; while (1) { init_completion(&ch->done); ret = srp_send_req(ch, multich); if (ret) - return ret; + goto out; ret = wait_for_completion_interruptible(&ch->done); if (ret < 0) - return ret; + goto out; /* * The CM event handling code will set status to @@ -1010,15 +1010,16 @@ static int srp_connect_ch(struct srp_rdma_ch *ch, bool multich) * back, or SRP_DLID_REDIRECT if we get a lid/qp * redirect REJ back. */ - switch (ch->status) { + ret = ch->status; + switch (ret) { case 0: ch->connected = true; - return 0; + goto out; case SRP_PORT_REDIRECT: ret = srp_lookup_path(ch); if (ret) - return ret; + goto out; break; case SRP_DLID_REDIRECT: @@ -1027,13 +1028,16 @@ static int srp_connect_ch(struct srp_rdma_ch *ch, bool multich) case SRP_STALE_CONN: shost_printk(KERN_ERR, target->scsi_host, PFX "giving up on stale connection\n"); - ch->status = -ECONNRESET; - return ch->status; + ret = -ECONNRESET; + goto out; default: - return ch->status; + goto out; } } + +out: + return ret <= 0 ? ret : -ENODEV; } static int srp_inv_rkey(struct srp_rdma_ch *ch, u32 rkey, u32 send_flags)