All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dma-buf: Fix one use-after-free of fence
@ 2022-07-07  8:02 xinhui pan
  2022-07-07  8:05 ` Christian König
  0 siblings, 1 reply; 3+ messages in thread
From: xinhui pan @ 2022-07-07  8:02 UTC (permalink / raw)
  To: amd-gfx; +Cc: daniel.vetter, xinhui pan, christian.koenig, dri-devel

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 <xinhui.pan@amd.com>
---
 drivers/dma-buf/dma-resv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c
index 0cce6e4ec946..205acb2c744d 100644
--- a/drivers/dma-buf/dma-resv.c
+++ b/drivers/dma-buf/dma-resv.c
@@ -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);
 	}
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dma-buf: Fix one use-after-free of fence
  2022-07-07  8:02 [PATCH] dma-buf: Fix one use-after-free of fence xinhui pan
@ 2022-07-07  8:05 ` Christian König
  2022-07-28  3:09   ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2022-07-07  8:05 UTC (permalink / raw)
  To: xinhui pan, amd-gfx; +Cc: daniel.vetter, dri-devel

Am 07.07.22 um 10:02 schrieb xinhui pan:
> 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 <xinhui.pan@amd.com>

Good catch, Reviewed-by: Christian König <christian.koenig@amd.com>

Going to push that in a minute.

Christian.

> ---
>   drivers/dma-buf/dma-resv.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c
> index 0cce6e4ec946..205acb2c744d 100644
> --- a/drivers/dma-buf/dma-resv.c
> +++ b/drivers/dma-buf/dma-resv.c
> @@ -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);
>   	}
>   }


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dma-buf: Fix one use-after-free of fence
  2022-07-07  8:05 ` Christian König
@ 2022-07-28  3:09   ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2022-07-28  3:09 UTC (permalink / raw)
  To: Christian König; +Cc: daniel.vetter, xinhui pan, dri-devel, amd-gfx

Did this ever land?  I don't see it in drm-misc.

Alex

On Thu, Jul 7, 2022 at 4:05 AM Christian König <christian.koenig@amd.com> wrote:
>
> Am 07.07.22 um 10:02 schrieb xinhui pan:
> > 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 <xinhui.pan@amd.com>
>
> Good catch, Reviewed-by: Christian König <christian.koenig@amd.com>
>
> Going to push that in a minute.
>
> Christian.
>
> > ---
> >   drivers/dma-buf/dma-resv.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c
> > index 0cce6e4ec946..205acb2c744d 100644
> > --- a/drivers/dma-buf/dma-resv.c
> > +++ b/drivers/dma-buf/dma-resv.c
> > @@ -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);
> >       }
> >   }
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-28  3:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-07  8:02 [PATCH] dma-buf: Fix one use-after-free of fence xinhui pan
2022-07-07  8:05 ` Christian König
2022-07-28  3:09   ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.