From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A8CF54704B; Thu, 17 Sep 2026 17:50:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789667418; cv=none; b=phjOJ2aDN+brCiii1o218Nn+Tkf6rLxL2j9F8JMJwwpFzZs2WVmwPM2UC4FffJZxqAlWLXkCZM4OAkCTEyf65UpUFd6zKxQJMYchFwiegw7vu+Q3aV/ufJRfbsjZZMYKprWquqv71572W4Zdwvz3nID4cdP6N8AHwlXBdBtDjVc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789667418; c=relaxed/simple; bh=kmLXdtqRUolDVPRIlZ8GV+FS9E8AfvhVMeWeQh6qz6s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gJnhgXJk1p0zoz9qcnNkeSguUiPYvPiXjU94l9hxQkmMnKgjopQAjSclVQgzCBCu8x3jWLjBfJKTpjm2IEt2LZ7KSlp/QyfrDtZymuRICJtZguKrl1bk+DJJpGcfd6vV0RTQmhnPbh3ETYF+5u1NSCjbJ5YDHkvmPNPW9wxT/ho= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xmaDj5TH; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xmaDj5TH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D96861F000FF; Thu, 17 Sep 2026 17:50:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789667417; bh=ghCJI3ST1D1F4OlfO9a6do9d707jSoKVXqNbGqf9Jb4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=xmaDj5THL4Xt0sSsISt4Qn/sc6CgRDkLUgPcTT0vlWTMMtB8zb3DIVXp1L4mqtHTW XaFSuIitj7s3q+VY+Te/XQ5pqGrg+sX9DktNMsKT3lz/W40q37vpJLhHeqb452u7k6 Y/znIuucxxTWJwKyG+VefKdvmSiiMs5PqrReqKMo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kumar Meiyappan , Sagar Biradar , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 6.12 0084/1102] scsi: pm8001: Reject non-fatal dump when controller is crashed Date: Thu, 17 Sep 2026 16:00:27 +0100 Message-ID: <20260917151541.586589464@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151539.408551884@linuxfoundation.org> References: <20260917151539.408551884@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kumar Meiyappan [ Upstream commit aa3b8f56ef27ed72394a752820abdec4608b731c ] 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. Signed-off-by: Kumar Meiyappan Signed-off-by: Sagar Biradar Link: https://patch.msgid.link/20260416154650.415624-1-sagar.biradar@microchip.com Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/pm8001/pm80xx_hwi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index a9869cd8c4c07..e0e6bacef8c38 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -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, -- 2.53.0