dma-buf: Fix one use-after-free of fence
PATCH 1/1 dma-buf: Fix one use-after-free of fence
Need get the new fence when we replace the old one.
Fixes 047a1b877ed48 ("dma-buf & drm/amdgpu: remove dma_resv workaround")
Signed-off-by xinhui pan <[email protected]>
--- drivers/dma-buf/dma-resv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma-buf/dma-resv.c +1 -1
@@ -343,7 +343,7 @@ void dma_resv_replace_fences(struct dma_resv *obj, uint64_t context,if (old->context != context)continue ; -dma_resv_list_set (list, i, replacement, usage); +dma_resv_list_set (list, i,dma_fence_get (replacement), usage);dma_fence_put (old); } }
Signature · 1 line
2.34.1
Christian König
maintainerAm 07.07.22 um 10:02 schrieb xinhui pan:
Quoted 4 lines
Need get the new fence when we replace the old one.
Fixes 047a1b877ed48 ("dma-buf & drm/amdgpu: remove dma_resv workaround")Signed-off-by xinhui pan <[email protected]>
Good catch, Reviewed-by: Christian König <[email protected]>
Going to push that in a minute.
Christian.
Quoted 17 lines
--- drivers/dma-buf/dma-resv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/dma-buf/dma-resv.c +1
-1@@ -343,7 +343,7 @@ void dma_resv_replace_fences(struct dma_resv *obj, uint64_t context,if (old->context != context)continue ; -dma_resv_list_set (list, i, replacement, usage); +dma_resv_list_set (list, i,dma_fence_get (replacement), usage);dma_fence_put (old); } }
Did this ever land? I don't see it in drm-misc.
Alex
Quoted 31 lines · Christian König
Am 07.07.22 um 10:02 schrieb xinhui pan:
Quoted 4 lines
Need get the new fence when we replace the old one.
Fixes 047a1b877ed48 ("dma-buf & drm/amdgpu: remove dma_resv workaround")Signed-off-by xinhui pan <[email protected]>Good catch, Reviewed-by: Christian König <[email protected]>
Going to push that in a minute.
Christian.
Quoted 17 lines
--- drivers/dma-buf/dma-resv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/dma-buf/dma-resv.c +1
-1@@ -343,7 +343,7 @@ void dma_resv_replace_fences(struct dma_resv *obj, uint64_t context,if (old->context != context)continue ; -dma_resv_list_set (list, i, replacement, usage); +dma_resv_list_set (list, i,dma_fence_get (replacement), usage);dma_fence_put (old); } }