Re: [PATCH v1 1/2] drm/sched: cache the timeline name to fix a use-after-free

From: Christian König

Date: Wed Sep 02 2026 - 10:10:14 EST


On 9/2/26 13:39, Philipp Stanner wrote:
> On Wed, 2026-09-02 at 11:20 +0100, Tvrtko Ursulin wrote:
>>
>> To collate two replies in one:
>>
>> On 02/09/2026 11:07, Philipp Stanner wrote:
>>
>>>
>>> The issue here IMO is that we are discussing working around an issue
>>> that actually stems from dma_fence not being consistently synchronized,
>>> notably because of the ops->release callback being implemented.
>>>
>>> ops->release is de facto deprecated, precisely for reasons like these.
>>>
>>> If we could get rid of it for sched_fence, dma_fence would take care of
>>> the decoupling of the name callbacks.
>>>
>>> So that appears worth investigating from my POV.
>>
>> I completely agree here but I am just not sure how feasible that would
>> be. We may accept to live with the cross-documentation workaround at
>> least as a start since even if feasible it could be a lot of work to
>> change sched_fence like that.
>
>
> It should be enough to remove ops->release for the finished_fence for
> now, since that's the one typically (always?) shared with userspace.
>
> All that release cb does is drop yet another reference.

IIRC at some point that change was part of what my patch set to the drm_sched_fence did when I came up with the inline fence.

This was far from completed / thought through but might be useful digging that up again for a start.

Christian.

> I think it's worth an investigation. Maybe 김종혁 can give it a look?
>
>
> P.