[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 40/40] Migration+TLS: Fix crash due to double cleanup
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 40/40] Migration+TLS: Fix crash due to double cleanup |
Date: |
Wed, 16 May 2018 01:40:17 +0200 |
From: "Dr. David Alan Gilbert" <address@hidden>
During a TLS connect we see:
migration_channel_connect calls
migration_tls_channel_connect
(calls after TLS setup)
migration_channel_connect
My previous error handling fix made migration_channel_connect
call migrate_fd_connect in all cases; unfortunately the above
means it gets called twice and crashes doing double cleanup.
Fixes: 688a3dcba98
Reported-by: Peter Krempa <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
migration/channel.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/migration/channel.c b/migration/channel.c
index 716192bf75..33e0e9b82f 100644
--- a/migration/channel.c
+++ b/migration/channel.c
@@ -71,6 +71,15 @@ void migration_channel_connect(MigrationState *s,
!object_dynamic_cast(OBJECT(ioc),
TYPE_QIO_CHANNEL_TLS)) {
migration_tls_channel_connect(s, ioc, hostname, &error);
+
+ if (!error) {
+ /* tls_channel_connect will call back to this
+ * function after the TLS handshake,
+ * so we mustn't call migrate_fd_connect until then
+ */
+
+ return;
+ }
} else {
QEMUFile *f = qemu_fopen_channel_output(ioc);
--
2.17.0
- [Qemu-devel] [PULL 28/40] migration: synchronize dirty bitmap for resume, (continued)
- [Qemu-devel] [PULL 28/40] migration: synchronize dirty bitmap for resume, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 29/40] migration: setup ramstate for resume, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 32/40] qmp/migration: new command migrate-recover, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 33/40] hmp/migration: add migrate_recover command, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 34/40] migration: introduce lock for to_dst_file, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 35/40] migration/qmp: add command migrate-pause, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 36/40] migration/hmp: add migrate_pause command, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 38/40] migration: update index field when delete or qsort RDMALocalBlock, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 39/40] migration: Textual fixups for blocktime, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 37/40] migration: update docs, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 40/40] Migration+TLS: Fix crash due to double cleanup,
Juan Quintela <=
- Re: [Qemu-devel] [PULL 00/40] Migration PULL requset (take 2), Peter Maydell, 2018/05/17