diff options
| author | Kees Cook <keescook@chromium.org> | 2021-05-28 11:13:36 -0700 | 
|---|---|---|
| committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-06-02 00:56:15 -0400 | 
| commit | 66fc475bd9e1fca7250affe986862e94ae10a8fd (patch) | |
| tree | 8fc0f42fddb76730dee12bb230a1212015f07863 /drivers/scsi/mpi3mr/mpi/mpi30_init.h | |
| parent | 4d431153e751caa93f3b7e6f6313446974e92253 (diff) | |
scsi: esas2r: Switch to flexible array member
In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), avoid intentionally writing across
neighboring array fields.
Remove old-style 1-byte array in favor of a flexible array[1] to avoid
future false-positive cross-field memcpy() warning in:
esas2r_vda.c:
	memcpy(vi->cmd.gsv.version_info, esas2r_vdaioctl_versions, ...)
The change in struct size doesn't change other structure sizes (it is
already maxed out to 256 bytes, for example here:
        union {
                struct atto_ioctl_vda_scsi_cmd scsi;
                struct atto_ioctl_vda_flash_cmd flash;
                struct atto_ioctl_vda_diag_cmd diag;
                struct atto_ioctl_vda_cli_cmd cli;
                struct atto_ioctl_vda_smp_cmd smp;
                struct atto_ioctl_vda_cfg_cmd cfg;
                struct atto_ioctl_vda_mgt_cmd mgt;
                struct atto_ioctl_vda_gsv_cmd gsv;
                u8 cmd_info[256];
        } cmd;
No sizes are calculated using the enclosing structure, so no other
updates are needed.
Link: https://lore.kernel.org/r/20210528181337.792268-3-keescook@chromium.org
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/mpi3mr/mpi/mpi30_init.h')
0 files changed, 0 insertions, 0 deletions
