Files
mesa/src
Mike Blumenkrantz 3c5b7dca30 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>
2021-06-09 21:52:12 +00:00
..
2021-03-20 10:38:55 +00:00
2021-01-09 20:51:35 -06:00
2021-06-09 21:28:17 +00:00
2021-01-11 22:45:01 +00:00
2021-05-18 14:28:48 +00:00