qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] migration/tls: Graceful shutdowns for main and postcopy channels
@ 2025-09-11 21:23 Peter Xu
  2025-09-11 21:23 ` [PATCH v2 1/3] io/crypto: Move tls premature termination handling into QIO layer Peter Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Peter Xu @ 2025-09-11 21:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Juraj Marcin, Daniel P . Berrangé, peterx, Fabiano Rosas

This is v2 of the series.  Note that v2 is almost a rewrite, so please
ignore v1, and there's no changelog too.

Fabiano fixed graceful shutdowns for multifd channels previously:

https://lore.kernel.org/qemu-devel/20250206175824.22664-1-farosas@suse.de/

However we can still see an warning when running preempt unit test on TLS,
even though migration functionality will not be affected:

QTEST_QEMU_BINARY=./qemu-system-x86_64 ./tests/qtest/migration-test --full -r /x86_64/migration/postcopy/preempt/tls/psk
...
qemu-kvm: Cannot read from TLS channel: The TLS connection was non-properly terminated.
...

It turns out this is because the crypto code only passes the ->shutdown
field into the read function, however that value can change concurrently in
another thread by a concurrent qio_channel_shutdown().

Patch 1 should fix this issue.

Patch 2-3 are something I found when looking at this problem, there's no
known issues I am aware of with them, however I still think they're
logically flawed, so I post them together here.

Please review, thanks.

Peter Xu (3):
  io/crypto: Move tls premature termination handling into QIO layer
  io/tls: Make qio_channel_tls_bye() always synchronous
  migration: Make migration_has_failed() work even for CANCELLING

 include/crypto/tlssession.h |   7 +--
 include/io/channel-tls.h    |   5 +-
 crypto/tlssession.c         |   7 +--
 io/channel-tls.c            | 107 ++++++++++--------------------------
 migration/migration.c       |   3 +-
 io/trace-events             |   3 +-
 6 files changed, 39 insertions(+), 93 deletions(-)

-- 
2.50.1



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

end of thread, other threads:[~2025-09-18 18:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-11 21:23 [PATCH v2 0/3] migration/tls: Graceful shutdowns for main and postcopy channels Peter Xu
2025-09-11 21:23 ` [PATCH v2 1/3] io/crypto: Move tls premature termination handling into QIO layer Peter Xu
2025-09-12 11:18   ` Daniel P. Berrangé
2025-09-12 15:24     ` Peter Xu
2025-09-15 18:31       ` Daniel P. Berrangé
2025-09-12 12:05   ` Juraj Marcin
2025-09-18 14:12   ` Fabiano Rosas
2025-09-11 21:23 ` [PATCH v2 2/3] io/tls: Make qio_channel_tls_bye() always synchronous Peter Xu
2025-09-12 11:27   ` Daniel P. Berrangé
2025-09-12 15:36     ` Peter Xu
2025-09-15 18:40       ` Daniel P. Berrangé
2025-09-15 20:41         ` Peter Xu
2025-09-18 14:47   ` Fabiano Rosas
2025-09-18 18:12     ` Peter Xu
2025-09-11 21:23 ` [PATCH v2 3/3] migration: Make migration_has_failed() work even for CANCELLING Peter Xu
2025-09-12 12:07   ` Juraj Marcin
2025-09-18 14:52   ` Fabiano Rosas

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).