From b3198a53a34136e3b0d45f41685722efae8b8c54 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 29 Feb 2024 23:25:42 +0100 Subject: [PATCH] fixup! drm/scheduler: Fix UAF in drm_sched_fence_get_timeline_name (cherry picked from commit 19646934fe8b9d2c25ddba84e052c645491315d7 https://github.com/AsahiLinux/linux) Signed-off-by: John Cabaj --- drivers/gpu/drm/scheduler/sched_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/scheduler/sched_fence.c b/drivers/gpu/drm/scheduler/sched_fence.c index 0333ae935f15bc..2c197cfffdeae0 100644 --- a/drivers/gpu/drm/scheduler/sched_fence.c +++ b/drivers/gpu/drm/scheduler/sched_fence.c @@ -226,7 +226,7 @@ void drm_sched_fence_init(struct drm_sched_fence *fence, unsigned seq; fence->sched = entity->rq->sched; - strlcpy(fence->sched_name, entity->rq->sched->name, + strscpy(fence->sched_name, entity->rq->sched->name, sizeof(fence->sched_name)); seq = atomic_inc_return(&entity->fence_seq); dma_fence_init(&fence->scheduled, &drm_sched_fence_ops_scheduled,