From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, Fabiano Rosas <farosas@suse.de>,
Akash Kulhalli <akulhall@redhat.com>,
Juraj Marcin <jmarcin@redhat.com>
Subject: Re: [PATCH v2 3/7] migration: Fix socket listen backlog
Date: Tue, 6 Oct 2026 21:56:41 +0100 [thread overview]
Message-ID: <asVgieiXH1aieDak@redhat.com> (raw)
In-Reply-To: <20261006182046.3767283-4-peterx@redhat.com>
On Tue, Oct 06, 2026 at 02:20:42PM -0400, Peter Xu wrote:
> QEMU incoming side may have set a wrong listen() backlog. After the
> support of multifd + postcopy now we have four possibilities on setting the
> backlog, some of them are wrong:
>
> Vanilla: 1 (correct)
> Multifd: N (wrong, should be N+1)
> Preempt: 2 (correct)
> Multifd+Preempt: N (wrong, should be N+2)
>
> No real report for this, found by code observation only. Logically the
> backlog (pending accept requests on destination on the listening sockets)
> needs to be the maximum of possible channels. Otherwise if the accept
> queue full on destination, source QEMU may hit connection errors.
From a robustness POV, we might also consider retrying connections
if we see a transient failure. Though I'm not sure offhand what
errrno would result on the client when the accept() queue is full,
hopefully there's something distinct.
This would mitigate a risk of DoS from an unauthorized client
making its own incoming connections concurrently. Such a client
is not necessarily malicious, as there are monitoring tools or
port scanners that randomly open connections to TCP listener
sockets.
> Cc: Daniel P. Berrangé <berrange@redhat.com>
> Fixes: 0705e56496 ("multifd: Use number of channels as listen backlog")
> Fixes: e274188612 ("migration: enable multifd and postcopy together")
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
> migration/socket.c | 25 ++++++++++++++++++-------
> 1 file changed, 18 insertions(+), 7 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
next prev parent reply other threads:[~2026-10-07 8:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 18:20 [PATCH v2 0/7] migration: Fix multifd+postcopy break on qemu-7.2 machine type Peter Xu
2026-10-06 18:20 ` [PATCH v2 1/7] tests/migration-test: Add multifd+postcopy test for preempt recovery Peter Xu
2026-10-06 18:20 ` [PATCH v2 2/7] migration: Add two more trace points for incoming channel mgmt Peter Xu
2026-10-06 18:20 ` [PATCH v2 3/7] migration: Fix socket listen backlog Peter Xu
2026-10-06 20:56 ` Daniel P. Berrangé [this message]
2026-10-07 19:39 ` Peter Xu
2026-10-06 18:20 ` [PATCH v2 4/7] migration: Split migration_channel_process_incoming() Peter Xu
2026-10-06 18:20 ` [PATCH v2 5/7] migration: Dump type of channel in set_incoming_channel tracepoint Peter Xu
2026-10-06 18:20 ` [PATCH v2 6/7] migration: Fix incoming channel race with multifd and preempt_pre_7_2 Peter Xu
2026-10-06 18:20 ` [PATCH v2 7/7] migration: Postpone the outgoing preempt channel for preempt_pre_7_2 Peter Xu
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=asVgieiXH1aieDak@redhat.com \
--to=berrange@redhat.com \
--cc=akulhall@redhat.com \
--cc=farosas@suse.de \
--cc=jmarcin@redhat.com \
--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.