Commit e81d1bcb authored by Andrew Vasquez's avatar Andrew Vasquez Committed by Martin K. Petersen

scsi: qla2xxx: Further limit FLASH region write access from SysFS

Recent ISPs have larger and more complex flash-write semantics
(secure-access and signing). The BSG interfaces support these semantics for
all ISPs and is exclusively used by QLogic user-space tools. Limit
flash-write operations to ISPs <= 25xx.
Signed-off-by: default avatarAndrew Vasquez <andrewv@marvell.com>
Signed-off-by: default avatarHimanshu Madhani <hmadhani@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 5cbdae10
...@@ -430,6 +430,10 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj, ...@@ -430,6 +430,10 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj,
* 0x000000 -> 0x07ffff -- Boot code. * 0x000000 -> 0x07ffff -- Boot code.
* 0x080000 -> 0x0fffff -- Firmware. * 0x080000 -> 0x0fffff -- Firmware.
* 0x120000 -> 0x12ffff -- VPD and HBA parameters. * 0x120000 -> 0x12ffff -- VPD and HBA parameters.
*
* > ISP25xx type boards:
*
* None -- should go through BSG.
*/ */
valid = 0; valid = 0;
if (ha->optrom_size == OPTROM_SIZE_2300 && start == 0) if (ha->optrom_size == OPTROM_SIZE_2300 && start == 0)
...@@ -437,9 +441,7 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj, ...@@ -437,9 +441,7 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj,
else if (start == (ha->flt_region_boot * 4) || else if (start == (ha->flt_region_boot * 4) ||
start == (ha->flt_region_fw * 4)) start == (ha->flt_region_fw * 4))
valid = 1; valid = 1;
else if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha) else if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha))
|| IS_CNA_CAPABLE(ha) || IS_QLA2031(ha)
|| IS_QLA27XX(ha) || IS_QLA28XX(ha))
valid = 1; valid = 1;
if (!valid) { if (!valid) {
ql_log(ql_log_warn, vha, 0x7065, ql_log(ql_log_warn, vha, 0x7065,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment