[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 25/47] block/iscsi: fix double-free on BUSY or similar statuses
From: |
Michael Tokarev |
Subject: |
[PATCH 25/47] block/iscsi: fix double-free on BUSY or similar statuses |
Date: |
Wed, 8 Mar 2023 19:57:28 +0300 |
From: Paolo Bonzini <pbonzini@redhat.com>
Commit 8c460269aa77 ("iscsi: base all handling of check condition on
scsi_sense_to_errno", 2019-07-15) removed a "goto out" so that the
same coroutine is re-entered twice; once from iscsi_co_generic_cb,
once from the timer callback iscsi_retry_timer_expired. This can
cause a crash.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1378
Reported-by: Grzegorz Zdanowski <https://gitlab.com/kiler129>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 5080152e2ef6cde7aa692e29880c62bd54acb750)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
block/iscsi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/iscsi.c b/block/iscsi.c
index a316d46d96..1bba42a71b 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -268,6 +268,7 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
timer_mod(&iTask->retry_timer,
qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + retry_time);
iTask->do_retry = 1;
+ return;
} else if (status == SCSI_STATUS_CHECK_CONDITION) {
int error = iscsi_translate_sense(&task->sense);
if (error == EAGAIN) {
--
2.30.2
- [PATCH 16/47] migration/ram: Fix error handling in ram_write_tracking_start(), (continued)
- [PATCH 16/47] migration/ram: Fix error handling in ram_write_tracking_start(), Michael Tokarev, 2023/03/08
- [PATCH 22/47] target/i386: Fix C flag for BLSI, BLSMSK, BLSR, Michael Tokarev, 2023/03/08
- [PATCH 17/47] migration/ram: Fix populate_read_range(), Michael Tokarev, 2023/03/08
- [PATCH 15/47] target/arm: Fix physical address resolution for Stage2, Michael Tokarev, 2023/03/08
- [PATCH 20/47] tests/tcg/i386: Introduce and use reg_t consistently, Michael Tokarev, 2023/03/08
- [PATCH 19/47] block: fix detect-zeroes= with BDRV_REQ_REGISTERED_BUF, Michael Tokarev, 2023/03/08
- [PATCH 24/47] target/i386: Fix BZHI instruction, Michael Tokarev, 2023/03/08
- [PATCH 21/47] target/i386: Fix BEXTR instruction, Michael Tokarev, 2023/03/08
- [PATCH 23/47] target/i386: fix ADOX followed by ADCX, Michael Tokarev, 2023/03/08
- [PATCH 26/47] hw/smbios: fix field corruption in type 4 table, Michael Tokarev, 2023/03/08
- [PATCH 25/47] block/iscsi: fix double-free on BUSY or similar statuses,
Michael Tokarev <=
- [PATCH 27/47] Revert "x86: do not re-randomize RNG seed on snapshot load", Michael Tokarev, 2023/03/08
- [PATCH 32/47] Revert "hw/i386: pass RNG seed via setup_data entry", Michael Tokarev, 2023/03/08
- [PATCH 28/47] Revert "x86: re-initialize RNG seed when selecting kernel", Michael Tokarev, 2023/03/08
- [PATCH 29/47] Revert "x86: reinitialize RNG seed on system reboot", Michael Tokarev, 2023/03/08
- [PATCH 33/47] vhost-user-gpio: Configure vhost_dev when connecting, Michael Tokarev, 2023/03/08
- [PATCH 31/47] Revert "x86: return modified setup_data only if read as memory, not as file", Michael Tokarev, 2023/03/08
- [PATCH 30/47] Revert "x86: use typedef for SetupData struct", Michael Tokarev, 2023/03/08
- [PATCH 34/47] vhost-user-i2c: Back up vqs before cleaning up vhost_dev, Michael Tokarev, 2023/03/08
- [PATCH 41/47] libvhost-user: check for NULL when allocating a virtqueue element, Michael Tokarev, 2023/03/08
- [PATCH 42/47] chardev/char-socket: set s->listener = NULL in char_socket_finalize, Michael Tokarev, 2023/03/08