[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 3/7] esp: ensure that async_len is reset to 0 during esp_hard_rese
From: |
Paolo Bonzini |
Subject: |
[PULL 3/7] esp: ensure that async_len is reset to 0 during esp_hard_reset() |
Date: |
Fri, 19 Nov 2021 15:45:35 +0100 |
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
If a reset command is sent after data has been transferred into the SCSI buffer
ensure that async_len is reset to 0. Otherwise a subsequent TI command assumes
the SCSI buffer contains data to be transferred to the device causing it to
dereference the stale async_buf pointer.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/724
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211118100327.29061-2-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/scsi/esp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 84f935b549..58d0edbd56 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -894,6 +894,7 @@ void esp_hard_reset(ESPState *s)
memset(s->wregs, 0, ESP_REGS);
s->tchi_written = 0;
s->ti_size = 0;
+ s->async_len = 0;
fifo8_reset(&s->fifo);
fifo8_reset(&s->cmdfifo);
s->dma = 0;
--
2.33.1
- [PULL 0/7] Misc bugfixes for 2021-11-19, Paolo Bonzini, 2021/11/19
- [PULL 1/7] meson: fix botched compile check conversions, Paolo Bonzini, 2021/11/19
- [PULL 4/7] qtest/am53c974-test: add test for reset before transfer, Paolo Bonzini, 2021/11/19
- [PULL 6/7] meson.build: Support ncurses on MacOS and OpenBSD, Paolo Bonzini, 2021/11/19
- [PULL 5/7] docs: Spell QEMU all caps, Paolo Bonzini, 2021/11/19
- [PULL 2/7] nvmm: Fix support for stable version, Paolo Bonzini, 2021/11/19
- [PULL 3/7] esp: ensure that async_len is reset to 0 during esp_hard_reset(),
Paolo Bonzini <=
- [PULL 7/7] chardev/wctable: don't free the instance in wctablet_chr_finalize, Paolo Bonzini, 2021/11/19
- Re: [PULL 0/7] Misc bugfixes for 2021-11-19, Richard Henderson, 2021/11/19