From: Max Reitz <mreitz@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] qcow2: fail if encryption opts are provided to non-encrypted image
Date: Fri, 22 Feb 2019 20:17:40 +0100 [thread overview]
Message-ID: <f70b06ee-d5db-f1cc-35f4-5e34226b429c@redhat.com> (raw)
In-Reply-To: <20190219125044.5416-2-berrange@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1191 bytes --]
On 19.02.19 13:50, Daniel P. Berrangé wrote:
> If the qcow2 image does not have any encryption method specified in its
> header, the user should not be providing any encryption options when
> opening it. We already detect this if the user had set "encrypt.format"
> but this field is optional so must consider any "encrypt.*" option to be
> an error.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> block/qcow2.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 65a54c9ac6..ecc577175f 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -1045,6 +1045,12 @@ static int qcow2_update_options_prepare(BlockDriverState *bs,
> ret = -EINVAL;
> goto fail;
> }
> + if (encryptopts && qdict_size(encryptopts)) {
> + error_setg(errp, "No encryption in image header, but encryption "
> + "options provided");
> + ret = -EINVAL;
> + goto fail;
> + }
Doesn't this make the block right before this one a bit superfluous?
Max
> break;
>
> case QCOW_CRYPT_AES:
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-02-22 19:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-19 12:50 [Qemu-devel] [PATCH 0/2] qcow2: improve error handling when luks creation fails Daniel P. Berrangé
2019-02-19 12:50 ` [Qemu-devel] [PATCH 1/2] qcow2: fail if encryption opts are provided to non-encrypted image Daniel P. Berrangé
2019-02-19 15:56 ` Eric Blake
2019-02-22 19:17 ` Max Reitz [this message]
2019-02-25 10:36 ` Daniel P. Berrangé
2019-02-19 12:50 ` [Qemu-devel] [PATCH 2/2] qcow2: mark image as corrupt if failing during create Daniel P. Berrangé
2019-02-19 16:11 ` Eric Blake
2019-02-19 16:19 ` Daniel P. Berrangé
2019-02-22 19:21 ` Max Reitz
2019-02-25 10:40 ` Daniel P. Berrangé
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=f70b06ee-d5db-f1cc-35f4-5e34226b429c@redhat.com \
--to=mreitz@redhat.com \
--cc=berrange@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).