From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>
Subject: [Qemu-devel] [PATCH 0/2] vmdk: Fix possible segfault with non-VMDK backing
Date: Mon, 2 Jul 2018 23:07:19 +0200 [thread overview]
Message-ID: <20180702210721.4847-1-mreitz@redhat.com> (raw)
The VMDK driver assumes that its backing file is always a VMDK file,
too, because it verifies that when creating the overlay. However, that
verification means nothing at runtime, and consequently you can assign
non-VMDK backing files to a VMDK node. This then breaks because the
driver accesses the backing node as a VMDK node to read its supposed CID
to compare it with the overlay's parentCID entry -- which usually fails,
either in a benign way (we read from a garbage offset, and then we read
garbage or get a read error straight away), or we get a segfault
(because the backing node does not have a respective file child).
Anyway, we just shouldn't do it and instead check whether the backing
file is a VMDK node before treating it like one.
(This fixes
http://lists.nongnu.org/archive/html/qemu-block/2018-06/msg01268.html)
Max Reitz (2):
vmdk: Fix possible segfault with non-VMDK backing
iotests: Add VMDK backing file correlation test
block/vmdk.c | 6 ++
tests/qemu-iotests/225 | 132 +++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/225.out | 24 +++++++
tests/qemu-iotests/group | 1 +
4 files changed, 163 insertions(+)
create mode 100755 tests/qemu-iotests/225
create mode 100644 tests/qemu-iotests/225.out
--
2.17.1
next reply other threads:[~2018-07-02 21:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-02 21:07 Max Reitz [this message]
2018-07-02 21:07 ` [Qemu-devel] [PATCH 1/2] vmdk: Fix possible segfault with non-VMDK backing Max Reitz
2018-07-03 1:20 ` Fam Zheng
2018-07-02 21:07 ` [Qemu-devel] [PATCH 2/2] iotests: Add VMDK backing file correlation test Max Reitz
2018-07-09 15:34 ` [Qemu-devel] [PATCH 0/2] vmdk: Fix possible segfault with non-VMDK backing Max Reitz
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=20180702210721.4847-1-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@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).