Re: [PATCH] scsi: megaraid_sas: Add flexible array member for SGLs

Martin K. Petersen
2023-01-27T03:23:41Z

On Thu, 05 Jan 2023 21:32:00 -0800, Kees Cook wrote:

> 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)
>
> [...]

Applied to 6.3/scsi-queue, thanks!

[1/1] scsi: megaraid_sas: Add flexible array member for SGLs
https://git.kernel.org/mkp/scsi/c/a9a3629592ab

--
Martin K. Petersen Oracle Linux Engineering