Skip to content

Commit e1c9866

Browse files
lituo1996vinodkoul
authored andcommitted
dmaengine: idxd: fix possible wrong descriptor completion in llist_abort_desc()
At the end of this function, d is the traversal cursor of flist, but the code completes found instead. This can lead to issues such as NULL pointer dereferences, double completion, or descriptor leaks. Fix this by completing d instead of found in the final list_for_each_entry_safe() loop. Fixes: aa8d18b ("dmaengine: idxd: add callback support for iaa crypto") Signed-off-by: Tuo Li <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent e0adbf7 commit e1c9866

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/dma/idxd/submit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static void llist_abort_desc(struct idxd_wq *wq, struct idxd_irq_entry *ie,
138138
*/
139139
list_for_each_entry_safe(d, t, &flist, list) {
140140
list_del_init(&d->list);
141-
idxd_dma_complete_txd(found, IDXD_COMPLETE_ABORT, true,
141+
idxd_dma_complete_txd(d, IDXD_COMPLETE_ABORT, true,
142142
NULL, NULL);
143143
}
144144
}

0 commit comments

Comments
 (0)