[lvc-project] Patch "scsi: pm80xx: Set phy->enable_completion only when we" has been added to the 6.1-stable tree
gregkh at linuxfoundation.org
gregkh at linuxfoundation.org
Tue Dec 2 19:02:44 MSK 2025
This is a note to let you know that I've just added the patch titled
scsi: pm80xx: Set phy->enable_completion only when we
to the 6.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
scsi-pm80xx-set-phy-enable_completion-only-when-we.patch
and it can be found in the queue-6.1 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable at vger.kernel.org> know about it.
>From stable+bounces-197601-greg=kroah.com at vger.kernel.org Fri Nov 28 15:48:02 2025
From: Nazar Kalashnikov <sivartiwe at gmail.com>
Date: Fri, 28 Nov 2025 17:48:15 +0300
Subject: scsi: pm80xx: Set phy->enable_completion only when we
To: stable at vger.kernel.org, Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Cc: Nazar Kalashnikov <sivartiwe at gmail.com>, Jack Wang <jinpu.wang at cloud.ionos.com>, "James E.J. Bottomley" <jejb at linux.ibm.com>, "Martin K. Petersen" <martin.petersen at oracle.com>, linux-scsi at vger.kernel.org, linux-kernel at vger.kernel.org, lvc-project at linuxtesting.org, Igor Pylypiv <ipylypiv at google.com>, Terrence Adams <tadamsjr at google.com>, Jack Wang <jinpu.wang at ionos.com>
Message-ID: <20251128144816.55522-1-sivartiwe at gmail.com>
From: Igor Pylypiv <ipylypiv at google.com>
[ Upstream commit e4f949ef1516c0d74745ee54a0f4882c1f6c7aea ]
pm8001_phy_control() populates the enable_completion pointer with a stack
address, sends a PHY_LINK_RESET / PHY_HARD_RESET, waits 300 ms, and
returns. The problem arises when a phy control response comes late. After
300 ms the pm8001_phy_control() function returns and the passed
enable_completion stack address is no longer valid. Late phy control
response invokes complete() on a dangling enable_completion pointer which
leads to a kernel crash.
Signed-off-by: Igor Pylypiv <ipylypiv at google.com>
Signed-off-by: Terrence Adams <tadamsjr at google.com>
Link: https://lore.kernel.org/r/20240627155924.2361370-2-tadamsjr@google.com
Acked-by: Jack Wang <jinpu.wang at ionos.com>
Signed-off-by: Martin K. Petersen <martin.petersen at oracle.com>
Signed-off-by: Nazar Kalashnikov <sivartiwe at gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
Backport fix for CVE-2024-47666
drivers/scsi/pm8001/pm8001_sas.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -168,7 +168,6 @@ int pm8001_phy_control(struct asd_sas_ph
unsigned long flags;
pm8001_ha = sas_phy->ha->lldd_ha;
phy = &pm8001_ha->phy[phy_id];
- pm8001_ha->phy[phy_id].enable_completion = &completion;
switch (func) {
case PHY_FUNC_SET_LINK_RATE:
rates = funcdata;
@@ -181,6 +180,7 @@ int pm8001_phy_control(struct asd_sas_ph
rates->maximum_linkrate;
}
if (pm8001_ha->phy[phy_id].phy_state == PHY_LINK_DISABLE) {
+ pm8001_ha->phy[phy_id].enable_completion = &completion;
PM8001_CHIP_DISP->phy_start_req(pm8001_ha, phy_id);
wait_for_completion(&completion);
}
@@ -189,6 +189,7 @@ int pm8001_phy_control(struct asd_sas_ph
break;
case PHY_FUNC_HARD_RESET:
if (pm8001_ha->phy[phy_id].phy_state == PHY_LINK_DISABLE) {
+ pm8001_ha->phy[phy_id].enable_completion = &completion;
PM8001_CHIP_DISP->phy_start_req(pm8001_ha, phy_id);
wait_for_completion(&completion);
}
@@ -197,6 +198,7 @@ int pm8001_phy_control(struct asd_sas_ph
break;
case PHY_FUNC_LINK_RESET:
if (pm8001_ha->phy[phy_id].phy_state == PHY_LINK_DISABLE) {
+ pm8001_ha->phy[phy_id].enable_completion = &completion;
PM8001_CHIP_DISP->phy_start_req(pm8001_ha, phy_id);
wait_for_completion(&completion);
}
Patches currently in stable-queue which might be from sivartiwe at gmail.com are
queue-6.1/ksmbd-fix-use-after-free-in-session-logoff.patch
queue-6.1/scsi-pm80xx-set-phy-enable_completion-only-when-we.patch
More information about the lvc-project
mailing list