qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/8] crypto,io,migration: Add support to gnutls_bye()
@ 2025-02-07 14:27 Fabiano Rosas
  2025-02-07 14:27 ` [RFC PATCH v2 1/8] crypto: Allow gracefully ending the TLS session Fabiano Rosas
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: Fabiano Rosas @ 2025-02-07 14:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Xu, Maciej S . Szmigiero, Daniel P . Berrangé

v2:

Added the premature_ok logic;
Added compat property for QEMU <9.1;
Refactored the existing handshake code;

CI run:
https://gitlab.com/farosas/qemu/-/pipelines/1660800456

v1:
https://lore.kernel.org/r/20250206175824.22664-1-farosas@suse.de

Hi,

We've been discussing a way to stop multifd recv threads from getting
an error at the end of migration when the source threads close the
iochannel without ending the TLS session.

The original issue was introduced by commit 1d457daf86
("migration/multifd: Further remove the SYNC on complete") which
altered the synchronization of the source and destination in a manner
that causes the destination to already be waiting at recv() when the
source closes the connection.

One approach would be to issue gnutls_bye() at the source after all
the data has been sent. The destination would then gracefully exit
when it gets EOF.

Aside from stopping the recv thread from seeing an error, this also
creates a contract that all connections should be closed only after
the TLS session is ended. This helps to avoid masking a legitimate
issue where the connection is closed prematurely.

Fabiano Rosas (8):
  crypto: Allow gracefully ending the TLS session
  io: tls: Add qio_channel_tls_bye
  migration/multifd: Terminate the TLS connection
  migration: Check migration error after loadvm
  crypto: Remove qcrypto_tls_session_get_handshake_status
  io: Plumb read flags into qio_channel_read_all_eof
  io: Add a read flag for relaxed EOF
  migration/multifd: Add a compat property for TLS termination

 crypto/tlssession.c                 | 105 +++++++++++++++++-----------
 hw/remote/mpqemu-link.c             |   2 +-
 include/crypto/tlssession.h         |  46 ++++++------
 include/io/channel-tls.h            |  12 ++++
 include/io/channel.h                |   7 ++
 io/channel-tls.c                    |  92 +++++++++++++++++++++++-
 io/channel.c                        |  13 ++--
 io/trace-events                     |   5 ++
 migration/migration.h               |  33 +++++++++
 migration/multifd.c                 |  42 ++++++++++-
 migration/multifd.h                 |   2 +
 migration/options.c                 |   2 +
 migration/savevm.c                  |   6 +-
 migration/tls.c                     |   5 ++
 migration/tls.h                     |   2 +-
 tests/unit/test-crypto-tlssession.c |  12 ++--
 tools/i386/qemu-vmsr-helper.c       |   3 +-
 util/vhost-user-server.c            |   2 +-
 18 files changed, 308 insertions(+), 83 deletions(-)

-- 
2.35.3



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2025-02-10 14:20 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-07 14:27 [RFC PATCH v2 0/8] crypto,io,migration: Add support to gnutls_bye() Fabiano Rosas
2025-02-07 14:27 ` [RFC PATCH v2 1/8] crypto: Allow gracefully ending the TLS session Fabiano Rosas
2025-02-07 14:33   ` Daniel P. Berrangé
2025-02-07 17:21   ` Peter Xu
2025-02-07 17:55     ` Fabiano Rosas
2025-02-07 18:09       ` Peter Xu
2025-02-07 14:27 ` [RFC PATCH v2 2/8] io: tls: Add qio_channel_tls_bye Fabiano Rosas
2025-02-07 14:39   ` Daniel P. Berrangé
2025-02-07 14:27 ` [RFC PATCH v2 3/8] migration/multifd: Terminate the TLS connection Fabiano Rosas
2025-02-07 18:00   ` Peter Xu
2025-02-07 18:15     ` Fabiano Rosas
2025-02-10 14:20       ` Peter Xu
2025-02-07 14:27 ` [RFC PATCH v2 4/8] migration: Check migration error after loadvm Fabiano Rosas
2025-02-07 18:02   ` Peter Xu
2025-02-07 14:27 ` [RFC PATCH v2 5/8] crypto: Remove qcrypto_tls_session_get_handshake_status Fabiano Rosas
2025-02-07 14:41   ` Daniel P. Berrangé
2025-02-07 14:27 ` [RFC PATCH v2 6/8] io: Plumb read flags into qio_channel_read_all_eof Fabiano Rosas
2025-02-07 14:51   ` Daniel P. Berrangé
2025-02-07 14:27 ` [RFC PATCH v2 7/8] io: Add a read flag for relaxed EOF Fabiano Rosas
2025-02-07 14:53   ` Daniel P. Berrangé
2025-02-07 14:27 ` [RFC PATCH v2 8/8] migration/multifd: Add a compat property for TLS termination Fabiano Rosas
2025-02-07 18:07   ` Peter Xu
2025-02-07 18:40     ` Fabiano Rosas
2025-02-07 19:44 ` [RFC PATCH v2 0/8] crypto,io,migration: Add support to gnutls_bye() Maciej S. Szmigiero

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).