qemu-e2k/hw
Shin'ichiro Kawasaki 1849f297f5 scsi-generic: Check sense key before request snooping and patching
When READ CAPACITY command completes, scsi_read_complete() function
snoops the command result and updates SCSIDevice members blocksize and
max_lba . However, this update is executed even when READ CAPACITY
command indicates an error in sense data. This causes unexpected
blocksize update with zero value for SCSI devices without
READ CAPACITY(10) command support and eventually results in a divide
by zero. An emulated device by TCMU-runner is an example of a device
that doesn't support READ CAPACITY(10) command.

To avoid the unexpected update, add sense key check in
scsi_read_complete() function. The function already checks the sense key
for VPD Block Limits emulation. Do the scsi_parse_sense_buf() call for
all requests rather than just for VPD Block Limits emulation, so that
blocksize and max_lba are only updated if READ CAPACITY returns zero
sense key.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
[Extend the check to all requests, not just READ CAPACITY]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-07-19 19:04:49 +02:00
..
9pfs
acpi
adc
alpha hw: Replace global smp variables with MachineState for all remaining archs 2019-07-05 17:08:03 -03:00
arm hw/arm/virt: Fix non-secure flash mode 2019-07-15 14:17:04 +01:00
audio
block hw/block/pflash_cfi01: Start state machine as READY to accept commands 2019-07-16 17:54:06 +02:00
bt
char
core pl031: Correctly migrate state when using -rtc clock=host 2019-07-15 14:17:04 +01:00
cpu general: Replace global smp variables with smp machine properties 2019-07-05 17:07:36 -03:00
cris
display hw/display/xlnx_dp: Avoid crash when reading empty RX FIFO 2019-07-15 14:17:03 +01:00
dma
gpio
hppa hw: Replace global smp variables with MachineState for all remaining archs 2019-07-05 17:08:03 -03:00
hyperv Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
i2c hw/i2c/bitbang_i2c: Use in-place rather than malloc'd bitbang_i2c_interface struct 2019-07-03 10:51:35 +02:00
i386 hw/i386: turn off vmport if CONFIG_VMPORT is disabled 2019-07-15 11:20:42 +02:00
ide Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
input
intc xics/kvm: Always set the MASKED bit if interrupt is masked 2019-07-12 15:50:00 +10:00
ipack
ipmi Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
isa
lm32 hw/lm32/Kconfig: Milkymist One provides a USB 1.1 Controller 2019-07-15 20:58:37 +02:00
m68k
mem
microblaze
mips hw: Replace global smp variables with MachineState for all remaining archs 2019-07-05 17:08:03 -03:00
misc hw/misc/aspeed_xdma: New device 2019-07-01 17:29:00 +01:00
moxie
net sunhme: ensure that RX descriptor ring overflow is indicated to client driver 2019-07-02 22:49:08 +01:00
nios2
nvram
openrisc hw: Replace global smp variables with MachineState for all remaining archs 2019-07-05 17:08:03 -03:00
pci
pci-bridge xio3130_downstream: typo fix 2019-07-12 10:56:26 -04:00
pci-host i.mx7d: pci: Update PCI IRQ mapping to match HW 2019-07-01 17:28:59 +01:00
pcmcia
ppc machine: show if CLI option '-numa node,mem' is supported in QAPI schema 2019-07-05 17:08:03 -03:00
rdma
riscv hw/riscv: Load OpenSBI as the default firmware 2019-07-18 14:18:45 -07:00
s390x s390x/pci: add some fallthrough annotations 2019-07-18 11:29:50 +02:00
scsi scsi-generic: Check sense key before request snooping and patching 2019-07-19 19:04:49 +02:00
sd
semihosting
sh4
smbios machine: Refactor smp-related call chains to pass MachineState 2019-07-05 17:07:36 -03:00
sparc hw: Replace global smp variables with MachineState for all remaining archs 2019-07-05 17:08:03 -03:00
sparc64 hw: Replace global smp variables with MachineState for all remaining archs 2019-07-05 17:08:03 -03:00
ssi hw/ssi/mss-spi: Avoid crash when reading empty RX FIFO 2019-07-15 14:17:03 +01:00
timer pl031: Correctly migrate state when using -rtc clock=host 2019-07-15 14:17:04 +01:00
tpm hw/tpm: Only build tpm_ppi.o if any of TPM_TIS/TPM_CRB is built 2019-07-08 10:04:38 -04:00
tricore
unicore32
usb hw/usb/Kconfig: USB_XHCI_NEC requires USB_XHCI 2019-07-15 20:58:37 +02:00
vfio vfio-ccw: Test vfio_set_irq_signaling() return value 2019-07-08 12:10:37 +02:00
virtio virtio pmem: remove transitional names 2019-07-12 10:57:27 -04:00
watchdog aspeed: Link SCU to the watchdog 2019-07-01 17:29:00 +01:00
xen
xenpv
xtensa hw: Replace global smp variables with MachineState for all remaining archs 2019-07-05 17:08:03 -03:00
Kconfig
Makefile.objs Makefile: do not repeat $(CONFIG_SOFTMMU) in hw/Makefile.objs 2019-07-15 20:58:37 +02:00