Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/exynos: fix race condition UAF in exynos_g2d_exec_ioctl

If it is async, runqueue_node is freed in g2d_runqueue_worker on another
worker thread. So in extreme cases, if g2d_runqueue_worker runs first, and
then executes the following if statement, there will be use-after-free.

Signed-off-by: Min Li <lm0963hack@gmail.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

authored by

Min Li and committed by
Inki Dae
48bfd025 4a059559

+1 -1
+1 -1
drivers/gpu/drm/exynos/exynos_drm_g2d.c
··· 1335 1335 /* Let the runqueue know that there is work to do. */ 1336 1336 queue_work(g2d->g2d_workq, &g2d->runqueue_work); 1337 1337 1338 - if (runqueue_node->async) 1338 + if (req->async) 1339 1339 goto out; 1340 1340 1341 1341 wait_for_completion(&runqueue_node->complete);