radv/amdgpu: fix a buffer overflow for submissions with RADV_DEBUG=noibs
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 15 Jun 2023 08:00:57 +0000 (10:00 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 19 Jun 2023 07:33:35 +0000 (07:33 +0000)
commit8e1579a21421ffee3cb5a6477bf1fa57ec615003
tree721d19dbb0e93d0b7ea5435715e2338f43e786d9
parent795bf984c6bdbddb33dd00b7bf62c547a7855854
radv/amdgpu: fix a buffer overflow for submissions with RADV_DEBUG=noibs

With RADV_DEBUG=noibs (aka no chaining) the number of IBs to submit
depends on the number of old IB buffers of every CS.

This fixes a stack smashing error.

Fixes: 53b439d24fa ("radv/amdgpu: Use STACK_ARRAY for IB array to reduce stack usage."
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23669>
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c