All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Peter Xu" <peterx@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PATCH 6/8] io: Fix TLS bye task leak
Date: Tue, 10 Mar 2026 10:55:38 -0300	[thread overview]
Message-ID: <20260310135540.8679-6-farosas@suse.de> (raw)
In-Reply-To: <20260310135540.8679-1-farosas@suse.de>

Recent fixes to TLS tasks memory handling have left the TLS bye task
uncovered. Fix by freeing the task in the same way the handshake task
is freed.

Direct leak of 704 byte(s) in 4 object(s) allocated from:
    #1 0x7f5909b1d6a0 in g_malloc0 ../glib/gmem.c:163
    #2 0x557650496d61 in qio_task_new ../io/task.c:58:12
    #3 0x557650475d7f in qio_channel_tls_bye ../io/channel-tls.c:352:12
    #4 0x55764f7a1bb4 in migration_tls_channel_end ../migration/tls.c:159:5
    #5 0x55764f709750 in migration_ioc_shutdown_gracefully ../migration/multifd.c:462:9
    #6 0x55764f6fcf53 in multifd_send_terminate_threads ../migration/multifd.c:493:13
    #7 0x55764f6fcafb in multifd_send_shutdown ../migration/multifd.c:580:5
    #8 0x55764f6e1b14 in migration_cleanup ../migration/migration.c:1323:9
    #9 0x55764f6f5bac in migration_cleanup_bh ../migration/migration.c:1350:5

Fixes: d39d0f3acd ("io: fix cleanup for TLS I/O source data on cancellation")
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
 io/channel-tls.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/io/channel-tls.c b/io/channel-tls.c
index 940fc3c6d1..31ec4d236d 100644
--- a/io/channel-tls.c
+++ b/io/channel-tls.c
@@ -352,7 +352,9 @@ void qio_channel_tls_bye(QIOChannelTLS *ioc, Error **errp)
     task = qio_task_new(OBJECT(ioc), propagate_error, errp, NULL);
 
     trace_qio_channel_tls_bye_start(ioc);
-    qio_channel_tls_bye_task(ioc, task, NULL);
+    if (qio_channel_tls_bye_task(ioc, task, NULL)) {
+        qio_task_free(task);
+    }
 }
 
 static void qio_channel_tls_init(Object *obj G_GNUC_UNUSED)
-- 
2.51.0



  parent reply	other threads:[~2026-03-10 13:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 13:55 [PATCH 1/8] tests/qtest/migration: Fix leak of migration tests data Fabiano Rosas
2026-03-10 13:55 ` [PATCH 2/8] tests/qtest/migration: Change validate_uuid test to not trigger exit(1) Fabiano Rosas
2026-03-10 19:59   ` Peter Xu
2026-03-11 10:34   ` Prasad Pandit
2026-03-10 13:55 ` [PATCH 3/8] tests/qtest/migration: Fix misuse of listen_uri Fabiano Rosas
2026-03-10 15:48   ` Lukas Straub
2026-03-10 13:55 ` [PATCH 4/8] tests/qtest/migration: Stop invoking migrate_incoming from hooks Fabiano Rosas
2026-03-10 15:47   ` Lukas Straub
2026-03-10 13:55 ` [PATCH 5/8] tests/qtest/migration: Force exit-on-error=false when appropriate Fabiano Rosas
2026-03-10 20:46   ` Peter Xu
2026-03-10 21:14     ` Fabiano Rosas
2026-03-11 10:36       ` Prasad Pandit
2026-03-11 15:40       ` Peter Xu
2026-03-10 13:55 ` Fabiano Rosas [this message]
2026-03-10 14:29   ` [PATCH 6/8] io: Fix TLS bye task leak Daniel P. Berrangé
2026-03-10 13:55 ` [PATCH 7/8] tests/qtest/migration: Fix leak in CPR exec test Fabiano Rosas
2026-03-10 20:46   ` Peter Xu
2026-03-11  9:56   ` Prasad Pandit
2026-03-10 13:55 ` [PATCH 8/8] migration/multifd: Fix leaks of TLS error objects Fabiano Rosas
2026-03-10 20:49   ` Peter Xu
2026-03-11  9:32   ` Prasad Pandit
2026-03-10 19:47 ` [PATCH 1/8] tests/qtest/migration: Fix leak of migration tests data Peter Xu
2026-03-11 11:56 ` Prasad Pandit
2026-03-11 12:57   ` Fabiano Rosas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260310135540.8679-6-farosas@suse.de \
    --to=farosas@suse.de \
    --cc=berrange@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.