summaryrefslogtreecommitdiff
path: root/module-common.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2026-08-31 12:01:50 +0200
committerDaniel P. Berrangé <berrange@redhat.com>2026-09-07 11:31:03 +0100
commit7a72a4652a7955db579d2b9244a09edbf7b0529b (patch)
tree4f5703b60110f484ac7bc093b32754916766e081 /module-common.c
parente867e2047c6cf8c1e59e8e1155291cc0a0b9dd29 (diff)
downloadqemu-7a72a4652a7955db579d2b9244a09edbf7b0529b.tar.gz
qemu-7a72a4652a7955db579d2b9244a09edbf7b0529b.zip
io/channel-websock: do not lose QIO_CHANNEL_ERR_BLOCK while reading
qio_channel_websock_handshake_read() folds every negative return from qio_channel_read() into -1. QIO_CHANNEL_ERR_BLOCK leaves errp unset, so qio_channel_websock_handshake_io() then hands a NULL Error to error_get_pretty() and QEMU dies. The master channel is non-blocking and, for a wss:// client, is a TLS channel. A G_IO_IN wakeup carrying only part of a TLS record makes gnutls report EAGAIN, which is all it takes to reach this before the client has authenticated. ERR_BLOCK here means the headers are not complete yet, which is what a 0 return already tells the caller. Report it that way and keep waiting. The watch is level triggered, so an incomplete record sitting in the socket spins the main loop until the rest of it arrives. That is bounded by the round trip and is what every reader layered over TLS already does. Fixes: 2d1d0e70cf3e ("io: add QIOChannelWebsock class") Fixes: CVE-2026-84788 Cc: qemu-stable@nongnu.org Cc: Daniel P. Berrangé <berrange@redhat.com> Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'module-common.c')
0 files changed, 0 insertions, 0 deletions