From a8ca4600561e01de64d6fb9176dc79b9209b3891 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 31 May 2023 05:23:03 +1000 Subject: [PATCH] radv/meta: fix uninitialised stack memory usage. ==10199== Conditional jump or move depends on uninitialised value(s) ==10199== at 0xA107B13: radv_resume_queries (radv_meta.c:93) ==10199== by 0xA108097: radv_meta_restore (radv_meta.c:225) ==10199== Uninitialised value was created by a stack allocation ==10199== at 0xA1145B2: fill_buffer_shader (radv_meta_buffer.c:171) saved_state is never memset, so the value should be inited. Cc: mesa-stable Reviewed-by: Samuel Pitoiset Part-of: (cherry picked from commit 54ceec8d9e0eab30efa21547b15ed66b1655e480) --- .pick_status.json | 2 +- src/amd/vulkan/meta/radv_meta.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 300aed8f379..1777371b5fb 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -562,7 +562,7 @@ "description": "radv/meta: fix uninitialised stack memory usage.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/amd/vulkan/meta/radv_meta.c b/src/amd/vulkan/meta/radv_meta.c index f83a7eb76ba..92313819bc4 100644 --- a/src/amd/vulkan/meta/radv_meta.c +++ b/src/amd/vulkan/meta/radv_meta.c @@ -127,6 +127,7 @@ radv_meta_save(struct radv_meta_saved_state *state, struct radv_cmd_buffer *cmd_ assert(flags & (RADV_META_SAVE_GRAPHICS_PIPELINE | RADV_META_SAVE_COMPUTE_PIPELINE)); state->flags = flags; + state->active_occlusion_queries = 0; state->active_prims_gen_gds_queries = 0; state->active_prims_xfb_gds_queries = 0;