xref: /openbmc/openbmc/meta-openembedded/meta-oe/recipes-gnome/gtk+/gtk+/CVE-2024-6655.patch (revision 8460358c3d24c71d9d38fd126c745854a6301564)
1From 3bbf0b6176d42836d23c36a6ac410e807ec0a7a7 Mon Sep 17 00:00:00 2001
2From: Matthias Clasen <mclasen@redhat.com>
3Date: Sat, 15 Jun 2024 14:18:01 -0400
4Subject: [PATCH] Stop looking for modules in cwd
5
6This is just not a good idea. It is surprising, and can be misused.
7
8Fixes: #6786
9
10CVE: CVE-2024-6655
11
12Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gtk/-/commit/3bbf0b6176d42836d23c36a6ac410e807ec0a7a7]
13
14Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com>
15---
16 gtk/gtkmodules.c | 9 ++-------
17 1 file changed, 2 insertions(+), 7 deletions(-)
18
19diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c
20index e09b583..e75810c 100644
21--- a/gtk/gtkmodules.c
22+++ b/gtk/gtkmodules.c
23@@ -225,13 +225,8 @@ find_module (const gchar *name)
24   gchar *module_name;
25
26   module_name = _gtk_find_module (name, "modules");
27-  if (!module_name)
28-    {
29-      /* As last resort, try loading without an absolute path (using system
30-       * library path)
31-       */
32-      module_name = g_module_build_path (NULL, name);
33-    }
34+  if (module_name == NULL)
35+    return NULL;
36
37   module = g_module_open (module_name, G_MODULE_BIND_LOCAL | G_MODULE_BIND_LAZY);
38
39--
402.40.0
41