mirror-linux/drivers/scsi/lpfc
Sherry Yang 3417c9574e scsi: lpfc: Fix overflow build issue
Build failed while enabling "CONFIG_GCOV_KERNEL=y" and
"CONFIG_GCOV_PROFILE_ALL=y" with following error:

BUILDSTDERR: drivers/scsi/lpfc/lpfc_bsg.c: In function 'lpfc_get_cgnbuf_info':
BUILDSTDERR: ./include/linux/fortify-string.h:114:33: error: '__builtin_memcpy' accessing 18446744073709551615 bytes at offsets 0 and 0 overlaps 9223372036854775807 bytes at offset -9223372036854775808 [-Werror=restrict]
BUILDSTDERR:   114 | #define __underlying_memcpy     __builtin_memcpy
BUILDSTDERR:       |                                 ^
BUILDSTDERR: ./include/linux/fortify-string.h:637:9: note: in expansion of macro '__underlying_memcpy'
BUILDSTDERR:   637 |         __underlying_##op(p, q, __fortify_size);                        \
BUILDSTDERR:       |         ^~~~~~~~~~~~~
BUILDSTDERR: ./include/linux/fortify-string.h:682:26: note: in expansion of macro '__fortify_memcpy_chk'
BUILDSTDERR:   682 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
BUILDSTDERR:       |                          ^~~~~~~~~~~~~~~~~~~~
BUILDSTDERR: drivers/scsi/lpfc/lpfc_bsg.c:5468:9: note: in expansion of macro 'memcpy'
BUILDSTDERR:  5468 |         memcpy(cgn_buff, cp, cinfosz);
BUILDSTDERR:       |         ^~~~~~

This happens from the commit 06bb7fc0fe ("kbuild: turn on -Wrestrict by
default"). Address this issue by using size_t type.

Signed-off-by: Sherry Yang <sherry.yang@oracle.com>
Link: https://lore.kernel.org/r/20240821065131.1180791-1-sherry.yang@oracle.com
Reviewed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2024-08-22 20:57:41 -04:00
..
Makefile
lpfc.h scsi: lpfc: Change lpfc_hba hba_flag member into a bitmask 2024-05-06 21:53:58 -04:00
lpfc_attr.c Merge patch series "Update lpfc to revision 14.4.0.3" 2024-07-04 23:25:40 -04:00
lpfc_attr.h
lpfc_bsg.c scsi: lpfc: Fix overflow build issue 2024-08-22 20:57:41 -04:00
lpfc_bsg.h
lpfc_compat.h
lpfc_crtn.h
lpfc_ct.c scsi: lpfc: Relax PRLI issue conditions after GID_FT response 2024-07-04 23:24:51 -04:00
lpfc_debugfs.c scsi: lpfc: Use a dedicated lock for ras_fwlog state 2024-03-10 18:56:43 -04:00
lpfc_debugfs.h
lpfc_disc.h
lpfc_els.c scsi: lpfc: Handle mailbox timeouts in lpfc_get_sfp_info 2024-07-04 23:24:51 -04:00
lpfc_hbadisc.c scsi: lpfc: Fix handling of fully recovered fabric node in dev_loss callbk 2024-07-04 23:24:51 -04:00
lpfc_hw.h scsi: lpfc: Set Establish Image Pair service parameter only for Target Functions 2023-07-23 16:17:07 -04:00
lpfc_hw4.h scsi: lpfc: Add support for 32 byte CDBs 2024-05-06 21:53:58 -04:00
lpfc_ids.h
lpfc_init.c scsi: lpfc: Add support for 32 byte CDBs 2024-05-06 21:53:58 -04:00
lpfc_logmsg.h scsi: lpfc: Introduce LOG_NODE_VERBOSE messaging flag 2023-10-13 16:58:27 -04:00
lpfc_mbox.c scsi: lpfc: Define types in a union for generic void *context3 ptr 2024-03-10 18:56:44 -04:00
lpfc_mem.c scsi: lpfc: Copyright updates for 14.2.0.16 patches 2023-11-15 09:52:58 -05:00
lpfc_nl.h
lpfc_nportdisc.c scsi: lpfc: Change lpfc_hba hba_flag member into a bitmask 2024-05-06 21:53:58 -04:00
lpfc_nvme.c scsi: lpfc: Change lpfc_hba hba_flag member into a bitmask 2024-05-06 21:53:58 -04:00
lpfc_nvme.h
lpfc_nvmet.c lpfc_nvmet: implement 'host_traddr' 2024-06-24 12:53:43 -07:00
lpfc_scsi.c scsi: lpfc: Add support for 32 byte CDBs 2024-05-06 21:53:58 -04:00
lpfc_scsi.h scsi: lpfc: Copyright updates for 14.4.0.2 patches 2024-05-06 21:53:58 -04:00
lpfc_sli.c scsi: lpfc: Revise lpfc_prep_embed_io routine with proper endian macro usages 2024-07-04 23:24:52 -04:00
lpfc_sli.h scsi: lpfc: Copyright updates for 14.4.0.1 patches 2024-03-10 18:56:44 -04:00
lpfc_sli4.h scsi: lpfc: Copyright updates for 14.4.0.1 patches 2024-03-10 18:56:44 -04:00
lpfc_version.h scsi: lpfc: Update lpfc version to 14.4.0.3 2024-07-04 23:24:52 -04:00
lpfc_vmid.c scsi: lpfc: Move determination of vmid_flag after VMID reinitialization completes 2023-12-13 22:17:57 -05:00
lpfc_vport.c scsi: lpfc: Define lpfc_dmabuf type for ctx_buf ptr 2024-03-10 18:56:44 -04:00
lpfc_vport.h