Skip to content

vulkan/shader_module: Fix the lifetime of temporary shader modules

Pierre-Eric Pelloux-Prayer requested to merge foofoo into main

The vk_shader_module_handle_from_nir() macro was constructing a temporary vk_shader_module and passing it through vk_shader_module_to_handle(). Since this is a function and not a macro, it means that the lifetime of the temporary vk_shader_module will end once the to_handle() function is called. Technically, this is a use-after-free. I really don't know why no one has been bitten by this yet....

Fixes: a41e98dd "vk/util: add a util macro for initializing stack..." Reviewed-by: Alejandro Piñeiro apinheiro@igalia.com Part-of: mesa/mesa!13101 (merged)

Merge request reports