Eric Biggers 21d2b12273
drm/vgem: fix use-after-free when drm_gem_handle_create() fails
If drm_gem_handle_create() fails in vgem_gem_create(), then the
drm_vgem_gem_object is freed twice: once when the reference is dropped
by drm_gem_object_put_unlocked(), and again by __vgem_gem_destroy().

This was hit by syzkaller using fault injection.

Fix it by skipping the second free.

Reported-by: syzbot+e73f2fb5ed5a5df36d33@syzkaller.appspotmail.com
Fixes: af33a9190d02 ("drm/vgem: Enable dmabuf import interfaces")
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190226214451.195123-1-ebiggers@kernel.org
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-03-18 08:45:57 +01:00
..
2019-01-24 13:20:42 +01:00
2019-01-24 13:20:42 +01:00
2019-03-04 12:02:55 +10:00
2019-03-08 08:23:15 -08:00
2019-02-05 10:28:13 +01:00
2019-01-29 15:45:21 +01:00
2019-01-24 13:20:42 +01:00
2019-02-18 13:27:15 +10:00
2019-01-29 15:45:21 +01:00
2019-03-08 08:23:15 -08:00
2019-03-12 10:04:00 -07:00
2019-02-18 13:27:15 +10:00
2019-01-24 13:20:42 +01:00
2019-01-29 15:45:21 +01:00
2019-03-04 12:02:55 +10:00
2019-02-18 13:27:15 +10:00
2019-01-24 13:20:42 +01:00
2019-01-24 13:20:42 +01:00
2019-02-18 13:27:15 +10:00
2019-02-11 13:32:49 +10:00
2019-01-24 13:20:42 +01:00
2019-01-24 13:20:42 +01:00
2019-01-24 13:20:42 +01:00
2019-02-18 13:27:15 +10:00
2019-02-18 13:27:15 +10:00
2019-03-09 15:53:03 -08:00
2019-01-24 13:20:42 +01:00
2019-02-18 13:27:15 +10:00
2019-01-10 05:58:52 +10:00
2018-11-20 14:56:18 +01:00
2019-01-12 13:07:30 +01:00
2019-02-18 13:27:15 +10:00
2019-03-05 08:14:22 +10:00
2019-01-10 05:58:52 +10:00
2019-01-29 15:45:21 +01:00
2019-02-18 13:27:15 +10:00
2019-02-04 10:21:17 +01:00
2019-01-10 05:58:52 +10:00
2019-02-18 13:27:15 +10:00
2019-01-12 13:07:58 +01:00
2018-11-30 10:57:18 +01:00