Mesa (main): turnip: Fix out-of-bounds builder->shader_iova access

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 10 14:32:13 UTC 2022


Module: Mesa
Branch: main
Commit: 4846d53b18a768390050ae168965f9619a2fafb2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4846d53b18a768390050ae168965f9619a2fafb2

Author: Danylo Piliaiev <dpiliaiev at igalia.com>
Date:   Fri Jun 10 12:31:08 2022 +0300

turnip: Fix out-of-bounds builder->shader_iova access

src/freedreno/vulkan/tu_pipeline.c:1722:72: runtime error: index 5 out of bounds for type 'uint64_t [5]'

Fixes: 05329d7f9acabbc9306c9538a30b502d4c580d38
("tu: Implement pipeline caching with shared Vulkan cache")

Signed-off-by: Danylo Piliaiev <dpiliaiev at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16967>

---

 src/freedreno/vulkan/tu_pipeline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c
index 9ad4a39db0e..60278313367 100644
--- a/src/freedreno/vulkan/tu_pipeline.c
+++ b/src/freedreno/vulkan/tu_pipeline.c
@@ -1713,7 +1713,7 @@ tu6_emit_program(struct tu_cs *cs,
       stage++;
    }
 
-   for (; stage < ARRAY_SIZE(builder->shaders->variants); stage++) {
+   for (; stage < ARRAY_SIZE(builder->shader_iova); stage++) {
       const struct ir3_shader_variant *xs = builder->shaders->variants[stage];
 
       if (stage == MESA_SHADER_FRAGMENT && binning_pass)



More information about the mesa-commit mailing list