[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 7/7] block/nbd: NBDReply is used being uninit
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v4 7/7] block/nbd: NBDReply is used being uninitialized |
Date: |
Fri, 19 Jul 2019 09:34:30 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 7/19/19 4:40 AM, Andrey Shinkevich wrote:
> In case nbd_co_receive_one_chunk() fails in
> nbd_reply_chunk_iter_receive(), 'NBDReply reply' parameter is used in
> the check nbd_reply_is_simple() without being initialized. The iotest
> 083 does not pass under the Valgrind: $./check -nbd -valgrind 083.
> The alternative solution is to swap the operands in the condition:
> 'if (s->quit || nbd_reply_is_simple(reply))'
>
> Signed-off-by: Andrey Shinkevich <address@hidden>
> ---
> block/nbd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Huh. Very similar to
https://lists.gnu.org/archive/html/qemu-devel/2019-07/msg03712.html, but
affects a different function. I can queue this one through my NBD tree
to get both in my rc2 pull request.
Reviewed-by: Eric Blake <address@hidden>
>
> diff --git a/block/nbd.c b/block/nbd.c
> index 81edabb..8480ad4 100644
> --- a/block/nbd.c
> +++ b/block/nbd.c
> @@ -786,7 +786,7 @@ static int nbd_co_receive_cmdread_reply(BDRVNBDState *s,
> uint64_t handle,
> int *request_ret, Error **errp)
> {
> NBDReplyChunkIter iter;
> - NBDReply reply;
> + NBDReply reply = {};
> void *payload = NULL;
> Error *local_err = NULL;
>
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v4 0/7] Allow Valgrind checking all QEMU processes, Andrey Shinkevich, 2019/07/19
- [Qemu-devel] [PATCH v4 7/7] block/nbd: NBDReply is used being uninitialized, Andrey Shinkevich, 2019/07/19
- Re: [Qemu-devel] [PATCH v4 7/7] block/nbd: NBDReply is used being uninitialized,
Eric Blake <=
- Re: [Qemu-devel] [PATCH v4 7/7] block/nbd: NBDReply is used being uninitialized, Andrey Shinkevich, 2019/07/19
- Re: [Qemu-devel] [PATCH v4 7/7] block/nbd: NBDReply is used being uninitialized, Eric Blake, 2019/07/19
- Re: [Qemu-devel] [PATCH v4 7/7] block/nbd: NBDReply is used being uninitialized, Andrey Shinkevich, 2019/07/19
- Re: [Qemu-devel] [PATCH v4 7/7] block/nbd: NBDReply is used being uninitialized, Eric Blake, 2019/07/19
- Re: [Qemu-devel] [PATCH v4 7/7] block/nbd: NBDReply is used being uninitialized, Andrey Shinkevich, 2019/07/19
[Qemu-devel] [PATCH v4 6/7] iotests: extend sleeping time under Valgrind, Andrey Shinkevich, 2019/07/19
[Qemu-devel] [PATCH v4 2/7] iotests: exclude killed processes from running under Valgrind, Andrey Shinkevich, 2019/07/19
[Qemu-devel] [PATCH v4 3/7] iotests: Add casenotrun report to bash tests, Andrey Shinkevich, 2019/07/19
[Qemu-devel] [PATCH v4 4/7] iotests: Valgrind fails with nonexistent directory, Andrey Shinkevich, 2019/07/19
[Qemu-devel] [PATCH v4 5/7] iotests: extended timeout under Valgrind, Andrey Shinkevich, 2019/07/19