linux/drivers/scsi/megaraid
Kees Cook a9a3629592 scsi: megaraid_sas: Add flexible array member for SGLs
struct MPI2_RAID_SCSI_IO_REQUEST ends with a single SGL, but expects to
copy multiple. Add a flexible array member so the compiler can reason about
the size of the memcpy(). This will avoid the run-time false positive
warning:

  memcpy: detected field-spanning write (size 128) of single field "&r1_cmd->io_request->SGL" at drivers/scsi/megaraid/megaraid_sas_fusion.c:3326 (size 16)

This change results in no binary output differences.

Reported-by: Holger Kiehl <Holger.Kiehl@dwd.de>
Link: https://lore.kernel.org/all/88de8faa-56c4-693d-2d3-67152ee72057@diagnostix.dwd.de/
Cc: Kashyap Desai <kashyap.desai@broadcom.com>
Cc: Sumit Saxena <sumit.saxena@broadcom.com>
Cc: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: megaraidlinux.pdl@broadcom.com
Cc: linux-scsi@vger.kernel.org
Link: https://lore.kernel.org/r/20230106053153.never.999-kees@kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Tested-by: Holger Kiehl <Holger.Kiehl@dwd.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-01-18 18:22:22 -05:00
..
Kconfig.megaraid
Makefile
mbox_defs.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
mega_common.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
megaraid_ioctl.h
megaraid_mbox.c scsi: megaraid: Convert sysfs snprintf() to sysfs_emit() 2022-09-15 22:34:34 -04:00
megaraid_mbox.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
megaraid_mm.c scsi: megaraid_mm: Fix end of loop tests for list_for_each_entry() 2021-07-28 23:29:09 -04:00
megaraid_mm.h
megaraid_sas_base.c SCSI misc on 20221213 2022-12-14 08:58:51 -08:00
megaraid_sas_debugfs.c
megaraid_sas_fp.c scsi: megaraid_sas: Use struct_size() in code related to struct MR_FW_RAID_MAP 2022-08-31 23:39:59 -04:00
megaraid_sas_fusion.c scsi: megaraid_sas: Add flexible array member for SGLs 2023-01-18 18:22:22 -05:00
megaraid_sas_fusion.h scsi: megaraid_sas: Add flexible array member for SGLs 2023-01-18 18:22:22 -05:00
megaraid_sas.h scsi: megaraid_sas: Target with invalid LUN ID is deleted during scan 2022-04-06 22:58:17 -04:00