]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vkms: Hold gem object while still in-use
authorEzequiel Garcia <ezequiel@collabora.com>
Mon, 27 Apr 2020 21:44:05 +0000 (18:44 -0300)
committerRodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Thu, 7 May 2020 01:51:46 +0000 (21:51 -0400)
commit0ccfa309b03c243478fc867a0d6ab20e049847f5
tree47cd2b2a7c0892bbb040ea4914d758414d7bf263
parent8cd2857a25e6c3015677038dc4d98b0a5a3aaf5f
drm/vkms: Hold gem object while still in-use

We need to keep the reference to the drm_gem_object
until the last access by vkms_dumb_create.

Therefore, the put the object after it is used.

This fixes a use-after-free issue reported by syzbot.

While here, change vkms_gem_create() symbol to static.

Reported-and-tested-by: syzbot+e3372a2afe1e7ef04bc7@syzkaller.appspotmail.com
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200427214405.13069-1-ezequiel@collabora.com
drivers/gpu/drm/vkms/vkms_drv.h
drivers/gpu/drm/vkms/vkms_gem.c