From patchwork Mon Oct 23 21:08:36 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: 10023081 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 EA86260381 for ; Mon, 23 Oct 2017 21:08:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD7152891E for ; Mon, 23 Oct 2017 21:08:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D23D828945; Mon, 23 Oct 2017 21:08:54 +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, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SBL 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 5C2532891E for ; Mon, 23 Oct 2017 21:08:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932195AbdJWVIl (ORCPT ); Mon, 23 Oct 2017 17:08:41 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:57466 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932192AbdJWVIi (ORCPT ); Mon, 23 Oct 2017 17:08:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1508792920; x=1540328920; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=MHkWWicWnZyaoSLzumiLeHXi/y9JzsJN/Hh4RTRn2/o=; b=DAdwR6euvsPyLdVJ7kjIGfTrDJfvvnTzKYz7ltn34t16F6efU83wYr+f fIBCSqGvEvF7VI0q3lydCFj1T6kS6QRV7dfI6T52QCcg1qVLPHuM0fjVC YHPKQTCFSe5dYXTMj5w3VmU3k+5OgqqTxWzIt2uPr97OiGCSLQHhB2Pcu tQcLso9bmPhVvJzhWDBbNXaiQUlCSsgD8EI4B/uULu7Wl+E4bNAy9K6C9 /zMToELgz2Qld+X33/w5kx4ZL/OnQfkJrSeEm+BxhrIq3duBHU9fwGJLW mrbjb8Dkj+JWMGX6cVCZ937SWxTu6zyFSGBCrIZqJzRgWArsf/5Bao6hi Q==; X-IronPort-AV: E=Sophos;i="5.43,424,1503331200"; d="scan'208";a="59332556" Received: from mail-by2nam01lp0178.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) ([216.32.181.178]) by ob1.hgst.iphmx.com with ESMTP; 24 Oct 2017 05:08:39 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=MHkWWicWnZyaoSLzumiLeHXi/y9JzsJN/Hh4RTRn2/o=; b=APHiXjr6i+gdqalmZU5tjwqk1QD8uR7BjYHeTjF4d1awyrDGgtZsafrv3DBR+fBiy/a+2lr176PesWQHcE/lvoCQww/gUyyUHmEax6NHaBGaPHxZEwyu9+L07JfRTqQz2+yxJA3+aTMYMamdPr59DeUoSGmh9trKlJpgBO3cxgg= Received: from CY1PR0401MB1536.namprd04.prod.outlook.com (10.163.19.154) by CY1PR0401MB1533.namprd04.prod.outlook.com (10.163.19.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Mon, 23 Oct 2017 21:08:37 +0000 Received: from CY1PR0401MB1536.namprd04.prod.outlook.com ([10.163.19.154]) by CY1PR0401MB1536.namprd04.prod.outlook.com ([10.163.19.154]) with mapi id 15.20.0156.007; Mon, 23 Oct 2017 21:08:37 +0000 From: Bart Van Assche To: "dann.frazier@canonical.com" CC: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" Subject: Re: [bug report] regression bisected to "block: Make most scsi_req_init() calls implicit" Thread-Topic: [bug report] regression bisected to "block: Make most scsi_req_init() calls implicit" Thread-Index: AQHTSfZgUnf0fdfQmkefWAffHMETGqLtYwUAgAQz14CAAFtjAA== Date: Mon, 23 Oct 2017 21:08:36 +0000 Message-ID: <1508792914.2634.6.camel@wdc.com> References: <20171020225420.utvoqmtwit2isalc@xps13.dannf> <1508542254.3029.24.camel@wdc.com> <20171023154129.iik3ic36i5fi7sqs@xps13.dannf> In-Reply-To: <20171023154129.iik3ic36i5fi7sqs@xps13.dannf> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bart.VanAssche@wdc.com; x-originating-ip: [147.75.100.161] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY1PR0401MB1533; 20:psIdkut2Aiw3Chebu11HKXHwnXpGJjlbcPbBQc8z6LEIByZ9QUZ3P4XPaV16PCqPmCeJYwQhGwSm3LDU9z905PwY9bWedZeoURnvqINEQ3wn5ZUfuuaHqFl+zv4ru3KHSHW3/bKzdzt9uF4eeVpcCKlgrrUZCteGjYBa3HUIb38= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: ffe2bd5a-6cdb-42db-dd8b-08d51a5a3a48 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199); SRVR:CY1PR0401MB1533; x-ms-traffictypediagnostic: CY1PR0401MB1533: wdcipoutbound: EOP-TRUE x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(3231020)(3002001)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0401MB1533; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0401MB1533; x-forefront-prvs: 046985391D x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39860400002)(346002)(376002)(189002)(51884002)(377424004)(199003)(24454002)(6246003)(2906002)(6506006)(2950100002)(6916009)(5660300001)(68736007)(3846002)(6436002)(229853002)(77096006)(102836003)(6486002)(6116002)(2900100001)(86362001)(76176999)(54356999)(50986999)(66066001)(97736004)(2501003)(4001150100001)(478600001)(33646002)(106356001)(2351001)(25786009)(7736002)(81156014)(8936002)(101416001)(36756003)(316002)(3660700001)(72206003)(4326008)(53936002)(5640700003)(81166006)(14454004)(6512007)(189998001)(305945005)(105586002)(8676002)(103116003)(99286003)(54906003)(3280700002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0401MB1533; H:CY1PR0401MB1536.namprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <3D898801CDA68D4F941830DCA991C951@namprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: ffe2bd5a-6cdb-42db-dd8b-08d51a5a3a48 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Oct 2017 21:08:36.7682 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0401MB1533 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 On Mon, 2017-10-23 at 09:41 -0600, dann frazier wrote: > (gdb) list *(sg_io+0x120) > 0xffff0000084e71a8 is in sg_io (./include/linux/uaccess.h:113). > 108 static inline unsigned long > 109 _copy_from_user(void *to, const void __user *from, unsigned long n) > 110 { > 111 unsigned long res = n; > 112 might_fault(); > 113 if (likely(access_ok(VERIFY_READ, from, n))) { > 114 kasan_check_write(to, n); > 115 res = raw_copy_from_user(to, from, n); > 116 } > 117 if (unlikely(res)) Hello Dann, Would it be possible to check whether the patch below is sufficient to fix this? Thanks, Bart. diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 34e17ee799be..15e11a519801 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -597,6 +597,7 @@ static const struct blk_mq_ops virtio_mq_ops = { .queue_rq = virtio_queue_rq, .complete = virtblk_request_done, .init_request = virtblk_init_request, + .initialize_rq_fn = scsi_initialize_rq, .map_queues = virtblk_map_queues, }; diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 0419c2298eab..14096f67eebb 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1722,6 +1722,8 @@ sg_start_req(Sg_request *srp, unsigned char *cmd) } req = scsi_req(rq); + WARN_ON_ONCE(!req->cmd); + if (hp->cmd_len > BLK_MAX_CDB) req->cmd = long_cmdp; memcpy(req->cmd, cmd, hp->cmd_len);