vulkan: fix use-after-free in vk_common_DestroyDebugReportCallbackEXT

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: bd1705a480 ("vulkan: Make vk_debug_report_callback derive from vk_object_base")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10433>
This commit is contained in:
Rhys Perry 2021-04-23 12:49:33 +01:00 committed by Marge Bot
parent c425b67c76
commit 32ebbd8c23

View file

@ -88,10 +88,9 @@ vk_common_DestroyDebugReportCallbackEXT(VkInstance _instance,
/* Remove from list and destroy given callback. */
mtx_lock(&instance->debug_report.callbacks_mutex);
list_del(&callback->link);
vk_object_base_finish(&callback->base);
vk_free2(&instance->alloc, pAllocator, callback);
mtx_unlock(&instance->debug_report.callbacks_mutex);
vk_object_base_finish(&callback->base);
}
static void