Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: qla2xxx: Fix partial flash write of MBI

For new adapters with multiple flash regions to write to, current code
allows FW & Boot regions to be written, while other regions are blocked via
sysfs. The fix is to block all flash read/write through sysfs interface.

Fixes: e81d1bcbde06 ("scsi: qla2xxx: Further limit FLASH region write access from SysFS")
Cc: stable@vger.kernel.org # 5.2
Link: https://lore.kernel.org/r/20191022193643.7076-3-hmadhani@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Girish Basrur <gbasrur@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Quinn Tran and committed by
Martin K. Petersen
8d8b83f5 c2ff2a36

+3 -4
+3 -4
drivers/scsi/qla2xxx/qla_attr.c
··· 440 440 valid = 0; 441 441 if (ha->optrom_size == OPTROM_SIZE_2300 && start == 0) 442 442 valid = 1; 443 - else if (start == (ha->flt_region_boot * 4) || 444 - start == (ha->flt_region_fw * 4)) 445 - valid = 1; 446 443 else if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha)) 447 444 valid = 1; 448 445 if (!valid) { ··· 486 489 "Writing flash region -- 0x%x/0x%x.\n", 487 490 ha->optrom_region_start, ha->optrom_region_size); 488 491 489 - ha->isp_ops->write_optrom(vha, ha->optrom_buffer, 492 + rval = ha->isp_ops->write_optrom(vha, ha->optrom_buffer, 490 493 ha->optrom_region_start, ha->optrom_region_size); 494 + if (rval) 495 + rval = -EIO; 491 496 break; 492 497 default: 493 498 rval = -EINVAL;