Message ID | 1498493106-28604-2-git-send-email-Ram.Amrani@cavium.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show
Return-Path: <linux-rdma-owner@kernel.org> 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 10521603F2 for <patchwork-linux-rdma@patchwork.kernel.org>; Mon, 26 Jun 2017 16:05:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1231628556 for <patchwork-linux-rdma@patchwork.kernel.org>; Mon, 26 Jun 2017 16:05:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0682E285E8; Mon, 26 Jun 2017 16:05:42 +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 5849928556 for <patchwork-linux-rdma@patchwork.kernel.org>; Mon, 26 Jun 2017 16:05:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751431AbdFZQFk (ORCPT <rfc822;patchwork-linux-rdma@patchwork.kernel.org>); Mon, 26 Jun 2017 12:05:40 -0400 Received: from mail-sn1nam01on0082.outbound.protection.outlook.com ([104.47.32.82]:27133 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750919AbdFZQFi (ORCPT <rfc822;linux-rdma@vger.kernel.org>); Mon, 26 Jun 2017 12:05:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=0k7UCoJ4cCE+J+c+tU3wHlTNWrZa6/Ti+Wtxesn5y8U=; b=INn0vrmuc0DxGFF9s3jvNIbEDHIAsScvWK9/HpL1lS5RgWr+PZJ4AmOxCP6/5gQvzPB92C3mUk2MkaSHuDWIAX9h3dwn/G8gOiILJDGyTClS1afLAyf3YhPCaHE0ueBCzXbfG4vVkfndR+8EPeo/EslD5p0GgYrvhI5Vl7g1lPk= Received: from CO2PR07CA0044.namprd07.prod.outlook.com (2603:10b6:100::12) by CO1PR07MB427.namprd07.prod.outlook.com (2a01:111:e400:103d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15; Mon, 26 Jun 2017 16:05:36 +0000 Received: from BN1AFFO11FD018.protection.gbl (2a01:111:f400:7c10::174) by CO2PR07CA0044.outlook.office365.com (2603:10b6:100::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15 via Frontend Transport; Mon, 26 Jun 2017 16:05:35 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; obsidianresearch.com; dkim=none (message not signed) header.d=none;obsidianresearch.com; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1AFFO11FD018.mail.protection.outlook.com (10.58.52.78) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1199.9 via Frontend Transport; Mon, 26 Jun 2017 16:05:34 +0000 Received: from lb-tlvb-ramrani.il.qlogic.org (10.185.6.119) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Mon, 26 Jun 2017 09:05:31 -0700 From: Ram Amrani <Ram.Amrani@cavium.com> To: <dledford@redhat.com> CC: <Ariel.Elior@cavium.com>, <linux-rdma@vger.kernel.org>, <jgunthorpe@obsidianresearch.com>, Ram Amrani <Ram.Amrani@cavium.com> Subject: [PATCH rdma 1/3] RDMA/qedr: Prevent memory overrun in verbs' user responses Date: Mon, 26 Jun 2017 19:05:04 +0300 Message-ID: <1498493106-28604-2-git-send-email-Ram.Amrani@cavium.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1498493106-28604-1-git-send-email-Ram.Amrani@cavium.com> References: <1498493106-28604-1-git-send-email-Ram.Amrani@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39400400002)(39450400003)(39850400002)(39410400002)(39840400002)(2980300002)(428002)(189002)(199003)(9170700003)(478600001)(106466001)(36756003)(50986999)(86362001)(5003940100001)(5660300001)(47776003)(104016004)(105586002)(8676002)(81166006)(50226002)(356003)(305945005)(8936002)(2906002)(76176999)(101416001)(72206003)(2351001)(54906002)(2950100002)(50466002)(6916009)(6666003)(48376002)(77096006)(189998001)(38730400002)(107886003)(110136004)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:CO1PR07MB427; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD018; 1:TLbjN+T5jya46sfys8+9t6HmhkxmbQtBIdzIuZnjsK5frtj95yyWsyAduw6CWR3Du2o43oNyUj2Jkb16I5riR7Ccr6PlK9OogbaFbvjQ30j6lNfZJanx01yzEZLBEWAWwNOJqANooFAOa+5ifopgww4JwIWaOkzIqDuupQLQPSfd/pICiZ6wKpRBQlC68YlR2BL/GLQ3UxZXWp2Vzq/inJi9y9HBFh9c54LeyHtbLE6BS5DILv/Swced7eoercNqTiK9xjGn6+aZQG8bh9kFE3GNnt9yzPU/XVaSvmrLbZBZfGOs90vS0RphzOQStrMZsVSA5rFdhVNo5Q4yd3fgAITpSG8IVgLkUSWH3Moq2QTfVdeHNvbGuZk2FsJJjzn14s3E4QXPWHGRhiw7oFA9CmU8gaQmt/fNwomIqwH7vunBJwi3BSnP3RctWure64p8k7OgADsupz2BTg0oyBZHITXwNC1JcznElP2KF68aGFqIdpJD9i7ZCg48GqjHO9wXJjkUl+lVeGg13zZADdzhfNtV7MFR1MTRHIWFMDOBxLulldYMGXjOkhDldS5WyiBj168CTcZyTJnHpwlRvNwIwe1gK1eK3jjSJUsDIceNP5KhuBp83DxCsMX/+qISNzuCtSA/R7Xb0COwfGHeonGfZxRYngWqUAdaAvkg65YyDBh2fEUVdYPPcFJDY11qgcB7kbNoBwsRZZjZSk4VvV0fKgBSMk4adBqi8WI58rd8yTXQ9663QfczpCIDlLIB+8NV9k+HtZ0B1koBm2R5jfwQbU7UNOvBnFONpfpE3yzONxrD/okj78sJxIB8Tdt9znHgkR54e8em2MZ3D5m0H/l2q2zBaNYlCOhrEVmFMM16ALU= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f7fed38-8558-43f7-ae5f-08d4bcad2ded X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095); SRVR:CO1PR07MB427; X-Microsoft-Exchange-Diagnostics: 1; CO1PR07MB427; 3:d0Mh/UqZ1JSkI+9J1tIECH8so3RpILUKKjNYEWZ+b6r8G4ojxQWa+kfxgEo8L7aot0SiMbFY5m4sPGdfT19Anhdvi3YbqXc4XRqUf7Pq04cDfZtmU+LiI+ePk5L7nNhk2eZEvizySk73aswcEvuRlSDkc3bMIbvuyYb8thQaxxRRHARdqXxntR34QatrJQLen/6ILH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3AWhuULkTqfE22DA1iqPPoj2JvKlEcCxMLtpMspEsgKWiy0PQUyEdFzJ4SvTlXbdfMPmP+pYPpNp6UzRz25jeqbk01hmypWlGXhQZ2CsC3aHjEVNCiPL8dE4hj2NgYoBxojBfkXEJkLKv2z0+QQaVeo2ayF/m8SiP21bWPsjwd5OQ1zccSR8j1b6YWfsvQT2+jj9g6ZSC/CVTtXyyAJvka+Ni6jMGVzfCkPczxDqQBeTtyQV2BJRCnquFJatCQ5m2vP X-Microsoft-Exchange-Diagnostics: 1; CO1PR07MB427; 20:+KkP1FtIqKt5XN86FuH6bMWGgsn0CCQLZTgvQpVJkfhgqxAKeUZTmDuHxlQBb/J1fRN8/i8StCyR2XK/VxH0PPpxCE3n0V9QLJEnTIlFxvj2CYyUzv7gjAA0Xr8bsuiestWnQwyXVMqZhIZ/P2XOL1eRsIlMV9BnA5KI5W2JHWF3GQUrl3pKSI1wNasOOnLHe3kFTjUTTzoE77MxaZPnfasdCfYaAY4Ci3+vee7ibUPrvshEYe2ppyspnH4cPRFuNLF96hQd7vrmhxUMVfC9xrW1aOUXIdQ2UVSxk/cScotY1AQi5SvE6DKk29lG4o7huWNIybCq1DR1KydN5WYOsg+j86kWY2jIms5R6wcUXKDxB+4MypyGiu7WeXNJszgUbBKxKbngNzDnnXdElO4ljDj3y+aeNYhHKCH9Tgdszwf6UIGk0uFylHhN2eahkSgPDyQzqLIsYzGbpCjK7VGLeWt3llnpq1QIlvonoTEBUZpKk7EEZ2JvmEUs9P2cxibC X-Microsoft-Antispam-PRVS: <CO1PR07MB4270C3A3F1951850CDD93DDF8DF0@CO1PR07MB427.namprd07.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(133145235818549)(236129657087228); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(13016025)(13018025)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6041248)(20161123555025)(20161123562025)(20161123558100)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO1PR07MB427; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO1PR07MB427; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO1PR07MB427; 4:5Ks4We08zAut+GXHhgxQdzpQgV40bJaBS56nRrAatAt?= =?us-ascii?Q?6ILGIlgdBqaUrMh8lRCE8YZEbN9E8kaO26qKUA2whct5Gb39aoFAxze6Uvgg?= =?us-ascii?Q?DU1/yvGOfIXF4g1HT8SjrajParlfU3DC9clRrWC02gSFzSlsRbJw802pxj6t?= =?us-ascii?Q?7Z7wVg40vQLKRV7WvC1drfffRvNMPP4RrQ3UQB/XaY1zJ/pZVXu/rcITR54V?= =?us-ascii?Q?WjlZ2sEZKOI9yHe81Sf6F++1PQbjsasknh+17CT9S8qFFPhREj67uHXCeyfD?= =?us-ascii?Q?Lj0kI+pB/lWBOGKJAZy26+DkUGnuqlGR3A6yrd7c6XVOo1okUuWv5CLBrA5L?= =?us-ascii?Q?zcS38r9Es+HMg9nKRmlBleAaqehm8a8L7pIdMImGLesZGF+ZHEjhTnubzwHR?= =?us-ascii?Q?tvlW+rJdEIJDaFGctlFZPx4607A2LX0yvjP+KXtuigI5fo3CL5bVe4+6Sd98?= =?us-ascii?Q?p5+uEhYJXObKZTlGYxQlNLWOxumIsE2JslCOiKyeKB+Zh1OuwRmwq5zmgbzk?= =?us-ascii?Q?WKtXW4iAKExTOd2sLKD9WWXyvlG5ruHaMWfNClOYbxg6i1dk/KMTxUHum+kB?= =?us-ascii?Q?jwFFLthfzHpbB7fCk7wHS8cgjMQxbGEPRZt6lowNV8LIOASM0WrPlExYTICL?= =?us-ascii?Q?ZvHTauSlCty63U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l3ZscdDmFkLSFK6CJHR4T8ZGdJLWbPRhnsB5y2QMnqBglgOMDBaGWAtmM?= =?us-ascii?Q?Bvya4zPFLetGi9puUXemgdbD9cjuGk3qOM6O0jklvW35ctukMv6HvqsIzA7m?= =?us-ascii?Q?76Gwu4d2Z0v7RR/KTc324hYJSoeF7xllOAdOYsgHspVfwKQ6xO+3GMF+vL1Y?= =?us-ascii?Q?nzbMetNFvnQhnp0UaAQQR8uSBwA5izOwPS7zRPLNNotESmGDXb3vNqL2n+80?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; CO1PR07MB427; 5:+rErSOZjgLjBbGh48+TwPTbRyZCQl1FRkn6TAtOhqwVhaqyHcCLXURdB52LwUW0NTDyIxu+i4SP8ahg+OFiEGeUqDR767qYDRUVjDD/6zeMd2OJCbjzp/Kmz/iXOmsxGWIWNdx1mBj1X8LfrzB3axgUSwyu7ClRXBlcMo7wpgwbjxZwMh7wvRzY1ZUFHmak7BFS/YElRNOaxZDKzuHG8TVsAJVSOEubvlhG7qBR5ruoWugk1WVKoel3lvYIIWc7y4b+oIvOzeqxIlGHlBLiD88X2NEos1ZUwQOwI01I9hMPXDNJNgsXsbC/dq0ha8xyfMqNWLGwmhQ2aB5GXQ7oSww3InZsukeeabAr9aIr11brgc0ajjlqyVXOw2Q9GO+iKFSLzGcZP6HlG4SzuZw2gxJcJvWLx9vi8yZK7MpberxLvLJAoSiyC1Ep4/pQQIj5xvsigfUSMcDu+XO/QsK6wyK9JmTmWJB9/Fc6pq/CH3Wlx/R4C+BLuXapp2JH8M16p; 24:AqbwJfofovxytecX++i4ZMudZeHHMN5TZkcTZGeLsJj0gColAq3Qe+ltzkKYlqVnKbTwH1RwuH3OlaqS2n4gV4lk68T0epx6i9RO/QnE0CU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO1PR07MB427; 7:IqjQUxTnzFkbp0deuJZA1kZ+ejZNJOomXJCZcrVsbA8h0vOhXKZHrVW2a0b2MQCS6IQWhI4nwfGWO62gmg/5xx8emeLggAF5xSAPh6EoragXu9ZX8bnnQsrUf5u27vvpv0Uxlscekh73XhF6WXfY3WkH6N8IQ7C6eMrh2nZ5SbNMMvpC00K71uAqoOpQVoKX5oTGVSfBh3sjKn8PC59lSLFQ5AP8UKQgF5/E6Nt99x83nBCkNm9hVbF8TRR8wgjLryLylttUsgIbotYuDedZKT9ELnZ0cWQ82pmcZ/yx/wA3TCLOQjQ1X97JzXHKeT/fr9btpARJMA29HfEyt96MviubDQnBcD8lf/84y1YnLVZb+2uPDUAbXcBKSRMQwWgG7BFWywdEiKEZa/YXuFqHy1/neUIAg9jDy1Bd20jX6+LqA/E1Dwr2Dxm1rnr0DvXD0CEEyB+U+C+cYMI+sjeDIwR2tUdmMdQfpQ9mhrXR9vRjeHtVThKXO4REhoMbPxA66ueldAVSDBpMUT6jco64I9CQ2KqZoSCyOw3z4+RJ7d16dhNuUpJ/yS+owXJCrZCE0YzvHnIfIWWWJfl/IwVteqAFkSX1hI/o+ZS0s4TKW7tRSPwvrYApTAp529P8sKNAbnIBO6mx+g8lHgIp7NtoXtFvW1wx4A+tW9pfY7lHA05r5IDBK2++TSXJFy9CX62GBfzz63xMJWwN0AUtBfkBdK3YigNNS2I1Qtsshn3vBlvcMUq56N2nFsAZvEfqz3IiEB/K/b9ZI3MMjTNvxur+yorbbwN8vjDx9lEPFaPcXc4= X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2017 16:05:34.8566 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR07MB427 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: <linux-rdma.vger.kernel.org> X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
On 6/26/2017 12:05 PM, Ram Amrani wrote: > Wrap ib_copy_to_udata with a function that ensures that the data > being copied over to user space isn't longer than the allowed. > > Fixes: cecbcddf6461 ("qedr: Add support for QP verbs") > Fixes: a7efd7773e31 ("qedr: Add support for PD,PKEY and CQ verbs") > Fixes: ac1b36e55a51 ("qedr: Add support for user context verbs") > Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com> This was accepted into 4.13-rc, thanks.
diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c index 17685cf..3ec861c 100644 --- a/drivers/infiniband/hw/qedr/verbs.c +++ b/drivers/infiniband/hw/qedr/verbs.c @@ -53,6 +53,14 @@ #define DB_ADDR_SHIFT(addr) ((addr) << DB_PWM_ADDR_OFFSET_SHIFT) +static inline int qedr_ib_copy_to_udata(struct ib_udata *udata, void *src, + size_t len) +{ + size_t min_len = min_t(size_t, len, udata->outlen); + + return ib_copy_to_udata(udata, src, min_len); +} + int qedr_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey) { if (index > QEDR_ROCE_PKEY_TABLE_LEN) @@ -378,7 +386,7 @@ struct ib_ucontext *qedr_alloc_ucontext(struct ib_device *ibdev, uresp.sges_per_srq_wr = dev->attr.max_srq_sge; uresp.max_cqes = QEDR_MAX_CQES; - rc = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); + rc = qedr_ib_copy_to_udata(udata, &uresp, sizeof(uresp)); if (rc) goto err; @@ -499,7 +507,7 @@ struct ib_pd *qedr_alloc_pd(struct ib_device *ibdev, uresp.pd_id = pd_id; - rc = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); + rc = qedr_ib_copy_to_udata(udata, &uresp, sizeof(uresp)); if (rc) { DP_ERR(dev, "copy error pd_id=0x%x.\n", pd_id); dev->ops->rdma_dealloc_pd(dev->rdma_ctx, pd_id); @@ -722,7 +730,7 @@ static int qedr_copy_cq_uresp(struct qedr_dev *dev, uresp.db_offset = DB_ADDR_SHIFT(DQ_PWM_OFFSET_UCM_RDMA_CQ_CONS_32BIT); uresp.icid = cq->icid; - rc = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); + rc = qedr_ib_copy_to_udata(udata, &uresp, sizeof(uresp)); if (rc) DP_ERR(dev, "copy error cqid=0x%x.\n", cq->icid); @@ -1228,7 +1236,7 @@ static int qedr_copy_qp_uresp(struct qedr_dev *dev, uresp.atomic_supported = dev->atomic_cap != IB_ATOMIC_NONE; uresp.qp_id = qp->qp_id; - rc = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); + rc = qedr_ib_copy_to_udata(udata, &uresp, sizeof(uresp)); if (rc) DP_ERR(dev, "create qp: failed a copy to user space with qp icid=0x%x.\n",
Wrap ib_copy_to_udata with a function that ensures that the data being copied over to user space isn't longer than the allowed. Fixes: cecbcddf6461 ("qedr: Add support for QP verbs") Fixes: a7efd7773e31 ("qedr: Add support for PD,PKEY and CQ verbs") Fixes: ac1b36e55a51 ("qedr: Add support for user context verbs") Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com> --- drivers/infiniband/hw/qedr/verbs.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)