From: Stefan Hajnoczi <stefanha@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
pbonzini@redhat.com, qemu-devel@nongnu.org,
qemu-block@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v7 2/3] block: Fix NULL deference for unaligned write if qiov is NULL
Date: Mon, 18 May 2015 11:00:27 +0100 [thread overview]
Message-ID: <20150518100027.GC2679@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1431522721-3266-3-git-send-email-famz@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 744 bytes --]
On Wed, May 13, 2015 at 01:12:00PM +0000, Fam Zheng wrote:
> For zero write, callers pass in NULL qiov (qemu-io "write -z" or
> scsi-disk "write same").
>
> Commit fc3959e466 fixed bdrv_co_write_zeroes which is the common case
> for this bug, but it still exists in bdrv_aio_write_zeroes. A simpler
> fix would be in bdrv_co_do_pwritev which is the NULL dereference point
> and covers both cases.
>
> So don't access it in bdrv_co_do_pwritev in this case, use three aligned
> writes.
>
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
> block/io.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 95 insertions(+), 2 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-05-18 10:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-13 13:11 [Qemu-devel] [PATCH v7 0/3] block: Fix unaligned bdrv_aio_write_zeroes Fam Zheng
2015-05-13 13:11 ` [Qemu-devel] [PATCH v7 1/3] Revert "block: Fix unaligned zero write" Fam Zheng
2015-05-13 13:12 ` [Qemu-devel] [PATCH v7 2/3] block: Fix NULL deference for unaligned write if qiov is NULL Fam Zheng
2015-05-18 10:00 ` Stefan Hajnoczi [this message]
2015-05-13 13:12 ` [Qemu-devel] [PATCH v7 3/3] qemu-iotests: Test unaligned sub-block zero write Fam Zheng
2015-05-18 10:01 ` [Qemu-devel] [PATCH v7 0/3] block: Fix unaligned bdrv_aio_write_zeroes Stefan Hajnoczi
2015-05-18 10:05 ` Stefan Hajnoczi
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=20150518100027.GC2679@stefanha-thinkpad.redhat.com \
--to=stefanha@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.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;
as well as URLs for NNTP newsgroup(s).