summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-graphics/openbox/files/0001-Fix-list-traversal-issue-in-client_calc_layer.patch56
-rw-r--r--meta-oe/recipes-graphics/openbox/openbox_3.6.1.bb1
2 files changed, 57 insertions, 0 deletions
diff --git a/meta-oe/recipes-graphics/openbox/files/0001-Fix-list-traversal-issue-in-client_calc_layer.patch b/meta-oe/recipes-graphics/openbox/files/0001-Fix-list-traversal-issue-in-client_calc_layer.patch
new file mode 100644
index 000000000..8bc2b80f6
--- /dev/null
+++ b/meta-oe/recipes-graphics/openbox/files/0001-Fix-list-traversal-issue-in-client_calc_layer.patch
@@ -0,0 +1,56 @@
1From d41128e5a1002af41c976c8860f8299cfcd3cd72 Mon Sep 17 00:00:00 2001
2From: pldubouilh <pldubouilh@gmail.com>
3Date: Fri, 17 Mar 2023 18:23:47 +0100
4Subject: [PATCH] Fix list traversal issue in client_calc_layer
5
6The calls to client_calc_layer_internal can modify stacking_list, which
7can cause us to follow dangling ->next pointers (either by the pointer
8itself already being freed, or it pointing to a freed area). Avoid this
9by copying the list first, the goal is to visit every client in the list
10once so this should be fine.
11
12Upstream-Status: Backport [http://git.openbox.org/?p=mikachu/openbox.git;a=commit;h=d41128e5a1002af41c976c8860f8299cfcd3cd72]
13Signed-off-by: Alexandre Videgrain <alexandre.videgrain@smile.fr>
14---
15 openbox/client.c | 9 +++++++--
16 1 file changed, 7 insertions(+), 2 deletions(-)
17
18diff --git a/openbox/client.c b/openbox/client.c
19index 7168b240..b8264587 100644
20--- a/openbox/client.c
21+++ b/openbox/client.c
22@@ -2742,9 +2742,12 @@ static void client_calc_layer_internal(ObClient *self)
23 void client_calc_layer(ObClient *self)
24 {
25 GList *it;
26+ /* the client_calc_layer_internal calls below modify stacking_list,
27+ so we have to make a copy to iterate over */
28+ GList *list = g_list_copy(stacking_list);
29
30 /* skip over stuff above fullscreen layer */
31- for (it = stacking_list; it; it = g_list_next(it))
32+ for (it = list; it; it = g_list_next(it))
33 if (window_layer(it->data) <= OB_STACKING_LAYER_FULLSCREEN) break;
34
35 /* find the windows in the fullscreen layer, and mark them not-visited */
36@@ -2757,7 +2760,7 @@ void client_calc_layer(ObClient *self)
37 client_calc_layer_internal(self);
38
39 /* skip over stuff above fullscreen layer */
40- for (it = stacking_list; it; it = g_list_next(it))
41+ for (it = list; it; it = g_list_next(it))
42 if (window_layer(it->data) <= OB_STACKING_LAYER_FULLSCREEN) break;
43
44 /* now recalc any windows in the fullscreen layer which have not
45@@ -2768,6 +2771,8 @@ void client_calc_layer(ObClient *self)
46 !WINDOW_AS_CLIENT(it->data)->visited)
47 client_calc_layer_internal(it->data);
48 }
49+
50+ g_list_free(it);
51 }
52
53 gboolean client_should_show(ObClient *self)
54--
552.34.1
56
diff --git a/meta-oe/recipes-graphics/openbox/openbox_3.6.1.bb b/meta-oe/recipes-graphics/openbox/openbox_3.6.1.bb
index 9a1507731..1851a84b9 100644
--- a/meta-oe/recipes-graphics/openbox/openbox_3.6.1.bb
+++ b/meta-oe/recipes-graphics/openbox/openbox_3.6.1.bb
@@ -8,6 +8,7 @@ SRC_URI = " \
8 http://icculus.org/openbox/releases/openbox-${PV}.tar.gz \ 8 http://icculus.org/openbox/releases/openbox-${PV}.tar.gz \
9 file://0001-Makefile.am-avoid-race-when-creating-autostart-direc.patch \ 9 file://0001-Makefile.am-avoid-race-when-creating-autostart-direc.patch \
10 file://0001-openbox-xdg-autostart-convert-to-python3.patch \ 10 file://0001-openbox-xdg-autostart-convert-to-python3.patch \
11 file://0001-Fix-list-traversal-issue-in-client_calc_layer.patch \
11" 12"
12 13
13SRC_URI[md5sum] = "b72794996c6a3ad94634727b95f9d204" 14SRC_URI[md5sum] = "b72794996c6a3ad94634727b95f9d204"