]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dmaengine: idxd: Fix possible Use-After-Free in irq_process_work_list
authorLi RongQing <lirongqing@baidu.com>
Mon, 3 Jun 2024 01:24:44 +0000 (09:24 +0800)
committerVinod Koul <vkoul@kernel.org>
Tue, 11 Jun 2024 16:07:25 +0000 (21:37 +0530)
commite3215deca4520773cd2b155bed164c12365149a7
treea5c55d584e2c1d8a265305b22d706def9e3bb198
parent462237d2d93fc9e9221d1cf9f773954d27da83c0
dmaengine: idxd: Fix possible Use-After-Free in irq_process_work_list

Use list_for_each_entry_safe() to allow iterating through the list and
deleting the entry in the iteration process. The descriptor is freed via
idxd_desc_complete() and there's a slight chance may cause issue for
the list iterator when the descriptor is reused by another thread
without it being deleted from the list.

Fixes: 16e19e11228b ("dmaengine: idxd: Fix list corruption in description completion")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Fenghua Yu <fenghua.yu@intel.com>
Link: https://lore.kernel.org/r/20240603012444.11902-1-lirongqing@baidu.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/idxd/irq.c