aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2022-08-30 08:38:27 +0200
committerGerd Hoffmann <kraxel@redhat.com>2022-09-27 07:32:30 +0200
commit12b69878fc7b4b92b1bbd3959f2c3d4c717881fb (patch)
tree63dc05ce5fb3aba25dffc251980849270a09da7e /include
parentcea5aa85691d7f26b7ea995417d41a32802691b7 (diff)
usb/msd: add usb_msd_fatal_error() and fix guest-triggerable assert
Add handler for fatal errors. Moves device into error state where it stops responding until the guest resets it. Guest can send illegal requests where scsi command and usb packet transfer directions are inconsistent. Use the new usb_msd_fatal_error() function instead of assert() in that case. Reported-by: Qiang Liu <cyruscyliu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Qiang Liu <cyruscyliu@gmail.com> Message-Id: <20220830063827.813053-3-kraxel@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/usb/msd.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/hw/usb/msd.h b/include/hw/usb/msd.h
index 54e9f38bda..f9fd862b52 100644
--- a/include/hw/usb/msd.h
+++ b/include/hw/usb/msd.h
@@ -40,6 +40,7 @@ struct MSDState {
bool removable;
bool commandlog;
SCSIDevice *scsi_dev;
+ bool needs_reset;
};
typedef struct MSDState MSDState;