mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-26 15:54:18 +08:00
staging: vme_user: Fix possible UAF in tsi148_dma_list_add
[ Upstream commit357057ee55
] Smatch report warning as follows: drivers/staging/vme_user/vme_tsi148.c:1757 tsi148_dma_list_add() warn: '&entry->list' not removed from list In tsi148_dma_list_add(), the error path "goto err_dma" will not remove entry->list from list->entries, but entry will be freed, then list traversal may cause UAF. Fix by removeing it from list->entries before free(). Fixes:b2383c90a9
("vme: tsi148: fix first DMA item mapping") Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> Link: https://lore.kernel.org/r/20221117035914.2954454-1-cuigaosheng1@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a3c4bc2616
commit
1f5661388f
@ -1765,6 +1765,7 @@ static int tsi148_dma_list_add(struct vme_dma_list *list,
|
||||
return 0;
|
||||
|
||||
err_dma:
|
||||
list_del(&entry->list);
|
||||
err_dest:
|
||||
err_source:
|
||||
err_align:
|
||||
|
Loading…
Reference in New Issue
Block a user