scsi: libsas: Fix use-after-free bug in smp_execute_task_sg()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2908d778ab3e244900c310974e1fc1c69066e450 · < 46ba53c30666717cb06c2b3c5d896301cd00d0c0| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
scsi: libsas: Fix use-after-free bug in smp_execute_task_sg()
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.
From the CVE record · Linux
The Linux kernel's scsi libsas component has a use-after-free in smp_execute_task_sg(). If an SMP task fails while its timeout handler is running, the handler can access freed memory. The input does not specify whether exploitation requires local or network access, authentication, or user interaction.
Engineers running the Linux kernel should check their installations; affected versions are not specified.