mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
radv: fix use-after-free upon GS copy shader cache hits
If radv_pipeline_cache_insert_shaders() finds a GS copy shader in the
cache, it will free the variant in gs_variants and replace it with the one
in the cache.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10433>
(cherry picked from commit d6894b643b)
This commit is contained in:
parent
5ddac7c5e7
commit
2c8eba7188
2 changed files with 3 additions and 1 deletions
|
|
@ -22,7 +22,7 @@
|
|||
"description": "radv: fix use-after-free upon GS copy shader cache hits",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3444,6 +3444,8 @@ radv_create_shaders(struct radv_pipeline *pipeline, struct radv_device *device,
|
|||
gs_variants[MESA_SHADER_GEOMETRY] = pipeline->gs_copy_shader;
|
||||
|
||||
radv_pipeline_cache_insert_shaders(device, cache, gs_copy_hash, gs_variants, gs_binaries);
|
||||
|
||||
pipeline->gs_copy_shader = gs_variants[MESA_SHADER_GEOMETRY];
|
||||
}
|
||||
free(gs_copy_binary);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue