Commit 48bfd025 authored by Min Li's avatar Min Li Committed by Inki Dae

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: default avatarMin Li <lm0963hack@gmail.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@kernel.org>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent 4a059559
...@@ -1335,7 +1335,7 @@ int exynos_g2d_exec_ioctl(struct drm_device *drm_dev, void *data, ...@@ -1335,7 +1335,7 @@ int exynos_g2d_exec_ioctl(struct drm_device *drm_dev, void *data,
/* Let the runqueue know that there is work to do. */ /* Let the runqueue know that there is work to do. */
queue_work(g2d->g2d_workq, &g2d->runqueue_work); queue_work(g2d->g2d_workq, &g2d->runqueue_work);
if (runqueue_node->async) if (req->async)
goto out; goto out;
wait_for_completion(&runqueue_node->complete); wait_for_completion(&runqueue_node->complete);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment