Re: [PATCH] dma-buf: Precheck for a valid dma_fence before acquiring the reference

2020-02-21 Thread Daniel Vetter
On Fri, Feb 21, 2020 at 4:26 PM Chris Wilson wrote: > > Quoting Chris Wilson (2020-02-21 15:23:38) > > Quoting Daniel Vetter (2020-02-21 15:17:24) > > > On Fri, Feb 21, 2020 at 3:38 PM Chris Wilson > > > wrote: > > > > dma_fence_get_rcu() is used to acquire a reference to under a dma-fence > > >

Re: [PATCH] dma-buf: Precheck for a valid dma_fence before acquiring the reference

2020-02-21 Thread Chris Wilson
Quoting Chris Wilson (2020-02-21 15:23:38) > Quoting Daniel Vetter (2020-02-21 15:17:24) > > On Fri, Feb 21, 2020 at 3:38 PM Chris Wilson > > wrote: > > > dma_fence_get_rcu() is used to acquire a reference to under a dma-fence > > > under racey conditions -- a perfect recipe for a disaster. As we

Re: [PATCH] dma-buf: Precheck for a valid dma_fence before acquiring the reference

2020-02-21 Thread Chris Wilson
Quoting Daniel Vetter (2020-02-21 15:17:24) > On Fri, Feb 21, 2020 at 3:38 PM Chris Wilson wrote: > > dma_fence_get_rcu() is used to acquire a reference to under a dma-fence > > under racey conditions -- a perfect recipe for a disaster. As we know > > the caller may be handling stale memory, use k

Re: [PATCH] dma-buf: Precheck for a valid dma_fence before acquiring the reference

2020-02-21 Thread Daniel Vetter
On Fri, Feb 21, 2020 at 3:38 PM Chris Wilson wrote: > dma_fence_get_rcu() is used to acquire a reference to under a dma-fence > under racey conditions -- a perfect recipe for a disaster. As we know > the caller may be handling stale memory, use kasan to confirm the > dma-fence, or rather its memor

[PATCH] dma-buf: Precheck for a valid dma_fence before acquiring the reference

2020-02-21 Thread Chris Wilson
dma_fence_get_rcu() is used to acquire a reference to under a dma-fence under racey conditions -- a perfect recipe for a disaster. As we know the caller may be handling stale memory, use kasan to confirm the dma-fence, or rather its memory block, is valid before attempting to acquire a reference. T