diff options
author | Zack Rusin <zackr@vmware.com> | 2023-02-08 21:00:50 +0300 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2023-02-15 06:05:21 +0300 |
commit | 36d421e632e9a0e8375eaed0143551a34d81a7e3 (patch) | |
tree | 1185f76b80051a8b8db7b6f8f1fe6955d604d2d5 /drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | |
parent | a44df74c720eb45d16a92ab9fc8a780d961d5e2b (diff) | |
download | linux-36d421e632e9a0e8375eaed0143551a34d81a7e3.tar.xz |
drm/vmwgfx: Stop accessing buffer objects which failed init
ttm_bo_init_reserved on failure puts the buffer object back which
causes it to be deleted, but kfree was still being called on the same
buffer in vmw_bo_create leading to a double free.
After the double free the vmw_gem_object_create_with_handle was
setting the gem function objects before checking the return status
of vmw_bo_create leading to null pointer access.
Fix the entire path by relaying on ttm_bo_init_reserved to delete the
buffer objects on failure and making sure the return status is checked
before setting the gem function objects on the buffer object.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Fixes: 8afa13a0583f ("drm/vmwgfx: Implement DRIVER_GEM")
Reviewed-by: Maaz Mombasawala <mombasawalam@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230208180050.2093426-1-zack@kde.org
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_shader.c')
0 files changed, 0 insertions, 0 deletions