linux-stable/drivers/scsi/hisi_sas
Xiang Chen 080b4f976b scsi: hisi_sas: Replace del_timer() calls with del_timer_sync()
Some usage of del_timer() in the driver is potentially unsafe.

When running the sas_task->slow_task timer in
hisi_sas_exec_internal_tmf_task(), execution may be blocked in function
hisi_sas_task_exec(); so it is possible that the timer is running when the
callback to disable the timer is running. This could be dangerous, as we
immediately release resources which the timer callback uses after disabling
the timer. The same situation may be found at other sites, such as
_hisi_sas_internal_task_abort().

Change calls to del_timer() to del_timer_sync() as necessary, to ensure any
timer has finished when disabling.

Also remove calls to timer_pending() prior to del_timer() as it is not
necessary.

Link: https://lore.kernel.org/r/1629799260-120116-5-git-send-email-john.garry@huawei.com
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-09-13 23:56:02 -04:00
..
hisi_sas.h scsi: hisi_sas: Rename HISI_SAS_{RESET -> RESETTING}_BIT 2021-09-13 23:56:02 -04:00
hisi_sas_main.c scsi: hisi_sas: Replace del_timer() calls with del_timer_sync() 2021-09-13 23:56:02 -04:00
hisi_sas_v1_hw.c scsi: hisi_sas: Rename HISI_SAS_{RESET -> RESETTING}_BIT 2021-09-13 23:56:02 -04:00
hisi_sas_v2_hw.c scsi: hisi_sas: Replace del_timer() calls with del_timer_sync() 2021-09-13 23:56:02 -04:00
hisi_sas_v3_hw.c scsi: hisi_sas: Replace del_timer() calls with del_timer_sync() 2021-09-13 23:56:02 -04:00
Kconfig scsi: hisi_sas: Enable debugfs support by default 2021-01-26 23:02:11 -05:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00