From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932213AbdJWVIm (ORCPT ); Mon, 23 Oct 2017 17:08:42 -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 X-IronPort-AV: E=Sophos;i="5.43,424,1503331200"; d="scan'208";a="59332556" 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-Type: text/plain; charset="utf-8" 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v9NL8kko001001 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);