scsi: FDMI Fixes
Subsystems (3)
v2 cover scsi: FDMI Fixes
This series has two fixes for FDMI.
Attributes length corrected for RHBA.
Fixed the wrong condition check in fc_ct_ms_fill_attr().
Kindly apply this series to scsi-queue at your earliest convenience.
Javed Hasan (2):
scsi: fc: Corrected RHBA attributes length
libfc: Corrected the condition check and invalid argument passed
drivers/scsi/libfc/fc_encode.h | 8 +++++--- include/scsi/fc/fc_ms.h | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-)
Signature · 1 line
2.26.2
PATCH v2 1/2 scsi: fc: Corrected RHBA attributes length
-As per document of FC-GS-5, attribute lengths of node_name
and manufacturer should in range of "4 to 64 Bytes" only.
---
Changes in v2:
- Added [email protected] in cc
--- include/scsi/fc/fc_ms.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/scsi/fc/fc_ms.h +2 -2
@@ -63,8 +63,8 @@ enum fc_fdmi_hba_attr_type {* HBA Attribute Length */ #define FC_FDMI_HBA_ATTR_NODENAME_LEN 8 -#define FC_FDMI_HBA_ATTR_MANUFACTURER_LEN 80 -#define FC_FDMI_HBA_ATTR_SERIALNUMBER_LEN 80 +#define FC_FDMI_HBA_ATTR_MANUFACTURER_LEN 64 +#define FC_FDMI_HBA_ATTR_SERIALNUMBER_LEN 64#define FC_FDMI_HBA_ATTR_MODEL_LEN 256#define FC_FDMI_HBA_ATTR_MODELDESCR_LEN 256#define FC_FDMI_HBA_ATTR_HARDWAREVERSION_LEN 256
Signature · 1 line
2.26.2
PATCH v2 2/2 libfc: Corrected the condition check and invalid argument passed
In reply to Javed Hasan -In correct condition check was leading to data corruption
and so the invalid argument.
---
Changes in v2:
- Added [email protected] in cc
--- drivers/scsi/libfc/fc_encode.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/scsi/libfc/fc_encode.h +5 -3
@@ -166,9 +166,11 @@ static inline int fc_ct_ns_fill(struct fc_lport *lport,static inline void fc_ct_ms_fill_attr (struct fc_fdmi_attr_entry *entry,const char *in,size_t len) { -int copied =strscpy (entry->value, in, len); -if (copied >0 ) -memset (entry->value, copied, len - copied); +int copied; + + copied =strscpy ((char *)&entry->value, in, len); +if (copied >0 && (copied +1 ) < len) +memset ((entry->value + copied +1 ),0 , len - copied -1 ); }/**
Signature · 1 line
2.26.2
Martin K. Petersen
AppliedJaved,
Quoted 3 lines
This series has two fixes for FDMI.
Attributes length corrected for RHBA.
Fixed the wrong condition check infc_ct_ms_fill_attr().
Applied to 5.14/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 11 lines · Javed Hasan
This series has two fixes for FDMI.
Attributes length corrected for RHBA.
Fixed the wrong condition check infc_ct_ms_fill_attr().Kindly apply this series to scsi-queue at your earliest convenience.
Javed Hasan (2):
scsi: fc: Corrected RHBA attributes length
libfc: Corrected the condition check and invalid argument passed[...]
Applied to 5.14/scsi-queue, thanks!
[1/2] scsi: fc: Corrected RHBA attributes length
https://git.kernel.org/mkp/scsi/c/40445fd2c9fa [2/2] libfc: Corrected the condition check and invalid argument passed https://git.kernel.org/mkp/scsi/c/8f70328c068f
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering