scsi: lpfc: Use struct_group() to initialize struct lpfc_cgn_info
authorKees Cook <keescook@chromium.org>
Wed, 8 Dec 2021 19:59:57 +0000 (11:59 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 14 Dec 2021 04:30:30 +0000 (23:30 -0500)
commit532adda9f405d69ef1837f59e60512313fdf0f63
treeab597bc2b6d924f5dc7b674bfc7a84f68f4fdefe
parent4437503bfbec2f02b41b2492520fe627715889a7
scsi: lpfc: Use struct_group() to initialize struct lpfc_cgn_info

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memset(), avoid intentionally writing across
neighboring fields.

Add struct_group() to mark "stat" region of struct lpfc_cgn_info that
should be initialized to zero, and refactor the "data" region memset()
to wipe everything up to the cgn_stats region.

Link: https://lore.kernel.org/r/20211208195957.1603092-1-keescook@chromium.org
Reviewed-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc.h
drivers/scsi/lpfc/lpfc_init.c