From patchwork Tue Aug 11 00:07:27 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: 6987001 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4309AC05AC for ; Tue, 11 Aug 2015 00:07:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 37073205B4 for ; Tue, 11 Aug 2015 00:07:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2DE8F20595 for ; Tue, 11 Aug 2015 00:07:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933428AbbHKAHe (ORCPT ); Mon, 10 Aug 2015 20:07:34 -0400 Received: from mail-bl2on0058.outbound.protection.outlook.com ([65.55.169.58]:50607 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933067AbbHKAHd (ORCPT ); Mon, 10 Aug 2015 20:07:33 -0400 Received: from BY2PR02CA0005.namprd02.prod.outlook.com (10.163.44.143) by CY1PR0201MB0746.namprd02.prod.outlook.com (10.160.141.149) with Microsoft SMTP Server (TLS) id 15.1.225.19; Tue, 11 Aug 2015 00:07:30 +0000 Received: from BN1BFFO11FD005.protection.gbl (2a01:111:f400:7c10::1:108) by BY2PR02CA0005.outlook.office365.com (2a01:111:e400:5261::15) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Tue, 11 Aug 2015 00:07:29 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.173) smtp.mailfrom=sandisk.com; obsidianresearch.com; dkim=none (message not signed) header.d=none; 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 BN1BFFO11FD005.mail.protection.outlook.com (10.58.144.68) with Microsoft SMTP Server id 15.1.243.9 via Frontend Transport; Tue, 11 Aug 2015 00:07:27 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep12.sandisk.com (Symantec Messaging Gateway) with SMTP id 6F.A4.06265.FBC39C55; Mon, 10 Aug 2015 17:07:27 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.224.2; Mon, 10 Aug 2015 17:06:40 -0700 X-AuditID: ac160a69-f790f6d000001879-63-55c93cbf1a33 Received: from [10.60.52.33] ( [10.177.8.100]) by milsmgip11.sandisk.com (Symantec Messaging Gateway) with SMTP id BC.5B.03643.FBC39C55; Mon, 10 Aug 2015 17:07:27 -0700 (PDT) Subject: [PATCH 3/8] IB/srp: Add memory descriptor array pointer range checking To: Jason Gunthorpe References: <55BBF4B8.2050700@sandisk.com> <20150803152420.GA24193@infradead.org> <55BFB40F.8000500@sandisk.com> <20150804180933.GB5038@obsidianresearch.com> <1438756876.5698.2.camel@haswell.thedillows.org> <20150805195122.GA31595@obsidianresearch.com> <55C2840C.5050301@sandisk.com> <55C2912A.50709@sandisk.com> <20150806001006.GD2483@obsidianresearch.com> <55C2A7FE.7020904@sandisk.com> <20150806043642.GA14153@obsidianresearch.com> <55C93C61.9010508@sandisk.com> CC: "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <55C93CBF.1060606@sandisk.com> Date: Mon, 10 Aug 2015 17:07:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55C93C61.9010508@sandisk.com> X-Brightmail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qJ6Dg1NAW6JxqizESHWJP/MuQY2Xl9j+dg7zBEb+WUg6ZiEpm4WkbAEj8ypGsdzMnOLc9MwC Q0O94sS8lMzibL3k/NxNjODQ44zcwfh0ovkhRiYOTqkGxqJnhye9+Gle8MrV7tmm7HuztR50 hZ9X7H3lkszoYpmsMiVMovhfdtVj3+0KboFic/1el1QVFmxdrPdeXODzopWLd4f9cDnx3mjl 79t+EaZmH91kRLh+zF+T8zopbp206OvpW0+vjvhXzXdqWtfJsLArFgVz5vi8vn16W9Vchl1O 072T4iIu+SmxFGckGmoxFxUnAgCMLKo77QEAAA== X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD005; 1:K+64pyzzCn1sKCUaIkBPAfvw4kivxKh60lJkK1tfLnjm59VS/SMRIC0Q7vRdc4RJ5qEjcYoWjTfu6dQ6RhMtjF+Zva654EulDy3zb6HiQkkmuUaBvaKa1sh2uBfK2ly7bTav4nClftGZUp9M0IqVxJvuEiMdwWm1MFmCEcsRL9qdkusGpaqyK1N7FYoAELRLc8A18Mniugnf48M6TDRH4IzSzh2GtoRR3MghLY5kBRLEegNwd7HPt8f/pb/KgxnTwFJqtIpg+FShDMq9aPkLar0k2wiE+ic1+5Ui8Ow73sfW+6I7LjCgtTQrWAHxhtNg1OctYlQOHdd3lStluKsjMA== X-Forefront-Antispam-Report: CIP:63.163.107.173; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(3050300001)(199003)(189002)(229853001)(87936001)(110136002)(76176999)(62966003)(5001860100001)(106466001)(54356999)(5001960100002)(50986999)(5001830100001)(19580395003)(19580405001)(23676002)(80316001)(33656002)(92566002)(77156002)(4001540100001)(86362001)(83506001)(65816999)(65806001)(97736004)(189998001)(46102003)(68736005)(64706001)(87266999)(36756003)(4001350100001)(64126003)(77096005)(81156007)(50466002)(69596002)(47776003)(59896002)(65956001)(93886004)(2950100001)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB0746; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; PTR:ErrorRetry; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0746; 2:WL8w5Ya7PFMYX8Mzy8nnCrho8fSYz4bR1yjwONaKjJbVyHQI+ME89WVM7WHSC/rMqaSVoHCAvGEde/4fUlNuiFO7zEAhpsbcOVgwtFxnBpZDEpByWvjiEGPjwDRLq65jxHlGFK/BrX+GeDGtxk+ojiGowDhSOSDSoJYzeeLNewc=; 3:Pcr/4oMfoSx8DcI9RAAK6aN/KK/FDl8vY80K+LbnjQwr87t7b3gK75r3vZ8VhELl0q6P2BRmKzwgvDKiXi/iHV0Z2gIo4Xq0UASgVmDRBhgyXAw5NcDbWR5Q/6qkzV2yQcrto6HMt3LfHQZTcb84oSGJL639EI14tXV5OwehUHCTkk9YpOvXqSGcEF9GugDffPHgOPniUcmJ9GyrhnjKDmaCqqzaqmiWNi1FLR7ssYpsjCe2JsDVfq6bEShXv0oS; 25:hF2dozJ8Wxi6CvPjh4ZNl00ztdHjS+pnA32eCOWO77UHzXaFbNMb4wgZQmdjziO/ZqotcQNKhf+amIanI5iXVFSdujb9bBaJ3HKuqeQNXkG6zyEPJHlKBBdPV2+ShKBptWNjBvH4LJSwCi47kTIStKwl5GgCayJ0fJkI5DIy17lZrFTGJWJFzk9xZCABobmkf9Hl+9yqbf7p14xwQfOMGNrm6xf3+wFw4/ro3AEPbi2++tJxKPglddEVSvHgxYvrRvE4MzTzqTyAC2RG6xv8Nw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB0746; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0746; 20:g/WnX4iKFABeaY5WbapSqhVRNcnq1GWEOhqyVDwk3rxRxCldPMzIAzvD1K49eo25+IKMS8su1123rt23BOBufnhvmgdD4HWlVAKMMMDXBbFMYzSR7gW9qyfeFUgx85u+1TYmiZB+7ujjkg1tpgQuI5/UWFijEKPic13/QQL2j3OXqZMG86VytqgU9zncNk0BziB4PL9bMsm35WHOkGxWaSGb/OCacbeUlQEZwV/v/kALOVYaZnQ+fgtY8HNj9NA3ZH/yOFZWLjMck62LBaSePfDk+P+052dnDttTB5fMJjB30Fy4b7xwtTI0Fx2KKDy///lgFmx8hz9oav/5yCxBwmifY7SAxxE+0su681itIJ/DePYcisq70fxU3MHiLP1D+BQX/wD7k6lFiqKaeV7fmtlDpYXNe0rBFfBCbqT6A1y+0PWg2OaqheD7njG5wUFmROpCpZGQDG74S4DMj6P1E+5NKJ1/Pp3XzAwIhSkL1woMdR9OWPZ3vPA0ws9j8jM8; 4:xQoePu7HNjlXoVB2DffGdWmcStqwXieU9syPNS/gbsgtx9stP03kjesMe4t+r0YyUsbGyccHrZFK/g+qqE21R2spxYDZ/NfkyJP1tqC8Gfm15OK+RkZio+txQYhDcyRekDgvrINBL3p8QrQIa0PDU7vUVWf9cxU9ZnXcgGPm+eW0tDCXoevhZ8JclZq3pOk/wp++FzMo3wUvQsQ3sSVzrLrF9oe6QBmJLtxlsTFuo85vOu7ZLgTgVImCon7JI5cAysohBWG7k9WbVrpuYqIjMSWYqYnGZw0uURYsxYR6dpI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:CY1PR0201MB0746; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB0746; X-Forefront-PRVS: 066517B35B X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjAyMDFNQjA3NDY7MjM6WGRlWjVONFdFY21wQjk5Ti9yV3I1TCt2?= =?utf-8?B?SnU3dXhMcWFKNzJQU2Q0bEZ2bUpRemFTc280UjRIYS9BWGFXNm1kZTNhelVx?= =?utf-8?B?SXdweWpPUTRCWVJyUXdYcFJEdHp3Ym41WWJJVGZxWC9CUGs4bzNIZHJBMn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Xa/v+RdN4EuVWj86o=; 20:H9KdtTrlsDFHYAINGAE0/sH5IPlYg8mVlaJajK5jGohkoqRaNoPCy7WJn2efSS77PCwNDFc4hMALIH+U7RabVisS+tnJSblDiuoy7nXKG0Xbp9LVZ0M0VcRzQ79WmnG/W3Yq6x24o6t/fxNtB3Fxucu0YJzUp5ypK24b2sCt1do= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2015 00:07:27.8622 (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: CY1PR0201MB0746 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 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 Although most paths through which a request is submitted check block layer parameters like the max_segments limit, these are not checked when an SG_IO or direct I/O request is submitted. Hence add a range check for the memory descriptor array pointer. Signed-off-by: Bart Van Assche --- drivers/infiniband/ulp/srp/ib_srp.c | 16 ++++++++++++---- drivers/infiniband/ulp/srp/ib_srp.h | 10 ++++++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index b6b9a55..f9fa220 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1277,12 +1277,15 @@ static int srp_map_finish_fmr(struct srp_map_state *state, struct ib_pool_fmr *fmr; u64 io_addr = 0; + if (state->fmr.next >= state->fmr.end) + return -ENOMEM; + fmr = ib_fmr_pool_map_phys(ch->fmr_pool, state->pages, state->npages, io_addr); if (IS_ERR(fmr)) return PTR_ERR(fmr); - *state->next_fmr++ = fmr; + *state->fmr.next++ = fmr; state->nmdesc++; srp_map_desc(state, state->base_dma_addr & ~dev->mr_page_mask, @@ -1301,6 +1304,9 @@ static int srp_map_finish_fr(struct srp_map_state *state, struct srp_fr_desc *desc; u32 rkey; + if (state->fr.next >= state->fr.end) + return -ENOMEM; + desc = srp_fr_pool_get(ch->fr_pool); if (!desc) return -ENOMEM; @@ -1324,7 +1330,7 @@ static int srp_map_finish_fr(struct srp_map_state *state, IB_ACCESS_REMOTE_WRITE); wr.wr.fast_reg.rkey = desc->mr->lkey; - *state->next_fr++ = desc; + *state->fr.next++ = desc; state->nmdesc++; srp_map_desc(state, state->base_dma_addr, state->dma_len, @@ -1450,10 +1456,12 @@ static int srp_map_sg(struct srp_map_state *state, struct srp_rdma_ch *ch, state->desc = req->indirect_desc; state->pages = req->map_page; if (dev->use_fast_reg) { - state->next_fr = req->fr_list; + state->fr.next = req->fr_list; + state->fr.end = req->fr_list + target->cmd_sg_cnt; use_mr = !!ch->fr_pool; } else { - state->next_fmr = req->fmr_list; + state->fmr.next = req->fmr_list; + state->fmr.end = req->fmr_list + target->cmd_sg_cnt; use_mr = !!ch->fmr_pool; } diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h index 17ee3f8..2ab73bc 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.h +++ b/drivers/infiniband/ulp/srp/ib_srp.h @@ -282,8 +282,14 @@ struct srp_fr_pool { */ struct srp_map_state { union { - struct ib_pool_fmr **next_fmr; - struct srp_fr_desc **next_fr; + struct { + struct ib_pool_fmr **next; + struct ib_pool_fmr **end; + } fmr; + struct { + struct srp_fr_desc **next; + struct srp_fr_desc **end; + } fr; }; struct srp_direct_buf *desc; u64 *pages;