]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 19:02:04 +0000 (20:02 +0100)
commitde6a6f5151c8d7f2ee7e27ce632f4fe842097ff7
treee5e381ab13b39766bc246d1112b7f7021ab607e8
parentbf7ac708dd1b0f9bb84fc428338b03d1560bdd2f
drm/v3d: Fix a use-after-free race accessing the scheduler's fences.

[ Upstream commit 34c2c4f632f232ed2fdb66d4e42cc72d322273fe ]

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: 57692c94dcbe ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/v3d/v3d_drv.h
drivers/gpu/drm/v3d/v3d_gem.c