]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: pm80xx: Set phy->enable_completion only when we wait for it
authorIgor Pylypiv <ipylypiv@google.com>
Thu, 27 Jun 2024 15:59:23 +0000 (15:59 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:11:36 +0000 (11:11 +0200)
commit7b1d779647afaea9185fa2f150b1721e7c1aae89
treebf74b82c3521288fa6012ece3264401b27d3ea30
parent2f49e05d6b58d660f035a75ff96b77071b4bd5ed
scsi: pm80xx: Set phy->enable_completion only when we wait for it

[ 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@google.com>
Signed-off-by: Terrence Adams <tadamsjr@google.com>
Link: https://lore.kernel.org/r/20240627155924.2361370-2-tadamsjr@google.com
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/pm8001/pm8001_sas.c