Skip to content

Commit 3328395

Browse files
[AUTO-CHERRYPICK] Patch for gtk2 and gtk3 CVE-2024-6655 - branch main (#9967)
Co-authored-by: joejoew <111843948+joejoew@users.noreply.github.com>
1 parent 84853eb commit 3328395

4 files changed

Lines changed: 78 additions & 2 deletions

File tree

SPECS/gtk2/CVE-2024-6655.patch

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
From 3bbf0b6176d42836d23c36a6ac410e807ec0a7a7 Mon Sep 17 00:00:00 2001
2+
From: Matthias Clasen <mclasen@redhat.com>
3+
Date: Sat, 15 Jun 2024 14:18:01 -0400
4+
Subject: [PATCH] Stop looking for modules in cwd
5+
6+
This is just not a good idea. It is surprising, and can be misused.
7+
8+
Fixes: #6786
9+
---
10+
gtk/gtkmodules.c | 9 ++-------
11+
1 file changed, 2 insertions(+), 7 deletions(-)
12+
13+
diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c
14+
index 704e412aeb5..f93101c272e 100644
15+
--- a/gtk/gtkmodules.c
16+
+++ b/gtk/gtkmodules.c
17+
@@ -214,13 +214,8 @@ find_module (const gchar *name)
18+
gchar *module_name;
19+
20+
module_name = _gtk_find_module (name, "modules");
21+
- if (!module_name)
22+
- {
23+
- /* As last resort, try loading without an absolute path (using system
24+
- * library path)
25+
- */
26+
- module_name = g_module_build_path (NULL, name);
27+
- }
28+
+ if (module_name == NULL)
29+
+ return NULL;
30+
31+
module = g_module_open (module_name, G_MODULE_BIND_LOCAL | G_MODULE_BIND_LAZY);
32+
33+
--
34+
GitLab

SPECS/gtk2/gtk2.spec

100644100755
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
Summary: GTK+ graphical user interface library
1616
Name: gtk2
1717
Version: 2.24.32
18-
Release: 11%{?dist}
18+
Release: 12%{?dist}
1919
License: LGPLv2+
2020
Vendor: Microsoft Corporation
2121
Distribution: Mariner
@@ -36,6 +36,7 @@ Patch15: window-dragging.patch
3636
# Backported from upstream:
3737
Patch20: 0001-calendar-Use-the-new-OB-format-if-supported.patch
3838
Patch21: 0001-Fix-compiler-warnings-with-GCC-8.1.patch
39+
Patch22: CVE-2024-6655.patch
3940
BuildRequires: autoconf
4041
BuildRequires: automake
4142
BuildRequires: cairo-devel
@@ -317,6 +318,9 @@ gtk-query-immodules-2.0-%{__isa_bits} --update-cache
317318
%doc tmpdocs/examples
318319

319320
%changelog
321+
* Tue Jul 23 2024 Zhichun Wan <zhichunwan@microsoft.com> - 2.24.32-12
322+
- Patch CVE-2024-6655
323+
320324
* Wed Sep 20 2023 Jon Slobodzian <joslobo@microsoft.com> - 2.24.32-11
321325
- Recompile with stack-protection fixed gcc version (CVE-2023-4039)
322326

SPECS/gtk3/CVE-2024-6655.patch

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
From 3bbf0b6176d42836d23c36a6ac410e807ec0a7a7 Mon Sep 17 00:00:00 2001
2+
From: Matthias Clasen <mclasen@redhat.com>
3+
Date: Sat, 15 Jun 2024 14:18:01 -0400
4+
Subject: [PATCH] Stop looking for modules in cwd
5+
6+
This is just not a good idea. It is surprising, and can be misused.
7+
8+
Fixes: #6786
9+
---
10+
gtk/gtkmodules.c | 9 ++-------
11+
1 file changed, 2 insertions(+), 7 deletions(-)
12+
13+
diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c
14+
index 704e412aeb5..f93101c272e 100644
15+
--- a/gtk/gtkmodules.c
16+
+++ b/gtk/gtkmodules.c
17+
@@ -214,13 +214,8 @@ find_module (const gchar *name)
18+
gchar *module_name;
19+
20+
module_name = _gtk_find_module (name, "modules");
21+
- if (!module_name)
22+
- {
23+
- /* As last resort, try loading without an absolute path (using system
24+
- * library path)
25+
- */
26+
- module_name = g_module_build_path (NULL, name);
27+
- }
28+
+ if (module_name == NULL)
29+
+ return NULL;
30+
31+
module = g_module_open (module_name, G_MODULE_BIND_LOCAL | G_MODULE_BIND_LAZY);
32+
33+
--
34+
GitLab

SPECS/gtk3/gtk3.spec

100644100755
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
Summary: GTK+ graphical user interface library
1616
Name: gtk3
1717
Version: 3.24.28
18-
Release: 9%{?dist}
18+
Release: 10%{?dist}
1919
License: GPLv2+
2020
Vendor: Microsoft Corporation
2121
Distribution: Mariner
@@ -24,6 +24,7 @@ Source0: https://download.gnome.org/sources/gtk+/3.24/gtk+-%{version}.tar
2424
# https://bugzilla.redhat.com/show_bug.cgi?id=1946133
2525
# https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3387
2626
Patch0: 3387.patch
27+
Patch1: CVE-2024-6655.patch
2728
BuildRequires: cairo-devel >= %{cairo_version}
2829
BuildRequires: cairo-gobject-devel >= %{cairo_version}
2930
BuildRequires: cups-devel
@@ -289,6 +290,9 @@ gtk-query-immodules-3.0-%{__isa_bits} --update-cache &>/dev/null || :
289290
%{_datadir}/installed-tests/
290291

291292
%changelog
293+
* Tue Jul 23 2024 Zhichun Wan <zhichunwan@microsoft.com> - 3.24.28-10
294+
- Patch CVE-2024-6655
295+
292296
* Wed Sep 20 2023 Jon Slobodzian <joslobo@microsoft.com> - 3.24.28-9
293297
- Recompile with stack-protection fixed gcc version (CVE-2023-4039)
294298

0 commit comments

Comments
 (0)