[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v2 18/36] rbd: Fix use after free in qemu_rbd_set_ke
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PATCH v2 18/36] rbd: Fix use after free in qemu_rbd_set_keypairs() error path |
Date: |
Wed, 21 Feb 2018 14:53:46 +0100 |
If we want to include the invalid option name in the error message, we
can't free the string earlier than that.
Signed-off-by: Kevin Wolf <address@hidden>
---
block/rbd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/rbd.c b/block/rbd.c
index 8474b0ba11..27fa11b473 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
- Re: [Qemu-block] [PATCH v2 13/36] block: Make bdrv_is_whitelisted() public, (continued)
- [Qemu-block] [PATCH v2 14/36] block: x-blockdev-create QMP command, Kevin Wolf, 2018/02/21
- [Qemu-block] [PATCH v2 15/36] file-posix: Support .bdrv_co_create, Kevin Wolf, 2018/02/21
- [Qemu-block] [PATCH v2 17/36] gluster: Support .bdrv_co_create, Kevin Wolf, 2018/02/21
- [Qemu-block] [PATCH v2 18/36] rbd: Fix use after free in qemu_rbd_set_keypairs() error path,
Kevin Wolf <=
- [Qemu-block] [PATCH v2 20/36] rbd: Remove non-schema options from runtime_opts, Kevin Wolf, 2018/02/21
- [Qemu-block] [PATCH v2 19/36] rbd: Factor out qemu_rbd_connect(), Kevin Wolf, 2018/02/21
- [Qemu-block] [PATCH v2 16/36] file-win32: Support .bdrv_co_create, Kevin Wolf, 2018/02/21