mirror of
https://github.com/SCST-project/scst.git
synced 2026-10-22 14:12:33 +00:00
qla2x00t-32gbit: Serialize flash version read in reset handler
The "update cache versions without reset" sysfs reset operation (0x20261)
calls get_flash_version(), which reads hardware flash registers, without
holding ha->optrom_mutex. The VPD update path serializes the same call
under optrom_mutex, so this reset path can interleave its flash register
accesses with a concurrent VPD or optrom flash operation and corrupt the
reads.
Hold ha->optrom_mutex across the get_flash_version() call to match the
VPD update path.
Fixes: 8c2cf7d4e387 ("[SCSI] qla2xxx: Add a new interface to update versions.")
Reported-by: Sashiko <sashiko-dev@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://patch.msgid.link/20260730155838.2119230-4-njavali@marvell.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
[ commit f606ed93de0c4f1e7e3618779e9fad731455314a upstream ]
This commit is contained in:
committed by
Gleb Chesnokov
parent
2cc915a799
commit
e1023cd4aa
@@ -881,7 +881,9 @@ qla2x00_sysfs_write_reset(struct file *filp, struct kobject *kobj,
|
||||
"Unable to allocate memory for VPD information update.\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
mutex_lock(&ha->optrom_mutex);
|
||||
ha->isp_ops->get_flash_version(vha, tmp_data);
|
||||
mutex_unlock(&ha->optrom_mutex);
|
||||
vfree(tmp_data);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user