QEMU websocket code busy-waited after remote close
A decoding bug treated leftover incomplete frames as a reason to ignore end-of-file, spinning instead of closing the channel.
QEMU's websocket channel could spin in a tight loop after the far end closed the connection, a flaw tracked as CVE-2026-141286 and fixed by Daniel P. Berrangé for the 11.2 release.
The decoder reported end-of-file only when the underlying stream had closed and no encoded bytes were still waiting. That second condition was wrong. Bytes left from an earlier read can be too short to form a complete websocket frame, so they sit in the encoded buffer without ever becoming readable data. Anything watching for input then kept asking for more, received end-of-file from the socket, and refused to pass that condition upward because the incomplete fragment was still pending. The result was a busy-wait rather than a clean close.
Berrangé changed the check so that end-of-file from the underlying stream is reported upward when the decoder cannot produce any further frames. The bug is recorded as QEMU work item 5030.