mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
46ba53c306
When executing SMP task failed, the smp_execute_task_sg() calls del_timer()
to delete "slow_task->timer". However, if the timer handler
sas_task_internal_timedout() is running, the del_timer() in
smp_execute_task_sg() will not stop it and a UAF will happen. The process
is shown below:
(thread 1) | (thread 2)
smp_execute_task_sg() | sas_task_internal_timedout()
... |
del_timer() |
... | ...
sas_free_task(task) |
kfree(task->slow_task) //FREE|
| task->slow_task->... //USE
Fix by calling del_timer_sync() in smp_execute_task_sg(), which makes sure
the timer handler have finished before the "task->slow_task" is
deallocated.
Link: https://lore.kernel.org/r/20220920144213.10536-1-duoming@zju.edu.cn
Fixes:
|
||
---|---|---|
.. | ||
Kconfig | ||
Makefile | ||
sas_ata.c | ||
sas_discover.c | ||
sas_event.c | ||
sas_expander.c | ||
sas_host_smp.c | ||
sas_init.c | ||
sas_internal.h | ||
sas_phy.c | ||
sas_port.c | ||
sas_scsi_host.c | ||
sas_task.c |