RFC crypto,io,migration: Add support to gnutls_bye()
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 RFC Latest8 patches 3 repliesIn review
- v2 RFC8 patches 15 repliesSuperseded
- v1 RFC4 patches 2 repliesSuperseded
v2 from the cover letter
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | crypto: Allow gracefully ending the TLS sessioncrypto/ include/ | +63 | 0 replies | |
| 2/8 | io: tls: Add qio_channel_tls_byeinclude/ io/ io/ | +101 | 0 replies | |
| 3/8 | crypto: Remove qcrypto_tls_session_get_handshake_statuscrypto/ include/ io/ +1 more | +39 | 0 replies | |
| 4/8 | io: Add flags argument to qio_channel_readv_full_all_eofhw/ include/ io/ | +9 | 1 reply | |
| 5/8 | io: Add a read flag for relaxed EOFinclude/ io/ | +2 | 0 replies | |
| 6/8 | migration/multifd: Terminate the TLS connectionmigration/ migration/ migration/ | +43 | 0 replies | |
| 7/8 | migration/multifd: Add a compat property for TLS terminationhw/ migration/ migration/ +2 more | +51 | 1 reply | |
| 8/8 | migration: Check migration error after loadvmmigration/ | +5 | 1 reply |
Reviews trailers per patch
All 8 patches have a Reviewed-by or Acked-by.
| Patch | Daniel P. Berrangé | Peter Xu |
|---|---|---|
| 1/8 | R-b A-b | |
| 2/8 | R-b A-b | |
| 3/8 | R-b A-b | |
| 4/8 | R-b A-b | |
| 5/8 | R-b | |
| 6/8 | R-b | |
| 7/8 | R-b | |
| 8/8 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC PATCH v3 0/8] crypto,io,migration: Add support to gnutls_bye()
(cover-letter update I forgot on v2:)
This series now contains the two approches we've been discussing to avoid the TLS termination error on the multifd_recv threads.
The source machine now ends the TLS session with gnutls_bye() and the destination will consider a premature termination an error. The only exception is the src <9.1 case where there's a compatibility issue, in which case the presence of multifd-tls-clean-termination=false will cause the destination to (always) ignore a premature termination error.
changes in v3:
Reordered the patches to have the io/crypto stuff at the start and the compat property before the code that breaks compat.
Commit message improvements.
Turned assert into an warning when gnutls_bye() fails but migration succeeded (should never happen).
Other minor fixes asked by Daniel.
CI run: https://gitlab.com/farosas/qemu/-/pipelines/1661172595
v2:
https://lore.kernel.org/r/[email protected]
v1:
https://lore.kernel.org/r/[email protected]
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
crypto: Remove qcrypto_tls_session_get_handshake_status
io: Add flags argument to qio_channel_readv_full_all_eof
io: Add a read flag for relaxed EOF migration/multifd: Terminate the TLS connection migration/multifd: Add a compat property for TLS termination
migration: Check migration error after loadvm
crypto/tlssession.c | 96 ++++++++++++++++++----------- hw/core/machine.c | 1 + hw/remote/mpqemu-link.c | 2 +- include/crypto/tlssession.h | 46 ++++++++------ include/io/channel-tls.h | 12 ++++ include/io/channel.h | 3 + io/channel-tls.c | 92 ++++++++++++++++++++++++++- io/channel.c | 9 ++- io/trace-events | 5 ++ migration/migration.h | 33 ++++++++++ migration/multifd.c | 53 +++++++++++++++- 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 ++-- 17 files changed, 305 insertions(+), 76 deletions(-)
Signature · 1 line
2.35.3