From d3875a0cf7a476f7e4997cdbf14439a0e85f8639 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 26 Jan 2023 09:48:54 -0800 Subject: [PATCH] Backport MR #20933 to fix double-free crash (rhbz#2164667) --- 20933.patch | 35 +++++++++++++++++++++++++++++++++++ mesa.spec | 4 ++++ 2 files changed, 39 insertions(+) create mode 100644 20933.patch diff --git a/20933.patch b/20933.patch new file mode 100644 index 0000000..010ec78 --- /dev/null +++ b/20933.patch @@ -0,0 +1,35 @@ +From dd3730f8bdd7afdbc7fb0e9dd200951f9d713a34 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Corentin=20No=C3=ABl?= +Date: Thu, 26 Jan 2023 13:25:57 +0100 +Subject: [PATCH] kopper: Do not free the given screen in initScreen + implementation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The given screen is already freed by the caller in case a NULL-pointer is +returned by the implementation. + +Cc: mesa-stable +Signed-off-by: Corentin Noël +Reviewed-By: Mike Blumenkrantz +Part-of: +--- + src/gallium/frontends/dri/kopper.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c +index 8453585b8471..9e8056975150 100644 +--- a/src/gallium/frontends/dri/kopper.c ++++ b/src/gallium/frontends/dri/kopper.c +@@ -171,7 +171,6 @@ fail: + dri_destroy_screen_helper(screen); + if (screen->dev) + pipe_loader_release(&screen->dev, 1); +- FREE(screen); + return NULL; + } + +-- +GitLab + diff --git a/mesa.spec b/mesa.spec index d0f4ed7..a1cee2f 100644 --- a/mesa.spec +++ b/mesa.spec @@ -69,6 +69,10 @@ Patch10: gnome-shell-glthread-disable.patch # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19778 Patch11: mesa-valgrind-build-fix.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2164667 +# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20933 +Patch12: 20933.patch + BuildRequires: meson >= 0.61.4 BuildRequires: gcc BuildRequires: gcc-c++