Re: [PATCH v2] scsi: ufs: core: disable exception work before removing hwmon

From: Martin K. Petersen (Oracle)

Date: Sun Dec 06 2026 - 00:19:42 EST


On Fri, 27 Nov 2026 15:25:03 +0800, Yaohan Li wrote:

> ufshcd_remove() unregisters the hwmon device while hba->eeh_work can
> still be running. A SCSI completion can also queue hba->eeh_work later
> during scsi_remove_host(). When the worker runs ufs_hwmon_notify_event(),
> it can access the freed hwmon device and trigger a use-after-free.
>
> Disable and drain hba->eeh_work in ufshcd_remove() before removing
> hwmon. This ensures any running handler finishes while hwmon is still
> present and prevents later SCSI completions during removal from
> requeuing the work.
>
> [...]

Applied to 7.4/scsi-fixes, thanks!

[1/1] scsi: ufs: core: disable exception work before removing hwmon
https://git.kernel.org/mkp/scsi/c/f38b29f3e677

--
Martin K. Petersen