diff options
author | Eric Biggers <ebiggers@google.com> | 2019-02-26 14:08:58 -0800 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@bootlin.com> | 2019-03-18 08:45:57 +0100 |
commit | 36b6c9ed45afe89045973e8dee1b004dd5372d40 (patch) | |
tree | 8a87ce3696a429ae4beeec4543ae79a1cc1cebcc /kernel/cred.c | |
parent | 21d2b122732318b48c10b7262e15595ce54511d3 (diff) | |
download | linux-36b6c9ed45afe89045973e8dee1b004dd5372d40.tar.bz2 |
drm/vkms: fix use-after-free when drm_gem_handle_create() fails
If drm_gem_handle_create() fails in vkms_gem_create(), then the
vkms_gem_object is freed twice: once when the reference is dropped by
drm_gem_object_put_unlocked(), and again by the extra calls to
drm_gem_object_release() and kfree().
Fix it by skipping the second release and free.
This bug was originally found in the vgem driver by syzkaller using
fault injection, but I noticed it's also present in the vkms driver.
Fixes: 559e50fd34d1 ("drm/vkms: Add dumb operations")
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190226220858.214438-1-ebiggers@kernel.org
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Diffstat (limited to 'kernel/cred.c')
0 files changed, 0 insertions, 0 deletions