The handshake functions in the TLS and websock channels could leak
a QIOTask and some related data if the underlying channel was torn
down before the handshake completed. This also applies to the async
TLS "bye" tasks.
Fixing this required refactoring the QIOTask cleanup paradigm
slightly.
This is a followup to a proposed fix at
https://lists.nongnu.org/archive/html/qemu-devel/2025-09/msg02984.html
and also reported at
https://gitlab.com/qemu-project/qemu/-/issues/3114
Daniel P. Berrangé (3):
io: separate freeing of tasks from marking them as complete
io: fix cleanup for TLS I/O source data on cancellation
io: fix cleanup for websock I/O source data on cancellation
include/io/task.h | 29 +++++++++++++------
io/channel-tls.c | 60 ++++++++++++++++++++++++++-------------
io/channel-websock.c | 2 +-
io/task.c | 8 ++++--
tests/unit/test-io-task.c | 26 +++++++++++++++++
5 files changed, 94 insertions(+), 31 deletions(-)
--
2.52.0