linux-stable/drivers/gpu/drm/vmwgfx
Zack Rusin 8d62e3d506 drm/vmwgfx: Fix an invalid read
[ Upstream commit 10a26e0d5f ]

vmw_move assumed that buffers to be moved would always be
vmw_buffer_object's but after introduction of new placement for mob
pages that's no longer the case.
The resulting invalid read didn't have any practical consequences
because the memory isn't used unless the object actually is a
vmw_buffer_object.
Fix it by moving the cast to the spot where the results are used.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Fixes: f6be23264b ("drm/vmwgfx: Introduce a new placement for MOB page tables")
Reported-by: Chuck Lever III <chuck.lever@oracle.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220318174332.440068-2-zack@kde.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:25:36 +02:00
..
device_include drm/vmwgfx: Update device headers for GL43 2021-12-09 13:16:22 -05:00
Kconfig drm/vmwgfx: Implement DRIVER_GEM 2021-12-09 13:16:16 -05:00
Makefile drm/vmwgfx: Remove explicit transparent hugepages support 2021-12-17 16:34:27 +01:00
ttm_object.c drm/vmwgfx: Implement DRIVER_GEM 2021-12-09 13:16:16 -05:00
ttm_object.h drm/vmwgfx: Implement DRIVER_GEM 2021-12-09 13:16:16 -05:00
vmw_surface_cache.h
vmwgfx_binding.c drm/vmwgfx: add support for updating only offsets of constant buffers 2021-12-09 13:16:30 -05:00
vmwgfx_binding.h drm/vmwgfx: add support for updating only offsets of constant buffers 2021-12-09 13:16:30 -05:00
vmwgfx_blit.c
vmwgfx_bo.c drm/vmwgfx: Fix gem refcounting and memory evictions 2022-04-27 14:41:15 +02:00
vmwgfx_cmd.c drm/vmwgfx: Disable command buffers on svga3 without gbobjects 2022-05-18 10:28:21 +02:00
vmwgfx_cmdbuf.c drm/vmwgfx: Make use of PFN_ALIGN/PFN_UP helper macro 2021-08-09 17:30:34 -04:00
vmwgfx_cmdbuf_res.c drm/vmwgfx: Remove the dedicated memory accounting 2021-12-09 13:16:10 -05:00
vmwgfx_context.c drm/vmwgfx: Implement DRIVER_GEM 2021-12-09 13:16:16 -05:00
vmwgfx_cotable.c drm/vmwgfx: Implement DRIVER_GEM 2021-12-09 13:16:16 -05:00
vmwgfx_devcaps.c
vmwgfx_devcaps.h
vmwgfx_drv.c drm/vmwgfx: Fix gem refcounting and memory evictions 2022-04-27 14:41:15 +02:00
vmwgfx_drv.h drm/vmwgfx: Fix fencing on SVGAv3 2022-05-18 10:28:16 +02:00
vmwgfx_execbuf.c drm/vmwgfx: Fix stale file descriptors on failed usercopy 2022-01-27 17:55:20 +02:00
vmwgfx_fb.c drm/vmwgfx: Initialize drm_mode_fb_cmd2 2022-05-18 10:28:22 +02:00
vmwgfx_fence.c drm/vmwgfx: Fix fencing on SVGAv3 2022-05-18 10:28:16 +02:00
vmwgfx_fence.h
vmwgfx_gem.c drm/vmwgfx: Fix a size_t/long int format specifier mismatch 2021-12-17 16:34:02 +01:00
vmwgfx_gmr.c
vmwgfx_gmrid_manager.c drm/vmwgfx: Add a debug callback to mobid resource manager 2021-12-09 13:16:15 -05:00
vmwgfx_hashtab.c drm/vmwgfx: Copy DRM hash-table code into driver 2021-11-30 09:41:25 +01:00
vmwgfx_hashtab.h drm/vmwgfx: Copy DRM hash-table code into driver 2021-11-30 09:41:25 +01:00
vmwgfx_ioctl.c drm/vmwgfx: Allow checking for gl43 contexts 2021-12-09 13:16:29 -05:00
vmwgfx_irq.c drm/vmwgfx: Fix fencing on SVGAv3 2022-05-18 10:28:16 +02:00
vmwgfx_kms.c drm/vmwgfx: validate the screen formats 2022-06-09 10:25:17 +02:00
vmwgfx_kms.h drm/vmwgfx: validate the screen formats 2022-06-09 10:25:17 +02:00
vmwgfx_ldu.c
vmwgfx_mksstat.h
vmwgfx_mob.c drm/vmwgfx: Remove unused compile options 2021-12-17 16:35:02 +01:00
vmwgfx_msg.c treewide: Replace the use of mem_encrypt_active() with cc_platform_has() 2021-10-04 11:47:24 +02:00
vmwgfx_msg_arm64.h
vmwgfx_msg_x86.h
vmwgfx_overlay.c drm/vmwgfx: Implement DRIVER_GEM 2021-12-09 13:16:16 -05:00
vmwgfx_page_dirty.c drm/vmwgfx: Remove the dedicated memory accounting 2021-12-09 13:16:10 -05:00
vmwgfx_prime.c drm/vmwgfx: Implement DRIVER_GEM 2021-12-09 13:16:16 -05:00
vmwgfx_reg.h
vmwgfx_resource.c drm/vmwgfx: Fix an invalid read 2022-06-09 10:25:36 +02:00
vmwgfx_resource_priv.h
vmwgfx_scrn.c drm/vmwgfx: Implement DRIVER_GEM 2021-12-09 13:16:16 -05:00
vmwgfx_shader.c drm/vmwgfx: Implement DRIVER_GEM 2021-12-09 13:16:16 -05:00
vmwgfx_simple_resource.c drm/vmwgfx: Implement DRIVER_GEM 2021-12-09 13:16:16 -05:00
vmwgfx_so.c drm/vmwgfx: support SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE_V2 command 2021-12-09 13:16:27 -05:00
vmwgfx_so.h drm/vmwgfx: support SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE_V2 command 2021-12-09 13:16:27 -05:00
vmwgfx_stdu.c drm/vmwgfx: Remove unused compile options 2021-12-17 16:35:02 +01:00
vmwgfx_streamoutput.c drm/vmwgfx: Remove the dedicated memory accounting 2021-12-09 13:16:10 -05:00
vmwgfx_surface.c drm/vmwgfx: Fix gem refcounting and memory evictions 2022-04-27 14:41:15 +02:00
vmwgfx_system_manager.c drm/vmwgfx: Introduce a new placement for MOB page tables 2021-12-01 11:58:35 -05:00
vmwgfx_ttm_buffer.c drm/vmwgfx: Remove usage of MOBFMT_RANGE 2021-12-09 13:16:34 -05:00
vmwgfx_ttm_glue.c drm/vmwgfx: Implement DRIVER_GEM 2021-12-09 13:16:16 -05:00
vmwgfx_va.c drm/vmwgfx: Implement DRIVER_GEM 2021-12-09 13:16:16 -05:00
vmwgfx_validation.c drm/vmwgfx: Remove the dedicated memory accounting 2021-12-09 13:16:10 -05:00
vmwgfx_validation.h drm/vmwgfx: Remove the dedicated memory accounting 2021-12-09 13:16:10 -05:00