diff options
author | Justin Tee <justin.tee@broadcom.com> | 2023-10-31 12:12:17 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-11-15 09:52:57 -0500 |
commit | f5779b529240b715f0e358489ad0ed933bf77c97 (patch) | |
tree | b4bb842c071a070646bbf2cb7cce1fe4f8fcb8e8 /drivers/scsi/lpfc/lpfc.h | |
parent | 2fe4b6a67730e6ffd002b2b3c4752ef262fedde4 (diff) | |
download | linux-stable-f5779b529240b715f0e358489ad0ed933bf77c97.tar.gz linux-stable-f5779b529240b715f0e358489ad0ed933bf77c97.tar.bz2 linux-stable-f5779b529240b715f0e358489ad0ed933bf77c97.zip |
scsi: lpfc: Fix possible file string name overflow when updating firmware
Because file_name and phba->ModelName are both declared a size 80 bytes,
the extra ".grp" file extension could cause an overflow into file_name.
Define a ELX_FW_NAME_SIZE macro with value 84. 84 incorporates the 4 extra
characters from ".grp". file_name is changed to be declared as a char and
initialized to zeros i.e. null chars.
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20231031191224.150862-3-justintee8345@gmail.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc.h')
-rw-r--r-- | drivers/scsi/lpfc/lpfc.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index af15f7a22d25..04d608ea9106 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -33,6 +33,7 @@ struct lpfc_sli2_slim; #define ELX_MODEL_NAME_SIZE 80 +#define ELX_FW_NAME_SIZE 84 #define LPFC_PCI_DEV_LP 0x1 #define LPFC_PCI_DEV_OC 0x2 |