From: Eric Blake <eblake@redhat.com>
To: Connor Kuehl <ckuehl@redhat.com>, kwolf@redhat.com, mreitz@redhat.com
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH] block: Raise an error when backing file parameter is an empty string
Date: Wed, 17 Jun 2020 14:11:28 -0500 [thread overview]
Message-ID: <1827f63d-4f8d-1a45-476e-ff2d5a50a53b@redhat.com> (raw)
In-Reply-To: <20200617182725.951119-1-ckuehl@redhat.com>
On 6/17/20 1:27 PM, Connor Kuehl wrote:
> Providing an empty string for the backing file parameter like so:
>
> qemu-img create -f qcow2 -b '' /tmp/foo
>
> allows the flow of control to reach and subsequently fail an assert
> statement because passing an empty string to
>
> bdrv_get_full_backing_filename_from_filename()
>
> simply results in NULL being returned without an error being raised.
>
> To fix this, let's check for an empty string when getting the value from
> the opts list.
>
> Reported-by: Attila Fazekas <afazekas@redhat.com>
> Fixes: https://bugzilla.redhat.com/1809553
> Signed-off-by: Connor Kuehl <ckuehl@redhat.com>
> ---
> block.c | 4 ++++
> tests/qemu-iotests/298 | 47 ++++++++++++++++++++++++++++++++++++++
> tests/qemu-iotests/298.out | 5 ++++
> tests/qemu-iotests/group | 1 +
> 4 files changed, 57 insertions(+)
> create mode 100755 tests/qemu-iotests/298
> create mode 100644 tests/qemu-iotests/298.out
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2020-06-17 19:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-17 18:27 [PATCH] block: Raise an error when backing file parameter is an empty string Connor Kuehl
2020-06-17 18:50 ` no-reply
2020-06-17 19:11 ` Eric Blake [this message]
2020-06-18 10:48 ` Alberto Garcia
2020-07-01 22:42 ` Connor Kuehl
2020-07-10 15:57 ` Connor Kuehl
2020-07-13 10:10 ` 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=1827f63d-4f8d-1a45-476e-ff2d5a50a53b@redhat.com \
--to=eblake@redhat.com \
--cc=ckuehl@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@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).