Mesa (staging/21.2): panfrost: Zero initialize blend_shaders
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Aug 24 20:29:58 UTC 2021
Module: Mesa
Branch: staging/21.2
Commit: a352ba172df991e02a856be027338e0aee0438c3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a352ba172df991e02a856be027338e0aee0438c3
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Mon Aug 23 13:42:23 2021 -0400
panfrost: Zero initialize blend_shaders
Fixes an invalid read caught by valgrind when there is a hole in the
valid render target mask:
==6749== Conditional jump or move depends on uninitialised value(s)
==6749== at 0x5E88EC0: panfrost_prepare_fs_state (pan_cmdstream.c:417)
==6749== by 0x5E88EC0: panfrost_emit_frag_shader (pan_cmdstream.c:501)
==6749== by 0x5E88EC0: panfrost_emit_frag_shader_meta (pan_cmdstream.c:573)
==6749== by 0x5E88EC0: panfrost_update_state_fs (pan_cmdstream.c:2593)
==6749== by 0x5E8B0BF: panfrost_direct_draw (pan_cmdstream.c:2839)
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Fixes: a124c47b9f9 ("panfrost: Fix NULL derefs in pan_cmdstream.c")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11383>
(cherry picked from commit 3113dbd83710899c82478646011c1e1832f04fa1)
---
.pick_status.json | 2 +-
src/gallium/drivers/panfrost/pan_cmdstream.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index dd541422751..e530dc299d5 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -274,7 +274,7 @@
"description": "panfrost: Zero initialize blend_shaders",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "a124c47b9f90c3f18032928c24a06d157a0334c1"
},
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 88aab01d891..4d3a442eac9 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -695,7 +695,7 @@ panfrost_emit_frag_shader_meta(struct panfrost_batch *batch)
PAN_DESC_ARRAY(rt_count, BLEND));
}
- mali_ptr blend_shaders[PIPE_MAX_COLOR_BUFS];
+ mali_ptr blend_shaders[PIPE_MAX_COLOR_BUFS] = { 0 };
unsigned shader_offset = 0;
struct panfrost_bo *shader_bo = NULL;
More information about the mesa-commit
mailing list