2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-20 03:04:01 +08:00
linux-next/drivers/scsi/esas2r
Kees Cook 66fc475bd9 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>
2021-06-02 00:56:15 -04:00
..
atioctl.h scsi: esas2r: Switch to flexible array member 2021-06-02 00:56:15 -04:00
atvda.h
esas2r_disc.c scsi: esas2r: esas2r_disc: Place brackets around a potentially empty if() 2020-11-10 22:27:46 -05:00
esas2r_flash.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
esas2r_init.c scsi: esas2r: Use generic power management 2020-11-25 23:14:31 -05:00
esas2r_int.c scsi: esas2r: esas2r_int: Add brackets around potentially empty if()s 2020-11-10 22:27:47 -05:00
esas2r_io.c
esas2r_ioctl.c scsi: esas2r: Remove unnecessary casts 2020-08-24 23:36:33 -04:00
esas2r_log.c scsi: esas2r: Supply __printf(x, y) formatting for esas2r_log_master() 2021-03-15 22:28:58 -04:00
esas2r_log.h scsi: esas2r: Fix format string type mistakes 2017-01-09 23:52:26 -05:00
esas2r_main.c proc: mandate ->proc_lseek in "struct proc_ops" 2021-05-06 19:24:11 -07:00
esas2r_targdb.c
esas2r_vda.c
esas2r.h scsi: esas2r: Use generic power management 2020-11-25 23:14:31 -05:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00