Message ID | 20170519183016.12646-3-bart.vanassche@sandisk.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-block-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 1D21D601C2 for <patchwork-linux-block@patchwork.kernel.org>; Fri, 19 May 2017 18:30:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14C642856E for <patchwork-linux-block@patchwork.kernel.org>; Fri, 19 May 2017 18:30:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 094F828579; Fri, 19 May 2017 18:30:55 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable 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 86CCB2856E for <patchwork-linux-block@patchwork.kernel.org>; Fri, 19 May 2017 18:30:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755824AbdESSah (ORCPT <rfc822;patchwork-linux-block@patchwork.kernel.org>); Fri, 19 May 2017 14:30:37 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:10207 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752810AbdESSaX (ORCPT <rfc822;linux-block@vger.kernel.org>); Fri, 19 May 2017 14:30:23 -0400 X-IronPort-AV: E=Sophos;i="5.38,365,1491235200"; d="scan'208";a="115828395" Received: from mail-by2nam03lp0051.outbound.protection.outlook.com (HELO NAM03-BY2-obe.outbound.protection.outlook.com) ([216.32.180.51]) by ob1.hgst.iphmx.com with ESMTP; 20 May 2017 02:46:34 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=jmJ6xV0MzHGfhinvbkPR5dCL8yHkfWdnOuVn9szsmfQ=; b=Naxb09m4EA2lAo/XhkjGFGhI8gYY6RcFhxipH1GHmX+JNz8pVs8aeHRkZ1JgACj4TzYqbywdxFQ2eORXJ93+9xcS1SolpXu7/m8m+Ha/5+DnKCtxWWzI9yJsDV5PWPxxqboRktsG04n2lZsapYoE+I+Uw7Drq7+y8/NZwuAxi1Y= Received: from CO2PR04CA018.namprd04.prod.outlook.com (10.141.240.146) by DM5PR04MB0363.namprd04.prod.outlook.com (10.173.169.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Fri, 19 May 2017 18:30:20 +0000 Received: from SN1NAM04FT008.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4c::205) by CO2PR04CA018.outlook.office365.com (2a01:111:e400:1428::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14 via Frontend Transport; Fri, 19 May 2017 18:30:20 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by SN1NAM04FT008.mail.protection.outlook.com (10.152.88.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1075.5 via Frontend Transport; Fri, 19 May 2017 18:30:19 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 40.5A.29323.AB93F195; Fri, 19 May 2017 11:30:18 -0700 (PDT) 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.319.2; Fri, 19 May 2017 11:30:18 -0700 X-AuditID: 0ac94369-1d7ff7000000728b-8b-591f39ba9c8f Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id F8.37.18148.AB93F195; Fri, 19 May 2017 11:30:18 -0700 (PDT) From: Bart Van Assche <bart.vanassche@sandisk.com> To: "Martin K . Petersen" <martin.petersen@oracle.com>, James Bottomley <James.Bottomley@HansenPartnership.com> CC: <linux-scsi@vger.kernel.org>, Bart Van Assche <bart.vanassche@sandisk.com>, Christoph Hellwig <hch@lst.de>, Omar Sandoval <osandov@fb.com>, Hannes Reinecke <hare@suse.com>, <linux-block@vger.kernel.org> Subject: [PATCH 02/18] bsg: Check private request size before attaching to a queue Date: Fri, 19 May 2017 11:30:00 -0700 Message-ID: <20170519183016.12646-3-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170519183016.12646-1-bart.vanassche@sandisk.com> References: <20170519183016.12646-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRmVeSWpSXmKPExsXCddJ5ke4uS/lIgx2nLCwWvNnLZrFy9VEm i439HBZ7b2lbdF/fwWax/Pg/JovD966yOLB7TGx+x+4xbdIpNo/dNxvYPD4+vcXisX7LVRaP z5vkAtiiuGxSUnMyy1KL9O0SuDKm73/KXtDPWfF+YyNrA+M59i5GTg4JAROJHX8e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KrF+Lf+SM7KlNgzR/LWerb bx58012pJWa/KHLzq8SDHyruR73fP6O75JexDfM/lRuHmG1YNvsGTnOMZFPL5Iy9uz9h4ZWg xffSJnpdr57TtqbB3qSgPebuxMOTtjMrsRRnJBpqMRcVJwIAavHXztABAAA= MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39860400002)(39840400002)(39410400002)(39400400002)(39450400003)(39850400002)(2980300002)(438002)(199003)(189002)(9170700003)(5003940100001)(356003)(38730400002)(77096006)(4326008)(8676002)(72206003)(81166006)(33646002)(50226002)(106466001)(2906002)(48376002)(5660300001)(6666003)(86362001)(36756003)(2950100002)(305945005)(478600001)(1076002)(8936002)(76176999)(189998001)(47776003)(54906002)(50986999)(53936002)(50466002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR04MB0363; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM04FT008; 1:0t/+cIo3ksy7eW6bHMnSfHCj4O+rdtOKMI8Oh/H2yK606jIicS1rqyx1LTCXeq7U1t7jRFnmwrl1BVPNDcfJwUVzjS26R3EZqgwXrv9T4nIHfvHGl/evWXM7/Xt00YAcqCAhORBDVDOmaOnv6mLs0LYm/Cz7RsOQh1iH2dUJOnQwY+qEblq2ZSlCYxbuzsm8s+NkVgSSemVGmBBRgGDq5dSTaJcdLMauckdkUTUDeIoEwHp5xBfvWUfKvp0ljTX568Fruq5JuvJ0AV5hmxqlxKa+cJOoeS/4OBa60zdmqKmkw0fGKWwd/RS0trS7MSODR2sonBDdV1qZ29q9ovHDAQHFkDyBfdsKPmab+zdCDaa4o92vGpOJa+56pZu7k2niVsKRbEjOd13X+IfraLqxaQ/L6b8g+UXg84oRcTFKnoU2YTd1nNYupWvOoGinEvZ4dt6W+fkYGFc8f/4J9QrBxpOr2TvvVwljZmVBCcBxgq693yLR7lPlLnsmq2VQlu/DUL3L4YplCkAKO0jE9vz8jppGpN34I2BDBSKc8QHxMzI= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR04MB0363: X-MS-Office365-Filtering-Correlation-Id: c5d38681-e5bb-47b6-1ab1-08d49ee51af3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:DM5PR04MB0363; X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0363; 3:LZ0s5tiSrOUeRGPjaw+jK8jjlKr+MNVvDdOAc88i6gI3WSCDpgztbIe5GFoHHGRKh/IUOEA1EM7FRf5PULA/AIcv1E+6bn5VDUprTvY/fYbxw/AMeiL13VAVgNwf9EVZ4nrNsVSyfz8vR334iii4teneMsQXppIKUBH9TCqVdvZ7jfpVLGL5z8yaCLBa4sAx7hhtYfS8tqU9KFZA99ck+1uTkFLnVl7tdX9wxGaWknsGpys2zxe0itrD/and1dBQ6zwFOtopp9HdNByxnQhX+UruFlFhw/s/GIolxAkZdwh9qMlUC1eI70nvRlqsxnq8ZoRh8xas+Q0B1ZbMcOMhXzxmqRvguiHly9wWR1DoTzyBhQECdnwiAaOsXmabaN46jJ67d0G/6ze+0cgVO+eT4WDDaJGQNa+L0o7NfSttKhIy5Zfct6sSk5jplaHJrDCLEOUr1tZS9we3aGpcBCVM7MzCJLVtlwfnrJ3krk1M+ebQq/uyCSyLIbz3SUDq1GjV X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0363; 25:jLOfKkatJU2Ohoydc3yTTYBBaaFCCf1JwLI7DRfTq+r5Y2spq1AM5cMV//G5noUn0pb2TPwYTKM/qmw+uoSPBm3BA0Zxe/ez8AsffTzChBovKUBY6TiGEzxVLQND5m3tZHoZvrd0AdzuiXY977guDUF1CyyXP2pNcfW42GvlWXAUMWx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wQuErjpCP0fUj/cLdjxyfIIMNxgICsIcVBHWKK1Fou1Agczb92zVqbTqUBSeInwAuEwWE7+PEgptn7j1DHP7oOQyjzgmBYS5FywTCwk6yk X-Microsoft-Antispam-PRVS: <DM5PR04MB03633BC0027BA677E8200ACF81E50@DM5PR04MB0363.namprd04.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(67672495146484)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(13016025)(13018025)(8121501046)(3002001)(93006095)(93004095)(10201501046)(6055026)(6041248)(20161123558100)(20161123560025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148); SRVR:DM5PR04MB0363; BCL:0; PCL:0; RULEID:; SRVR:DM5PR04MB0363; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR04MB0363; 4:2l13eROWz/MPu2IEN+XLC6KtZpAnCzkomInEa3nXVi?= =?us-ascii?Q?7DtbNLxru4O6tEV8VzWsTF9jKCbC5vgkkhbeOQEedndrJfRh3RhvYXBVbV4W?= =?us-ascii?Q?ev0VzPQ3/Ug6fS/fcbwyrNikbcybw2iEwuyYMajqHP6rsRFAuYFNm411vmEu?= =?us-ascii?Q?qQ8AIM35PAE/E8yGh9BOjNnjc1TNjNfaqnCcC7gI9vINL4VccPWpRuWG49h3?= =?us-ascii?Q?S43cQ994D+5NzpjxDmxlflvbMjTyERnXnWWYqMLjEO3h6aYWwZXSiEY4PQ6b?= =?us-ascii?Q?1GD511CDETqXlMhMD2nfmI1JHR//m8dmpotNCrVd2/4kTTgazHXxr8ckLtBC?= =?us-ascii?Q?XKQz4VuKXuCl/u+zAj8dBsm4gg5RuJgyGKNEBU/Yk+YDE5ogfWeCZMrCAM4d?= =?us-ascii?Q?0NLGbMfAz5BYvyF4m2o/ZfKKBeljDwg0yW/g6c+COq7MUazVUoSj6F3TYyt/?= =?us-ascii?Q?Mhbw4i1QO8lxfNeAluoDTtlgg9xo5W1MIupBKgOumP+GSmQFEdr8WlmB2ECQ?= =?us-ascii?Q?ocMEjFFM1cTd9yeem0Cbszdui5tZxsP8s//JwIJS6SWtRo/+a9CWaOvc+AYZ?= =?us-ascii?Q?Xgt9PKq49/tyimHc8M32KLWeI5y3CAIpSJ0bDZAs7FRBtexfbnB9677YISu2?= =?us-ascii?Q?H9zs8A15nTu617hwaE6YKZmteBxq3/1/M7UbPMMSIzRyg84lT6V8DZpGTIBM?= =?us-ascii?Q?B2h/e/2MG3ZsmdnPGanFiq9PFBZLPVLSayI6yvBYuwS+NZj5ZWDKnmM4PwFm?= =?us-ascii?Q?iBPxf2K8kIdwParKBcRZdGUxgbpwBK/5q2TY8PuVuctzdlbkAPnDGQvUOsFM?= =?us-ascii?Q?GtIr82oQV80A4/EwyK6KnmDS+3/ELNoGY6pxNootfS2G++1HQ1iqzRCu+SQ9?= =?us-ascii?Q?M3lLZdD6d5m1h8X5/I/XI0XxSbSicaplAtlBoxoEKjbU4GIMt+qlVy8Wp19F?= =?us-ascii?Q?Po7xpyQNf/A8BjZTDjH8W3gWHcGMtFUlk9nU0sEQ=3D=3D?= X-Forefront-PRVS: 031257FE13 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR04MB0363; 23:dTY+NsrCOO5aH6hIDC+FoCAzu52vMVqmUAStbqjXQ?= =?us-ascii?Q?M0ExDehqyWVc16g+KIXL4VDibUo+JabIigeUen8MFQ/eRTch9ifML8v09xBw?= =?us-ascii?Q?Nc0WlAD44mAZe37v9BWtiQ+7LBlFY2ASJaLwPmVHuZ0qEwFh+j5aLVuojFOs?= =?us-ascii?Q?ByWKoRRepWFYzDTqDPPQf9wr71OMATVde4cW9efbE/BXYt4FP1Wh8757cCiO?= =?us-ascii?Q?3J3E5Gn0Jrkpat64DQMMQxsmT+opxKCZ4BaZE3oOjxt0T8VAY4FgFK4ScEPr?= =?us-ascii?Q?zIu3OvDl5wB5oYQAbvWhxaZuB09IA5gvysUN+nZMoW9egwSynwT96x0nhHAC?= =?us-ascii?Q?avzyF+JzOLvrwjPEiAt/teRa89R1h6AGoteVDcbWBtLxXVn5/EmYjDyygio4?= =?us-ascii?Q?y9wjv0a/SAK9UGKHYCZPqljI0vCJVOGZ0/6IsPfKK0hGMT7fCm2c31PGjsBY?= =?us-ascii?Q?tvwmsQ7Kc7dozHf+fltK2eo78/HLbln1/kMuGIFrTRKrUKghJksiGyt0SU+X?= =?us-ascii?Q?CC0jvAoUu/KtwWXHu8a14jfKD5nVJOeIp+ckPcqKnnO7gcbjcs6k5IAdICKT?= =?us-ascii?Q?0JB1d2Ra8kBYhStvxuNFHUAGTp8mK90yqd/KJ1gqjpK47T+PDwbWtKXlj9Mr?= =?us-ascii?Q?Npa4PiFJzVUM0GxKpmTmudNVAEg9LoYQW2NCXNWYskMy8D2ssHtsfUaWtwTX?= =?us-ascii?Q?nvb9dcOMaxnmC9oXbyBTvWwZ+PetnX8gh/LgPVLKfedafi1FGlSSd4RQhzze?= =?us-ascii?Q?yqUaWC1w0+Ogkw0xzTcGMWlK4A2ef/JT/spdH2UASL8945Cfi6SrUwKv42gf?= =?us-ascii?Q?c23LuNG8SetToT3pXRXXef7EpPLGbhmawPHQzz23PPOSSEeYxBFz1CIj73k1?= =?us-ascii?Q?fOw27XyaYvUqTT2E71YgpqxrM3O8QhLIm41bpKh8TUJiPVtcltlrXzSUmgwQ?= =?us-ascii?Q?qP/WvEGHhZTvPKThwfGqueiJAsziMpJy6E7p43qqKyKDDSt+pErjXZwv4RhU?= =?us-ascii?Q?+iqWpuQU2aZi/Qf9VN28qzDcppbU4q2zRTaBU3Wp6ylrHYnync28vtPdiqwG?= =?us-ascii?Q?Iw4gLU=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0363; 6:49F0rR89kpl/qFyy9ji8nGhs12u7mabz9gebI+O7t6Cm6d2oo1hM8tYa6YnrW0IcWujKwBO+Isjb/cmT0IP1to8j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C3KzAyGUVdx+UfKXKWBHHyQ8YOtv56quwnRnPGt8mVpBlK20XFYizY1CIxe2/Rd/TEa8+YKg==; 20:6tFNrFfvgPlurCycl/5jfz7RNzpHSmS8XHwb+WlQ5N70BpN8+ZQf6KERwJk2b3nhESdZ6GhaSaitQ91qpIBxk1e7Kz1Hz+z2/aFOERVr+bfqjFh+K3/zxbMP/VoE7W6Ewttn4bFEXA0PzQbHd59HM+bph97jNG94XCYb0vQntEE= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2017 18:30:19.5421 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR04MB0363 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: <linux-block.vger.kernel.org> X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
Hi Bart, I think this is the wrong kind of check - while we do care about the size of the queue, we only do it as a side effect of the queue being able to handle REQ_OP_SCSI_IN/REQ_OP_SCSI_OUT commands. I think we'll need a flag for those in the queue instead. And btw, I didn't get your cover letter [0/18], did that get lost somewhere?
On Sun, 2017-05-21 at 08:32 +0200, Christoph Hellwig wrote: > And btw, I didn't get your cover letter [0/18], did that get lost > somewhere? Hello Christoph, Thanks for the review comments. The cover letter should have made it to at least the linux-scsi mailing list since it shows up in at least one archive of that mailing list: https://www.spinics.net/lists/linux-scsi/msg108940.html. Bart.
On Sun, May 21, 2017 at 02:33:05PM +0000, Bart Van Assche wrote: > Thanks for the review comments. The cover letter should have made it to at > least the linux-scsi mailing list since it shows up in at least one archive of > that mailing list: https://www.spinics.net/lists/linux-scsi/msg108940.html. Yes, I see it on the list now. But it's missing various Cc that the actual patches have, including that to me, which seems a bit broken.
diff --git a/block/bsg.c b/block/bsg.c index 6fd08544d77e..5ccecc9855ac 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -750,6 +750,12 @@ static struct bsg_device *bsg_add_device(struct inode *inode, #ifdef BSG_DEBUG unsigned char buf[32]; #endif + + if (blk_queue_cmd_size(rq) < sizeof(struct scsi_request)) { + WARN_ONCE(true, "Attempt to register a non-SCSI queue\n"); + return ERR_PTR(-EINVAL); + } + if (!blk_get_queue(rq)) return ERR_PTR(-ENXIO);
Since BSG only supports request queues for which struct scsi_request is the first member of their private request data, refuse to register block layer queues for which the private data is smaller than struct scsi_request. References: commit bd1599d931ca ("scsi_transport_sas: fix BSG ioctl memory corruption") References: commit 82ed4db499b8 ("block: split scsi_request out of struct request") Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Omar Sandoval <osandov@fb.com> Cc: Hannes Reinecke <hare@suse.com> Cc: linux-block@vger.kernel.org --- block/bsg.c | 6 ++++++ 1 file changed, 6 insertions(+)