This is a note to let you know that I've just added the patch titled drm/sched: Cancel and flush all outstanding jobs before finish. to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-sched-cancel-and-flush-all-outstanding-jobs-before-finish.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From e582951baabba3e278c97169d0acc1e09b24a72e Mon Sep 17 00:00:00 2001 From: Andrey Grodzovsky <andrey.grodzovsky@xxxxxxx> Date: Mon, 18 Jan 2021 16:01:13 -0500 Subject: drm/sched: Cancel and flush all outstanding jobs before finish. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Andrey Grodzovsky <andrey.grodzovsky@xxxxxxx> commit e582951baabba3e278c97169d0acc1e09b24a72e upstream. To avoid any possible use after free. Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@xxxxxxx> Reviewed-by: Christian König <christian.koenig@xxxxxxx> Link: https://patchwork.freedesktop.org/patch/414814/ CC: stable@xxxxxxxxxxxxxxx Signed-off-by: Christian König <christian.koenig@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/scheduler/sched_main.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -890,6 +890,9 @@ void drm_sched_fini(struct drm_gpu_sched if (sched->thread) kthread_stop(sched->thread); + /* Confirm no work left behind accessing device structures */ + cancel_delayed_work_sync(&sched->work_tdr); + sched->ready = false; } EXPORT_SYMBOL(drm_sched_fini); Patches currently in stable-queue which might be from andrey.grodzovsky@xxxxxxx are queue-5.10/drm-sched-cancel-and-flush-all-outstanding-jobs-before-finish.patch