]> git.baikalelectronics.ru Git - kernel.git/commit
drm: hold gem reference until object is no longer accessed
authorSteve Cohen <cohens@codeaurora.org>
Mon, 20 Jul 2020 22:30:50 +0000 (18:30 -0400)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 27 Jul 2020 20:05:51 +0000 (22:05 +0200)
commitad70522a047dd02b31fc5862ceba99a47b9de9ad
tree4c48fca4801198cf553f3ec0438fb069a6516615
parentf2474d5e8b9ca7aaa2f65098f14531cc5c7c0df4
drm: hold gem reference until object is no longer accessed

A use-after-free in drm_gem_open_ioctl can happen if the
GEM object handle is closed between the idr lookup and
retrieving the size from said object since a local reference
is not being held at that point. Hold the local reference
while the object can still be accessed to fix this and
plug the potential security hole.

Signed-off-by: Steve Cohen <cohens@codeaurora.org>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1595284250-31580-1-git-send-email-cohens@codeaurora.org
drivers/gpu/drm/drm_gem.c