]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
hw/scsi/lsi53c895a: add missing decrement of reentrancy counter
authorSven Schnelle <svens@stackframe.org>
Sun, 28 Jan 2024 20:22:14 +0000 (21:22 +0100)
committerThomas Huth <thuth@redhat.com>
Mon, 5 Feb 2024 13:21:21 +0000 (14:21 +0100)
When the maximum count of SCRIPTS instructions is reached, the code
stops execution and returns, but fails to decrement the reentrancy
counter. This effectively renders the SCSI controller unusable
because on next entry the reentrancy counter is still above the limit.

This bug was seen on HP-UX 10.20 which seems to trigger SCRIPTS
loops.

Fixes: b987718bbb ("hw/scsi/lsi53c895a: Fix reentrancy issues in the LSI controller (CVE-2023-0330)")
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Message-ID: <20240128202214.2644768-1-svens@stackframe.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Tested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/scsi/lsi53c895a.c

index 34e3b8928777263cae78cfd2fa9c01db9213c406..d607a5f9fb104d3a7f389539e47cf5dbeff8ee55 100644 (file)
@@ -1159,6 +1159,7 @@ again:
         lsi_script_scsi_interrupt(s, LSI_SIST0_UDC, 0);
         lsi_disconnect(s);
         trace_lsi_execute_script_stop();
+        reentrancy_level--;
         return;
     }
     insn = read_dword(s, s->dsp);