summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-graphics/openbox
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-graphics/openbox')
-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/obconf_git.bb1
-rw-r--r--meta-oe/recipes-graphics/openbox/openbox_3.6.1.bb5
3 files changed, 60 insertions, 2 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 0000000000..8bc2b80f68
--- /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/obconf_git.bb b/meta-oe/recipes-graphics/openbox/obconf_git.bb
index 1210af70ea..917492c982 100644
--- a/meta-oe/recipes-graphics/openbox/obconf_git.bb
+++ b/meta-oe/recipes-graphics/openbox/obconf_git.bb
@@ -16,7 +16,6 @@ SRC_URI = " \
16 file://0001-Fix-function-protype-visibility.patch \ 16 file://0001-Fix-function-protype-visibility.patch \
17" 17"
18 18
19S = "${WORKDIR}/git"
20 19
21inherit autotools gettext pkgconfig mime mime-xdg features_check 20inherit autotools gettext pkgconfig mime mime-xdg features_check
22# depends on openbox, which is X11-only 21# depends on openbox, which is X11-only
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 9a15077316..5b62b9b2a7 100644
--- a/meta-oe/recipes-graphics/openbox/openbox_3.6.1.bb
+++ b/meta-oe/recipes-graphics/openbox/openbox_3.6.1.bb
@@ -8,11 +8,14 @@ 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[sha256sum] = "8b4ac0760018c77c0044fab06a4f0c510ba87eae934d9983b10878483bde7ef7" 14SRC_URI[sha256sum] = "8b4ac0760018c77c0044fab06a4f0c510ba87eae934d9983b10878483bde7ef7"
15 15
16UPSTREAM_CHECK_URI = "https://github.com/Mikachu/openbox/tags"
17UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)"
18
16inherit autotools gettext update-alternatives pkgconfig features_check 19inherit autotools gettext update-alternatives pkgconfig features_check
17# depends on virtual/libx11 20# depends on virtual/libx11
18REQUIRED_DISTRO_FEATURES = "x11" 21REQUIRED_DISTRO_FEATURES = "x11"