]> git.baikalelectronics.ru Git - kernel.git/commit
drm/v3d: Fix a use-after-free race accessing the scheduler's fences.
authorEric Anholt <eric@anholt.net>
Fri, 28 Sep 2018 23:21:23 +0000 (16:21 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 15 Oct 2018 20:10:29 +0000 (13:10 -0700)
commit1fa91c9e111304e814197ec8262d36ec7ac190fe
treed36884a8ac5fac3aa0fb98fa83e0d9287781a399
parentc997c351cf71479b2e36f804323d40941319117c
drm/v3d: Fix a use-after-free race accessing the scheduler's fences.

Once we push the job, the scheduler could run it and free it.  So, if
we want to reference their fences, we need to grab them before then.
I haven't seen this happen in many days of conformance test runtime,
but let's still close the race.

Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: 1cc8c2fdf9bb ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+")
Link: https://patchwork.freedesktop.org/patch/254119/
Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
drivers/gpu/drm/v3d/v3d_drv.h
drivers/gpu/drm/v3d/v3d_gem.c