From patchwork Tue Jun 27 14:04:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Amrani, Ram" X-Patchwork-Id: 9811727 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 8A35D60329 for ; Tue, 27 Jun 2017 14:05:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CCEF285ED for ; Tue, 27 Jun 2017 14:05:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 714AD28668; Tue, 27 Jun 2017 14:05:31 +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 7F2B7285ED for ; Tue, 27 Jun 2017 14:05:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751483AbdF0OF3 (ORCPT ); Tue, 27 Jun 2017 10:05:29 -0400 Received: from mail-by2nam01on0064.outbound.protection.outlook.com ([104.47.34.64]:48736 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751043AbdF0OF1 (ORCPT ); Tue, 27 Jun 2017 10:05:27 -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=37eH0RbYrVxpu1GfJE3YVv7BJgir3pk1TOEDTiHr4cI=; b=XPJ67NIz45yX4CB2mKdMY/KD0JQrd/tCfXtT8mzBmlRhd+cQ88i/VFZNZTPR9Z0PEKpavYfrnLszUbxGLZ5zlleDVckCtDITRSRB/EBKbP2SNQA+qgdX1BEepBSVr/EJnNimfi8aOjRcK3lNREoFnrcUsHnw602dxXrSo8bAgiM= Received: from CY1PR07CA0015.namprd07.prod.outlook.com (10.166.202.25) by BN1PR07MB023.namprd07.prod.outlook.com (10.255.225.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Tue, 27 Jun 2017 14:05:26 +0000 Received: from BN1AFFO11FD015.protection.gbl (2a01:111:f400:7c10::167) by CY1PR07CA0015.outlook.office365.com (2a01:111:e400:c60a::25) 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; Tue, 27 Jun 2017 14:05:25 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; 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 BN1AFFO11FD015.mail.protection.outlook.com (10.58.52.75) 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; Tue, 27 Jun 2017 14:05:24 +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; Tue, 27 Jun 2017 07:05:22 -0700 From: Ram Amrani To: , CC: , Ram Amrani Subject: [PATCH rdma v1 1/1] IB/core: Fix input len in multiple user verbs Date: Tue, 27 Jun 2017 17:04:42 +0300 Message-ID: <1498572282-22370-2-git-send-email-Ram.Amrani@cavium.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1498572282-22370-1-git-send-email-Ram.Amrani@cavium.com> References: <1498572282-22370-1-git-send-email-Ram.Amrani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39840400002)(39450400003)(39850400002)(39410400002)(39400400002)(2980300002)(428002)(189002)(199003)(9170700003)(2906002)(48376002)(4326008)(2950100002)(6666003)(5660300001)(356003)(72206003)(189998001)(54906002)(36756003)(50226002)(50466002)(5003940100001)(105586002)(86362001)(106466001)(47776003)(305945005)(575784001)(76176999)(50986999)(81166006)(101416001)(104016004)(8936002)(478600001)(38730400002)(77096006)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR07MB023; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD015; 1:FN7p6w+7bD7st66NFou7H0eJp7SdYsyx0VXyAjtbyHsVJsFSJssPYXrvn7W4p6NsFaCk2zU+75w4z2teWv2uX5EW/CPBqcKvlWy2bH9Jc7F/9sIL0cJzSUnATxiWtpCnKptu0HR1RL7DogoDfsSSxPGcrBeeudUhxWZNaiB/qFYoiEdw7coYQlsEK4lfxBKEOWtGOVUuvT7QETlICEFAkByCUS9DzJZDyKSPjplBmOxgR8YrupqeDnhkM6cSkJp68copdReOOiIaTUj+kFAbmPP1hvN6qmHheB0qtGR15wruTfKXB/DKetdcBNwo6qgtwhodUiPJfl+t4OXcis0PUGWEyMEoF873SjxNCqBgWEEhvAKaLygs/uqgBMBDa+Z8drR/kehUS7mLVtppQekAKN+o22zaZ0ZKaoSKh8zQ+o6ewSCDVWZC3Ir9UvDK0RiyH0pgEPaGKV0Hndp04ZeyIxHgfBU4KaYBMxUi5Hh8yvStKUzESdhWhjhW8abalqUtMvJmGFz+SsYcPQCLZCVfY3cbekL8y4zMybs1IrpnF/sKwzw8XmOnqp3npU8BBeL07Kn5U1ys9yqvYN74RuLELCTh41FYHlUMacoOF0NQyHFEyW6d4lBVP2ejbM/uBIYoLgPq05BucE+7sp8m3IJxjaKiCblFe7o9P66j/mmLC+67ABzUoeNeTmcjGu1nAWMJ7FkPhXE2glyo8b24aaPHUy+yZ7Vpnb4wQk41TlV8qaOXjdWyujadN4+miTbC3lDg/U1zi1iT7FhNMwjvTXPKhOVPodFRSs0eotFZc8/h6VNsP2kA6wRC2fSzo2g9Uf0y7dtJwl/lTpi9chiHRi/x2zhE8MMtA/O19opsJTn6YX4= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PR07MB023: X-MS-Office365-Filtering-Correlation-Id: 664b9e7b-b7ad-4b79-f7e9-08d4bd658ecc 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:BN1PR07MB023; X-Microsoft-Exchange-Diagnostics: 1; BN1PR07MB023; 3:yp8lm2PJFvoTX8vYBig++FE/4R3yfPbbJpItxGB95Ikkh2kwfAxbrWw+sqCv0qb6SunEoaA5ou5fVMFDfKBKUwdFOe0EYTQ7bJhVjCHmJliWRFPOinOWK7EGA1TAN/2/r0dwmuN8LRpIUgZ6H8xrsL8WQXeOS0tfAbWEx4eQ3adrX6+rmGRAnsZgipE5RTiNyBPGpGoU0+IydlFNDs8O8VtJxDVEgncUvkqK3pjOtcG9+EsCu2rfEYxkOHxJrZX9YdHQycb2Jr4MtPtAWZKAIjWGo8MuewBWmIK7RWR1ho4exdvJ8O0JwTHjq0DlUiXn+GkC79Z0oM14qoyroRcD+D70RA/m2JucEeNWHTD9MnfKGyCXEjzY7fb7Qwv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2dFMLF61BybQhqvWAVXYjfftaA== X-Microsoft-Exchange-Diagnostics: 1; BN1PR07MB023; 20:oouT0lXBEjQxBBuG+w6Ep2KVTKF4aqlhO+vkjukjTYt4WmZrVrPRiMzHfqxoTw08iHMzcT7BECHC7MAwsGwk99kmswSGAZRnWmgrZBA9ICkjMdBk0LyaOjAKdu9CnKEuy3TuiCjt3t/rPVfWawzcHevVPzKJeInKiBASEoqo1lF0W5A02fKTwrYVgmTLYEAmMFDvSnpX6/SGfM//PIMvLijfqTB2fnxp9k7hyDO0qUCE5s4ExkS6tRe0Ee7vifJjdc4LRzhc97pUnKd3XPpRh9EgwfT4XQd4gGNIEmbUhWK1IQOiK3yuQ3Y0uv/jQRqhj32E+iDFm4vTAyL+iGBBHroemSmdP4aYWn5WL+C6byFBDk/VMeN6SnTNz66XmDjHN6F8BOcD/V4wxqGt3D3mvW5LezMgt9sVvetQXyfU48XIjjseB8INzDxdB8D8OtUUvqMfo4JML518/c//3HQidfoAGe71saBYO8/9arNywlTX2P76dQYlo9kj09t7r9gO X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(13018025)(13016025)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(20161123558100)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN1PR07MB023; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN1PR07MB023; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR07MB023; 4:iqZyVyHAhDKO5tpTq+ZK6QPd3JaVby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fzbg0A/e4rDUydBcbT8xevqmO45ip?= =?us-ascii?Q?/9lQenPfJ8eX2h1pepfcvzGaekuwZEv8hUg8e9X6BqK6vvwT8FpwmWgYCFuj?= =?us-ascii?Q?3z8B/s4mhkgzI0O+I4+f7zp58lYfwWqhDS+suXuVd6/CHdsu+E0R0GQlbSok?= =?us-ascii?Q?0x+oipEf5ZAOm3LsJEeGSRwi6642vW9A8c9GsqvWl5szXMDkEUc850sYO3iR?= =?us-ascii?Q?mXBkl8/7NszEc+HIycdICwuBTnmj0Nj6G30CJNEiteTdqy9fqDzToFg3tiwq?= =?us-ascii?Q?+SBfdjm/+N6jVC0KPW1bc5g66LKlvOEoxYBLPAQzU8TJrM2rtCD233g=3D?= =?us-ascii?Q?=3D?= X-Forefront-PRVS: 0351D213B3 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR07MB023; 23:Jj1cpSB0h/J73xPFLKXG/1hTO0S4xQiSQ5xJXaqgMX?= =?us-ascii?Q?ybDqvn/8AlmASGZyNbQLJXDhoNohJ++cv2ld+d7lVXqkpWfq9niKfsNP2vS4?= =?us-ascii?Q?V0WIYoqEEL7Ti/k/eOS2g5y6EY3DdjGAm/9Z/iMINwg8Z0LJwfn9oPmrmZ/W?= =?us-ascii?Q?etDcvy26Y70rFDM88oStYhVWL4N0CrrzjbSyMo//qFCHP4Rqooxcu89h+K3j?= =?us-ascii?Q?kFfPBX7jd9G+pF1WaSHeGosjV50m/khxG5ZkyJnP7t4wLxVvaXItGdHnBJod?= =?us-ascii?Q?g0n+TYgG/yqJqZBLVHrzoAJshQ5bX22L+nFpKF0sNQ1QE/CEia1JlRP2WYtT?= =?us-ascii?Q?vyzKZagvKv85zDA+gGqITLvvlPMzLrl6yPwJPy622ajhHYRZab/YabGD9hSR?= =?us-ascii?Q?jUF3zD5hsxNMprtYN/rmSffOlh6/WKlgBblI5dmZ6egQqX2IRX/5GGZasDkK?= =?us-ascii?Q?NwHbG8/dmmw08pJSxrXSB24mhReKP1x+cuUnCBrj3uxWdL+LTOfeHV/afVaC?= =?us-ascii?Q?7/ochttvd4HT7SYlGGaU94ckfbgiY0ASZrW/CTEnTSCcdtwj+Ao1oEy07Y0p?= =?us-ascii?Q?g+SE8+123zgejAUED6ny1CyFUYkStZUmJabHSqBU3niXrWQSKXRyFhv6QfSN?= =?us-ascii?Q?N5saYfT/DnfFZyi5t1P+x+HLSCq0vV7aW75wId3pLCnziAJ+UJf1fW50T4ma?= =?us-ascii?Q?chEAk8p/BcKXzeVyfbI5lCTXfk0EPO9Fk2SC+ftEuh2sv+li903PLGKAbnhU?= =?us-ascii?Q?AwWELYGhCwh3gDqpO/WR3IWWbQQQWyJwvw2cVl8bqpaZ/jRW2uYZKWEQi8UH?= =?us-ascii?Q?aP/Ij/e1/h4n1lbVQe0bFQTm26WGP5IlcSDvydCBBTBDPd4CNRr4o9hvf8EN?= =?us-ascii?Q?qv+IN/JkhU59JnmdoVYxC87cxcAb7fHq6a2ZsB0F59Q81JCfTIrlF0kkG62s?= =?us-ascii?Q?rTB2asJSJWrZ0CMwV844oJuSwUAhdNRHCzHo3BbQOCcWk3yJSL010ExnOghy?= =?us-ascii?Q?W3epb3l+jqU3+Qsk7DWZ3PpRHJAlRqiLK2cxDC6XztjLtr0l+T2wzmc7ZX2T?= =?us-ascii?Q?LZacY=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR07MB023; 6:LTZE9bXZBL83tDxHb5XWJrsM0SnyyspP1AYgKlSss3O?= =?us-ascii?Q?Sc8HsbW0et1FT8y/6+qaIzDg7lKVw7nbZXx7asDWkool5ckSawL4pIUF//cU?= =?us-ascii?Q?kvnKzLli0eoihDniPZSIuoDy2R7j+1tXo57PXIAoo9hv2bb3WImo8dIEjr6h?= =?us-ascii?Q?J+qlAxLI4xyFqppFBoDgXVKyl9vpsQb4sguuzkwHPse0cxJl2xqZZbUCeI7B?= =?us-ascii?Q?wMOr1iGPdVqnO/Grz6wqXKHfYnajLvd49Ph6JF/fwnjjuGjzcDIl+ACokWFf?= =?us-ascii?Q?22ws56TILunmB8esiq+9519sASNqHoqz0rvCKfYYxykh1mTUhJIRxnDpRYxP?= =?us-ascii?Q?QH6sc3sMVrJLp5rgOGQHpRNUjl5zwCtrtoWxD/nvdZPjqjIO03Ht7O02+6uN?= =?us-ascii?Q?CK/7xncCTUGBr0OzU3zvdBuyqngemTKaY/cErvffv4dNo04tZFTLLX4qxxia?= =?us-ascii?Q?j/riNRZ5Zt7bQJDX6FRylrnhOziz8GDlPH5N8jwSQWuxDAhH6mMQUQMVF/UH?= =?us-ascii?Q?Iho+jHdKVMlWdB+/K2g3GemGMSk97eahOpBSqLgN/ATHt2lmqVzfIaZLT7Yg?= =?us-ascii?Q?E71A9qNXpjneX0OFSmiBq6y2he+CHtuNFGS2QZoAeX/l3bytKofn4Fr6ipe5?= =?us-ascii?Q?6YEg7OGIMhTpYau9TcRnUixuPnNiu5JFFQE3nH9Si3/TsJO1C5ZqMFlzlyLx?= =?us-ascii?Q?siaNSBNTqe72kPhKaE/vO/SfVHhYSHL9ifHNAUFCLhEa4ksg9xG6j1puB9A5?= =?us-ascii?Q?1Aze7VXzIjpx1SNDIFJnRGZmS2UspnjDaF/CBTFsilE9+vsyqNwu012OdMvv?= =?us-ascii?Q?CD+RueYMNWt508CeQhrEYNq63N9viNe3mhcxtqoHKVKWYH7q5VXcefYcSpwr?= =?us-ascii?Q?chF3xF4e3vHQNdfZerxk1R3MhM+NpX9ITmPQGFYLb0ftD4mZmBEbWM649BOc?= =?us-ascii?Q?4KOJnKURxACsp+E5D0/ZkNDncuz29YShDGXSXAae/7EHStFvwHkqU6YkuHxU?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR07MB023; 5:Gj/Swr5Xn19UqAqgtsQhpBz7EvlfCtAmhYVJnWBUTGAuJ7RlGoLCHgLMFbV0H14EXVa4By9g4CoQ0TszjTBGsJvEGuGySZFM2YPM2mxF8F8+50Nzp87/Hv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EWNSyO5YE7U7ymr6HdUjVfGNqxA5aa5IAFrGEEKUKBdpb1bKj7nnT7COuB8X1Ulzw83AOYovqmLtClgx5FCtX8iykzAUXKD3h49gw3EMdhvMaXmD/AdP7pR8hc5/icmXzsH8P7wOHLgLLBWWYqd/Wk8PBjIZNB7qPOFy33DYQLJE+wwVxmOUjzSqwCGgLgD5hwVV+1cCt7hYsX3R3HT3mMQmgU1ksqS9e8UDSCTh/4d2ocbfhBAODOK/pNUGRvV9n8EDomxkYeCOUkfiQ7ySzM/swptLeFFo8oOqMK7RG9d38OzO2+dO3BFe4= X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2017 14:05:24.7794 (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: BN1PR07MB023 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 Most user verbs pass user data to the kernel with the inclusion of the ib_uverbs_cmd_hdr structure. This is problematic because the vendor has no ideas if the verb was called by a legacy verb or an extended verb. Also, the incosistency between the verbs is confusing. Fixes: 565197dd8fb1 ("IB/core: Extend ib_uverbs_create_cq") Signed-off-by: Ram Amrani Signed-off-by: Ariel Elior --- drivers/infiniband/core/uverbs_cmd.c | 70 ++++++++++++++++------------ drivers/infiniband/hw/mlx5/cq.c | 6 +-- drivers/infiniband/hw/mlx5/main.c | 11 ++--- drivers/infiniband/hw/mthca/mthca_provider.c | 2 +- 4 files changed, 46 insertions(+), 43 deletions(-) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 70b7fb1..c418a0a 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -91,9 +91,10 @@ ssize_t ib_uverbs_get_context(struct ib_uverbs_file *file, goto err; } - INIT_UDATA(&udata, buf + sizeof cmd, - (unsigned long) cmd.response + sizeof resp, - in_len - sizeof cmd, out_len - sizeof resp); + INIT_UDATA(&udata, buf + sizeof(cmd), + (unsigned long) cmd.response + sizeof(resp), + in_len - sizeof(cmd) - sizeof(struct ib_uverbs_cmd_hdr), + out_len - sizeof(resp)); ret = ib_rdmacg_try_charge(&cg_obj, ib_dev, RDMACG_RESOURCE_HCA_HANDLE); if (ret) @@ -313,9 +314,10 @@ ssize_t ib_uverbs_alloc_pd(struct ib_uverbs_file *file, if (copy_from_user(&cmd, buf, sizeof cmd)) return -EFAULT; - INIT_UDATA(&udata, buf + sizeof cmd, - (unsigned long) cmd.response + sizeof resp, - in_len - sizeof cmd, out_len - sizeof resp); + INIT_UDATA(&udata, buf + sizeof(cmd), + (unsigned long) cmd.response + sizeof(resp), + in_len - sizeof(cmd) - sizeof(struct ib_uverbs_cmd_hdr), + out_len - sizeof(resp)); uobj = uobj_alloc(uobj_get_type(pd), file->ucontext); if (IS_ERR(uobj)) @@ -482,9 +484,10 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file, if (copy_from_user(&cmd, buf, sizeof cmd)) return -EFAULT; - INIT_UDATA(&udata, buf + sizeof cmd, - (unsigned long) cmd.response + sizeof resp, - in_len - sizeof cmd, out_len - sizeof resp); + INIT_UDATA(&udata, buf + sizeof(cmd), + (unsigned long) cmd.response + sizeof(resp), + in_len - sizeof(cmd) - sizeof(struct ib_uverbs_cmd_hdr), + out_len - sizeof(resp)); mutex_lock(&file->device->xrcd_tree_mutex); @@ -646,9 +649,10 @@ ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file, if (copy_from_user(&cmd, buf, sizeof cmd)) return -EFAULT; - INIT_UDATA(&udata, buf + sizeof cmd, - (unsigned long) cmd.response + sizeof resp, - in_len - sizeof cmd, out_len - sizeof resp); + INIT_UDATA(&udata, buf + sizeof(cmd), + (unsigned long) cmd.response + sizeof(resp), + in_len - sizeof(cmd) - sizeof(struct ib_uverbs_cmd_hdr), + out_len - sizeof(resp)); if ((cmd.start & ~PAGE_MASK) != (cmd.hca_va & ~PAGE_MASK)) return -EINVAL; @@ -740,7 +744,8 @@ ssize_t ib_uverbs_rereg_mr(struct ib_uverbs_file *file, INIT_UDATA(&udata, buf + sizeof(cmd), (unsigned long) cmd.response + sizeof(resp), - in_len - sizeof(cmd), out_len - sizeof(resp)); + in_len - sizeof(cmd) - sizeof(struct ib_uverbs_cmd_hdr), + out_len - sizeof(resp)); if (cmd.flags & ~IB_MR_REREG_SUPPORTED || !cmd.flags) return -EINVAL; @@ -1080,7 +1085,8 @@ ssize_t ib_uverbs_create_cq(struct ib_uverbs_file *file, INIT_UDATA(&uhw, buf + sizeof(cmd), (unsigned long)cmd.response + sizeof(resp), - in_len - sizeof(cmd), out_len - sizeof(resp)); + in_len - sizeof(cmd) - sizeof(struct ib_uverbs_cmd_hdr), + out_len - sizeof(resp)); memset(&cmd_ex, 0, sizeof(cmd_ex)); cmd_ex.user_handle = cmd.user_handle; @@ -1161,9 +1167,10 @@ ssize_t ib_uverbs_resize_cq(struct ib_uverbs_file *file, if (copy_from_user(&cmd, buf, sizeof cmd)) return -EFAULT; - INIT_UDATA(&udata, buf + sizeof cmd, - (unsigned long) cmd.response + sizeof resp, - in_len - sizeof cmd, out_len - sizeof resp); + INIT_UDATA(&udata, buf + sizeof(cmd), + (unsigned long) cmd.response + sizeof(resp), + in_len - sizeof(cmd) - sizeof(struct ib_uverbs_cmd_hdr), + out_len - sizeof(resp)); cq = uobj_get_obj_read(cq, cmd.cq_handle, file->ucontext); if (!cq) @@ -1719,9 +1726,10 @@ ssize_t ib_uverbs_open_qp(struct ib_uverbs_file *file, if (copy_from_user(&cmd, buf, sizeof cmd)) return -EFAULT; - INIT_UDATA(&udata, buf + sizeof cmd, - (unsigned long) cmd.response + sizeof resp, - in_len - sizeof cmd, out_len - sizeof resp); + INIT_UDATA(&udata, buf + sizeof(cmd), + (unsigned long) cmd.response + sizeof(resp), + in_len - sizeof(cmd) - sizeof(struct ib_uverbs_cmd_hdr), + out_len - sizeof(resp)); obj = (struct ib_uqp_object *)uobj_alloc(uobj_get_type(qp), file->ucontext); @@ -2038,7 +2046,8 @@ ssize_t ib_uverbs_modify_qp(struct ib_uverbs_file *file, return -EOPNOTSUPP; INIT_UDATA(&udata, buf + sizeof(cmd.base), NULL, - in_len - sizeof(cmd.base), out_len); + in_len - sizeof(cmd.base) - sizeof(struct ib_uverbs_cmd_hdr), + out_len); ret = modify_qp(file, &cmd, &udata); if (ret) @@ -2543,7 +2552,8 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file, INIT_UDATA(&udata, buf + sizeof(cmd), (unsigned long)cmd.response + sizeof(resp), - in_len - sizeof(cmd), out_len - sizeof(resp)); + in_len - sizeof(cmd) - sizeof(struct ib_uverbs_cmd_hdr), + out_len - sizeof(resp)); uobj = uobj_alloc(uobj_get_type(ah), file->ucontext); if (IS_ERR(uobj)) @@ -3609,10 +3619,10 @@ ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file, xcmd.max_sge = cmd.max_sge; xcmd.srq_limit = cmd.srq_limit; - INIT_UDATA(&udata, buf + sizeof cmd, - (unsigned long) cmd.response + sizeof resp, - in_len - sizeof cmd - sizeof(struct ib_uverbs_cmd_hdr), - out_len - sizeof resp); + INIT_UDATA(&udata, buf + sizeof(cmd), + (unsigned long) cmd.response + sizeof(resp), + in_len - sizeof(cmd) - sizeof(struct ib_uverbs_cmd_hdr), + out_len - sizeof(resp)); ret = __uverbs_create_xsrq(file, ib_dev, &xcmd, &udata); if (ret) @@ -3636,10 +3646,10 @@ ssize_t ib_uverbs_create_xsrq(struct ib_uverbs_file *file, if (copy_from_user(&cmd, buf, sizeof cmd)) return -EFAULT; - INIT_UDATA(&udata, buf + sizeof cmd, - (unsigned long) cmd.response + sizeof resp, - in_len - sizeof cmd - sizeof(struct ib_uverbs_cmd_hdr), - out_len - sizeof resp); + INIT_UDATA(&udata, buf + sizeof(cmd), + (unsigned long) cmd.response + sizeof(resp), + in_len - sizeof(cmd) - sizeof(struct ib_uverbs_cmd_hdr), + out_len - sizeof(resp)); ret = __uverbs_create_xsrq(file, ib_dev, &cmd, &udata); if (ret) diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c index 94c049b..619e265 100644 --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c @@ -751,10 +751,8 @@ static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata, void *cqc; int err; - ucmdlen = - (udata->inlen - sizeof(struct ib_uverbs_cmd_hdr) < - sizeof(ucmd)) ? (sizeof(ucmd) - - sizeof(ucmd.reserved)) : sizeof(ucmd); + ucmdlen = udata->inlen < sizeof(ucmd) ? + (sizeof(ucmd) - sizeof(ucmd.reserved)) : sizeof(ucmd); if (ib_copy_from_udata(&ucmd, udata, ucmdlen)) return -EFAULT; diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 9ecc089..906baf0 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -1211,7 +1211,6 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev, struct mlx5_bfreg_info *bfregi; int ver; int err; - size_t reqlen; size_t min_req_v2 = offsetof(struct mlx5_ib_alloc_ucontext_req_v2, max_cqe_version); bool lib_uar_4k; @@ -1219,18 +1218,14 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev, if (!dev->ib_active) return ERR_PTR(-EAGAIN); - if (udata->inlen < sizeof(struct ib_uverbs_cmd_hdr)) - return ERR_PTR(-EINVAL); - - reqlen = udata->inlen - sizeof(struct ib_uverbs_cmd_hdr); - if (reqlen == sizeof(struct mlx5_ib_alloc_ucontext_req)) + if (udata->inlen == sizeof(struct mlx5_ib_alloc_ucontext_req)) ver = 0; - else if (reqlen >= min_req_v2) + else if (udata->inlen >= min_req_v2) ver = 2; else return ERR_PTR(-EINVAL); - err = ib_copy_from_udata(&req, udata, min(reqlen, sizeof(req))); + err = ib_copy_from_udata(&req, udata, min(udata->inlen, sizeof(req))); if (err) return ERR_PTR(err); diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c index c197cd9..1a222dc 100644 --- a/drivers/infiniband/hw/mthca/mthca_provider.c +++ b/drivers/infiniband/hw/mthca/mthca_provider.c @@ -914,7 +914,7 @@ static struct ib_mr *mthca_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, int err = 0; int write_mtt_size; - if (udata->inlen - sizeof (struct ib_uverbs_cmd_hdr) < sizeof ucmd) { + if (udata->inlen < sizeof ucmd) { if (!to_mucontext(pd->uobject->context)->reg_mr_warned) { mthca_warn(dev, "Process '%s' did not pass in MR attrs.\n", current->comm);