From 6846fe4c749834bc9fc05b8ca077db978e966004 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 20 Sep 2020 10:50:34 +0200 Subject: [PATCH] Release 1.4.2 - Fix Issue 16 --- Bugs.md | 8 ++++++++ README.md | 5 +++++ man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 6 +++--- signatures/1.4.1.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes view.c | 29 +++++++++++++++++++++-------- view.h | 4 +++- xdg_shell.c | 4 +--- 10 files changed, 43 insertions(+), 17 deletions(-) create mode 100644 signatures/1.4.1.sig diff --git a/Bugs.md b/Bugs.md index 65b77ac..08e2d93 100644 --- a/Bugs.md +++ b/Bugs.md @@ -216,3 +216,11 @@ Steps to reproduce: * Click on dialog box (not on the dropdown menu) to make the menu disappear * Observe flickering of the area, where the dropdown menu used to be +### Issue 16 + + * github issue number: N/A + * Fixed: 1.4.2 + +Cagebreak up to and including release 1.4.1 has a difficult-to-reproduce +use-after-free bug, which can sometimes trigger crashes when popups are closed. + diff --git a/README.md b/README.md index f88dff3..5046f2f 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.4.2 + + * sha 256: 27efb9328cf9cab1f81e66627696baf8c7cc2c372339a2890f955b40f3a7c396 + * sha 512: afcdbbce0753aff4770a88ddbd7df5687a7de0c77de3a2d296f85a8b8e01813212be6a0b69548aadef58e0e7da19ffea71c4f3448572656d4b19ff7f2f2fb70a + 1.4.1 * sha 256: c3e0ccceaf1078b91071c40b0ccb7c4f8e53ae38b05ee6637f9f39f7f6ece2cb diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 80a5cbc..5198daa 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.4.1 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.4.2 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 6e6df57..f140cc8 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.4.1 | Cagebreak Manual +% CAGEBREAK(1) Version 1.4.2 | Cagebreak Manual # NAME diff --git a/meson.build b/meson.build index 9f73e79..a87fae7 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.4.1', + version: '1.4.2', license: 'MIT', default_options: [ 'c_std=c11', @@ -199,9 +199,9 @@ reproducible_build_versions = { 'xkbcommon': '1.0.1', 'fontconfig': '2.13.91', 'pixman': '0.40.0', - 'pango': '1.46.1', + 'pango': '1.46.2', 'cairo': '1.17.3', - 'pangocairo': '1.46.1', + 'pangocairo': '1.46.2', 'math': '-1' } diff --git a/signatures/1.4.1.sig b/signatures/1.4.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..07c06c78f75741a4e5e6c2e410d46b57384697ea GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+6HLHmt3S1SZD7Rm95KPD1rPrth0$*I~%m4}r5Ofes z$K0jYs6bB-{TCQKKtZ>?1(52S>x8j>i5{60=tNM6*~3j82?KgNxzeY95%$@b0JYChQWUByc__*kYFE@D> z@spm&fb@{5jg$%{R^*eA@b$?g?Aw9ItzCxg2L#%a3@dcrKdAIs(dRG8QN!r{UEV|( zG?MS-`;|t7YVE9XKmGqnDE$$5n_w4sHg1E}ldH4=kp+28gPdQ4;e4syvI6B(Ev|?? z_4oyM?>tGRzgzUa`lX_pW@LOgIoRf|dzYLNKfnAxPaX_?Wcg!Pj|QML1lIR{yh}Cj zmFI$UPCaJ@(!2-7n&nlgxa5->8VeW<^bTZe!H)KEHGFozRFB`JQvS}p_HRH)@9^gv z0dQal0`kDLWxyk$RpHDG_gAOtVWc1|Xo2y)4<1=Er8h`sBKEsPOkvFgS=F3o7q*%< z@HlVICF6O00ZO3~y&*0X8PbR+xeK@ZVMe7pe2^VG3qR+Bk9L`j8X z3yMje8rWw?`oWm^A^aG&MSL{TYibi5aHL!>ui~gG%z76mOT_k70)0$HsG~eQ@KH`# za&QOP0Qilo@XndwS$#fg#%=}WHSHLuzrzW$a(1YKY+5P&Y=5HVG<+st8kd$Rw|Bhp z>bro;oA!v9?NXlFWsz$13p*!)X~b0C%^^7)$HD@bi?k&2c%11=&$hW6P~}j3MBaK6 z;`!$9VHSUkWho@tS2FN@E2G?1(52S>x8j>i5{60 z=tNM6*~3j82?KgNxzeY95%$nSayX7!X+Nr^OO?DDtq)Fes*j8}hvXSUU_ zh%&fG(0Kz3BRpNzs${DGYxub6hc7pI7V(pw$bj^asg0BhC0681*ZL>M%Z@8$cIMuckZtZ_g6|4AtQ5qO(m7kD;q zgVmF(v;mO?c};_yUxeX&sot^zq#!J4 zf$_Z$9$7M_H%Mk8_Paz(Va)_t)tqJ*wwgBZIB(7+<9U4nN}&?HAubdd(ugOy3%C1W gMx{G^kQW_03qRview->workspace->output, child->wlr_surface, x, - y, whole); +view_damage_child(struct cg_view_child *child, bool whole) { + int x, y; + child->get_coords(child, &x, &y); + output_damage_surface(child->view->workspace->output, child->wlr_surface, + x + child->view->ox, y + child->view->oy, whole); } static void view_child_handle_commit(struct wl_listener *listener, void *_data) { struct cg_view_child *child = wl_container_of(listener, child, commit); - int x, y; - child->get_coords(child, &x, &y); - view_damage_child(child, x + child->view->ox, y + child->view->oy, false); + view_damage_child(child, false); } static void @@ -74,11 +74,20 @@ view_child_finish(struct cg_view_child *child) { return; } - if(child->view != NULL && child->view->wlr_surface != NULL) { - view_damage_whole(child->view); + if(child->view != NULL) { + view_damage_child(child, true); + } + + struct cg_view_child *subchild, *tmpchild; + wl_list_for_each_safe(subchild, tmpchild, &child->children, parent_link) { + subchild->parent = NULL; + wl_list_remove(&subchild->parent_link); } wl_list_remove(&child->link); + if(child->parent != NULL) { + wl_list_remove(&child->parent_link); + } wl_list_remove(&child->commit.link); wl_list_remove(&child->new_subsurface.link); } @@ -88,7 +97,11 @@ view_child_init(struct cg_view_child *child, struct cg_view_child *parent, struct cg_view *view, struct wlr_surface *wlr_surface) { child->view = view; child->parent = parent; + if(parent != NULL) { + wl_list_insert(&parent->children, &child->parent_link); + } child->wlr_surface = wlr_surface; + wl_list_init(&child->children); child->commit.notify = view_child_handle_commit; wl_signal_add(&wlr_surface->events.commit, &child->commit); diff --git a/view.h b/view.h index 7474198..251c00f 100644 --- a/view.h +++ b/view.h @@ -53,8 +53,10 @@ struct cg_view_impl { struct cg_view_child { struct cg_view *view; struct cg_view_child *parent; + struct wl_list children; struct wlr_surface *wlr_surface; struct wl_list link; + struct wl_list parent_link; struct wl_listener commit; struct wl_listener new_subsurface; @@ -83,7 +85,7 @@ view_damage_part(struct cg_view *view); void view_damage_whole(struct cg_view *view); void -view_damage_child(struct cg_view_child *view, int x, int y, bool whole); +view_damage_child(struct cg_view_child *view, bool whole); void view_activate(struct cg_view *view, bool activate); void diff --git a/xdg_shell.c b/xdg_shell.c index 9c076f2..6a65e01 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -58,9 +58,7 @@ xdg_popup_destroy(struct cg_view_child *child) { return; } - int x, y; - child->get_coords(child, &x, &y); - view_damage_child(child, x + child->view->ox, y + child->view->oy, true); + view_damage_child(child, true); struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; wl_list_remove(&popup->destroy.link); wl_list_remove(&popup->map.link);