Timo Aaltonen pushed to branch debian-unstable at X Strike Force / lib / mesa
Commits: 995d2c7d by Timo Aaltonen at 2022-12-05T16:34:34+02:00 patches: Import two upstream commits to fix crashes when libd3d12.so can't be found. (Closes: #1025312) - - - - - 42ebe819 by Timo Aaltonen at 2022-12-05T16:40:11+02:00 release to sid - - - - - 4 changed files: - debian/changelog - + debian/patches/0001-d3d12-Don-t-crash-when-libd3d12.so-can-t-be-found.patch - + debian/patches/0002-dzn-Don-t-crash-when-libd3d12.so-can-t-be-found.patch - debian/patches/series Changes: ===================================== debian/changelog ===================================== @@ -1,3 +1,10 @@ +mesa (22.3.0-2) unstable; urgency=medium + + * patches: Import two upstream commits to fix crashes when libd3d12.so + can't be found. (Closes: #1025312) + + -- Timo Aaltonen <[email protected]> Mon, 05 Dec 2022 16:34:36 +0200 + mesa (22.3.0-1) unstable; urgency=medium * New upstream release. ===================================== debian/patches/0001-d3d12-Don-t-crash-when-libd3d12.so-can-t-be-found.patch ===================================== @@ -0,0 +1,35 @@ +From b3d1ae19f2f4d93cf0a5f45a598149ac4e8e05aa Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" <[email protected]> +Date: Sun, 4 Dec 2022 00:17:57 +0000 +Subject: [PATCH 1/2] d3d12: Don't crash when libd3d12.so can't be found + +`d3d12_destroy_screen` is called by `d3d12_create_dxcore_screen` after +`d3d12_init_screen_base` fails and attempts to call `util_dl_close` on +a NULL pointer, leading to an abort. + +To fix this, only close the library after if it was actually opened. + +Cc: mesa-stable +Reviewed-by: Jesse Natalie <[email protected]> +Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20145> +--- + src/gallium/drivers/d3d12/d3d12_screen.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp +index 7debc1f0c57..e9aca69819f 100644 +--- a/src/gallium/drivers/d3d12/d3d12_screen.cpp ++++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp +@@ -743,7 +743,8 @@ d3d12_destroy_screen(struct d3d12_screen *screen) + slab_destroy_parent(&screen->transfer_pool); + mtx_destroy(&screen->submit_mutex); + mtx_destroy(&screen->descriptor_pool_mutex); +- util_dl_close(screen->d3d12_mod); ++ if (screen->d3d12_mod) ++ util_dl_close(screen->d3d12_mod); + glsl_type_singleton_decref(); + FREE(screen); + } +-- +2.37.2 + ===================================== debian/patches/0002-dzn-Don-t-crash-when-libd3d12.so-can-t-be-found.patch ===================================== @@ -0,0 +1,35 @@ +From b5133894005720db24a8e0cc17e047a291953ff4 Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" <[email protected]> +Date: Sun, 4 Dec 2022 00:21:45 +0000 +Subject: [PATCH 2/2] dzn: Don't crash when libd3d12.so can't be found + +`dzn_instance_create` will call `dzn_instance_destroy` when the d3d12 +library fails to load. Just like the issue in `d3d12_screen`, this will +lead to a crash because `d3d12_mod` is NULL. + +To fix this, only close the library after if it was actually opened. + +Cc: mesa-stable +Reviewed-by: Jesse Natalie <[email protected]> +Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20145> +--- + src/microsoft/vulkan/dzn_device.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/microsoft/vulkan/dzn_device.c b/src/microsoft/vulkan/dzn_device.c +index 16a5aca331f..8f9b5939eb8 100644 +--- a/src/microsoft/vulkan/dzn_device.c ++++ b/src/microsoft/vulkan/dzn_device.c +@@ -174,7 +174,8 @@ dzn_instance_destroy(struct dzn_instance *instance, const VkAllocationCallbacks + if (instance->factory) + ID3D12DeviceFactory_Release(instance->factory); + +- util_dl_close(instance->d3d12_mod); ++ if (instance->d3d12_mod) ++ util_dl_close(instance->d3d12_mod); + + vk_instance_finish(&instance->vk); + vk_free2(vk_default_allocator(), alloc, instance); +-- +2.37.2 + ===================================== debian/patches/series ===================================== @@ -1,3 +1,5 @@ 07_gallium-fix-build-failure-on-powerpcspe.diff path_max.diff src_glx_dri_common.h.diff +0001-d3d12-Don-t-crash-when-libd3d12.so-can-t-be-found.patch +0002-dzn-Don-t-crash-when-libd3d12.so-can-t-be-found.patch View it on GitLab: https://salsa.debian.org/xorg-team/lib/mesa/-/compare/e1382d8ec8712426a51f8fd75a3056465a165e02...42ebe8192485746db833d8299ee2e80e82f913b5 -- View it on GitLab: https://salsa.debian.org/xorg-team/lib/mesa/-/compare/e1382d8ec8712426a51f8fd75a3056465a165e02...42ebe8192485746db833d8299ee2e80e82f913b5 You're receiving this email because of your account on salsa.debian.org.

