]> git.proxmox.com Git - mirror_qemu.git/commit
nbd: safeguard against waking up invalid coroutine
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 14 Apr 2022 17:57:48 +0000 (19:57 +0200)
committerEric Blake <eblake@redhat.com>
Tue, 26 Apr 2022 18:16:24 +0000 (13:16 -0500)
commit8846b7d1c137ba261b2300b20e94ae360d88a538
tree080561e4c89f8fc80509c21de37e40fc2a7052cb
parentc08c220be70603941b680d5b39f2061222dd74e8
nbd: safeguard against waking up invalid coroutine

The .reply_possible field of s->requests is never set to false.  This is
not a problem as it is only a safeguard to detect protocol errors,
but it's sloppy.  In fact, the field is actually not necessary at all,
because .coroutine is set to NULL in NBD_FOREACH_REPLY_CHUNK after
receiving the last chunk.  Thus, replace .reply_possible with .coroutine
and move the check before deciding the fate of this request.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220414175756.671165-2-pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Signed-off-by: Eric Blake <eblake@redhat.com>
block/nbd.c