mirror of
https://github.com/torvalds/linux.git
synced 2026-11-25 07:52:34 +00:00
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: [email protected]
Fixes: af33a9190d ("drm/vgem: Enable dmabuf import interfaces")
Reviewed-by: Chris Wilson <[email protected]>
Cc: Laura Abbott <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: [email protected]
Signed-off-by: Eric Biggers <[email protected]>
Acked-by: Laura Abbott <[email protected]>
Signed-off-by: Rodrigo Siqueira <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Maxime Ripard <[email protected]>