From patchwork Wed May 24 00:34:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9744789 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 8B2CF602A7 for ; Wed, 24 May 2017 00:36:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E4802885B for ; Wed, 24 May 2017 00:36:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72FD128867; Wed, 24 May 2017 00:36:22 +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 AFAF12885B for ; Wed, 24 May 2017 00:36:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968986AbdEXAgO (ORCPT ); Tue, 23 May 2017 20:36:14 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:7422 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760489AbdEXAgF (ORCPT ); Tue, 23 May 2017 20:36:05 -0400 X-IronPort-AV: E=Sophos;i="5.38,383,1491235200"; d="scan'208";a="19885602" Received: from mail-bn3nam01lp0178.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.178]) by ob1.hgst.iphmx.com with ESMTP; 24 May 2017 08:34:32 +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=dprvt0Abx3fqo0867hYArRh4yYoUT3UGTZBnKb4tRng=; b=ZGlx52fDRLURC/IfAayAo8Jkz3i/fP1FIbclbtvlhE5nisKinSlhTtMEVLRBHoEdlrw0bEZpOxtqWhRibA8lNQsJ6kjgxIzhswJlwUSY05KaOSUzq2tv7i1T79TMJeVqmxoasatgVxe8+ghCwOQXFUaK4ohM4y+xZ72VaOFhYv8= Received: from CO2PR04CA0115.namprd04.prod.outlook.com (10.165.95.17) by MWHPR04MB0513.namprd04.prod.outlook.com (10.173.49.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Wed, 24 May 2017 00:34:27 +0000 Received: from CO1NAM04FT011.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::203) by CO2PR04CA0115.outlook.office365.com (2603:10b6:104:7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Wed, 24 May 2017 00:34:27 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; 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 CO1NAM04FT011.mail.protection.outlook.com (10.152.90.158) 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; Wed, 24 May 2017 00:34:26 +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 88.43.45291.115D4295; Tue, 23 May 2017 17:34:26 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Tue, 23 May 2017 17:34:23 -0700 X-AuditID: 0ac94369-166ac9800001b0eb-f9-5924d511f8e6 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 55.A3.18148.F05D4295; Tue, 23 May 2017 17:34:23 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , James Bottomley CC: , , "Bart Van Assche" , "J . Bruce Fields" , Jeff Layton , Jens Axboe , Christoph Hellwig , Omar Sandoval , Hannes Reinecke , Subject: [PATCH 15/31] nfsd: Check private request size before submitting a SCSI request Date: Tue, 23 May 2017 17:34:04 -0700 Message-ID: <20170524003420.5381-16-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170524003420.5381-1-bart.vanassche@sandisk.com> References: <20170524003420.5381-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmkeLIzCtJLcpLzFFi42LhOum8SFfoqkqkwbwVPBb/9xxjs3gxJcpi wZu9bBYrVx9lstjYz2Hx4d8fRou9t7QtLhw4zWrRfX0Hm8Xy4/+YLA7fu8riwO0xsfkdu8eG qU1sHtMmnWLz2H2zgc3j49NbLB5r218ye6zfcpXF4/MmuQCOKC6blNSczLLUIn27BK6MhW8u Mxcs4KzYs66ZvYHxIXsXIyeHhICJxLR5+5m6GLk4hASWMkmsP7qKGcLZxiixp6OdCabq0axd LBCJjYwSpyccYgVJsAkYSXx7P5MFxBYRKJS4tK2DEaSIWeARk8TZjo9gCWGBCInXjxewgdgs AqoSC59uAIvzCthLHN+1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rdVrXr9Jvlp97IrvAJj5N5O0dd7Tpv4BFdPpk/ekmfzaPO7t0aqMRS nJFoqMVcVJwIABZsPITsAQAA MIME-Version: 1.0 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)(39400400002)(39410400002)(39840400002)(39450400003)(39850400002)(2980300002)(438002)(199003)(189002)(9170700003)(53936002)(33646002)(106466001)(38730400002)(50466002)(76176999)(6666003)(50986999)(8676002)(50226002)(81166006)(48376002)(356003)(8936002)(2950100002)(5660300001)(86362001)(1076002)(575784001)(47776003)(2906002)(5003940100001)(189998001)(36756003)(7416002)(478600001)(54906002)(72206003)(4326008)(305945005)(77096006); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR04MB0513; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT011; 1:iesrEfhianVHqEax4n33JBjMIvlKRUkFf8TQoiGsiFwWCEwXadgILFvSUDWUFmy8bjAWNXSapfKG27xfYM9RmMQf4pcHM4itxDHvwBm2P5JW8Ia1Mu/lop2M4VdEeFkQKv5SfafgSwlP+eBpw60F2nvBe6U+u55xWdjcbo7iBf3LwdmH01LJNbbbPEmsVShOXwqBR2juSTRhq9q3EBSnu4xAC/lPk7/UbvpPCOmt9vsMsMj/VR8ijbQp8B57/H5C0QbKgVdUln4FfFB0VL+G1YHEWVVZkB9tOW6zEC5ZFInhPBhClvFA3obX0+cdyGnu4WYRdWQ5H22PRgSBT4/sSIsXLTMsj9z2iYcRm92/EZ8X2HwTeaHbjXYZOW1cCR0jG0h1TUb+hMUaa7ZfS1RqH9mTot6iQAGofZDBrpVSQ7+LkglbDSSvT0viz+6AcAVQSowPQ2yNxeJGoUcpbVzorZAVUS1bmERRPHaZOdPQ/NhiUeqno3LWL0eXj5LaX9tQ89QF/mg2cRvrKg1vXIz1RafW9a2RRjqJRt7JQzVKqEI= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR04MB0513: X-MS-Office365-Filtering-Correlation-Id: 14dfea78-2c07-4678-7642-08d4a23ca289 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:MWHPR04MB0513; X-Microsoft-Exchange-Diagnostics: 1; MWHPR04MB0513; 3:+eO6+J0FFbyt4qLEYGYiTXsA0tt3bCcHzVhyG679+QwNSz/Hfu+0z+1+BDNLlExyuXtzsYSKSH2bHVg34ETaOMpqOGH3aeORR/F07Y653W8hEbKa1rMLLJRasLzps3gMgKuQc5ipAR1fyvv8u+CxfzyrE4+VwM4JM0j0tKaxBpoTXohkwoJ9K6paIAP0SAVCezEJqkn6tq1E6VQvkeL727PIAAnyHA0leyh0nhMfeWleEfdL7RlIQ17rDXcZOZDu0ZzRZoOvqAr0xfFHHKmCZ68iGTQKfZwl7wHISfwQpB5j0XMRwlCyiHcnYWtZ5lAtAO9z4P+y4r67PAKeynZefvm/1veOTuq0MtCvw/wONFPlaOrfp03LVs0I+if/2sZrutDTFYuaonkHhSKpwT/xmJ79o/O3bTL/cGVoym4Uhn0oJp0sq3aSSaoRU13YPgErNhpV9MVPoEMAGRH4TOcKdGpQ4Hfe/+Es8IaF9AAHPX4rDkdbWNzevFil+e975tX6 X-Microsoft-Exchange-Diagnostics: 1; MWHPR04MB0513; 25:YY3JLS47UU2Osho1l0Az+YqNcyQJKBpvyicLCE1cUee92JiaQCVqOKH/rn8dNb9bE2ChASrHH6HNL5rq6I4AEPyh+3Zv4f4QfsAJEwYR+wwR/lsV8jikSGTTEYatsEEpD9rq5lrAqqenW5sfJURpnnQswIOSRMs/WuDTgBhN4Wjx3e2N3LlxaU2rUhmRL30w4tjbzRWR0nDPK1a+p/KupeLVnJOOeyr3egdRw88UfwEkoiKeSHNU6Xe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x2ffFte/79PFaDq+Rk8WQc8dfiYGi X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(67672495146484)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(13018025)(13016025)(5005006)(10201501046)(3002001)(93006095)(93004095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148); SRVR:MWHPR04MB0513; BCL:0; PCL:0; RULEID:; SRVR:MWHPR04MB0513; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR04MB0513; 4:6nbOdQYiw1/ekU8x7Mo3iI8WgUpfreV6YR2owOTSbz?= =?us-ascii?Q?anbYvxqlIvZuy4T1/xrpzWAAzT2wIAiWGJXx/ebtKGHZyJdZS8hSV+RAVioq?= =?us-ascii?Q?M8HLHjKmkQhyC4bzNvYeclFSdU4ksuviqiS10XdIqkviktXPtYtZifYHq8YI?= =?us-ascii?Q?l5jKjtFM8HJanx6+r/p30YmO3eLlt+XiMgCDw/XBm6j2ZqqEBQcoouelEGS1?= =?us-ascii?Q?CNypgFc3fUWkn5Qd5HebW0QLGBnFjQDfrkEjXy3Okvdwmoa+IF87iBv/d4Z2?= =?us-ascii?Q?PpQKuEicYiEiv1DNQt0ltuetHSC3ih1HfYUrzR8rYTxLVADSEgJDOvuEImeo?= =?us-ascii?Q?atG9tfLDIAka0DiZSA9Oy0FOdBFEcDfOB0N1vtfw1S3lux5iucnyeLFUMnDk?= =?us-ascii?Q?+j1wLFf9gGg37FA8IN7c8iihE82Dq7t2b+iNYcgHt7UqoWBMOG51fDA8FaG0?= =?us-ascii?Q?zxe4zHobWWHEgQEH8Ht6/rhvaM/ptuTTSzNglx04bPtmzD9TntaP6MZGJhJW?= =?us-ascii?Q?XNyafThQhGzic9j8JPRhvE2+GK75eLq49yBt+BQOndfZ4dibiRw+ZITNWM3f?= =?us-ascii?Q?IF1pC9nacR6PDd6uuQmz9FQUUcOvvcyxyUIULGR5V6PWZOWLveype65JkPXp?= =?us-ascii?Q?Z2wC/z5iD+jVaQwIMkZ6kQfpukT8CzB5/1eqf641KvA3pm9EZVX/Q9ws/Ody?= =?us-ascii?Q?/fBt4QtOWmZIqQKcYRvTsvRer9SSQdV5klPpKDQ5XyadJtzbBNXQ/aamMbfJ?= =?us-ascii?Q?1rjbznpDo9XwCBPZoAdiFHH9eBeryJoMRREFU6Q9OMWSBAIqifpgARP2mtay?= =?us-ascii?Q?YJWW8O03cShJX12V/kBj/RQRxbq7eghK8y6Ej5e99Zj64tGW9EL8NU8W8vpk?= =?us-ascii?Q?WXbZentj07h6ruGwbr6Vx4CCyWKnOm4ekZrayk51wBAJs+tZ/xjn/sag84fo?= =?us-ascii?Q?1SEYIGctO3pE34Y58525N2zRmj8uYlNn0ASU46NQ=3D=3D?= X-Forefront-PRVS: 031763BCAF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR04MB0513; 23:Vnix8GYKb8b4cCq/OMyVmeJNs8Jle/dvb1UpyUEGI?= =?us-ascii?Q?4Idub3ZzO+5VrkNf2jAhHCSEow9erCK5KiMHKvjQP4lUngBacV8tCQlPBnIi?= =?us-ascii?Q?LYSbKFBqkOkySKxd28nR1KziUiMyAfi9shmCHIoilGUG93xlGcm01zaZ6ogn?= =?us-ascii?Q?wqeQoeF/xiVnq830dl3LQcHeFO4AnFsjeB7ZjcmDaCVt9JG6hl+/lyytSJEI?= =?us-ascii?Q?BSVb6S4LuxPItZjO4MeVXNE1i9fqrfRgazCZ3GtsfhUBkNKATJJTqvFRqHc2?= =?us-ascii?Q?SRJaAUHoagpD7gR3h3OY3En9Olrj6X7F+rfpO3ApaJ2zL5tPDNpda1/BNzlM?= =?us-ascii?Q?hxze85IqLRRTrdCN4nbKXAiKaUYJPs9L6HjEWd4EGAUyPVWuMU6cYhoHITJn?= =?us-ascii?Q?GCJJXrw7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67yOGqPDXDZV3N3RONmHL9345zWe+TB4nSZqCGUnFj7iusjpHtGGO0CYFRNIDPkEpM4keg7qGaIKLHi2Fc1iTEze6QmsNEVr6oImZwhPDLTSuPkeqhzanQiwLILN1AFLJp3qsE7v7ho4lcobh9EsWdn/qUqtae5oZtR4D+gGQ= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2017 00:34:26.8175 (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: MWHPR04MB0513 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since using scsi_req() is only allowed against request queues for which struct scsi_request is the first member of their private request data, refuse to submit SCSI commands against a queue for which this is not the case. References: commit 82ed4db499b8 ("block: split scsi_request out of struct request") Signed-off-by: Bart Van Assche Cc: J. Bruce Fields Cc: Jeff Layton Cc: Jens Axboe Cc: Christoph Hellwig Cc: Omar Sandoval Cc: Hannes Reinecke Cc: linux-nfs@vger.kernel.org Cc: linux-block@vger.kernel.org Reviewed-by: Hannes Reinecke --- fs/nfsd/blocklayout.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c index fb5213afc854..9ca0ca5efbc8 100644 --- a/fs/nfsd/blocklayout.c +++ b/fs/nfsd/blocklayout.c @@ -219,6 +219,9 @@ static int nfsd4_scsi_identify_device(struct block_device *bdev, u8 *buf, *d, type, assoc; int error; + if (WARN_ON_ONCE(!blk_queue_scsi_sup(q))) + return -EINVAL; + buf = kzalloc(bufflen, GFP_KERNEL); if (!buf) return -ENOMEM;