Skip to content

Commit 48bfd02

Browse files
Min Lidaeinki
authored andcommitted
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>
1 parent 4a05955 commit 48bfd02

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/exynos/exynos_drm_g2d.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ int exynos_g2d_exec_ioctl(struct drm_device *drm_dev, void *data,
13351335
/* Let the runqueue know that there is work to do. */
13361336
queue_work(g2d->g2d_workq, &g2d->runqueue_work);
13371337

1338-
if (runqueue_node->async)
1338+
if (req->async)
13391339
goto out;
13401340

13411341
wait_for_completion(&runqueue_node->complete);

0 commit comments

Comments
 (0)