From: Peter Xu <peterx@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: jasowang@redhat.com, mst@redhat.com, armbru@redhat.com,
farosas@suse.de, raphael.s.norwitz@gmail.com, bchaney@akamai.com,
qemu-devel@nongnu.org, berrange@redhat.com, pbonzini@redhat.com,
yc-core@yandex-team.ru, mark.caveayland@nutanix.com
Subject: Re: [PATCH v21 10/16] migration/fd: fix fd leak when fd is not valid for migration
Date: Wed, 19 Aug 2026 14:53:48 -0400 [thread overview]
Message-ID: <aoX7vDHFIB9PHvsf@x1.local> (raw)
In-Reply-To: <20260819180201.1970193-11-vsementsov@yandex-team.ru>
On Wed, Aug 19, 2026 at 09:01:53PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> Both fd_connect_outgoing() and fd_connect_incoming() own the file
> descriptor after resolving it from the monitor, but forget to close
> it when migration_fd_valid() check fails.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Oops.. thanks for fixing.
Reviewed-by: Peter Xu <peterx@redhat.com>
Cc: qemu-stable <qemu-stable@nongnu.org>
Fixes: f1fcc1c101 ("migration: Remove fd: support on files")
> ---
> migration/fd.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/migration/fd.c b/migration/fd.c
> index f05f95992f8..02b39b150eb 100644
> --- a/migration/fd.c
> +++ b/migration/fd.c
> @@ -62,6 +62,7 @@ QIOChannel *fd_connect_outgoing(MigrationState *s, const char *fdname,
> if (!migration_fd_valid(fd)) {
> error_setg(errp, "fd: migration to a file is not supported."
> " Use file: instead.");
> + close(fd);
> goto out;
> }
>
> @@ -97,6 +98,7 @@ void fd_connect_incoming(const char *fdname, Error **errp)
> if (!migration_fd_valid(fd)) {
> error_setg(errp, "fd: migration to a file is not supported."
> " Use file: instead.");
> + close(fd);
> return;
> }
>
> --
> 2.43.0
>
--
Peter Xu
next prev parent reply other threads:[~2026-08-19 18:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260819180201.1970193-1-vsementsov@yandex-team.ru>
2026-08-19 18:01 ` [PATCH v21 01/16] net/tap: rework tap_parse_script Vladimir Sementsov-Ogievskiy
2026-08-19 18:01 ` [PATCH v21 02/16] net/tap: improve script/downscript options documentation Vladimir Sementsov-Ogievskiy
2026-08-19 18:01 ` [PATCH v21 03/16] net/tap: deprecate "no" as special value for script/downscript Vladimir Sementsov-Ogievskiy
2026-08-19 18:01 ` [PATCH v21 05/16] net/tap: move vhost initialization to tap_setup_vhost() Vladimir Sementsov-Ogievskiy
2026-08-19 18:01 ` [PATCH v21 06/16] net/tap: use container_of instead of DO_UPCAST Vladimir Sementsov-Ogievskiy
2026-08-19 18:01 ` [PATCH v21 07/16] net/tap: QOMify tap backend Vladimir Sementsov-Ogievskiy
2026-08-19 18:01 ` [PATCH v21 10/16] migration/fd: fix fd leak when fd is not valid for migration Vladimir Sementsov-Ogievskiy
2026-08-19 18:53 ` Peter Xu [this message]
2026-08-19 18:01 ` [PATCH v21 11/16] migration/fd: add errp parameter to migration_fd_valid() Vladimir Sementsov-Ogievskiy
2026-08-19 18:54 ` Peter Xu
2026-08-19 18:01 ` [PATCH v21 12/16] migration: check that transfer is UNIX socket when "local" set Vladimir Sementsov-Ogievskiy
2026-08-19 18:59 ` Peter Xu
2026-08-19 18:01 ` [PATCH v21 13/16] virtio-net: support local migration of backend Vladimir Sementsov-Ogievskiy
2026-08-19 18:01 ` [PATCH v21 15/16] net/tap: support local migration with virtio-net Vladimir Sementsov-Ogievskiy
2026-08-19 18:01 ` [PATCH v21 16/16] tests/functional: add test_tap_migration Vladimir Sementsov-Ogievskiy
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=aoX7vDHFIB9PHvsf@x1.local \
--to=peterx@redhat.com \
--cc=armbru@redhat.com \
--cc=bchaney@akamai.com \
--cc=berrange@redhat.com \
--cc=farosas@suse.de \
--cc=jasowang@redhat.com \
--cc=mark.caveayland@nutanix.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=raphael.s.norwitz@gmail.com \
--cc=vsementsov@yandex-team.ru \
--cc=yc-core@yandex-team.ru \
/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.