Re: [PATCH] scsi: ufs: core: disable exception work before removing hwmon
From: Bean Huo
Date: Thu Nov 26 2026 - 13:09:13 EST
On Thu, 2026-11-26 at 19:14 +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.
>
> Fixes: 66ec6d59407b ("[SCSI] ufs: Add support for host assisted background
> operations")
please double check this fix tag, should be e88e2d32200a, where hwmon came in?
Kind regards,
Bean