]> git.ipfire.org Git - thirdparty/qemu.git/commit
io: remove io watch if TLS channel is closed during handshake
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 20 Jun 2023 08:45:34 +0000 (09:45 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 4 Aug 2023 16:14:46 +0000 (19:14 +0300)
commit5300472ec0990c61742d89b5eea1c1e6941f6d62
tree074c3f7fc6fd7223ce3c6103ed9c2f722ffbcd99
parentca93a302a093a754c2e1363c17178eea47bebe9b
io: remove io watch if TLS channel is closed during handshake

The TLS handshake make take some time to complete, during which time an
I/O watch might be registered with the main loop. If the owner of the
I/O channel invokes qio_channel_close() while the handshake is waiting
to continue the I/O watch must be removed. Failing to remove it will
later trigger the completion callback which the owner is not expecting
to receive. In the case of the VNC server, this results in a SEGV as
vnc_disconnect_start() tries to shutdown a client connection that is
already gone / NULL.

CVE-2023-3354
Reported-by: jiangyegen <jiangyegen@huawei.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 10be627d2b5ec2d6b3dce045144aa739eef678b4)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
include/io/channel-tls.h
io/channel-tls.c