scsi: pm8001: reject non-fatal dump when controller is crashed
Subsystems (3)
PATCH 1/1 scsi: pm8001: reject non-fatal dump when controller is crashed
From: Kumar Meiyappan <[email protected]>
pm80xx_get_non_fatal_dump() can be called even after the controller has entered a fatal error state. In that case the forensic memory contents are not safe to access for a non-fatal dump request, and attempting to do so can trigger a call trace.
Check controller_fatal_error before reading the non-fatal dump buffer and return -EINVAL when the controller is already in a crashed state.
This prevents non-fatal dump collection from running in an invalid controller state.
--- drivers/scsi/pm8001/pm80xx_hwi.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/scsi/pm8001/pm80xx_hwi.c +7 -0
@@ -401,6 +401,13 @@ ssize_t pm80xx_get_non_fatal_dump(struct device *cdev,char *buf_copy = buf; temp = (u32 *)pm8001_ha->memoryMap.region[FORENSIC_MEM ].virt_ptr; + +if (pm8001_ha->controller_fatal_error) { +pm8001_dbg (pm8001_ha,FAIL , +"non-fatal dump not available in fatal error state\n" ); +return -EINVAL ; + } +if (++pm8001_ha->non_fatal_count ==1 ) {if (pm8001_ha->chip_id == chip_8001) { snprintf(pm8001_ha->forensic_info.data_buf.direct_data,
Signature · 1 line
2.43.0
Martin K. Petersen
AppliedSagar,
Quoted 4 lines
pm80xx_get_non_fatal_dump()can be called even after the controller has entered a fatal error state. In that case the forensic memory contents are not safe to access for a non-fatal dump request, and attempting to do so can trigger a call trace.
Applied to 7.2/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen
Martin K. Petersen
AppliedQuoted 9 lines · Sagar Biradar
pm80xx_get_non_fatal_dump()can be called even after the controller has entered a fatal error state. In that case the forensic memory contents are not safe to access for a non-fatal dump request, and attempting to do so can trigger a call trace.Check
controller_fatal_errorbefore reading the non-fatal dump buffer and return-EINVALwhen the controller is already in a crashed state.[...]
Applied to 7.2/scsi-queue, thanks!
[1/1] scsi: pm8001: reject non-fatal dump when controller is crashed
https://git.kernel.org/mkp/scsi/c/aa3b8f56ef27
Signature · 1 line
Martin K. Petersen