From patchwork Tue Apr 11 20:58:37 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: 9676067 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 0E793600CB for ; Tue, 11 Apr 2017 20:59:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0363626E96 for ; Tue, 11 Apr 2017 20:59:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC2C32857B; Tue, 11 Apr 2017 20:59:01 +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=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 83B4D26E96 for ; Tue, 11 Apr 2017 20:59:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753619AbdDKU7A (ORCPT ); Tue, 11 Apr 2017 16:59:00 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:57683 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753584AbdDKU66 (ORCPT ); Tue, 11 Apr 2017 16:58:58 -0400 X-IronPort-AV: E=Sophos;i="5.37,187,1488816000"; d="scan'208";a="10324664" Received: from mail-bl2nam02lp0079.outbound.protection.outlook.com (HELO NAM02-BL2-obe.outbound.protection.outlook.com) ([207.46.163.79]) by ob1.hgst.iphmx.com with ESMTP; 12 Apr 2017 04:58:52 +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=buNHoHGApqSwTEJffhHkM1VmX9hPyr5HjSXdT7shX3I=; b=ZG53HDuEcvFCz5eEo5iiQDV2LdsPH8pui1c7QtMKORoGhGu1RhlEstadiZkrvP7/u1+sIW711g+6f5aOTYh7KFpYWCKdTzVgcnfcoPLZhyi7ZzftQTQ33yj0plFCXSV4/KThHf1qOs9bpdLcOuhXHJF9QZXk8WZJuQGBvzORpLo= Received: from BY2PR04CA026.namprd04.prod.outlook.com (10.141.249.144) by BL2PR04MB099.namprd04.prod.outlook.com (10.255.231.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17; Tue, 11 Apr 2017 20:58:48 +0000 Received: from SN1NAM04FT058.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4c::203) by BY2PR04CA026.outlook.office365.com (2a01:111:e400:2c5e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.10 via Frontend Transport; Tue, 11 Apr 2017 20:58:47 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) 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.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by SN1NAM04FT058.mail.protection.outlook.com (10.152.89.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1019.14 via Frontend Transport; Tue, 11 Apr 2017 20:58:47 +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 37.F1.19026.6834DE85; Tue, 11 Apr 2017 13:58:46 -0700 (PDT) Received: from milsmgip11.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, 11 Apr 2017 13:58:44 -0700 X-AuditID: 0ac94371-41ba798000004a52-c5-58ed4386505d Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 37.2D.11415.4834DE85; Tue, 11 Apr 2017 13:58:44 -0700 (PDT) From: Bart Van Assche To: Jens Axboe CC: , Bart Van Assche , Omar Sandoval , Hannes Reinecke Subject: [PATCH 1/6] blk-mq: Do not invoke queue operations on a dead queue Date: Tue, 11 Apr 2017 13:58:37 -0700 Message-ID: <20170411205842.28137-2-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170411205842.28137-1-bart.vanassche@sandisk.com> References: <20170411205842.28137-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCLMWRmVeSWpSXmKPExsXCddJ5kW6b89sIg33XdC1W3+1ns1jwZi+b xd5b2haH711lcWDxmNj8jt3j8tlSj/VbrrJ4fN4kF8ASxWWTkpqTWZZapG+XwJXx7KtfwWLO ig2zpjE1MF5k72Lk5JAQMJH48GUxaxcjF4eQwFImidtXzjNBONsYJf5NaWCEqWpt72aBSGxm lFi4YDILSIJNwEji2/uZYLaIgIJEz++VbCBFzAJTGCWmnfsD1i0s4C2xcOFksH0sAqoSx97/ ZAaxeQXsJVZPf8EKsUFeYtGmGWCDOAUcJPov/wKzhYBqVhy9wgJR849F4uN+OYheQYmTM5+A xZkFJCQOvnjBDFGvLnFyyXymCYxCs5CUzUJStoCRaRWjWG5mTnFuemqBoYlecWJeSmZxtl5y fu4mRkhYF+5gfH3b+xCjAAejEg/vgnNvIoRYE8uKK3MPMUpwMCuJ8M4yfhshxJuSWFmVWpQf X1Sak1p8iFGag0VJnDdLdmqEkEB6YklqdmpqQWoRTJaJg1OqgVGFy+nMREWVSI8bLXHPF86o /+Xr0LRi6w3zAKfEtQ8ltF8Ib5xtOFnHx6C3cMlbjgmiVb83NiyRmRXH7dkS18xjmSQZv+q1 bmzv5A2NJ36yu7zalvuvutz5c/KEKS5W2WdFps89vO997aJv9yZ7rawSYvhy+1HoKv2zSSn/ epIzWF4qea+dPFWJpTgj0VCLuag4EQCCM05QZwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMJMWRmVeSWpSXmKPExsXCtZEjRbfF+W2Ewdnz5har7/azWRz82cZo seDNXjaLvbe0LQ7fu8riwOoxsfkdu8fls6Ue09acZ/JYv+Uqi8fnTXIBrFFcNimpOZllqUX6 dglcGc+++hUs5qzYMGsaUwPjRfYuRk4OCQETidb2bhYQW0hgI6PEisUZIDabgJHEt/czweIi AgoSPb9XsnUxcnEwC0xhlPiydxMbSEJYwFti4cLJYINYBFQljr3/yQxi8wrYS2ybcIcZYoG8 xKJNM8AGcQo4SPRf/gW1zF5ixdErLBMYuRcwMqxiFMvNzCnOTc8sMDTUK07MS8ksztZLzs/d xAgOBs7IHYxPJ5ofYmTi4JRqYMyN4k22mdR0i/uCc9SewF6DsGADBSsDmyl7pmqeEjr/sGKh zAn7PYuCvLZt5LrT8jli2nztmIYvGx5fKvrxvFznzwH23AffH4jbz/NmqnK0tFlx8On80POd Mar53NzbLAO175+9p3kvQ/3Rz3drZvow1F2YH3FLkcdKcp5Ij2OQ3uJ5HxoLRJVYijMSDbWY i4oTAZ5ic722AQAA MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39850400002)(39400400002)(39840400002)(39450400003)(39860400002)(39410400002)(2980300002)(438002)(199003)(189002)(9170700003)(50986999)(54906002)(76176999)(77096006)(38730400002)(33646002)(1076002)(47776003)(110136004)(2906002)(50226002)(53936002)(86362001)(36756003)(6916009)(356003)(2950100002)(6666003)(8676002)(5003940100001)(4326008)(8936002)(81166006)(5660300001)(106466001)(305945005)(50466002)(48376002)(189998001); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR04MB099; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM04FT058; 1:Uze3HjFQhZ98p+RRjDSEAVLoPjGxxLwosTn9NjER4aFeVj1EGctE4nSyujT3D+w+NzVBBVyQy7XYYBB99L1HtPIatG/6a7owffzzLZ78h1swPy7y+EUu10fsBiUpDyU9Gw+gYSVK8tyPVoSaSZ3z3L/DpwF7G1C3VrRrRYgR+U9y97YMLauyMGGtIvqEQNq7m5Qw0KhYd7WIMYWr0jU+mjyt7vS/Bwb0OtRoHyYEJTaFNIaOXdLU1jBTegtDOFaEbdJyWqQuDSwxsYl7Q9lRXCkxuh6FeUNlIZdOmc5292cZD6qKd1ESYZACZUEyYEbSYZJg98HzrdBmVQbZNXzAxapmRusS6LR3SwRfxMc1DAaMNXGr+QxQFLtnx/mKWXIhaf6YqFagS8WdVEboJKMawvwVezD652/NoH+Slono0rqlY0jTHy3MTtcm0KX+fpVs17+MLnGU3nSOo0i+UAIn2p/ddAEaHgsSJLn2844uUj5xbbttKyHsOQyobNVjsbeFXYvgoLzurGTGYQmpAfuQk9GDwfWOg0cbVkja0gtDUSc= X-MS-Office365-Filtering-Correlation-Id: 1e4f249d-90e9-4941-a58d-08d4811d8c69 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:BL2PR04MB099; X-Microsoft-Exchange-Diagn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hoJz3rnha1VHHKsTFInP/WJU0TJsPXeyvFsRJLXznLEfbTHS18M3dB9o5IfXKsDbltg2sHFu1tTZis+0ttjK3Q3QoQdGbwnGJhBkrvkL0rsmrF1gCgiPIzNvnAuXmfhISC8u9BCD5s4r1+JbcAXDt/xS2Q4AH5FZzI5mPlSSeVEEz1x/UlouresSKX8L8D6tOFFQp5v2n0HEPXMUfkr4VBeO/6Kh7BZpXmhZqIhdNvSjPeukLGYOk9fNbf82qK+zxtYE+EaxQAWEsU+dB1Cw= WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB099; 20:cibnj/dv0wJHYG1PvotaEKjOoZzKugy5sldhhcBByIzMv2FutPwCNSxGEnxGLlDAf32LQwJ3sLPm1GVMpjnt+GECGviW709nLuDR1HSjGoHnMOfOXyprAsBP/eTbSEQK13IWjQHeovXgvXS9rJEq64wkpQRHWc6Bm4Vn/e7RqDGXJJ/fC8CnYLW2j2TiBvT04o1brNRzGbD8eMgYtj6BHeu9AwOWtqQD82wjtWD4z0T606huCdyEv30rq6rt1mEV3dOD+9HxaBIAwD5tIUMAdlt5oKpf8F1oLT5o2tSq4d1biwOdDTsPHqI6pY1AlQCBahSP/9beLvqbNBa/WBeXM1KXNHild4fczBeso2MqPUFOqzildXgK9MYxh0AjGC6sHtn9xNaAB0Ds5fMilpECUnx5gIVvViGO0eNx2tVQE3nZaHi27otFeyJgEn7utUJeZlHY/cLuY8HpHrQmUh8q8vwaCP44JSiSSas9pzo8CA+JVq8PCHVvQyeigs6t9GSi X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13016025)(13018025)(8121501046)(5005006)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(20161123555025)(6072148); SRVR:BL2PR04MB099; BCL:0; PCL:0; RULEID:; SRVR:BL2PR04MB099; X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB099; 4:lbDt/B7WCX+RirUsUByDj7juib26FIA6kuVHXA8cJOJp77Pfz/Lu94HBVM8x3UI1AHzYhwWjFHAGi3so2vSod06gDDHF14ey7csnLpeSdY4KANfPK0Vtz8ADDpMmyZy+Z8ANHVQu4OZ+y5TXf3pcogyfGxoOnUnIuBv26PAovvyWWj9qjxzx6HyN+I2NTdBw6+Q+u01XwycHkTmn6BDdzRSOInl+XUOdGsCAtXLfJzeIIsNcWLk+7a/0lvOzwq+d3N1F3LlCsyPVpvYs30md94YOTy8k7Y9nihnolU98VTMyP/SoVKdWZxsFtUhjeNGbZH4K5tGLMruW+tE1SZqjaer4GfYavBmnFfjzfi4sHzsZu8KWvTQP1S8fjyyLzqVvHhpYyXteFHN/S+8Qxm37Kwa5j/YAxjxQV8F6gEZfOCNxTg2zV1jgfh0sF04WmJhykCn5kOqTeOeWv9bR15eM8SvCwk4ceDj1jsdsIqWnQFejDS+M+mQFIbMjv1QuSwlTdjd7+R6YWjPQIo19DczHQP2XpTitRlhFIL026Kr4YdjEcv1B8JBZJby1MolgF4ZIBlhRrkfVy/YvcRLCAlI92k6w2inwTzaPLtTT+WR9YS7FZtPGFrOSLc+ZHcwpkPHZxL97h/D4aliS+SoAGzyh/y4Wpe+4+Lrq4VR8XbY6WlK+ZtX/qz22IlGAHwu+kCECSi3y29xnQz6jUviwT54C3/EyK+/ATSWlGMGFx4bDIxvC38rhUwsX4RKgw1uHChVRauVnDdX9rqmF5pqRTsx4Zmdjt43WMwqtjSdcSlzhOalT169chYPY+z1tnD4PmKPS/UoNsrHBIBxXIhb01P+djHgCoZJdQ5k0tvD3myiKKfQ= X-Forefront-PRVS: 0274272F87 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR04MB099; 23:53sLabHnKdOYRbY59Ih19Fv05D4APvjuw+WUaPVrfB?= =?us-ascii?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m2hqoZ3e3?= =?us-ascii?Q?nNtD0L6qtjCvQAKOL1GVDRu3mysLs5e8CAZeytkFnxhxlpo8fyAYHdirk2vT?= =?us-ascii?Q?GKw4HByRU7rfiBwjFkjtXsMYVz1YasUj4rPZSB+ER7SQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB099; 6:arsSG2gNBLf/5cZLS2hTwbPCu8b5qnOFN/Wt6x5bbFmA4bsVy58jhuiY1m/P/AAcDz0eHmjESzZRscDotN4XExnJW8JMigLK+4iidAfoyDyTfS9n1tJI5RdbzeCCdj4kQ+gDYDvq9u+Asd12hqFz1liFjx47N+wZPqvNrc47b/pE3+MAfhqhLTQXq764E3j8dOLazir5ezSZWS76Rxi6BtqUe82jqUe3MROjFUrJhv1smWIR79i/SW9WmJTUnVu5pLOz8LBgM5bML3pJCOwvM224gYxl8rnPJtdSvBIgrpidoGNG+0YKP1TJUGfHtpAZoQF/uU5iw4p8Nol8sStgKLn4w4uiZZEtk/zBg17VUC8qUW6A0U14hAGxz0BPeYr9yodo9WLv+8St8AVNPBvcN1rDBoVdofktac7G1LWnZxOWdRaVKl2mqUpMDgtVHookvn9w4qYLxt6WRAt3zG5yLfxkxhbdzzwZEaS7AI+LUDk=; 5:uV/Wo0F1j1nKjIsuLZm0aRKb0HWfGHxVTUfU4IDC4kqrNeByBjgav+l51479s5Rdi4gbjI1RUal3WZexK4PvYz1X69yd/i7+BTY8biYfcnH0Rwqmr6n0JYIBTMbU8qIj507Wgz6Y88o7ABOdNkk5wg==; 24:ciTNpVGgPpQ01clJ2cOoHWQyagIZqg5iM9e2kA0AZrlYLAf+VMx5vrzhLm+DrKI+MP/mYWRvSrKZ9UMxWX43uVBiV2AlyxdQfFEMlSVioVY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB099; 7:98HJQqzOs7w4wLGekJ6Z89Lkv4gGl3c9UIT2sFuFt7ZRXLzUP/16keA/+Wih+VbWA7ej5CKBqNTUo9Szc4uUWALke6HnQd1jCJtF4e68ZdJEFSmTstaNrzylv2sA9QaqyTc5lZ8tB6WaTr8H5IVlTszmk0ilm9UpXi3fr/OqPI6M8HZHM8PKelzkfeLj7ndq4K3a6vLq+DCKkm1XkPsCUxj2ECxvaDxTzJWDaXzzJwPjTDhNhTEb6kKjoHA4qWVt2mwPqumlUP7tCJ8Jp+EW/nlCJZHrTsD6z5bDljcccLhL8jrQX5uMau/rC22HvSBDHEVERnt5hLCFycArLRuBcQ==; 20:iB9xUC3n7FhIy0VvkRaPr6RxwJc0UAqaS88Rcy34Al1c5TvucCigQ1wDG+LHLEV3ea6wHTmz7Wp2zP5pGqjbpNh67ofXiFu3TT9ufCjAsXNFdTUCs1l4u5DqQ6QK6kAGbSahyRLV64aM3Pm8OtGEp38qUBwUEyDfpCbJzPtNdOA= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2017 20:58:47.1788 (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.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR04MB099 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The blk-mq debugfs attributes are removed after blk_cleanup_queue() has finished. Since running a queue after a queue has entered the "dead" state is not allowed, disallow this. This patch avoids that an attempt to run a dead queue triggers a kernel crash. Signed-off-by: Bart Van Assche Cc: Omar Sandoval Cc: Hannes Reinecke --- block/blk-mq-debugfs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index df9b688b877c..a1ce823578c7 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -111,6 +111,14 @@ static ssize_t blk_queue_flags_store(struct file *file, const char __user *ubuf, struct request_queue *q = file_inode(file)->i_private; char op[16] = { }, *s; + /* + * The debugfs attributes are removed after blk_cleanup_queue() has + * called blk_mq_free_queue(). Return if QUEUE_FLAG_DEAD has been set + * to avoid triggering a use-after-free. + */ + if (blk_queue_dead(q)) + return -ENOENT; + len = min(len, sizeof(op) - 1); if (copy_from_user(op, ubuf, len)) return -EFAULT;