Skip to contentSkip to conversation

qcow2: don't permit changing encryption parameters

PATCH Applied Daniel P. Berrange 4 participants 4 messages Nov 3, 2017 – Nov 8, 2017 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qcow2: don't permit changing encryption parameters

Currently if trying to change encryption parameters on a qcow2 image, qemu-img will abort. We already explicitly check for attempt to change encrypt.format but missed other parameters like encrypt.key-secret. Rather than list each parameter, just blacklist changing of all parameters with a 'encrypt.' prefix.

---
 block/qcow2.c | 3 +++
 1 file changed, 3 insertions(+)
block/qcow2.c +3 -0
index 92cb9f9bfa..8edf8ac3c7 100644
@@ -4062,6 +4062,9 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
                 error_report("Changing the encryption format is not supported");
                 return -ENOTSUP;
             }
+        } else if (g_str_has_prefix(desc->name, "encrypt.")) {
+            error_report("Changing the encryption parameters is not supported");
+            return -ENOTSUP;
         } else if (!strcmp(desc->name, BLOCK_OPT_CLUSTER_SIZE)) {
             cluster_size = qemu_opt_get_size(opts, BLOCK_OPT_CLUSTER_SIZE,
                                              cluster_size);
Signature · 1 line
2.13.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Daniel P. Berrange

Currently if trying to change encryption parameters on a qcow2 image, qemu-img will abort. We already explicitly check for attempt to change encrypt.format but missed other parameters like encrypt.key-secret. Rather than list each parameter, just blacklist changing of all parameters with a 'encrypt.' prefix.

---
 block/qcow2.c | 3 +++
 1 file changed, 3 insertions(+)
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
Reviewed-by on v1 1/1
#2 lore raw
In reply to Daniel P. Berrange
Quoted 6 lines · Daniel P. Berrange

Currently if trying to change encryption parameters on a qcow2 image, qemu-img will abort. We already explicitly check for attempt to change encrypt.format but missed other parameters like encrypt.key-secret. Rather than list each parameter, just blacklist changing of all parameters with a 'encrypt.' prefix.

Berto

Applied
#3 lore raw
In reply to Daniel P. Berrange

Am 03.11.2017 um 15:39 hat Daniel P. Berrange geschrieben:

Quoted 6 lines

Currently if trying to change encryption parameters on a qcow2 image, qemu-img will abort. We already explicitly check for attempt to change encrypt.format but missed other parameters like encrypt.key-secret. Rather than list each parameter, just blacklist changing of all parameters with a 'encrypt.' prefix.

Thanks, applied to the block branch.

Kevin