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

From: Tvrtko Ursulin

Date: Fri Sep 04 2026 - 05:15:43 EST



To address only one narrow point quickly, I haven't had the time to catch up with the thread yet:

On 04/09/2026 09:31, Jonghyuk Kim(MalHyuk) wrote:

8><

One thing I noticed while checking the callers: the tracepoints in
include/trace/events/dma_fence.h and drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
call fence->ops->get_driver_name() / get_timeline_name() directly instead of
going through the helpers, so they are not covered by the above. That looks
like a pre-existing and much narrower exposure (tracing only), but let me know
if you want it addressed in the same series or separately.

For the dma_fence.h see the comment:

/*
* Safe only for call sites which are guaranteed to not race with fence
* signaling, holding the fence->lock and having checked for not signaled, or
* the signaling path itself.
*
* TODO: Remove the need for this event class when drivers switch to independent
* fences.
*/


These tracepoints call the name vfuncs directly: dma_fence_init, dma_fence_enable_signal, dma_fence_signaled. So those are supposed to be safe as per comment and changing them to use the helper would create a different issue (can't remember from the top of my head which one - but the thread is moving fast so I wanted to reply quickly).

amdgpu_trace.h also look safe on a quick look because they are called before the job which can signal the fence is submitted.

Regards,

Tvrtko