mesa/src
Mike Blumenkrantz 6084c73575 util/vbuf: fix buffer overrun in attribute conversions
using the stride to calculate the buffer map size here is not correct, as
the stride is not necessarily equal to the attribute size, it's only the distance
between elements. for the case of overlapping elements (cts does this), the result
is that the attribute conversion will read past the end of the mapped src region

this is usually fine for drivers when they directly map the vertex buffer, as the memory
past the requested region is usually made available, but in the case where the readback
occurs using a staging resource sized exactly to the map region, this overflows and fails
silently, not even triggering a valgrind error because gpu memory lol

instead, add the size of the largest possible element, which will automatically be clamped
and ensure any staging buffers are correctly sized

Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10963>
(cherry picked from commit 3c5b7dca30)
2021-06-10 13:23:21 +02:00
..
amd aco: use v1b/v2b for ds_read_u8/ds_read_u16 2021-06-10 13:23:18 +02:00
android_stub android: add some more stub functions for cross compilation 2021-03-25 06:06:16 +00:00
broadcom Revert "glx: Lift sending the MakeCurrent request to top-level code" 2021-04-18 22:13:21 +02:00
compiler nir/algebraic: Invert comparisons less often 2021-05-31 22:48:16 +02:00
drm-shim drm-shim: report support for timeline semaphores 2021-02-09 21:08:52 +00:00
egl egl: zero is a valid fd 2021-06-10 13:23:11 +02:00
etnaviv etnaviv: tell the truth if alpha-test is supported 2021-04-08 19:25:26 +00:00
freedreno freedreno/ir3: Fix use after free 2021-06-10 13:23:16 +02:00
gallium util/vbuf: fix buffer overrun in attribute conversions 2021-06-10 13:23:21 +02:00
gbm egl: fix software flag in _eglAddDevice call on DRM 2021-03-26 10:32:31 +00:00
getopt scons: Remove. 2021-03-20 10:38:55 +00:00
glx glx: revert "Downgrade sRGB-ful fbconfigs" 2021-05-03 23:55:02 +02:00
gtest
hgl hgl: Major refactor and cleanup 2021-01-09 20:51:35 -06:00
imgui
intel anv: Handle OOM in the pinned path in anv_reloc_list_add 2021-06-10 13:23:15 +02:00
loader loader: prefer iris on Android 2021-03-31 06:28:18 +00:00
mapi mesa: fix incomplete GL_NV_half_float implementation 2021-04-26 19:05:42 +02:00
mesa classic/xlib: Fix the build after !9817 2021-06-10 13:23:20 +02:00
microsoft microsoft/compiler: Fix MSVC warning C4334 (32bit shift cast to 64bit) 2021-04-20 19:43:26 +02:00
nouveau nouveau: add drm-shim support 2021-01-11 22:45:01 +00:00
panfrost panfrost: Use first_tiler to check if tiling is needed 2021-06-05 17:56:52 +02:00
util radv: enable RADV_DEBUG=invariantgeom for SotTR DX11/DX12 versions 2021-06-05 18:29:18 +02:00
virtio venus: Fix zero-initialized fd causing apps to hang/crash 2021-05-18 23:02:27 +02:00
vulkan vulkan/device_select: avoid segfault on Wayland if wl_drm is unavailable 2021-06-02 20:08:40 +02:00
meson.build venus: add driver skeleton 2021-04-08 17:15:37 +00:00