[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 33/56] rbd: Fix use after free in qemu_rbd_set_keypai
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 33/56] rbd: Fix use after free in qemu_rbd_set_keypairs() error path |
Date: |
Fri, 9 Mar 2018 17:19:10 +0100 |
If we want to include the invalid option name in the error message, we
can't free the string earlier than that.
Cc: address@hidden
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
block/rbd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/rbd.c b/block/rbd.c
index c1275c1ec9..c1025c8493 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -268,13 +268,14 @@ static int qemu_rbd_set_keypairs(rados_t cluster, const
char *keypairs_json,
key = qstring_get_str(name);
ret = rados_conf_set(cluster, key, qstring_get_str(value));
- QDECREF(name);
QDECREF(value);
if (ret < 0) {
error_setg_errno(errp, -ret, "invalid conf option %s", key);
+ QDECREF(name);
ret = -EINVAL;
break;
}
+ QDECREF(name);
}
QDECREF(keypairs);
--
2.13.6
- [Qemu-block] [PULL 22/56] qcow2: Handle full/falloc preallocation in qcow2_co_create(), (continued)
- [Qemu-block] [PULL 22/56] qcow2: Handle full/falloc preallocation in qcow2_co_create(), Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 18/56] qcow2: Let qcow2_create() handle protocol layer, Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 21/56] qcow2: Use QCryptoBlockCreateOptions in qcow2_co_create(), Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 25/56] test-qemu-opts: Test qemu_opts_to_qdict_filtered(), Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 16/56] block/qapi: Add qcow2 create options to schema, Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 26/56] qdict: Introduce qdict_rename_keys(), Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 24/56] test-qemu-opts: Test qemu_opts_append(), Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 27/56] qcow2: Use visitor for options in qcow2_create(), Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 20/56] qcow2: Use BlockdevRef in qcow2_co_create(), Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 19/56] qcow2: Pass BlockdevCreateOptions to qcow2_co_create(), Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 33/56] rbd: Fix use after free in qemu_rbd_set_keypairs() error path,
Kevin Wolf <=
- [Qemu-block] [PULL 28/56] block: Make bdrv_is_whitelisted() public, Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 36/56] rbd: Pass BlockdevOptionsRbd to qemu_rbd_connect(), Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 37/56] rbd: Support .bdrv_co_create, Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 39/56] rbd: Use qemu_rbd_connect() in qemu_rbd_do_create(), Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 23/56] util: Add qemu_opts_to_qdict_filtered(), Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 29/56] block: x-blockdev-create QMP command, Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 31/56] file-win32: Support .bdrv_co_create, Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 32/56] gluster: Support .bdrv_co_create, Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 30/56] file-posix: Support .bdrv_co_create, Kevin Wolf, 2018/03/09
- [Qemu-block] [PULL 34/56] rbd: Factor out qemu_rbd_connect(), Kevin Wolf, 2018/03/09