From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "dann.frazier@canonical.com" <dann.frazier@canonical.com>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [bug report] regression bisected to "block: Make most scsi_req_init() calls implicit"
Date: Mon, 23 Oct 2017 21:08:36 +0000 [thread overview]
Message-ID: <1508792914.2634.6.camel@wdc.com> (raw)
In-Reply-To: <20171023154129.iik3ic36i5fi7sqs@xps13.dannf>
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);
next prev parent reply other threads:[~2017-10-23 21:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-20 22:54 dann frazier
2017-10-20 23:30 ` Bart Van Assche
2017-10-23 15:41 ` dann frazier
2017-10-23 21:08 ` Bart Van Assche [this message]
2017-10-24 1:47 ` dann frazier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1508792914.2634.6.camel@wdc.com \
--to=bart.vanassche@wdc.com \
--cc=dann.frazier@canonical.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®