kernel_samsung_a53x/drivers/gpu/drm/vmwgfx
Zack Rusin d2990af3cd drm/vmwgfx: Fix possible null pointer derefence with invalid contexts
[ Upstream commit 517621b7060096e48e42f545fa6646fc00252eac ]

vmw_context_cotable can return either an error or a null pointer and its
usage sometimes went unchecked. Subsequent code would then try to access
either a null pointer or an error value.

The invalid dereferences were only possible with malformed userspace
apps which never properly initialized the rendering contexts.

Check the results of vmw_context_cotable to fix the invalid derefs.

Thanks:
ziming zhang(@ezrak1e) from Ant Group Light-Year Security Lab
who was the first person to discover it.
Niels De Graef who reported it and helped to track down the poc.

Fixes: 9c079b8ce8bf ("drm/vmwgfx: Adapt execbuf to the new validation api")
Cc: <stable@vger.kernel.org> # v4.20+
Reported-by: Niels De Graef  <ndegraef@redhat.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Cc: Martin Krastev <martin.krastev@broadcom.com>
Cc: Maaz Mombasawala <maaz.mombasawala@broadcom.com>
Cc: Ian Forbes <ian.forbes@broadcom.com>
Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com>
Reviewed-by: Martin Krastev <martin.krastev@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240110200305.94086-1-zack.rusin@broadcom.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 09:22:15 +01:00
..
device_include
Kconfig
Makefile
ttm_lock.c
ttm_lock.h
ttm_object.c
ttm_object.h
vmwgfx_binding.c drm/vmwgfx: Fix some static checker warnings 2024-11-19 09:22:15 +01:00
vmwgfx_binding.h
vmwgfx_blit.c drm/vmwgfx: switch over to the new pin interface v2 2024-11-19 09:22:14 +01:00
vmwgfx_bo.c drm/vmwgfx: switch over to the new pin interface v2 2024-11-19 09:22:14 +01:00
vmwgfx_cmdbuf.c drm/vmwgfx: Fix some static checker warnings 2024-11-19 09:22:15 +01:00
vmwgfx_cmdbuf_res.c drm/vmwgfx: Fix some static checker warnings 2024-11-19 09:22:15 +01:00
vmwgfx_context.c
vmwgfx_cotable.c drm/vmwgfx: switch over to the new pin interface v2 2024-11-19 09:22:14 +01:00
vmwgfx_drv.c drm/vmwgfx: switch over to the new pin interface v2 2024-11-19 09:22:14 +01:00
vmwgfx_drv.h drm/vmwgfx: switch over to the new pin interface v2 2024-11-19 09:22:14 +01:00
vmwgfx_execbuf.c drm/vmwgfx: Fix possible null pointer derefence with invalid contexts 2024-11-19 09:22:15 +01:00
vmwgfx_fb.c drm/vmwgfx: switch over to the new pin interface v2 2024-11-19 09:22:14 +01:00
vmwgfx_fence.c
vmwgfx_fence.h
vmwgfx_fifo.c
vmwgfx_gmr.c
vmwgfx_gmrid_manager.c
vmwgfx_ioctl.c
vmwgfx_irq.c
vmwgfx_kms.c
vmwgfx_kms.h
vmwgfx_ldu.c
vmwgfx_marker.c
vmwgfx_mob.c drm/vmwgfx: Fix some static checker warnings 2024-11-19 09:22:15 +01:00
vmwgfx_msg.c drm/vmwgfx: Fix some static checker warnings 2024-11-19 09:22:15 +01:00
vmwgfx_msg.h
vmwgfx_overlay.c
vmwgfx_page_dirty.c
vmwgfx_prime.c
vmwgfx_reg.h
vmwgfx_resource.c drm/vmwgfx: Fix some static checker warnings 2024-11-19 09:22:15 +01:00
vmwgfx_resource_priv.h
vmwgfx_scrn.c drm/vmwgfx: switch over to the new pin interface v2 2024-11-19 09:22:14 +01:00
vmwgfx_shader.c drm/vmwgfx: switch over to the new pin interface v2 2024-11-19 09:22:14 +01:00
vmwgfx_simple_resource.c
vmwgfx_so.c drm/vmwgfx: Fix some static checker warnings 2024-11-19 09:22:15 +01:00
vmwgfx_so.h
vmwgfx_stdu.c
vmwgfx_streamoutput.c
vmwgfx_surface.c
vmwgfx_thp.c
vmwgfx_ttm_buffer.c drm/vmwgfx: switch over to the new pin interface v2 2024-11-19 09:22:14 +01:00
vmwgfx_ttm_glue.c
vmwgfx_va.c
vmwgfx_validation.c drm/vmwgfx: Fix some static checker warnings 2024-11-19 09:22:15 +01:00
vmwgfx_validation.h