ata: fix a race condition when internal cmd time out
euler inclusion
category: bugfix
bugzilla: NA
CVE: NA
---------------------------
For internal cmds, we will unmap DMA memory associated with the cmd
before we abort the cmd. If DMA transferring data before the aborting,
bus error will occur.
ata_exec_internal_sg
->ata_port_freeze if timeout
->ata_qc_complete
->ata_sg_clean
dma transferring data = bus error
->ap->ops->post_internal_cmd
->sas_ata_post_internal
->sas_ata_internal_abort
->abort the cmd
Fix this by moving post_internal_cmd() before unmapping the DMA memory
when time out. Notice that we have to set ATA_QCFLAG_FAILED flag before
calling post_internal_cmd() so that the aborting will work.
Reported-by: Nluojian <luojian5@huawei.com>
Signed-off-by: NJason Yan <yanaijie@huawei.com>
Reviewed-by: Nzhengbin <zhengbin13@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Showing
想要评论请 注册 或 登录