Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/gnome-remote-desktop/files/
Date: Sun, 25 Apr 2021 12:59:59
Message-Id: 1619355572.6dea4493432086e510b044d3dda3451ee045e3dd.conikost@gentoo
1 commit: 6dea4493432086e510b044d3dda3451ee045e3dd
2 Author: Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
3 AuthorDate: Sat Apr 24 15:47:57 2021 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 25 12:59:32 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6dea4493
7
8 net-misc/gnome-remote-desktop: remove unused patch(es)
9
10 Closes: https://github.com/gentoo/gentoo/pull/20526
11 Package-Manager: Portage-3.0.18, Repoman-3.0.3
12 Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
13 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
14
15 .../gnome-remote-desktop-0.1.9-copy-pixels.patch | 71 -------------------
16 ...nome-remote-desktop-0.1.9-drop-vnc-frames.patch | 80 ----------------------
17 2 files changed, 151 deletions(-)
18
19 diff --git a/net-misc/gnome-remote-desktop/files/gnome-remote-desktop-0.1.9-copy-pixels.patch b/net-misc/gnome-remote-desktop/files/gnome-remote-desktop-0.1.9-copy-pixels.patch
20 deleted file mode 100644
21 index 44cecbf6ad6..00000000000
22 --- a/net-misc/gnome-remote-desktop/files/gnome-remote-desktop-0.1.9-copy-pixels.patch
23 +++ /dev/null
24 @@ -1,71 +0,0 @@
25 -From 4d358762948dccdcac6d01f4dd7b8635e53de979 Mon Sep 17 00:00:00 2001
26 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@×××××.com>
27 -Date: Mon, 12 Oct 2020 17:34:30 +0200
28 -Subject: [PATCH] vnc: Copy pixels using the right destination stride
29 -
30 -We're copying the pixels in a separate thread managed by PipeWire, and
31 -in this thread, accessing the VNC framebuffer dimension and stride is
32 -racy. Instead of fetching the dimension directly, pass the expected
33 -width and get the stride it will eventually have.
34 -
35 -Already before this patch, when the copied pixel end up on the main
36 -thread and the dimension still doesn't match up, the frame will be
37 -dropped.
38 ----
39 - src/grd-session-vnc.c | 5 +++--
40 - src/grd-session-vnc.h | 3 ++-
41 - src/grd-vnc-pipewire-stream.c | 5 +++--
42 - 3 files changed, 8 insertions(+), 5 deletions(-)
43 -
44 -diff --git a/src/grd-session-vnc.c b/src/grd-session-vnc.c
45 -index a06d34d..ba3e5ce 100644
46 ---- a/src/grd-session-vnc.c
47 -+++ b/src/grd-session-vnc.c
48 -@@ -519,9 +519,10 @@ check_rfb_password (rfbClientPtr rfb_client,
49 - }
50 -
51 - int
52 --grd_session_vnc_get_framebuffer_stride (GrdSessionVnc *session_vnc)
53 -+grd_session_vnc_get_stride_for_width (GrdSessionVnc *session_vnc,
54 -+ int width)
55 - {
56 -- return session_vnc->rfb_screen->paddedWidthInBytes;
57 -+ return width * BGRX_BYTES_PER_PIXEL;
58 - }
59 -
60 - static void
61 -diff --git a/src/grd-session-vnc.h b/src/grd-session-vnc.h
62 -index 07678c8..ee1f986 100644
63 ---- a/src/grd-session-vnc.h
64 -+++ b/src/grd-session-vnc.h
65 -@@ -55,7 +55,8 @@ void grd_session_vnc_move_cursor (GrdSessionVnc *session_vnc,
66 - int x,
67 - int y);
68 -
69 --int grd_session_vnc_get_framebuffer_stride (GrdSessionVnc *session_vnc);
70 -+int grd_session_vnc_get_stride_for_width (GrdSessionVnc *session_vnc,
71 -+ int width);
72 -
73 - gboolean grd_session_vnc_is_client_gone (GrdSessionVnc *session_vnc);
74 -
75 -diff --git a/src/grd-vnc-pipewire-stream.c b/src/grd-vnc-pipewire-stream.c
76 -index 96dd7c9..82ceb9b 100644
77 ---- a/src/grd-vnc-pipewire-stream.c
78 -+++ b/src/grd-vnc-pipewire-stream.c
79 -@@ -326,10 +326,11 @@ process_buffer (GrdVncPipeWireStream *stream,
80 - int height;
81 - int y;
82 -
83 -- src_stride = buffer->datas[0].chunk->stride;
84 -- dst_stride = grd_session_vnc_get_framebuffer_stride (stream->session);
85 - height = stream->spa_format.size.height;
86 - width = stream->spa_format.size.width;
87 -+ src_stride = buffer->datas[0].chunk->stride;
88 -+ dst_stride = grd_session_vnc_get_stride_for_width (stream->session,
89 -+ width);
90 -
91 - frame->data = g_malloc (height * dst_stride);
92 - for (y = 0; y < height; y++)
93 ---
94 -GitLab
95 -
96
97 diff --git a/net-misc/gnome-remote-desktop/files/gnome-remote-desktop-0.1.9-drop-vnc-frames.patch b/net-misc/gnome-remote-desktop/files/gnome-remote-desktop-0.1.9-drop-vnc-frames.patch
98 deleted file mode 100644
99 index 56ea75ff466..00000000000
100 --- a/net-misc/gnome-remote-desktop/files/gnome-remote-desktop-0.1.9-drop-vnc-frames.patch
101 +++ /dev/null
102 @@ -1,80 +0,0 @@
103 -From ab97841629f5f3f4fab9993b6255b6ae04828b9c Mon Sep 17 00:00:00 2001
104 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@×××××.com>
105 -Date: Wed, 9 Sep 2020 10:14:20 +0200
106 -Subject: [PATCH] vnc: Drop frames if client is gone
107 -
108 -Frames from PipeWire are posted asynchronously from a I/O thread to the
109 -main thread where they are turned into VNC frame updates and cursor
110 -movements. On the other hand, sessions are closed asynchronously when
111 -the VNC client disappears. If a frame ended up on the main thread after
112 -a client disappeared but before the session and stream was closed, we'd
113 -try to turn the new frames into VNC updates without a client being
114 -available, causing use after free.
115 -
116 -Fix this by dropping frames that happens during this time frame.
117 -
118 -Closes: https://gitlab.gnome.org/GNOME/gnome-remote-desktop/-/issues/43
119 ----
120 - src/grd-session-vnc.c | 7 +++++++
121 - src/grd-session-vnc.h | 2 ++
122 - src/grd-vnc-pipewire-stream.c | 8 ++++++++
123 - 3 files changed, 17 insertions(+)
124 -
125 -diff --git a/src/grd-session-vnc.c b/src/grd-session-vnc.c
126 -index 813838a..a06d34d 100644
127 ---- a/src/grd-session-vnc.c
128 -+++ b/src/grd-session-vnc.c
129 -@@ -209,6 +209,12 @@ maybe_queue_close_session_idle (GrdSessionVnc *session_vnc)
130 - g_idle_add (close_session_idle, session_vnc);
131 - }
132 -
133 -+gboolean
134 -+grd_session_vnc_is_client_gone (GrdSessionVnc *session_vnc)
135 -+{
136 -+ return !session_vnc->rfb_client;
137 -+}
138 -+
139 - static void
140 - handle_client_gone (rfbClientPtr rfb_client)
141 - {
142 -@@ -218,6 +224,7 @@ handle_client_gone (rfbClientPtr rfb_client)
143 -
144 - grd_session_vnc_detach_source (session_vnc);
145 - maybe_queue_close_session_idle (session_vnc);
146 -+ session_vnc->rfb_client = NULL;
147 - }
148 -
149 - static void
150 -diff --git a/src/grd-session-vnc.h b/src/grd-session-vnc.h
151 -index 579a12a..07678c8 100644
152 ---- a/src/grd-session-vnc.h
153 -+++ b/src/grd-session-vnc.h
154 -@@ -57,4 +57,6 @@ void grd_session_vnc_move_cursor (GrdSessionVnc *session_vnc,
155 -
156 - int grd_session_vnc_get_framebuffer_stride (GrdSessionVnc *session_vnc);
157 -
158 -+gboolean grd_session_vnc_is_client_gone (GrdSessionVnc *session_vnc);
159 -+
160 - #endif /* GRD_SESSION_VNC_H */
161 -diff --git a/src/grd-vnc-pipewire-stream.c b/src/grd-vnc-pipewire-stream.c
162 -index 78793c4..96dd7c9 100644
163 ---- a/src/grd-vnc-pipewire-stream.c
164 -+++ b/src/grd-vnc-pipewire-stream.c
165 -@@ -234,6 +234,14 @@ do_render (struct spa_loop *loop,
166 - if (!frame)
167 - return 0;
168 -
169 -+ if (grd_session_vnc_is_client_gone (stream->session))
170 -+ {
171 -+ g_free (frame->data);
172 -+ g_clear_pointer (&frame->rfb_cursor, rfbFreeCursor);
173 -+ g_free (frame);
174 -+ return 0;
175 -+ }
176 -+
177 - if (frame->rfb_cursor)
178 - grd_session_vnc_set_cursor (stream->session, frame->rfb_cursor);
179 -
180 ---
181 -GitLab
182 -