qemu-patch-raspberry4/hw/scsi
Eric Blake e91bae8e98 scsi: Silence gcc warning
On Fedora 33, gcc 10.2.1 notes that scsi_cdb_length(buf) can set
len==-1, which in turn overflows g_malloc():

[5/5] Linking target qemu-system-x86_64
In function ‘scsi_disk_new_request_dump’,
    inlined from ‘scsi_new_request’ at ../hw/scsi/scsi-disk.c:2608:9:
../hw/scsi/scsi-disk.c:2582:19: warning: argument 1 value ‘18446744073709551612’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
 2582 |     line_buffer = g_malloc(len * 5 + 1);
      |                   ^

Silence it with a decent assertion, since we only convert a buffer to
bytes when we have a valid cdb length.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210209152350.207958-1-eblake@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2021-03-09 21:21:54 +01:00
..
emulation.c scsi-generic: avoid invalid access to struct when emulating block limits 2018-11-06 21:35:06 +01:00
esp-pci.c esp: add vmstate_esp version to embedded ESPState 2021-03-07 10:39:05 +00:00
esp.c esp: add support for unaligned accesses 2021-03-07 10:39:05 +00:00
Kconfig hw/nvram/Kconfig: Add an entry for the NMC93xx EEPROM 2020-01-07 12:08:39 +01:00
lsi53c895a.c lsilogic: Use PCIDevice::exit instead of DeviceState::unrealize 2021-03-06 11:41:54 +01:00
megasas.c scsi: drop 'result' argument from command_complete callback 2021-02-25 14:14:32 +01:00
meson.build meson: convert hw/scsi 2020-08-21 06:30:28 -04:00
mfi.h Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
mpi.h hw: Add support for LSI SAS1068 (mptsas) device 2016-02-09 15:45:26 +01:00
mptconfig.c nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
mptendian.c nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
mptsas.c scsi: drop 'result' argument from command_complete callback 2021-02-25 14:14:32 +01:00
mptsas.h Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
scsi-bus.c scsi: move host_status handling into SCSI drivers 2021-03-06 11:42:57 +01:00
scsi-disk.c scsi: Silence gcc warning 2021-03-09 21:21:54 +01:00
scsi-generic.c scsi: move host_status handling into SCSI drivers 2021-03-06 11:42:57 +01:00
spapr_vscsi.c scsi: drop 'result' argument from command_complete callback 2021-02-25 14:14:32 +01:00
srp.h spapr-vscsi: add task management 2013-09-12 08:46:21 +02:00
trace-events esp: add PDMA trace events 2021-03-07 10:39:05 +00:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
vhost-scsi-common.c vhost-scsi: support inflight io track 2020-09-30 19:09:20 +02:00
vhost-scsi.c monitor: Use getter/setter functions for cur_mon 2020-10-09 07:08:19 +02:00
vhost-user-scsi.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
viosrp.h hw/scsi/spapr_vscsi: Do not mix SRP IU size with DMA buffer size 2020-03-17 15:08:50 +11:00
virtio-scsi-dataplane.c virtio-scsi: don't process IO on fenced dataplane 2021-02-25 14:14:32 +01:00
virtio-scsi.c scsi: move host_status handling into SCSI drivers 2021-03-06 11:42:57 +01:00
vmw_pvscsi.c scsi: move host_status handling into SCSI drivers 2021-03-06 11:42:57 +01:00
vmw_pvscsi.h scsi: VMWare PVSCSI paravirtual device implementation 2013-04-19 10:44:17 +02:00