diff --git a/0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch b/0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch deleted file mode 100644 index 9c846d0e6ef49d4f76105ac6333eba246d619310..0000000000000000000000000000000000000000 --- a/0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0ad717edcf372425ddf2ba9926857419ab62f4f5 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Wed, 29 May 2019 16:19:55 +1000 -Subject: [PATCH xserver] Xi: return AlreadyGrabbed for key grabs > 255 - -We can't have high keycodes because everything in XKB relies on 8 bits. XI2's -API allows for 32-bit keycodes so we have to take those but nothing in the -server is really ready for this. The effect of this right now is that any high -keycode grab is clipped to 255 and thus ends up grabbing a different key -instead. - -https://bugzilla.redhat.com/show_bug.cgi?id=1697804 - -Signed-off-by: Peter Hutterer ---- - Xi/xipassivegrab.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c -index 65d5870f6..d30f51f3c 100644 ---- a/Xi/xipassivegrab.c -+++ b/Xi/xipassivegrab.c -@@ -203,8 +203,14 @@ ProcXIPassiveGrabDevice(ClientPtr client) - ¶m, XI2, &mask); - break; - case XIGrabtypeKeycode: -- status = GrabKey(client, dev, mod_dev, stuff->detail, -- ¶m, XI2, &mask); -+ /* XI2 allows 32-bit keycodes but thanks to XKB we can never -+ * implement this. Just return an error for all keycodes that -+ * cannot work anyway */ -+ if (stuff->detail > 255) -+ status = XIAlreadyGrabbed; -+ else -+ status = GrabKey(client, dev, mod_dev, stuff->detail, -+ ¶m, XI2, &mask); - break; - case XIGrabtypeEnter: - case XIGrabtypeFocusIn: --- -2.21.0 - diff --git a/0001-dix-Add-GetCurrentClient-helper.patch b/0001-dix-Add-GetCurrentClient-helper.patch index 41ed9e769fc8d65a853f4bb1ce9e38a063012c89..d241c0e1fd941c32909f8cd9938ed89dec2312c1 100644 --- a/0001-dix-Add-GetCurrentClient-helper.patch +++ b/0001-dix-Add-GetCurrentClient-helper.patch @@ -1,7 +1,7 @@ -From 7d403201820fb2bdc04bfa8f83c9dd3822c6abda Mon Sep 17 00:00:00 2001 +From e78e96157efb523272404a85a9433c7b9803c1db Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 14:18:28 +0200 -Subject: [PATCH xserver 01/14] dix: Add GetCurrentClient helper +Subject: [PATCH xserver 01/24] dix: Add GetCurrentClient helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -43,13 +43,14 @@ to RRSetCrtc). Reviewed-by: Olivier Fourdan Reviewed-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 834a467af978ac7a24ed17b8c8e58b6cddb4faf9) --- dix/dispatch.c | 23 ++++++++++++++++++++++- include/dix.h | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/dix/dispatch.c b/dix/dispatch.c -index 176c7a0dd..ce84e6c8c 100644 +index a33bfaa9e..2b1cf1a74 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -148,6 +148,7 @@ xConnSetupPrefix connSetupPrefix; @@ -111,5 +112,5 @@ index b6e2bcfde..d65060cb6 100644 extern _X_EXPORT void SetInputCheck(HWEventQueuePtr /*c0 */ , HWEventQueuePtr /*c1 */ ); -- -2.23.0 +2.25.2 diff --git a/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch b/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch index 6fce6421108185d4f844c50e4bcbc3483a612363..441bf4c5e97486d4e194e84d2c9636ebca40ea3e 100644 --- a/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch +++ b/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch @@ -1,7 +1,7 @@ -From f473d009dba1029658f6c3fb5751fbbf027ed468 Mon Sep 17 00:00:00 2001 +From c0981af6a683266e3f2adfdd7d6539104f502233 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 22 Jan 2018 22:02:32 +0100 -Subject: [PATCH xserver 02/14] xwayland: Add wp_viewport wayland extension +Subject: [PATCH xserver 02/24] xwayland: Add wp_viewport wayland extension support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -18,12 +18,13 @@ xrandr for apps which want to change the resolution when going fullscreen. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 47bba4625339592d08b375bcd8e51029c0000850) --- hw/xwayland/Makefile.am | 9 ++++++++- hw/xwayland/meson.build | 3 +++ hw/xwayland/xwayland.c | 3 +++ hw/xwayland/xwayland.h | 2 ++ - 5 files changed, 24 insertions(+), 1 deletion(-) + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am index bc1cb8506..49aae3d8b 100644 @@ -80,10 +81,10 @@ index 36bf2133a..4a8d171bb 100644 xwayland_glamor = [] eglstream_srcs = [] diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index baa08d87b..292f239e8 100644 +index ed9f2e3c2..2084f2afb 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -863,6 +863,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, +@@ -923,6 +923,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, wl_registry_bind(registry, id, &zxdg_output_manager_v1_interface, 1); xwl_screen_init_xdg_output(xwl_screen); } @@ -94,7 +95,7 @@ index baa08d87b..292f239e8 100644 else if (xwl_screen->glamor) { xwl_glamor_init_wl_registry(xwl_screen, registry, id, interface, diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 0854df456..c4eabe4c3 100644 +index daa719209..f949ea157 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -48,6 +48,7 @@ @@ -114,5 +115,5 @@ index 0854df456..c4eabe4c3 100644 #define XWL_FORMAT_ARGB8888 (1 << 0) -- -2.23.0 +2.25.2 diff --git a/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch b/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch index c274d4ef7c8a011e2240c2ff40f7d952e8bcf7e0..acd1a06b1bbc678ec565232c992b776c0ad5c57f 100644 --- a/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch +++ b/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch @@ -1,7 +1,7 @@ -From 0356eff57bc1201e2bcd5fdd363a50ceabc4a4fa Mon Sep 17 00:00:00 2001 +From ce5eef7d33d7ba37cabee6b2bb020ed62abe6208 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Tue, 2 Jul 2019 12:03:12 +0200 -Subject: [PATCH xserver 03/14] xwayland: Use buffer_damage instead of surface +Subject: [PATCH xserver 03/24] xwayland: Use buffer_damage instead of surface damage if available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -25,6 +25,7 @@ Changes by Hans de Goede : Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 7c6f17790d3aedb164481264b0f05a8a14103731) --- hw/xwayland/xwayland-cursor.c | 12 ++++++------ hw/xwayland/xwayland-present.c | 6 +++--- @@ -63,11 +64,11 @@ index 66720bcc0..cbc715061 100644 xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 2937d9c97..df771c30f 100644 +index 5ba7dce08..58c32941d 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c -@@ -500,9 +500,9 @@ xwl_present_flip(WindowPtr present_window, - xwl_present_window->frame_timer_firing = FALSE; +@@ -495,9 +495,9 @@ xwl_present_flip(WindowPtr present_window, + /* Realign timer */ xwl_present_reset_timer(xwl_present_window); - wl_surface_damage(xwl_window->surface, 0, 0, @@ -80,10 +81,10 @@ index 2937d9c97..df771c30f 100644 wl_surface_commit(xwl_window->surface); diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 292f239e8..8b1c7918a 100644 +index 2084f2afb..942981834 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -759,6 +759,16 @@ xwl_destroy_window(WindowPtr window) +@@ -803,6 +803,16 @@ xwl_destroy_window(WindowPtr window) return ret; } @@ -100,7 +101,7 @@ index 292f239e8..8b1c7918a 100644 static void xwl_window_post_damage(struct xwl_window *xwl_window) { -@@ -795,13 +805,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window) +@@ -839,13 +849,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window) */ if (RegionNumRects(region) > 256) { box = RegionExtents(region); @@ -120,8 +121,8 @@ index 292f239e8..8b1c7918a 100644 + } } - xwl_window->frame_callback = wl_surface_frame(xwl_window->surface); -@@ -844,8 +856,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, + xwl_window_create_frame_callback(xwl_window); +@@ -904,8 +916,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, struct xwl_screen *xwl_screen = data; if (strcmp(interface, "wl_compositor") == 0) { @@ -137,11 +138,11 @@ index 292f239e8..8b1c7918a 100644 else if (strcmp(interface, "wl_shm") == 0) { xwl_screen->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index c4eabe4c3..3e973d688 100644 +index f949ea157..fa78b5ab9 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h -@@ -381,6 +381,9 @@ struct xwl_output { - }; +@@ -382,6 +382,9 @@ struct xwl_output { + void xwl_window_create_frame_callback(struct xwl_window *xwl_window); void xwl_sync_events (struct xwl_screen *xwl_screen); +void xwl_surface_damage(struct xwl_screen *xwl_screen, @@ -151,5 +152,5 @@ index c4eabe4c3..3e973d688 100644 Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); -- -2.23.0 +2.25.2 diff --git a/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch b/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch index 33467da310da23e60204c386a4dbdaed6045be24..4e055471fb1f5dfee26be5bb130c7a870a54d539 100644 --- a/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch +++ b/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch @@ -1,7 +1,7 @@ -From 873a7d2164c08ddf57e88095b34bbec092f28d31 Mon Sep 17 00:00:00 2001 +From 6ff9bf9f005ce81b587d3b4345232c73fc12da53 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 26 Jun 2019 16:46:54 +0200 -Subject: [PATCH xserver 04/14] xwayland: Add fake output modes to xrandr +Subject: [PATCH xserver 04/24] xwayland: Add fake output modes to xrandr output mode lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -17,6 +17,7 @@ WPviewport to scale there pixmap to cover the entire output. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 0d656d796071fb637e4969ea800855fe5d1c9728) --- hw/xwayland/xwayland-output.c | 112 ++++++++++++++++++++++++++++++++-- hw/xwayland/xwayland.c | 17 ++++++ @@ -162,10 +163,10 @@ index aa6f37864..2ccc3ca60 100644 xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { /* output done event is sent even when some property diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 8b1c7918a..a599c022a 100644 +index 942981834..3c50396f1 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -139,6 +139,23 @@ xwl_screen_get(ScreenPtr screen) +@@ -152,6 +152,23 @@ xwl_screen_get(ScreenPtr screen) return dixLookupPrivate(&screen->devPrivates, &xwl_screen_private_key); } @@ -190,10 +191,10 @@ index 8b1c7918a..a599c022a 100644 xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, const char *debug_msg) diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 3e973d688..0fafc07a6 100644 +index fa78b5ab9..c66997f00 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h -@@ -388,6 +388,7 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen, +@@ -389,6 +389,7 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen, Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); struct xwl_screen *xwl_screen_get(ScreenPtr screen); @@ -202,5 +203,5 @@ index 3e973d688..0fafc07a6 100644 void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); -- -2.23.0 +2.25.2 diff --git a/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch b/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch index e875403006e730f0b83d3bac532b91367b3d4fa5..8585f82e8374c4b9d08e4b1dd2d3b402b1d0e665 100644 --- a/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch +++ b/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch @@ -1,7 +1,7 @@ -From 81ff61afd6594e0cf00f4be7ff34f94cd9e8f9b0 Mon Sep 17 00:00:00 2001 +From d837f7003d22c5e0d5bd05d41e872e7ee331dfa4 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 22 Jan 2018 17:57:38 +0100 -Subject: [PATCH xserver 05/14] xwayland: Use RandR 1.2 interface (rev 2) +Subject: [PATCH xserver 05/24] xwayland: Use RandR 1.2 interface (rev 2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -23,6 +23,7 @@ was set. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit e89872f51aa834fa9d94a4ca4822f03b0341ab4f) --- hw/xwayland/xwayland-output.c | 81 +++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) @@ -134,5 +135,5 @@ index 2ccc3ca60..67e99bdab 100644 return TRUE; } -- -2.23.0 +2.25.2 diff --git a/0006-xwayland-Add-per-client-private-data.patch b/0006-xwayland-Add-per-client-private-data.patch index 40384806e916d52319278ff9a620dbe8d44281d3..fc4b473bb38d0ed06063aa9cec06ed941dfa55e2 100644 --- a/0006-xwayland-Add-per-client-private-data.patch +++ b/0006-xwayland-Add-per-client-private-data.patch @@ -1,7 +1,7 @@ -From 1dc4938467b6338695eda4224f0b0c592cb2c25c Mon Sep 17 00:00:00 2001 +From 80ca38c4428a499a795084dc696c390b707749b9 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 22:45:12 +0200 -Subject: [PATCH xserver 06/14] xwayland: Add per client private data +Subject: [PATCH xserver 06/24] xwayland: Add per client private data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -14,16 +14,17 @@ change emulation. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 905cb8b9e27add5f49a45fe167a0005bf05218bc) --- hw/xwayland/xwayland.c | 14 ++++++++++++++ hw/xwayland/xwayland.h | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index a599c022a..2b6065f1a 100644 +index 3c50396f1..b0e37ceb9 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -122,11 +122,18 @@ ddxProcessArgument(int argc, char *argv[], int i) +@@ -135,11 +135,18 @@ ddxProcessArgument(int argc, char *argv[], int i) return 0; } @@ -42,7 +43,7 @@ index a599c022a..2b6065f1a 100644 static struct xwl_window * xwl_window_get(WindowPtr window) { -@@ -1083,6 +1090,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1143,6 +1150,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) return FALSE; if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0)) return FALSE; @@ -57,21 +58,23 @@ index a599c022a..2b6065f1a 100644 dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen); xwl_screen->screen = pScreen; diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 0fafc07a6..17018fcf5 100644 +index c66997f00..593e92b64 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h -@@ -380,6 +380,11 @@ struct xwl_output { +@@ -379,8 +379,13 @@ struct xwl_output { Bool xdg_output_done; }; +struct xwl_client { +}; + + void xwl_window_create_frame_callback(struct xwl_window *xwl_window); + +struct xwl_client *xwl_client_get(ClientPtr client); + void xwl_sync_events (struct xwl_screen *xwl_screen); void xwl_surface_damage(struct xwl_screen *xwl_screen, struct wl_surface *surface, -- -2.23.0 +2.25.2 diff --git a/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch b/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch index 5ddec9d4ddf74a69a9e95023781e46ad2801302c..4d9b5327d2241f6c21437e1b45ce555d4cb8caed 100644 --- a/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch +++ b/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch @@ -1,7 +1,7 @@ -From dfb887783bfe3c5f57d46738bce13ec2d79b1769 Mon Sep 17 00:00:00 2001 +From 879fed575deea57462217fc31eb331db8d23637c Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 23:04:36 +0200 -Subject: [PATCH xserver 07/14] xwayland: Add support for storing per client +Subject: [PATCH xserver 07/24] xwayland: Add support for storing per client per output emulated resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -24,6 +24,7 @@ change emulation. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit aca0a588eb40a5e6669094a2ab7f71ca0ba06b16) --- hw/xwayland/xwayland-output.c | 67 +++++++++++++++++++++++++++++++++++ hw/xwayland/xwayland.h | 17 +++++++++ @@ -108,10 +109,10 @@ index 67e99bdab..82ff5db70 100644 const int32_t xwl_output_fake_modes[][2] = { /* 4:3 (1.33) */ diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 17018fcf5..d0e87a89d 100644 +index 593e92b64..0e6f92e63 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h -@@ -380,7 +380,21 @@ struct xwl_output { +@@ -379,7 +379,21 @@ struct xwl_output { Bool xdg_output_done; }; @@ -132,8 +133,8 @@ index 17018fcf5..d0e87a89d 100644 + struct xwl_emulated_mode emulated_modes[XWL_CLIENT_MAX_EMULATED_MODES]; }; - struct xwl_client *xwl_client_get(ClientPtr client); -@@ -424,6 +438,9 @@ void xwl_output_destroy(struct xwl_output *xwl_output); + void xwl_window_create_frame_callback(struct xwl_window *xwl_window); +@@ -425,6 +439,9 @@ void xwl_output_destroy(struct xwl_output *xwl_output); void xwl_output_remove(struct xwl_output *xwl_output); @@ -144,5 +145,5 @@ index 17018fcf5..d0e87a89d 100644 float VRefresh, Bool Reduced, Bool Interlaced); -- -2.23.0 +2.25.2 diff --git a/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch b/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch index 7119e3123efdcfa829af46c3bf95a9ecaf65d5d3..303855528e45a1efaf47d608793b18fdc440c938 100644 --- a/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch +++ b/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch @@ -1,7 +1,7 @@ -From e997273b14a23b0ffe89f542de783adbec6e8a1b Mon Sep 17 00:00:00 2001 +From a640802d33e0daccf2d4045ecb3e70cbf56bf0ac Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 2 Jul 2019 11:55:26 +0200 -Subject: [PATCH xserver 08/14] xwayland: Add support for randr-resolution +Subject: [PATCH xserver 08/24] xwayland: Add support for randr-resolution change emulation using viewport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -28,6 +28,7 @@ disabling resolution emulation all together when going windowed. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit d99b9ff0f237d15e7eb507484493c73b393d5dba) --- hw/xwayland/xwayland-input.c | 5 + hw/xwayland/xwayland-output.c | 63 ++++++++++- @@ -142,10 +143,10 @@ index 82ff5db70..99ab1b288 100644 static Bool diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 2b6065f1a..ec1b7eee4 100644 +index b0e37ceb9..1ab5b3a28 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -163,6 +163,23 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) +@@ -176,6 +176,23 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) return xwl_screen->rootless && xwl_screen_has_viewport_support(xwl_screen); } @@ -169,7 +170,7 @@ index 2b6065f1a..ec1b7eee4 100644 static void xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, const char *debug_msg) -@@ -499,6 +516,150 @@ xwl_pixmap_get(PixmapPtr pixmap) +@@ -512,6 +529,150 @@ xwl_pixmap_get(PixmapPtr pixmap) return dixLookupPrivate(&pixmap->devPrivates, &xwl_pixmap_private_key); } @@ -320,7 +321,7 @@ index 2b6065f1a..ec1b7eee4 100644 static void xwl_window_init_allow_commits(struct xwl_window *xwl_window) { -@@ -569,6 +730,8 @@ ensure_surface_for_window(WindowPtr window) +@@ -582,6 +743,8 @@ ensure_surface_for_window(WindowPtr window) xwl_window->xwl_screen = xwl_screen; xwl_window->window = window; @@ -329,15 +330,15 @@ index 2b6065f1a..ec1b7eee4 100644 xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor); if (xwl_window->surface == NULL) { ErrorF("wl_display_create_surface failed\n"); -@@ -610,6 +773,7 @@ ensure_surface_for_window(WindowPtr window) +@@ -623,6 +786,7 @@ ensure_surface_for_window(WindowPtr window) dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window); xorg_list_init(&xwl_window->link_damage); + xorg_list_add(&xwl_window->link_window, &xwl_screen->window_list); - xwl_window_init_allow_commits(xwl_window); - -@@ -704,8 +868,12 @@ xwl_unrealize_window(WindowPtr window) + #ifdef GLAMOR_HAS_GBM + xorg_list_init(&xwl_window->frame_callback_list); +@@ -716,8 +880,12 @@ xwl_unrealize_window(WindowPtr window) if (!xwl_window) return ret; @@ -350,7 +351,7 @@ index 2b6065f1a..ec1b7eee4 100644 unregister_damage(window); if (xwl_window->frame_callback) -@@ -743,6 +911,33 @@ xwl_set_window_pixmap(WindowPtr window, +@@ -767,6 +935,33 @@ xwl_set_window_pixmap(WindowPtr window, ensure_surface_for_window(window); } @@ -384,7 +385,7 @@ index 2b6065f1a..ec1b7eee4 100644 static void frame_callback(void *data, struct wl_callback *callback, -@@ -1158,6 +1353,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1218,6 +1413,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xorg_list_init(&xwl_screen->output_list); xorg_list_init(&xwl_screen->seat_list); xorg_list_init(&xwl_screen->damage_window_list); @@ -392,7 +393,7 @@ index 2b6065f1a..ec1b7eee4 100644 xwl_screen->depth = 24; xwl_screen->display = wl_display_connect(NULL); -@@ -1256,6 +1452,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1316,6 +1512,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xwl_close_screen; @@ -403,7 +404,7 @@ index 2b6065f1a..ec1b7eee4 100644 xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; pScreen->SetWindowPixmap = xwl_set_window_pixmap; diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index d0e87a89d..b52de11d2 100644 +index 0e6f92e63..9adf3af76 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -135,10 +135,12 @@ struct xwl_screen { @@ -433,7 +434,7 @@ index d0e87a89d..b52de11d2 100644 struct wl_callback *frame_callback; Bool allow_commits; #ifdef GLAMOR_HAS_GBM -@@ -408,6 +414,9 @@ Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); +@@ -409,6 +415,9 @@ Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); struct xwl_screen *xwl_screen_get(ScreenPtr screen); Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); @@ -443,7 +444,7 @@ index d0e87a89d..b52de11d2 100644 void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); -@@ -441,6 +450,12 @@ void xwl_output_remove(struct xwl_output *xwl_output); +@@ -442,6 +451,12 @@ void xwl_output_remove(struct xwl_output *xwl_output); struct xwl_emulated_mode *xwl_output_get_emulated_mode_for_client( struct xwl_output *xwl_output, ClientPtr client); @@ -457,5 +458,5 @@ index d0e87a89d..b52de11d2 100644 float VRefresh, Bool Reduced, Bool Interlaced); -- -2.23.0 +2.25.2 diff --git a/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch b/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch index 520eb90c2dd0b470c8ae9d0816f0006b624538e8..403f950bef3f4fb6dd56a5607ff3388ec6f0139e 100644 --- a/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch +++ b/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch @@ -1,7 +1,7 @@ -From 1ea054bda6618025838c3afb052080b749582454 Mon Sep 17 00:00:00 2001 +From 62e8b2ff7471f1a48b8bac9f41cceecea4931c03 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 8 Jul 2019 14:00:27 +0200 -Subject: [PATCH xserver 09/14] xwayland: Add xwlRRModeToDisplayMode() helper +Subject: [PATCH xserver 09/24] xwayland: Add xwlRRModeToDisplayMode() helper function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -14,6 +14,7 @@ Wayland viewport extension. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 43c80078126f6f33c6ab7d3cf4668733bde03366) --- hw/xwayland/xwayland-vidmode.c | 51 +++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 23 deletions(-) @@ -96,5 +97,5 @@ index 0bcd11401..a59c9f6a9 100644 return TRUE; } -- -2.23.0 +2.25.2 diff --git a/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch b/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch index c9ef93d9d2f938aed832944798370de30f435865..7fa5a1920d65566e611fd729272bdef530a24b4b 100644 --- a/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch +++ b/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch @@ -1,7 +1,7 @@ -From 9edd8e37b5e2659a71b05dabed45fd7c3447de79 Mon Sep 17 00:00:00 2001 +From 3ecabb250841ff0423744cd2291aaebf87b4239a Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 8 Jul 2019 18:35:27 +0200 -Subject: [PATCH xserver 10/14] xwayland: Add xwlVidModeGetCurrentRRMode helper +Subject: [PATCH xserver 10/24] xwayland: Add xwlVidModeGetCurrentRRMode helper to the vidmode code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -24,6 +24,7 @@ support to Xwayland's XF86 vidmode extension emulation. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit bcad1b813a04b9f3ff225f57a4baad09bd6315b9) --- hw/xwayland/xwayland-vidmode.c | 90 +++++++++++++++++++++------------- 1 file changed, 56 insertions(+), 34 deletions(-) @@ -188,5 +189,5 @@ index a59c9f6a9..e9aea7269 100644 static void -- -2.23.0 +2.25.2 diff --git a/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch b/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch index 99ebbae9b5ffbb368ded4fa08ce2bb5160d4127a..cf706e3d4a1fdf8e51086f4203d6bd53ff4d96f3 100644 --- a/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch +++ b/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch @@ -1,7 +1,7 @@ -From 984691516d78284a8ab63058b0c1d3c68666a7d9 Mon Sep 17 00:00:00 2001 +From 86e32a877ded8d67ec26ed2bcc06bd80ec2a5915 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 9 Jul 2019 09:31:13 +0200 -Subject: [PATCH xserver 11/14] xwayland: Add vidmode mode changing emulation +Subject: [PATCH xserver 11/24] xwayland: Add vidmode mode changing emulation support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -13,6 +13,7 @@ change the resolution when going fullscreen. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 38de6260816674b5430144cc38a8a27d93d1bf19) --- hw/xwayland/xwayland-vidmode.c | 130 ++++++++++++++++++++++----------- 1 file changed, 86 insertions(+), 44 deletions(-) @@ -231,5 +232,5 @@ index e9aea7269..56aac693a 100644 static Bool -- -2.23.0 +2.25.2 diff --git a/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch b/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch index 4ec587b07157462d43cbe44f462e91b04950f9b0..573ab8ee3fbaea9d6cca7f7bafe345c51794f631 100644 --- a/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch +++ b/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch @@ -1,7 +1,7 @@ -From 912688326c0f9435660e86a2bdab049caa4b0e9f Mon Sep 17 00:00:00 2001 +From fd95c9a52e35e994e140a925cfc01587257d4511 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 26 Aug 2019 12:26:34 +0200 -Subject: [PATCH xserver 12/14] xwayland: xwl_window_should_enable_viewport: +Subject: [PATCH xserver 12/24] xwayland: xwl_window_should_enable_viewport: Add extra test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -19,15 +19,16 @@ Xwayland. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 0c305dbff8a44f3fa3d6aefd372a967029a7a527) --- hw/xwayland/xwayland.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index ec1b7eee4..58252d2e8 100644 +index 1ab5b3a28..85036adfe 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -636,6 +636,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -649,6 +649,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, } } @@ -52,5 +53,5 @@ index ec1b7eee4..58252d2e8 100644 } -- -2.23.0 +2.25.2 diff --git a/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch b/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch index 500d1f58813477d8adf18d3d8e35c8db15db8395..cfcfd4c6aac7843c79622b64ebdfd431d09f17a2 100644 --- a/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch +++ b/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch @@ -1,7 +1,7 @@ -From d9f1d6f51f4c2d388214a675330b58ba2facb170 Mon Sep 17 00:00:00 2001 +From dda4a8b2f672eb5791f39222dd0996e07b416eb7 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 2 Sep 2019 17:32:45 +0200 -Subject: [PATCH xserver 13/14] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS +Subject: [PATCH xserver 13/24] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS property for resolution emulation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -29,6 +29,7 @@ be equal to the new resolution. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 5315f988d9f175e4850f4259f691a68d95ce7ac2) --- hw/xwayland/xwayland-output.c | 77 +++++++++++++++++++++++++++++++++++ hw/xwayland/xwayland.c | 23 +++++++++++ @@ -138,10 +139,10 @@ index 99ab1b288..20c254962 100644 static void diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 58252d2e8..75ff9f011 100644 +index 85036adfe..e43f3de96 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -677,6 +677,27 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) +@@ -690,6 +690,27 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) xwl_window_check_resolution_change_emulation(xwl_window); } @@ -169,7 +170,7 @@ index 58252d2e8..75ff9f011 100644 static void xwl_window_init_allow_commits(struct xwl_window *xwl_window) { -@@ -838,6 +859,8 @@ xwl_realize_window(WindowPtr window) +@@ -855,6 +876,8 @@ xwl_realize_window(WindowPtr window) return FALSE; } @@ -179,10 +180,10 @@ index 58252d2e8..75ff9f011 100644 } diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index b52de11d2..2d825ee8c 100644 +index 9adf3af76..eb8c4bd70 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h -@@ -417,6 +417,7 @@ Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); +@@ -418,6 +418,7 @@ Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); struct xwl_output *xwl_screen_get_first_output(struct xwl_screen *xwl_screen); void xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen); Bool xwl_window_has_viewport_enabled(struct xwl_window *xwl_window); @@ -190,7 +191,7 @@ index b52de11d2..2d825ee8c 100644 void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); -@@ -455,6 +456,8 @@ RRModePtr xwl_output_find_mode(struct xwl_output *xwl_output, +@@ -456,6 +457,8 @@ RRModePtr xwl_output_find_mode(struct xwl_output *xwl_output, void xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, RRModePtr mode, Bool from_vidmode); @@ -200,5 +201,5 @@ index b52de11d2..2d825ee8c 100644 RRModePtr xwayland_cvt(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, Bool Interlaced); -- -2.23.0 +2.25.2 diff --git a/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch b/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch new file mode 100644 index 0000000000000000000000000000000000000000..08c605f77e81e2f748c0ad32bc231b027fe02613 --- /dev/null +++ b/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch @@ -0,0 +1,137 @@ +From aa0f9ba1aa3f12f7e65ed64ac03114f27c8bff1f Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 27 Jan 2020 11:08:00 +0100 +Subject: [PATCH xserver 14/24] xwayland: Cache client-id for the + window-manager client + +Instead of iterating over all clients which are listening for events on the +root window and checking if the client we are dealing with is the one +listening for SubstructureRedirectMask | ResizeRedirectMask events and thus +is the window-manager, cache the client-id of the window-manager in +xwl_screen and use that when checking if a client is the window-manager. + +Note that we cache and compare the client-id rather then the ClienPtr, +this saves reading the ClientPtr from the global clients array when doing +the comparison. + +Suggested-by: Olivier Fourdan +Acked-by: Olivier Fourdan +Signed-off-by: Hans de Goede +(cherry picked from commit ded89300c1dd541f59fe6e93c5c69d7fe7088244) +--- + hw/xwayland/xwayland.c | 48 ++++++++++++++++++++++++++++-------------- + hw/xwayland/xwayland.h | 2 ++ + 2 files changed, 34 insertions(+), 16 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index e43f3de96..f4d433bca 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -576,20 +576,11 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, + } + + static Bool +-xwl_screen_client_is_window_manager(struct xwl_screen *xwl_screen, +- ClientPtr client) ++window_is_wm_window(WindowPtr window) + { +- WindowPtr root = xwl_screen->screen->root; +- OtherClients *others; +- +- for (others = wOtherClients(root); others; others = others->next) { +- if (SameClient(others, client)) { +- if (others->mask & (SubstructureRedirectMask | ResizeRedirectMask)) +- return TRUE; +- } +- } ++ struct xwl_screen *xwl_screen = xwl_screen_get(window->drawable.pScreen); + +- return FALSE; ++ return CLIENT_ID(window->drawable.id) == xwl_screen->wm_client_id; + } + + static ClientPtr +@@ -603,7 +594,7 @@ xwl_window_get_owner(struct xwl_window *xwl_window) + * decoration window. In that case return the client of the + * first *and only* child of the toplevel (decoration) window. + */ +- if (xwl_screen_client_is_window_manager(xwl_window->xwl_screen, client)) { ++ if (window_is_wm_window(window)) { + if (window->firstChild && window->firstChild == window->lastChild) + return wClient(window->firstChild); + else +@@ -698,9 +689,7 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) + Bool + xwl_window_is_toplevel(WindowPtr window) + { +- struct xwl_screen *xwl_screen = xwl_screen_get(window->drawable.pScreen); +- +- if (xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) ++ if (window_is_wm_window(window)) + return FALSE; + + /* CSD and override-redirect toplevel windows */ +@@ -975,6 +964,30 @@ xwl_set_window_pixmap(WindowPtr window, + ensure_surface_for_window(window); + } + ++static Bool ++xwl_change_window_attributes(WindowPtr window, unsigned long mask) ++{ ++ ScreenPtr screen = window->drawable.pScreen; ++ struct xwl_screen *xwl_screen = xwl_screen_get(screen); ++ OtherClients *others; ++ Bool ret; ++ ++ screen->ChangeWindowAttributes = xwl_screen->ChangeWindowAttributes; ++ ret = (*screen->ChangeWindowAttributes) (window, mask); ++ xwl_screen->ChangeWindowAttributes = screen->ChangeWindowAttributes; ++ screen->ChangeWindowAttributes = xwl_change_window_attributes; ++ ++ if (window != screen->root || !(mask & CWEventMask)) ++ return ret; ++ ++ for (others = wOtherClients(window); others; others = others->next) { ++ if (others->mask & (SubstructureRedirectMask | ResizeRedirectMask)) ++ xwl_screen->wm_client_id = CLIENT_ID(others->resource); ++ } ++ ++ return ret; ++} ++ + static void + xwl_resize_window(WindowPtr window, + int x, int y, +@@ -1552,6 +1565,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) + xwl_screen->CloseScreen = pScreen->CloseScreen; + pScreen->CloseScreen = xwl_close_screen; + ++ xwl_screen->ChangeWindowAttributes = pScreen->ChangeWindowAttributes; ++ pScreen->ChangeWindowAttributes = xwl_change_window_attributes; ++ + xwl_screen->ResizeWindow = pScreen->ResizeWindow; + pScreen->ResizeWindow = xwl_resize_window; + +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index eb8c4bd70..126af8823 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -118,6 +118,7 @@ struct xwl_screen { + int height; + int depth; + ScreenPtr screen; ++ int wm_client_id; + int expecting_event; + enum RootClipMode root_clip_mode; + +@@ -135,6 +136,7 @@ struct xwl_screen { + DestroyWindowProcPtr DestroyWindow; + XYToWindowProcPtr XYToWindow; + SetWindowPixmapProcPtr SetWindowPixmap; ++ ChangeWindowAttributesProcPtr ChangeWindowAttributes; + ResizeWindowProcPtr ResizeWindow; + + struct xorg_list output_list; +-- +2.25.2 + diff --git a/0015-xwayland-Reuse-viewport-instead-of-recreating.patch b/0015-xwayland-Reuse-viewport-instead-of-recreating.patch new file mode 100644 index 0000000000000000000000000000000000000000..3f6cb2d5a039a4d34dd2b17303a9c3fb5b095b39 --- /dev/null +++ b/0015-xwayland-Reuse-viewport-instead-of-recreating.patch @@ -0,0 +1,50 @@ +From 1f39cb2ef51c72ec0c448c5d9571540bb0d9f3eb Mon Sep 17 00:00:00 2001 +From: Roman Gilg +Date: Fri, 3 Jan 2020 17:12:14 +0100 +Subject: [PATCH xserver 15/24] xwayland: Reuse viewport instead of recreating + +When a viewport is already created we can reuse this object instead of +destroying it and getting a new one for updating the source rectangle and +destination size. + +Signed-off-by: Roman Gilg +Reviewed-by: Hans de Goede +Acked-by: Olivier Fourdan +Signed-off-by: Hans de Goede +(cherry picked from commit 948e02872feb641a176b3af82b6ef1201c97bb16) +--- + hw/xwayland/xwayland.c | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index f4d433bca..320589dde 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -550,17 +550,13 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, + struct xwl_output *xwl_output, + struct xwl_emulated_mode *emulated_mode) + { +- /* If necessary disable old viewport to apply new settings */ +- if (xwl_window_has_viewport_enabled(xwl_window)) +- xwl_window_disable_viewport(xwl_window); +- +- DebugF("XWAYLAND: enabling viewport %dx%d -> %dx%d\n", +- emulated_mode->width, emulated_mode->height, +- xwl_output->width, xwl_output->height); +- +- xwl_window->viewport = +- wp_viewporter_get_viewport(xwl_window->xwl_screen->viewporter, +- xwl_window->surface); ++ if (!xwl_window_has_viewport_enabled(xwl_window)) { ++ DebugF("XWAYLAND: enabling viewport %dx%d -> %dx%d\n", ++ emulated_mode->width, emulated_mode->height, ++ xwl_output->width, xwl_output->height); ++ xwl_window->viewport = wp_viewporter_get_viewport(xwl_window->xwl_screen->viewporter, ++ xwl_window->surface); ++ } + + wp_viewport_set_source(xwl_window->viewport, + wl_fixed_from_int(0), +-- +2.25.2 + diff --git a/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch b/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch new file mode 100644 index 0000000000000000000000000000000000000000..8299c92442c890572fa1c60ccc46da26d29c2e4e --- /dev/null +++ b/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch @@ -0,0 +1,81 @@ +From 8cedbfd448edf410a45c57addcee0e7304f11b86 Mon Sep 17 00:00:00 2001 +From: Roman Gilg +Date: Fri, 3 Jan 2020 17:27:28 +0100 +Subject: [PATCH xserver 16/24] xwayland: Recurse on finding the none-wm owner + +An X11 window manager might add a chain of parent windows when reparenting to a +decoration window. + +That is for example the case for KWin, which reparents client windows to one +decoration and another wrapper parent window. + +Account for that by a recursion into the tree. For now assume as before that +all X11 window managers reparent with one child only for these parent windows. + +Changes by Hans de Goede: +- Move the xwl_window_is_toplevel() from a later patch in this series here + as it really belongs together with these changes +- Drop no longer necessary xwl_window argument from window_get_none_wm_owner + parameters + +Signed-off-by: Roman Gilg +Reviewed-by: Hans de Goede +Acked-by: Olivier Fourdan +Signed-off-by: Hans de Goede +(cherry picked from commit a69f7fbb54efc8ffad320c8afd23cb41fc9edc27) +--- + hw/xwayland/xwayland.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 320589dde..f42b80b90 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -580,19 +580,18 @@ window_is_wm_window(WindowPtr window) + } + + static ClientPtr +-xwl_window_get_owner(struct xwl_window *xwl_window) ++window_get_none_wm_owner(WindowPtr window) + { +- WindowPtr window = xwl_window->window; + ClientPtr client = wClient(window); + + /* If the toplevel window is owned by the window-manager, then the +- * actual client toplevel window has been reparented to a window-manager +- * decoration window. In that case return the client of the +- * first *and only* child of the toplevel (decoration) window. ++ * actual client toplevel window has been reparented to some window-manager ++ * decoration/wrapper windows. In that case recurse by checking the client ++ * of the first *and only* child of the decoration/wrapper window. + */ + if (window_is_wm_window(window)) { + if (window->firstChild && window->firstChild == window->lastChild) +- return wClient(window->firstChild); ++ return window_get_none_wm_owner(window->firstChild); + else + return NULL; /* Should never happen, skip resolution emulation */ + } +@@ -613,7 +612,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, + if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) + return FALSE; + +- owner = xwl_window_get_owner(xwl_window); ++ owner = window_get_none_wm_owner(xwl_window->window); + if (!owner) + return FALSE; + +@@ -692,8 +691,8 @@ xwl_window_is_toplevel(WindowPtr window) + if (window_get_damage(window)) + return TRUE; + +- /* Normal toplevel client windows, reparented to decoration window */ +- return (window->parent && window_get_damage(window->parent)); ++ /* Normal toplevel client windows, reparented to a window-manager window */ ++ return window->parent && window_is_wm_window(window->parent); + } + + static void +-- +2.25.2 + diff --git a/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch b/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch new file mode 100644 index 0000000000000000000000000000000000000000..b9a2331be8654f531a23dd49a8c4195bfe2aaccd --- /dev/null +++ b/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch @@ -0,0 +1,82 @@ +From 939a78925a1d591e6aaf291a6609b9c6e54ee6ce Mon Sep 17 00:00:00 2001 +From: Roman Gilg +Date: Wed, 15 Jan 2020 10:07:58 +0100 +Subject: [PATCH xserver 17/24] xwayland: Make window_get_none_wm_owner return + a Window instead of a Client + +Make window_get_none_wm_owner return the first non-wm-window instead of the +owner (client) of the first non-wm-window and rename it to +window_get_client_toplevel to match its new behavior. + +This is a preparation patch for switching to using the drawable coordinates +in xwl_window_should_enable_viewport() + +Changes by Hans de Goede: +- Split this change out into a separate patch for easier reviewing +- Rename window_get_none_wm_owner to window_get_client_toplevel to match + its new behavior + +Signed-off-by: Roman Gilg +Acked-by: Olivier Fourdan +Signed-off-by: Hans de Goede +(cherry picked from commit 060f10062eb1761515b762b46cba56c7a53db72c) +--- + hw/xwayland/xwayland.c | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index f42b80b90..d70d729ae 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -579,10 +579,10 @@ window_is_wm_window(WindowPtr window) + return CLIENT_ID(window->drawable.id) == xwl_screen->wm_client_id; + } + +-static ClientPtr +-window_get_none_wm_owner(WindowPtr window) ++static WindowPtr ++window_get_client_toplevel(WindowPtr window) + { +- ClientPtr client = wClient(window); ++ assert(window); + + /* If the toplevel window is owned by the window-manager, then the + * actual client toplevel window has been reparented to some window-manager +@@ -591,12 +591,12 @@ window_get_none_wm_owner(WindowPtr window) + */ + if (window_is_wm_window(window)) { + if (window->firstChild && window->firstChild == window->lastChild) +- return window_get_none_wm_owner(window->firstChild); ++ return window_get_client_toplevel(window->firstChild); + else + return NULL; /* Should never happen, skip resolution emulation */ + } + +- return client; ++ return window; + } + + static Bool +@@ -608,14 +608,17 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, + struct xwl_emulated_mode *emulated_mode; + struct xwl_output *xwl_output; + ClientPtr owner; ++ WindowPtr window; + + if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) + return FALSE; + +- owner = window_get_none_wm_owner(xwl_window->window); +- if (!owner) ++ window = window_get_client_toplevel(xwl_window->window); ++ if (!window) + return FALSE; + ++ owner = wClient(window); ++ + /* 1. Test if the window matches the emulated mode on one of the outputs + * This path gets hit by most games / libs (e.g. SDL, SFML, OGRE) + */ +-- +2.25.2 + diff --git a/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch b/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch new file mode 100644 index 0000000000000000000000000000000000000000..dcc0f5e72bfca71a492d6e0155af1e695667cd10 --- /dev/null +++ b/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch @@ -0,0 +1,121 @@ +From c5d9cb5f4bc4f703b66fc524a76247c742490b30 Mon Sep 17 00:00:00 2001 +From: Roman Gilg +Date: Fri, 3 Jan 2020 17:55:28 +0100 +Subject: [PATCH xserver 18/24] xwayland: Check emulation on client toplevel + resize + +When a reparented window is resized directly check the emulation instead of +doing this only when the window manager parent window is resized, what might +never happen. + +For that to work we need to make sure that we compare the current size of the +client toplevel when looking for an emulated mode. + +Changes by Hans de Goede: +- Remove xwl_window x, y, width and height members as those are no longer used. +- Add check for xwl_window_from_window() returning NULL. + +Signed-off-by: Roman Gilg +Acked-by: Olivier Fourdan +Signed-off-by: Hans de Goede +(cherry picked from commit 6d98f840da6dfcf2a69e03a1b3fa0bf602ba1f27) +--- + hw/xwayland/xwayland.c | 27 +++++++++++---------------- + hw/xwayland/xwayland.h | 1 - + 2 files changed, 11 insertions(+), 17 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index d70d729ae..14227a327 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -609,6 +609,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, + struct xwl_output *xwl_output; + ClientPtr owner; + WindowPtr window; ++ DrawablePtr drawable; + + if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) + return FALSE; +@@ -618,6 +619,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, + return FALSE; + + owner = wClient(window); ++ drawable = &window->drawable; + + /* 1. Test if the window matches the emulated mode on one of the outputs + * This path gets hit by most games / libs (e.g. SDL, SFML, OGRE) +@@ -627,10 +629,10 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, + if (!emulated_mode) + continue; + +- if (xwl_window->x == xwl_output->x && +- xwl_window->y == xwl_output->y && +- xwl_window->width == emulated_mode->width && +- xwl_window->height == emulated_mode->height) { ++ if (drawable->x == xwl_output->x && ++ drawable->y == xwl_output->y && ++ drawable->width == emulated_mode->width && ++ drawable->height == emulated_mode->height) { + + *emulated_mode_ret = emulated_mode; + *xwl_output_ret = xwl_output; +@@ -646,9 +648,9 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, + emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, owner); + if (xwl_output && xwl_window->window->overrideRedirect && + emulated_mode && emulated_mode->from_vidmode && +- xwl_window->x == 0 && xwl_window->y == 0 && +- xwl_window->width == xwl_screen->width && +- xwl_window->height == xwl_screen->height) { ++ drawable->x == 0 && drawable->y == 0 && ++ drawable->width == xwl_screen->width && ++ drawable->height == xwl_screen->height) { + + *emulated_mode_ret = emulated_mode; + *xwl_output_ret = xwl_output; +@@ -768,8 +770,6 @@ ensure_surface_for_window(WindowPtr window) + + xwl_window->xwl_screen = xwl_screen; + xwl_window->window = window; +- xwl_window->width = window->drawable.width; +- xwl_window->height = window->drawable.height; + xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor); + if (xwl_window->surface == NULL) { + ErrorF("wl_display_create_surface failed\n"); +@@ -997,20 +997,15 @@ xwl_resize_window(WindowPtr window, + struct xwl_window *xwl_window; + + xwl_screen = xwl_screen_get(screen); +- xwl_window = xwl_window_get(window); ++ xwl_window = xwl_window_from_window(window); + + screen->ResizeWindow = xwl_screen->ResizeWindow; + (*screen->ResizeWindow) (window, x, y, width, height, sib); + xwl_screen->ResizeWindow = screen->ResizeWindow; + screen->ResizeWindow = xwl_resize_window; + +- if (xwl_window) { +- xwl_window->x = x; +- xwl_window->y = y; +- xwl_window->width = width; +- xwl_window->height = height; ++ if (xwl_window && xwl_window_is_toplevel(window)) + xwl_window_check_resolution_change_emulation(xwl_window); +- } + } + + static void +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index 126af8823..01aef27d2 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -184,7 +184,6 @@ struct xwl_window { + struct xwl_screen *xwl_screen; + struct wl_surface *surface; + struct wp_viewport *viewport; +- int32_t x, y, width, height; + float scale_x, scale_y; + struct wl_shell_surface *shell_surface; + WindowPtr window; +-- +2.25.2 + diff --git a/0019-xwayland-Also-check-resolution-change-emulation-when.patch b/0019-xwayland-Also-check-resolution-change-emulation-when.patch new file mode 100644 index 0000000000000000000000000000000000000000..a1c0e84e950b92da7ba7e5896180d3a8ffece42f --- /dev/null +++ b/0019-xwayland-Also-check-resolution-change-emulation-when.patch @@ -0,0 +1,45 @@ +From 63b0c0d76d1020f0cac331f3eff30fba07f79965 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 15 Jan 2020 14:36:45 +0100 +Subject: [PATCH xserver 19/24] xwayland: Also check + resolution-change-emulation when the xwl_window itself moves + +The recent change to use the top-level non-window-manager Window drawable +coordinates from xwl_window_check_resolution_change_emulation() in +combination with only calling it on a resize when the top-level window +is moved breaks things with mutter/gnome-shell. + +When fullscreening a X11 window, mutter moves its window-decoration Window +wrapping the top-level Window to the monitor's origin coordinates (e.g. 0x0) +last. This updates the top-level's drawable coordinates, but as the +actual MoveWindow is called on the wrapper Window and not on the toplevel +we do not call xwl_window_check_resolution_change_emulation() and we never +enable the viewport. + +This commit fixes this by also calling +xwl_window_check_resolution_change_emulation() if the Window being moved +is an xwl_window itself. + +Acked-by: Olivier Fourdan +Signed-off-by: Hans de Goede +(cherry picked from commit 4fc107460a349a1a46f0e5251e6fd2a31f4c0428) +--- + hw/xwayland/xwayland.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 14227a327..298ef3ac8 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -1004,7 +1004,7 @@ xwl_resize_window(WindowPtr window, + xwl_screen->ResizeWindow = screen->ResizeWindow; + screen->ResizeWindow = xwl_resize_window; + +- if (xwl_window && xwl_window_is_toplevel(window)) ++ if (xwl_window && (xwl_window_get(window) || xwl_window_is_toplevel(window))) + xwl_window_check_resolution_change_emulation(xwl_window); + } + +-- +2.25.2 + diff --git a/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch b/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch new file mode 100644 index 0000000000000000000000000000000000000000..51f3fe843755028ccf2072b406afaf3470f2f624 --- /dev/null +++ b/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch @@ -0,0 +1,83 @@ +From 309e6e549adc5a164541d16822745c022cd8574b Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 9 Jan 2020 11:00:36 +0100 +Subject: [PATCH xserver 20/24] xwayland: Also hook screen's MoveWindow method + +Not only hook the ResizeWindow method of the screen (which really is +MoveAndResize) but also hook the MoveWindow method for checking if we +need to setup a viewport for resolution change emulation. + +Our resolution change emulation check if the windows origin matches +the monitors origin and the windows origin can also be changed by just +a move without being resized. + +Also checking on a move becomes esp. important when we move to checking +on changes to the top-level non-window-manager client (X11)Window instead +of on changes to the xwl_window later on in this patch series. + +Acked-by: Olivier Fourdan +Signed-off-by: Hans de Goede +(cherry picked from commit 10df0437a2b142e61c4d84ffffa9592ac6846ef1) +--- + hw/xwayland/xwayland.c | 25 +++++++++++++++++++++++++ + hw/xwayland/xwayland.h | 1 + + 2 files changed, 26 insertions(+) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 298ef3ac8..1294ff1d8 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -1008,6 +1008,28 @@ xwl_resize_window(WindowPtr window, + xwl_window_check_resolution_change_emulation(xwl_window); + } + ++static void ++xwl_move_window(WindowPtr window, ++ int x, int y, ++ WindowPtr next_sib, ++ VTKind kind) ++{ ++ ScreenPtr screen = window->drawable.pScreen; ++ struct xwl_screen *xwl_screen; ++ struct xwl_window *xwl_window; ++ ++ xwl_screen = xwl_screen_get(screen); ++ xwl_window = xwl_window_from_window(window); ++ ++ screen->MoveWindow = xwl_screen->MoveWindow; ++ (*screen->MoveWindow) (window, x, y, next_sib, kind); ++ xwl_screen->MoveWindow = screen->MoveWindow; ++ screen->MoveWindow = xwl_move_window; ++ ++ if (xwl_window && (xwl_window_get(window) || xwl_window_is_toplevel(window))) ++ xwl_window_check_resolution_change_emulation(xwl_window); ++} ++ + static void + frame_callback(void *data, + struct wl_callback *callback, +@@ -1564,6 +1586,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) + xwl_screen->ResizeWindow = pScreen->ResizeWindow; + pScreen->ResizeWindow = xwl_resize_window; + ++ xwl_screen->MoveWindow = pScreen->MoveWindow; ++ pScreen->MoveWindow = xwl_move_window; ++ + if (xwl_screen->rootless) { + xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; + pScreen->SetWindowPixmap = xwl_set_window_pixmap; +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index 01aef27d2..72225374b 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -138,6 +138,7 @@ struct xwl_screen { + SetWindowPixmapProcPtr SetWindowPixmap; + ChangeWindowAttributesProcPtr ChangeWindowAttributes; + ResizeWindowProcPtr ResizeWindow; ++ MoveWindowProcPtr MoveWindow; + + struct xorg_list output_list; + struct xorg_list seat_list; +-- +2.25.2 + diff --git a/0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch b/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch similarity index 90% rename from 0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch rename to 0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch index 5d04e5df18f34d66663861a6d180b727dee2e5a2..2b1bc8446d2172762322b8275348193a9ce2e698 100644 --- a/0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch +++ b/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch @@ -1,7 +1,7 @@ -From c392765d459bd2cac6e3f431c67d698bb905e0ab Mon Sep 17 00:00:00 2001 +From 52bbef1f55d17229684b0d76a478ec639c4032ed Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 7 Oct 2019 14:27:49 +0200 -Subject: [PATCH xserver 14/14] xwayland: Fix emulated modes not being removed +Subject: [PATCH xserver 21/24] xwayland: Fix emulated modes not being removed when screen rotation is used The code building the mode-list does the following to deal with screen @@ -24,7 +24,9 @@ to a member of xwl_output->randr_output->modes, so we do not need to duplicate this code, instead we can simply check that the passed in mode is modes[0] which always is the actual output mode. +Acked-by: Olivier Fourdan Signed-off-by: Hans de Goede +(cherry picked from commit 88342353de45e64f408c38bb10cd1506ba0f159a) --- hw/xwayland/xwayland-output.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) @@ -57,5 +59,5 @@ index 20c254962..7d705d919 100644 else xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode); -- -2.23.0 +2.25.2 diff --git a/0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch b/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch similarity index 78% rename from 0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch rename to 0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch index 57ff541c98170c81c39c00d5058c5aceadd82bc2..0b6a07b64dac47f57ae973f9b17955d038ee5973 100644 --- a/0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch +++ b/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch @@ -1,7 +1,7 @@ -From 01629caef21b77cfabc052408eb04699e4fa5143 Mon Sep 17 00:00:00 2001 +From 57d0ad44fd0b04fff98e9b484816dc95068a90cc Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 11:46:49 +0100 -Subject: [PATCH xserver 15/17] xwayland: Call +Subject: [PATCH xserver 22/24] xwayland: Call xwl_window_check_resolution_change_emulation() on newly created O-R windows Some clients, which use vidmode to change the resolution when going fullscreen, @@ -20,20 +20,22 @@ thus will not have an xwl_window. This fixes ClanLib-0.6.x and alleggl-4.4.x using apps not properly fullscreening. +Acked-by: Olivier Fourdan Signed-off-by: Hans de Goede +(cherry picked from commit 4cfc2677f5c82ca5db0919de549b9b077f1ba113) --- hw/xwayland/xwayland.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 75ff9f011..ed1d671ff 100644 +index 1294ff1d8..6b86e56bd 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -815,6 +815,11 @@ ensure_surface_for_window(WindowPtr window) +@@ -819,6 +819,11 @@ ensure_surface_for_window(WindowPtr window) xwl_window_init_allow_commits(xwl_window); -+ if (!xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) { ++ if (!window_is_wm_window(window)) { + /* CSD or O-R toplevel window, check viewport on creation */ + xwl_window_check_resolution_change_emulation(xwl_window); + } @@ -42,5 +44,5 @@ index 75ff9f011..ed1d671ff 100644 err_surf: -- -2.23.0 +2.25.2 diff --git a/0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch b/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch similarity index 60% rename from 0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch rename to 0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch index fd4789571f2b3634ba73e65b0af4a8ab345c6e61..f2654fbb7460be2c11b1f197aad58baf40497961 100644 --- a/0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch +++ b/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch @@ -1,7 +1,7 @@ -From 2db2fcb97bd148476817634486cb384a1f623fa9 Mon Sep 17 00:00:00 2001 +From 87a1a7b9f8f7d848302057b9ca54f6729e82bbe7 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 14:32:29 +0100 -Subject: [PATCH xserver 16/17] xwayland: Fix setting of +Subject: [PATCH xserver 23/24] xwayland: Fix setting of _XWAYLAND_RANDR_EMU_MONITOR_RECTS prop on new windows For window-manager managed windows, xwl_realize_window is only called for @@ -27,31 +27,42 @@ work. This fixes apps using the ogre3d library always running at the monitors native resolution. +Acked-by: Olivier Fourdan Signed-off-by: Hans de Goede +(cherry picked from commit 148f428dfccf606b932a00d5a00af06e8dca8a7e) --- - hw/xwayland/xwayland.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) + hw/xwayland/xwayland.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index ed1d671ff..1ce29c51c 100644 +index 6b86e56bd..e721d6cb5 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -815,7 +815,13 @@ ensure_surface_for_window(WindowPtr window) +@@ -749,6 +749,7 @@ ensure_surface_for_window(WindowPtr window) + struct xwl_screen *xwl_screen; + struct xwl_window *xwl_window; + struct wl_region *region; ++ WindowPtr toplevel; + + if (xwl_window_get(window)) + return TRUE; +@@ -819,7 +820,14 @@ ensure_surface_for_window(WindowPtr window) xwl_window_init_allow_commits(xwl_window); -- if (!xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) { -+ /* When a new windom-manager decoration window is realized, then the randr -+ * emulation props have not been set on the managed client window yet. +- if (!window_is_wm_window(window)) { ++ /* When a new window-manager window is realized, then the randr emulation ++ * props may have not been set on the managed client window yet. + */ -+ if (xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) { -+ if (window->firstChild && window->firstChild == window->lastChild) -+ xwl_output_set_window_randr_emu_props(xwl_screen, window->firstChild); ++ if (window_is_wm_window(window)) { ++ toplevel = window_get_client_toplevel(window); ++ if (toplevel) ++ xwl_output_set_window_randr_emu_props(xwl_screen, toplevel); + } else { /* CSD or O-R toplevel window, check viewport on creation */ xwl_window_check_resolution_change_emulation(xwl_window); } -@@ -864,8 +870,6 @@ xwl_realize_window(WindowPtr window) +@@ -868,8 +876,6 @@ xwl_realize_window(WindowPtr window) return FALSE; } @@ -61,5 +72,5 @@ index ed1d671ff..1ce29c51c 100644 } -- -2.23.0 +2.25.2 diff --git a/0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch b/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch similarity index 87% rename from 0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch rename to 0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch index db3b4d94f7c97f6b7fca2c7e2b71c8f6171a190a..c4925c264a9c9d4b2d0112c5ac1e65ffbcf2b4ec 100644 --- a/0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch +++ b/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch @@ -1,7 +1,7 @@ -From f73305cc415d2fd464aae4b0dc72558fd1b6bd81 Mon Sep 17 00:00:00 2001 +From 231d5e2da2e1b0aee3cfe6febc54daf7a0e4b4c7 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 15:01:18 +0100 -Subject: [PATCH xserver 17/17] xwayland: Remove unnecessary +Subject: [PATCH xserver 24/24] xwayland: Remove unnecessary xwl_window_is_toplevel() check from xwl_output_set_window_randr_emu_props() Since the recent fix to call xwl_output_set_window_randr_emu_props() from @@ -13,7 +13,9 @@ This commit moves the check to xwl_output_set_randr_emu_prop_callback() so that we only do it when we are walking over all Windows of a client to update the property on a change of the emulated resolution. +Acked-by: Olivier Fourdan Signed-off-by: Hans de Goede +(cherry picked from commit d4faab8708779df265239b203ed5f020bff681bf) --- hw/xwayland/xwayland-output.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) @@ -43,5 +45,5 @@ index 7d705d919..084b669e4 100644 static void -- -2.23.0 +2.25.2 diff --git a/CVE-2020-14345.patch b/CVE-2020-14345.patch new file mode 100644 index 0000000000000000000000000000000000000000..06bf715734ac9c087cb1fa543d8d2665bd981e75 --- /dev/null +++ b/CVE-2020-14345.patch @@ -0,0 +1,179 @@ +From f7cd1276bbd4fe3a9700096dec33b52b8440788d Mon Sep 17 00:00:00 2001 +From: Matthieu Herrb +Date: Tue, 18 Aug 2020 14:46:32 +0200 +Subject: [PATCH] Correct bounds checking in XkbSetNames() + +CVE-2020-14345 / ZDI 11428 +reference£ºhttps://gitlab.freedesktop.org/xorg/xserver/-/commit/f7cd1276bbd4fe3a9700096dec33b52b8440788d + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Matthieu Herrb +--- + xkb/xkb.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 48 insertions(+) + +diff --git a/xkb/xkb.c b/xkb/xkb.c +index 3162574..ca7f44a 100644 +--- a/xkb/xkb.c ++++ b/xkb/xkb.c +@@ -152,6 +152,19 @@ static RESTYPE RT_XKBCLIENT; + #define CHK_REQ_KEY_RANGE(err,first,num,r) \ + CHK_REQ_KEY_RANGE2(err,first,num,r,client->errorValue,BadValue) + ++static Bool ++_XkbCheckRequestBounds(ClientPtr client, void *stuff, void *from, void *to) { ++ char *cstuff = (char *)stuff; ++ char *cfrom = (char *)from; ++ char *cto = (char *)to; ++ ++ return cfrom < cto && ++ cfrom >= cstuff && ++ cfrom < cstuff + ((size_t)client->req_len << 2) && ++ cto >= cstuff && ++ cto <= cstuff + ((size_t)client->req_len << 2); ++} ++ + /***====================================================================***/ + + int +@@ -4045,6 +4058,8 @@ _XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev, + client->errorValue = _XkbErrCode2(0x04, stuff->firstType); + return BadAccess; + } ++ if (!_XkbCheckRequestBounds(client, stuff, tmp, tmp + stuff->nTypes)) ++ return BadLength; + old = tmp; + tmp = _XkbCheckAtoms(tmp, stuff->nTypes, client->swapped, &bad); + if (!tmp) { +@@ -4074,6 +4089,8 @@ _XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev, + } + width = (CARD8 *) tmp; + tmp = (CARD32 *) (((char *) tmp) + XkbPaddedSize(stuff->nKTLevels)); ++ if (!_XkbCheckRequestBounds(client, stuff, width, tmp)) ++ return BadLength; + type = &xkb->map->types[stuff->firstKTLevel]; + for (i = 0; i < stuff->nKTLevels; i++, type++) { + if (width[i] == 0) +@@ -4083,6 +4100,8 @@ _XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev, + type->num_levels, width[i]); + return BadMatch; + } ++ if (!_XkbCheckRequestBounds(client, stuff, tmp, tmp + width[i])) ++ return BadLength; + tmp = _XkbCheckAtoms(tmp, width[i], client->swapped, &bad); + if (!tmp) { + client->errorValue = bad; +@@ -4095,6 +4114,9 @@ _XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev, + client->errorValue = 0x08; + return BadMatch; + } ++ if (!_XkbCheckRequestBounds(client, stuff, tmp, ++ tmp + Ones(stuff->indicators))) ++ return BadLength; + tmp = _XkbCheckMaskedAtoms(tmp, XkbNumIndicators, stuff->indicators, + client->swapped, &bad); + if (!tmp) { +@@ -4107,6 +4129,9 @@ _XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev, + client->errorValue = 0x09; + return BadMatch; + } ++ if (!_XkbCheckRequestBounds(client, stuff, tmp, ++ tmp + Ones(stuff->virtualMods))) ++ return BadLength; + tmp = _XkbCheckMaskedAtoms(tmp, XkbNumVirtualMods, + (CARD32) stuff->virtualMods, + client->swapped, &bad); +@@ -4120,6 +4145,9 @@ _XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev, + client->errorValue = 0x0a; + return BadMatch; + } ++ if (!_XkbCheckRequestBounds(client, stuff, tmp, ++ tmp + Ones(stuff->groupNames))) ++ return BadLength; + tmp = _XkbCheckMaskedAtoms(tmp, XkbNumKbdGroups, + (CARD32) stuff->groupNames, + client->swapped, &bad); +@@ -4141,9 +4169,14 @@ _XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev, + stuff->nKeys); + return BadValue; + } ++ if (!_XkbCheckRequestBounds(client, stuff, tmp, tmp + stuff->nKeys)) ++ return BadLength; + tmp += stuff->nKeys; + } + if ((stuff->which & XkbKeyAliasesMask) && (stuff->nKeyAliases > 0)) { ++ if (!_XkbCheckRequestBounds(client, stuff, tmp, ++ tmp + (stuff->nKeyAliases * 2))) ++ return BadLength; + tmp += stuff->nKeyAliases * 2; + } + if (stuff->which & XkbRGNamesMask) { +@@ -4151,6 +4184,9 @@ _XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev, + client->errorValue = _XkbErrCode2(0x0d, stuff->nRadioGroups); + return BadValue; + } ++ if (!_XkbCheckRequestBounds(client, stuff, tmp, ++ tmp + stuff->nRadioGroups)) ++ return BadLength; + tmp = _XkbCheckAtoms(tmp, stuff->nRadioGroups, client->swapped, &bad); + if (!tmp) { + client->errorValue = bad; +@@ -4344,6 +4380,8 @@ ProcXkbSetNames(ClientPtr client) + /* check device-independent stuff */ + tmp = (CARD32 *) &stuff[1]; + ++ if (!_XkbCheckRequestBounds(client, stuff, tmp, tmp + 1)) ++ return BadLength; + if (stuff->which & XkbKeycodesNameMask) { + tmp = _XkbCheckAtoms(tmp, 1, client->swapped, &bad); + if (!tmp) { +@@ -4351,6 +4389,8 @@ ProcXkbSetNames(ClientPtr client) + return BadAtom; + } + } ++ if (!_XkbCheckRequestBounds(client, stuff, tmp, tmp + 1)) ++ return BadLength; + if (stuff->which & XkbGeometryNameMask) { + tmp = _XkbCheckAtoms(tmp, 1, client->swapped, &bad); + if (!tmp) { +@@ -4358,6 +4398,8 @@ ProcXkbSetNames(ClientPtr client) + return BadAtom; + } + } ++ if (!_XkbCheckRequestBounds(client, stuff, tmp, tmp + 1)) ++ return BadLength; + if (stuff->which & XkbSymbolsNameMask) { + tmp = _XkbCheckAtoms(tmp, 1, client->swapped, &bad); + if (!tmp) { +@@ -4365,6 +4407,8 @@ ProcXkbSetNames(ClientPtr client) + return BadAtom; + } + } ++ if (!_XkbCheckRequestBounds(client, stuff, tmp, tmp + 1)) ++ return BadLength; + if (stuff->which & XkbPhysSymbolsNameMask) { + tmp = _XkbCheckAtoms(tmp, 1, client->swapped, &bad); + if (!tmp) { +@@ -4372,6 +4416,8 @@ ProcXkbSetNames(ClientPtr client) + return BadAtom; + } + } ++ if (!_XkbCheckRequestBounds(client, stuff, tmp, tmp + 1)) ++ return BadLength; + if (stuff->which & XkbTypesNameMask) { + tmp = _XkbCheckAtoms(tmp, 1, client->swapped, &bad); + if (!tmp) { +@@ -4379,6 +4425,8 @@ ProcXkbSetNames(ClientPtr client) + return BadAtom; + } + } ++ if (!_XkbCheckRequestBounds(client, stuff, tmp, tmp + 1)) ++ return BadLength; + if (stuff->which & XkbCompatNameMask) { + tmp = _XkbCheckAtoms(tmp, 1, client->swapped, &bad); + if (!tmp) { +-- +2.27.0 + diff --git a/CVE-2020-14346.patch b/CVE-2020-14346.patch new file mode 100644 index 0000000000000000000000000000000000000000..ee73959ab63e1f3e88c510c8ade7a88a9bcb9d7c --- /dev/null +++ b/CVE-2020-14346.patch @@ -0,0 +1,31 @@ +From c940cc8b6c0a2983c1ec974f1b3f019795dd4cff Mon Sep 17 00:00:00 2001 +From: Matthieu Herrb +Date: Tue, 18 Aug 2020 14:49:04 +0200 +Subject: [PATCH] Fix XIChangeHierarchy() integer underflow + +CVE-2020-14346 / ZDI-CAN-11429 +reference:https://gitlab.freedesktop.org/xorg/xserver/-/commit/c940cc8b6c0a2983c1ec974f1b3f019795dd4cff + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Matthieu Herrb +--- + Xi/xichangehierarchy.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c +index cbdd912..504defe 100644 +--- a/Xi/xichangehierarchy.c ++++ b/Xi/xichangehierarchy.c +@@ -423,7 +423,7 @@ ProcXIChangeHierarchy(ClientPtr client) + if (!stuff->num_changes) + return rc; + +- len = ((size_t)stuff->length << 2) - sizeof(xXIChangeHierarchyReq); ++ len = ((size_t)client->req_len << 2) - sizeof(xXIChangeHierarchyReq); + + any = (xXIAnyHierarchyChangeInfo *) &stuff[1]; + while (stuff->num_changes--) { +-- +2.27.0 \ No newline at end of file diff --git a/CVE-2020-14361.patch b/CVE-2020-14361.patch new file mode 100644 index 0000000000000000000000000000000000000000..c45be0f1170d4aa528d9419d0063b9f5c7106ca6 --- /dev/null +++ b/CVE-2020-14361.patch @@ -0,0 +1,32 @@ +From 144849ea27230962227e62a943b399e2ab304787 Mon Sep 17 00:00:00 2001 +From: Matthieu Herrb +Date: Tue, 18 Aug 2020 14:52:29 +0200 +Subject: [PATCH] Fix XkbSelectEvents() integer underflow + +CVE-2020-14361 ZDI-CAN 11573 +reference:https://gitlab.freedesktop.org/xorg/xserver/-/commit/144849ea27230962227e62a943b399e2ab304787 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Matthieu Herrb + +--- + xkb/xkbSwap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xkb/xkbSwap.c b/xkb/xkbSwap.c +index 1c1ed5f..50cabb9 100644 +--- a/xkb/xkbSwap.c ++++ b/xkb/xkbSwap.c +@@ -76,7 +76,7 @@ SProcXkbSelectEvents(ClientPtr client) + register unsigned bit, ndx, maskLeft, dataLeft, size; + + from.c8 = (CARD8 *) &stuff[1]; +- dataLeft = (stuff->length * 4) - SIZEOF(xkbSelectEventsReq); ++ dataLeft = (client->req_len * 4) - SIZEOF(xkbSelectEventsReq); + maskLeft = (stuff->affectWhich & (~XkbMapNotifyMask)); + for (ndx = 0, bit = 1; (maskLeft != 0); ndx++, bit <<= 1) { + if (((bit & maskLeft) == 0) || (ndx == XkbMapNotify)) +-- +2.27.0 \ No newline at end of file diff --git a/CVE-2020-14362.patch b/CVE-2020-14362.patch new file mode 100644 index 0000000000000000000000000000000000000000..b6f18cade3ddd7a5144178d6f80c5cd9c45ce323 --- /dev/null +++ b/CVE-2020-14362.patch @@ -0,0 +1,65 @@ +From 2902b78535ecc6821cc027351818b28a5c7fdbdc Mon Sep 17 00:00:00 2001 +From: Matthieu Herrb +Date: Tue, 18 Aug 2020 14:55:01 +0200 +Subject: [PATCH] Fix XRecordRegisterClients() Integer underflow + +CVE-2020-14362 ZDI-CAN-11574 +reference:https://gitlab.freedesktop.org/xorg/xserver/-/commit/2902b78535ecc6821cc027351818b28a5c7fdbdc + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Matthieu Herrb +--- + record/record.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/record/record.c b/record/record.c +index f0b739b..05d751a 100644 +--- a/record/record.c ++++ b/record/record.c +@@ -2499,7 +2499,7 @@ SProcRecordQueryVersion(ClientPtr client) + } /* SProcRecordQueryVersion */ + + static int _X_COLD +-SwapCreateRegister(xRecordRegisterClientsReq * stuff) ++SwapCreateRegister(ClientPtr client, xRecordRegisterClientsReq * stuff) + { + int i; + XID *pClientID; +@@ -2509,13 +2509,13 @@ SwapCreateRegister(xRecordRegisterClientsReq * stuff) + swapl(&stuff->nRanges); + pClientID = (XID *) &stuff[1]; + if (stuff->nClients > +- stuff->length - bytes_to_int32(sz_xRecordRegisterClientsReq)) ++ client->req_len - bytes_to_int32(sz_xRecordRegisterClientsReq)) + return BadLength; + for (i = 0; i < stuff->nClients; i++, pClientID++) { + swapl(pClientID); + } + if (stuff->nRanges > +- stuff->length - bytes_to_int32(sz_xRecordRegisterClientsReq) ++ client->req_len - bytes_to_int32(sz_xRecordRegisterClientsReq) + - stuff->nClients) + return BadLength; + RecordSwapRanges((xRecordRange *) pClientID, stuff->nRanges); +@@ -2530,7 +2530,7 @@ SProcRecordCreateContext(ClientPtr client) + + swaps(&stuff->length); + REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq); +- if ((status = SwapCreateRegister((void *) stuff)) != Success) ++ if ((status = SwapCreateRegister(client, (void *) stuff)) != Success) + return status; + return ProcRecordCreateContext(client); + } /* SProcRecordCreateContext */ +@@ -2543,7 +2543,7 @@ SProcRecordRegisterClients(ClientPtr client) + + swaps(&stuff->length); + REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq); +- if ((status = SwapCreateRegister((void *) stuff)) != Success) ++ if ((status = SwapCreateRegister(client, (void *) stuff)) != Success) + return status; + return ProcRecordRegisterClients(client); + } /* SProcRecordRegisterClients */ +-- +2.27.0 \ No newline at end of file diff --git a/backport-0001-CVE-2022-2319.patch b/backport-0001-CVE-2022-2319.patch new file mode 100644 index 0000000000000000000000000000000000000000..ce6d9210fe73585737b429f736b77bdc118b221c --- /dev/null +++ b/backport-0001-CVE-2022-2319.patch @@ -0,0 +1,76 @@ +From f1070c01d616c5f21f939d5ebc533738779451ac Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 5 Jul 2022 12:40:47 +1000 +Subject: [PATCH] xkb: switch to array index loops to moving pointers + +Most similar loops here use a pointer that advances with each loop +iteration, let's do the same here for consistency. + +No functional changes. + +Signed-off-by: Peter Hutterer +Reviewed-by: Olivier Fourdan + +Conflict:NA +Reference:https://github.com/freedesktop/xorg-xserver/commit/f1070c01d616c5f21f939d5ebc533738779451ac +--- + xkb/xkb.c | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/xkb/xkb.c b/xkb/xkb.c +index a29262c244..64e52611ee 100644 +--- a/xkb/xkb.c ++++ b/xkb/xkb.c +@@ -5368,16 +5368,16 @@ _CheckSetSections(XkbGeometryPtr geom, + row->left = rWire->left; + row->vertical = rWire->vertical; + kWire = (xkbKeyWireDesc *) &rWire[1]; +- for (k = 0; k < rWire->nKeys; k++) { ++ for (k = 0; k < rWire->nKeys; k++, kWire++) { + XkbKeyPtr key; + + key = XkbAddGeomKey(row); + if (!key) + return BadAlloc; +- memcpy(key->name.name, kWire[k].name, XkbKeyNameLength); +- key->gap = kWire[k].gap; +- key->shape_ndx = kWire[k].shapeNdx; +- key->color_ndx = kWire[k].colorNdx; ++ memcpy(key->name.name, kWire->name, XkbKeyNameLength); ++ key->gap = kWire->gap; ++ key->shape_ndx = kWire->shapeNdx; ++ key->color_ndx = kWire->colorNdx; + if (key->shape_ndx >= geom->num_shapes) { + client->errorValue = _XkbErrCode3(0x10, key->shape_ndx, + geom->num_shapes); +@@ -5389,7 +5389,7 @@ _CheckSetSections(XkbGeometryPtr geom, + return BadMatch; + } + } +- rWire = (xkbRowWireDesc *) &kWire[rWire->nKeys]; ++ rWire = (xkbRowWireDesc *)kWire; + } + wire = (char *) rWire; + if (sWire->nDoodads > 0) { +@@ -5454,16 +5454,16 @@ _CheckSetShapes(XkbGeometryPtr geom, + return BadAlloc; + ol->corner_radius = olWire->cornerRadius; + ptWire = (xkbPointWireDesc *) &olWire[1]; +- for (p = 0, pt = ol->points; p < olWire->nPoints; p++, pt++) { +- pt->x = ptWire[p].x; +- pt->y = ptWire[p].y; ++ for (p = 0, pt = ol->points; p < olWire->nPoints; p++, pt++, ptWire++) { ++ pt->x = ptWire->x; ++ pt->y = ptWire->y; + if (client->swapped) { + swaps(&pt->x); + swaps(&pt->y); + } + } + ol->num_points = olWire->nPoints; +- olWire = (xkbOutlineWireDesc *) (&ptWire[olWire->nPoints]); ++ olWire = (xkbOutlineWireDesc *)ptWire; + } + if (shapeWire->primaryNdx != XkbNoShape) + shape->primary = &shape->outlines[shapeWire->primaryNdx]; + diff --git a/backport-0002-CVE-2022-2319.patch b/backport-0002-CVE-2022-2319.patch new file mode 100644 index 0000000000000000000000000000000000000000..8a90a3121f4dccf192d3eba5d5c1fb91a39897e6 --- /dev/null +++ b/backport-0002-CVE-2022-2319.patch @@ -0,0 +1,182 @@ +From 6907b6ea2b4ce949cb07271f5b678d5966d9df42 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 5 Jul 2022 11:11:06 +1000 +Subject: [PATCH] xkb: add request length validation for XkbSetGeometry + +No validation of the various fields on that report were done, so a +malicious client could send a short request that claims it had N +sections, or rows, or keys, and the server would process the request for +N sections, running out of bounds of the actual request data. + +Fix this by adding size checks to ensure our data is valid. + +ZDI-CAN 16062, CVE-2022-2319. + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Peter Hutterer + +Conflict:NA +Reference:https://github.com/freedesktop/xorg-xserver/commit/6907b6ea2b4ce949cb07271f5b678d5966d9df42 +--- + xkb/xkb.c | 43 ++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 38 insertions(+), 5 deletions(-) + +diff --git a/xkb/xkb.c b/xkb/xkb.c +index 34b2c290be..4692895dbd 100644 +--- a/xkb/xkb.c ++++ b/xkb/xkb.c +@@ -5156,7 +5156,7 @@ _GetCountedString(char **wire_inout, ClientPtr client, char **str) + } + + static Status +-_CheckSetDoodad(char **wire_inout, ++_CheckSetDoodad(char **wire_inout, xkbSetGeometryReq *req, + XkbGeometryPtr geom, XkbSectionPtr section, ClientPtr client) + { + char *wire; +@@ -5167,6 +5167,9 @@ _CheckSetDoodad(char **wire_inout, + Status status; + + dWire = (xkbDoodadWireDesc *) (*wire_inout); ++ if (!_XkbCheckRequestBounds(client, req, dWire, dWire + 1)) ++ return BadLength; ++ + any = dWire->any; + wire = (char *) &dWire[1]; + if (client->swapped) { +@@ -5269,7 +5272,7 @@ _CheckSetDoodad(char **wire_inout, + } + + static Status +-_CheckSetOverlay(char **wire_inout, ++_CheckSetOverlay(char **wire_inout, xkbSetGeometryReq *req, + XkbGeometryPtr geom, XkbSectionPtr section, ClientPtr client) + { + register int r; +@@ -5280,6 +5283,9 @@ _CheckSetOverlay(char **wire_inout, + + wire = *wire_inout; + olWire = (xkbOverlayWireDesc *) wire; ++ if (!_XkbCheckRequestBounds(client, req, olWire, olWire + 1)) ++ return BadLength; ++ + if (client->swapped) { + swapl(&olWire->name); + } +@@ -5291,6 +5297,9 @@ _CheckSetOverlay(char **wire_inout, + xkbOverlayKeyWireDesc *kWire; + XkbOverlayRowPtr row; + ++ if (!_XkbCheckRequestBounds(client, req, rWire, rWire + 1)) ++ return BadLength; ++ + if (rWire->rowUnder > section->num_rows) { + client->errorValue = _XkbErrCode4(0x20, r, section->num_rows, + rWire->rowUnder); +@@ -5299,6 +5308,9 @@ _CheckSetOverlay(char **wire_inout, + row = XkbAddGeomOverlayRow(ol, rWire->rowUnder, rWire->nKeys); + kWire = (xkbOverlayKeyWireDesc *) &rWire[1]; + for (k = 0; k < rWire->nKeys; k++, kWire++) { ++ if (!_XkbCheckRequestBounds(client, req, kWire, kWire + 1)) ++ return BadLength; ++ + if (XkbAddGeomOverlayKey(ol, row, + (char *) kWire->over, + (char *) kWire->under) == NULL) { +@@ -5332,6 +5344,9 @@ _CheckSetSections(XkbGeometryPtr geom, + register int r; + xkbRowWireDesc *rWire; + ++ if (!_XkbCheckRequestBounds(client, req, sWire, sWire + 1)) ++ return BadLength; ++ + if (client->swapped) { + swapl(&sWire->name); + swaps(&sWire->top); +@@ -5357,6 +5372,9 @@ _CheckSetSections(XkbGeometryPtr geom, + XkbRowPtr row; + xkbKeyWireDesc *kWire; + ++ if (!_XkbCheckRequestBounds(client, req, rWire, rWire + 1)) ++ return BadLength; ++ + if (client->swapped) { + swaps(&rWire->top); + swaps(&rWire->left); +@@ -5371,6 +5389,9 @@ _CheckSetSections(XkbGeometryPtr geom, + for (k = 0; k < rWire->nKeys; k++, kWire++) { + XkbKeyPtr key; + ++ if (!_XkbCheckRequestBounds(client, req, kWire, kWire + 1)) ++ return BadLength; ++ + key = XkbAddGeomKey(row); + if (!key) + return BadAlloc; +@@ -5396,7 +5417,7 @@ _CheckSetSections(XkbGeometryPtr geom, + register int d; + + for (d = 0; d < sWire->nDoodads; d++) { +- status = _CheckSetDoodad(&wire, geom, section, client); ++ status = _CheckSetDoodad(&wire, req, geom, section, client); + if (status != Success) + return status; + } +@@ -5405,7 +5426,7 @@ _CheckSetSections(XkbGeometryPtr geom, + register int o; + + for (o = 0; o < sWire->nOverlays; o++) { +- status = _CheckSetOverlay(&wire, geom, section, client); ++ status = _CheckSetOverlay(&wire, req, geom, section, client); + if (status != Success) + return status; + } +@@ -5439,6 +5460,9 @@ _CheckSetShapes(XkbGeometryPtr geom, + xkbOutlineWireDesc *olWire; + XkbOutlinePtr ol; + ++ if (!_XkbCheckRequestBounds(client, req, shapeWire, shapeWire + 1)) ++ return BadLength; ++ + shape = + XkbAddGeomShape(geom, shapeWire->name, shapeWire->nOutlines); + if (!shape) +@@ -5449,12 +5473,18 @@ _CheckSetShapes(XkbGeometryPtr geom, + XkbPointPtr pt; + xkbPointWireDesc *ptWire; + ++ if (!_XkbCheckRequestBounds(client, req, olWire, olWire + 1)) ++ return BadLength; ++ + ol = XkbAddGeomOutline(shape, olWire->nPoints); + if (!ol) + return BadAlloc; + ol->corner_radius = olWire->cornerRadius; + ptWire = (xkbPointWireDesc *) &olWire[1]; + for (p = 0, pt = ol->points; p < olWire->nPoints; p++, pt++, ptWire++) { ++ if (!_XkbCheckRequestBounds(client, req, ptWire, ptWire + 1)) ++ return BadLength; ++ + pt->x = ptWire->x; + pt->y = ptWire->y; + if (client->swapped) { +@@ -5560,12 +5590,15 @@ _CheckSetGeom(XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client) + return status; + + for (i = 0; i < req->nDoodads; i++) { +- status = _CheckSetDoodad(&wire, geom, NULL, client); ++ status = _CheckSetDoodad(&wire, req, geom, NULL, client); + if (status != Success) + return status; + } + + for (i = 0; i < req->nKeyAliases; i++) { ++ if (!_XkbCheckRequestBounds(client, req, wire, wire + XkbKeyNameLength)) ++ return BadLength; ++ + if (XkbAddGeomKeyAlias(geom, &wire[XkbKeyNameLength], wire) == NULL) + return BadAlloc; + wire += 2 * XkbKeyNameLength; + diff --git a/backport-CVE-2020-14347.patch b/backport-CVE-2020-14347.patch new file mode 100644 index 0000000000000000000000000000000000000000..078c741199912a46b3b2ac8e6f79ed5a864f7ffe --- /dev/null +++ b/backport-CVE-2020-14347.patch @@ -0,0 +1,32 @@ +From aac28e162e5108510065ad4c323affd6deffd816 Mon Sep 17 00:00:00 2001 +From: Matthieu Herrb +Date: Sat, 25 Jul 2020 19:33:50 +0200 +Subject: [PATCH] fix for ZDI-11426 + +Avoid leaking un-initalized memory to clients by zeroing the +whole pixmap on initial allocation. + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Matthieu Herrb +Reviewed-by: Alan Coopersmith +--- + dix/pixmap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dix/pixmap.c b/dix/pixmap.c +index 1186d7dbbf..5a0146bbb6 100644 +--- a/dix/pixmap.c ++++ b/dix/pixmap.c +@@ -116,7 +116,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize) + if (pScreen->totalPixmapSize > ((size_t) - 1) - pixDataSize) + return NullPixmap; + +- pPixmap = malloc(pScreen->totalPixmapSize + pixDataSize); ++ pPixmap = calloc(1, pScreen->totalPixmapSize + pixDataSize); + if (!pPixmap) + return NullPixmap; + +-- +GitLab \ No newline at end of file diff --git a/backport-CVE-2020-14360.patch b/backport-CVE-2020-14360.patch new file mode 100644 index 0000000000000000000000000000000000000000..60ec435afc05030d62b3fc9b1af42579177ba4dd --- /dev/null +++ b/backport-CVE-2020-14360.patch @@ -0,0 +1,136 @@ +From 446ff2d3177087b8173fa779fa5b77a2a128988b Mon Sep 17 00:00:00 2001 +From: Matthieu Herrb +Date: Thu, 12 Nov 2020 19:15:07 +0100 +Subject: [PATCH] Check SetMap request length carefully. + +Avoid out of bounds memory accesses on too short request. + +ZDI-CAN 11572 / CVE-2020-14360 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Matthieu Herrb + +reason:CVE-2020-14360 + +Conflict:NA +Reference:https://gitlab.freedesktop.org/xorg/xserver/-/commit/446ff2d3177087b8173fa779fa5b77a2a128988b + +--- + xkb/xkb.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 92 insertions(+) + +diff --git a/xkb/xkb.c b/xkb/xkb.c +index f162e8d..779cdfd 100644 +--- a/xkb/xkb.c ++++ b/xkb/xkb.c +@@ -2382,6 +2382,93 @@ SetVirtualModMap(XkbSrvInfoPtr xkbi, + return (char *) wire; + } + ++#define _add_check_len(new) \ ++ if (len > UINT32_MAX - (new) || len > req_len - (new)) goto bad; \ ++ else len += new ++ ++/** ++ * Check the length of the SetMap request ++ */ ++static int ++_XkbSetMapCheckLength(xkbSetMapReq *req) ++{ ++ size_t len = sz_xkbSetMapReq, req_len = req->length << 2; ++ xkbKeyTypeWireDesc *keytype; ++ xkbSymMapWireDesc *symmap; ++ BOOL preserve; ++ int i, map_count, nSyms; ++ ++ if (req_len < len) ++ goto bad; ++ /* types */ ++ if (req->present & XkbKeyTypesMask) { ++ keytype = (xkbKeyTypeWireDesc *)(req + 1); ++ for (i = 0; i < req->nTypes; i++) { ++ _add_check_len(XkbPaddedSize(sz_xkbKeyTypeWireDesc)); ++ if (req->flags & XkbSetMapResizeTypes) { ++ _add_check_len(keytype->nMapEntries ++ * sz_xkbKTSetMapEntryWireDesc); ++ preserve = keytype->preserve; ++ map_count = keytype->nMapEntries; ++ if (preserve) { ++ _add_check_len(map_count * sz_xkbModsWireDesc); ++ } ++ keytype += 1; ++ keytype = (xkbKeyTypeWireDesc *) ++ ((xkbKTSetMapEntryWireDesc *)keytype + map_count); ++ if (preserve) ++ keytype = (xkbKeyTypeWireDesc *) ++ ((xkbModsWireDesc *)keytype + map_count); ++ } ++ } ++ } ++ /* syms */ ++ if (req->present & XkbKeySymsMask) { ++ symmap = (xkbSymMapWireDesc *)((char *)req + len); ++ for (i = 0; i < req->nKeySyms; i++) { ++ _add_check_len(sz_xkbSymMapWireDesc); ++ nSyms = symmap->nSyms; ++ _add_check_len(nSyms*sizeof(CARD32)); ++ symmap += 1; ++ symmap = (xkbSymMapWireDesc *)((CARD32 *)symmap + nSyms); ++ } ++ } ++ /* actions */ ++ if (req->present & XkbKeyActionsMask) { ++ _add_check_len(req->totalActs * sz_xkbActionWireDesc ++ + XkbPaddedSize(req->nKeyActs)); ++ } ++ /* behaviours */ ++ if (req->present & XkbKeyBehaviorsMask) { ++ _add_check_len(req->totalKeyBehaviors * sz_xkbBehaviorWireDesc); ++ } ++ /* vmods */ ++ if (req->present & XkbVirtualModsMask) { ++ _add_check_len(XkbPaddedSize(Ones(req->virtualMods))); ++ } ++ /* explicit */ ++ if (req->present & XkbExplicitComponentsMask) { ++ /* two bytes per non-zero explicit componen */ ++ _add_check_len(XkbPaddedSize(req->totalKeyExplicit * sizeof(CARD16))); ++ } ++ /* modmap */ ++ if (req->present & XkbModifierMapMask) { ++ /* two bytes per non-zero modmap component */ ++ _add_check_len(XkbPaddedSize(req->totalModMapKeys * sizeof(CARD16))); ++ } ++ /* vmodmap */ ++ if (req->present & XkbVirtualModMapMask) { ++ _add_check_len(req->totalVModMapKeys * sz_xkbVModMapWireDesc); ++ } ++ if (len == req_len) ++ return Success; ++bad: ++ ErrorF("[xkb] BOGUS LENGTH in SetMap: expected %ld got %ld\n", ++ len, req_len); ++ return BadLength; ++} ++ ++ + /** + * Check if the given request can be applied to the given device but don't + * actually do anything.. +@@ -2639,6 +2726,11 @@ ProcXkbSetMap(ClientPtr client) + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); + CHK_MASK_LEGAL(0x01, stuff->present, XkbAllMapComponentsMask); + ++ /* first verify the request length carefully */ ++ rc = _XkbSetMapCheckLength(stuff); ++ if (rc != Success) ++ return rc; ++ + tmp = (char *) &stuff[1]; + + /* Check if we can to the SetMap on the requested device. If this +-- +2.19.1 + diff --git a/backport-CVE-2020-25712.patch b/backport-CVE-2020-25712.patch new file mode 100644 index 0000000000000000000000000000000000000000..82459e2a45c77b2b97d9073dd0d6fa6a3d284e4c --- /dev/null +++ b/backport-CVE-2020-25712.patch @@ -0,0 +1,104 @@ +From 87c64fc5b0db9f62f4e361444f4b60501ebf67b9 Mon Sep 17 00:00:00 2001 +From: Matthieu Herrb +Date: Sun, 11 Oct 2020 17:05:09 +0200 +Subject: [PATCH] Fix XkbSetDeviceInfo() and SetDeviceIndicators() heap + overflows + +ZDI-CAN 11389 / CVE-2020-25712 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +reason:Fix XkbSetDeviceInfo() and SetDeviceIndicators() heap overflows + +Conflict:NA +Reference:https://gitlab.freedesktop.org/xorg/xserver/-/commit/87c64fc5b0db9f62f4e361444f4b60501ebf67b9 + +Signed-off-by: Matthieu Herrb +--- + xkb/xkb.c | 26 +++++++++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +diff --git a/xkb/xkb.c b/xkb/xkb.c +index 8e016cd74..f54cc97f8 100644 +--- a/xkb/xkb.c ++++ b/xkb/xkb.c +@@ -6536,7 +6536,9 @@ SetDeviceIndicators(char *wire, + unsigned changed, + int num, + int *status_rtrn, +- ClientPtr client, xkbExtensionDeviceNotify * ev) ++ ClientPtr client, ++ xkbExtensionDeviceNotify * ev, ++ xkbSetDeviceInfoReq * stuff) + { + xkbDeviceLedsWireDesc *ledWire; + int i; +@@ -6557,6 +6559,11 @@ SetDeviceIndicators(char *wire, + xkbIndicatorMapWireDesc *mapWire; + XkbSrvLedInfoPtr sli; + ++ if (!_XkbCheckRequestBounds(client, stuff, ledWire, ledWire + 1)) { ++ *status_rtrn = BadLength; ++ return (char *) ledWire; ++ } ++ + namec = mapc = statec = 0; + sli = XkbFindSrvLedInfo(dev, ledWire->ledClass, ledWire->ledID, + XkbXI_IndicatorMapsMask); +@@ -6575,6 +6582,10 @@ SetDeviceIndicators(char *wire, + memset((char *) sli->names, 0, XkbNumIndicators * sizeof(Atom)); + for (n = 0, bit = 1; n < XkbNumIndicators; n++, bit <<= 1) { + if (ledWire->namesPresent & bit) { ++ if (!_XkbCheckRequestBounds(client, stuff, atomWire, atomWire + 1)) { ++ *status_rtrn = BadLength; ++ return (char *) atomWire; ++ } + sli->names[n] = (Atom) *atomWire; + if (sli->names[n] == None) + ledWire->namesPresent &= ~bit; +@@ -6592,6 +6603,10 @@ SetDeviceIndicators(char *wire, + if (ledWire->mapsPresent) { + for (n = 0, bit = 1; n < XkbNumIndicators; n++, bit <<= 1) { + if (ledWire->mapsPresent & bit) { ++ if (!_XkbCheckRequestBounds(client, stuff, mapWire, mapWire + 1)) { ++ *status_rtrn = BadLength; ++ return (char *) mapWire; ++ } + sli->maps[n].flags = mapWire->flags; + sli->maps[n].which_groups = mapWire->whichGroups; + sli->maps[n].groups = mapWire->groups; +@@ -6671,7 +6686,7 @@ _XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, + ed.deviceID = dev->id; + wire = (char *) &stuff[1]; + if (stuff->change & XkbXI_ButtonActionsMask) { +- int nBtns, sz, i; ++ int nBtns, sz, i; + XkbAction *acts; + DeviceIntPtr kbd; + +@@ -6683,7 +6698,11 @@ _XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, + return BadAlloc; + dev->button->xkb_acts = acts; + } ++ if (stuff->firstBtn + stuff->nBtns > nBtns) ++ return BadValue; + sz = stuff->nBtns * SIZEOF(xkbActionWireDesc); ++ if (!_XkbCheckRequestBounds(client, stuff, wire, (char *) wire + sz)) ++ return BadLength; + memcpy((char *) &acts[stuff->firstBtn], (char *) wire, sz); + wire += sz; + ed.reason |= XkbXI_ButtonActionsMask; +@@ -6704,7 +6723,8 @@ _XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, + int status = Success; + + wire = SetDeviceIndicators(wire, dev, stuff->change, +- stuff->nDeviceLedFBs, &status, client, &ed); ++ stuff->nDeviceLedFBs, &status, client, &ed, ++ stuff); + if (status != Success) + return status; + } +-- +GitLab + diff --git a/backport-CVE-2021-3472.patch b/backport-CVE-2021-3472.patch new file mode 100644 index 0000000000000000000000000000000000000000..fd5bee9c11ab62beb80d163c4ede1cfcad06ed13 --- /dev/null +++ b/backport-CVE-2021-3472.patch @@ -0,0 +1,36 @@ +From 7aaf54a1884f71dc363f0b884e57bcb67407a6cd Mon Sep 17 00:00:00 2001 +From: Matthieu Herrb +Date: Sun, 21 Mar 2021 18:38:57 +0100 +Subject: [PATCH] Fix XChangeFeedbackControl() request underflow + +CVE-2021-3472 / ZDI-CAN-1259 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Matthieu Herrb + +--- + Xi/chgfctl.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c +index 1de4da9..7a597e4 100644 +--- a/Xi/chgfctl.c ++++ b/Xi/chgfctl.c +@@ -464,8 +464,11 @@ ProcXChangeFeedbackControl(ClientPtr client) + break; + case StringFeedbackClass: + { +- xStringFeedbackCtl *f = ((xStringFeedbackCtl *) &stuff[1]); ++ xStringFeedbackCtl *f; + ++ REQUEST_AT_LEAST_EXTRA_SIZE(xChangeFeedbackControlReq, ++ sizeof(xStringFeedbackCtl)); ++ f = ((xStringFeedbackCtl *) &stuff[1]); + if (client->swapped) { + if (len < bytes_to_int32(sizeof(xStringFeedbackCtl))) + return BadLength; +-- +2.23.0 + diff --git a/backport-CVE-2021-4008.patch b/backport-CVE-2021-4008.patch new file mode 100644 index 0000000000000000000000000000000000000000..c37af61b333d11f095be5b279fcfc95f0b0f57ac --- /dev/null +++ b/backport-CVE-2021-4008.patch @@ -0,0 +1,51 @@ +From ebce7e2d80e7c80e1dda60f2f0bc886f1106ba60 Mon Sep 17 00:00:00 2001 +From: Povilas Kanapickas +Date: Tue, 14 Dec 2021 15:00:03 +0200 +Subject: [PATCH] render: Fix out of bounds access in + SProcRenderCompositeGlyphs() + +ZDI-CAN-14192, CVE-2021-4008 + +This vulnerability was discovered and the fix was suggested by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Povilas Kanapickas +--- + render/render.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/render/render.c b/render/render.c +index c376090ca..456f156d4 100644 +--- a/render/render.c ++++ b/render/render.c +@@ -2309,6 +2309,9 @@ SProcRenderCompositeGlyphs(ClientPtr client) + + i = elt->len; + if (i == 0xff) { ++ if (buffer + 4 > end) { ++ return BadLength; ++ } + swapl((int *) buffer); + buffer += 4; + } +@@ -2319,12 +2322,18 @@ SProcRenderCompositeGlyphs(ClientPtr client) + buffer += i; + break; + case 2: ++ if (buffer + i * 2 > end) { ++ return BadLength; ++ } + while (i--) { + swaps((short *) buffer); + buffer += 2; + } + break; + case 4: ++ if (buffer + i * 4 > end) { ++ return BadLength; ++ } + while (i--) { + swapl((int *) buffer); + buffer += 4; +-- +GitLab diff --git a/backport-CVE-2021-4009.patch b/backport-CVE-2021-4009.patch new file mode 100644 index 0000000000000000000000000000000000000000..0ee1354fecaa0d5458e484d7528b0c5c18f87b7d --- /dev/null +++ b/backport-CVE-2021-4009.patch @@ -0,0 +1,42 @@ +From b5196750099ae6ae582e1f46bd0a6dad29550e02 Mon Sep 17 00:00:00 2001 +From: Povilas Kanapickas +Date: Tue, 14 Dec 2021 15:00:01 +0200 +Subject: [PATCH] xfixes: Fix out of bounds access in + *ProcXFixesCreatePointerBarrier() + +ZDI-CAN-14950, CVE-2021-4009 + +This vulnerability was discovered and the fix was suggested by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Povilas Kanapickas +--- + xfixes/cursor.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/xfixes/cursor.c b/xfixes/cursor.c +index 60580b88f..c5d4554b2 100644 +--- a/xfixes/cursor.c ++++ b/xfixes/cursor.c +@@ -1010,7 +1010,8 @@ ProcXFixesCreatePointerBarrier(ClientPtr client) + { + REQUEST(xXFixesCreatePointerBarrierReq); + +- REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, pad_to_int32(stuff->num_devices)); ++ REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, ++ pad_to_int32(stuff->num_devices * sizeof(CARD16))); + LEGAL_NEW_RESOURCE(stuff->barrier, client); + + return XICreatePointerBarrier(client, stuff); +@@ -1027,7 +1028,8 @@ SProcXFixesCreatePointerBarrier(ClientPtr client) + + swaps(&stuff->length); + swaps(&stuff->num_devices); +- REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, pad_to_int32(stuff->num_devices)); ++ REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, ++ pad_to_int32(stuff->num_devices * sizeof(CARD16))); + + swapl(&stuff->barrier); + swapl(&stuff->window); +-- +GitLab diff --git a/backport-CVE-2021-4010.patch b/backport-CVE-2021-4010.patch new file mode 100644 index 0000000000000000000000000000000000000000..447d9f1f89d77e6d0f5a42fa58d4051b384003b5 --- /dev/null +++ b/backport-CVE-2021-4010.patch @@ -0,0 +1,31 @@ +From 6c4c53010772e3cb4cb8acd54950c8eec9c00d21 Mon Sep 17 00:00:00 2001 +From: Povilas Kanapickas +Date: Tue, 14 Dec 2021 15:00:02 +0200 +Subject: [PATCH] Xext: Fix out of bounds access in SProcScreenSaverSuspend() + +ZDI-CAN-14951, CVE-2021-4010 + +This vulnerability was discovered and the fix was suggested by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Povilas Kanapickas +--- + Xext/saver.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Xext/saver.c b/Xext/saver.c +index 1d7e3cadf..f813ba08d 100644 +--- a/Xext/saver.c ++++ b/Xext/saver.c +@@ -1351,8 +1351,8 @@ SProcScreenSaverSuspend(ClientPtr client) + REQUEST(xScreenSaverSuspendReq); + + swaps(&stuff->length); +- swapl(&stuff->suspend); + REQUEST_SIZE_MATCH(xScreenSaverSuspendReq); ++ swapl(&stuff->suspend); + return ProcScreenSaverSuspend(client); + } + +-- +GitLab diff --git a/backport-CVE-2021-4011.patch b/backport-CVE-2021-4011.patch new file mode 100644 index 0000000000000000000000000000000000000000..fcc56eeabe357e53412bf3f89d12a1503f501246 --- /dev/null +++ b/backport-CVE-2021-4011.patch @@ -0,0 +1,32 @@ +From e56f61c79fc3cee26d83cda0f84ae56d5979f768 Mon Sep 17 00:00:00 2001 +From: Povilas Kanapickas +Date: Tue, 14 Dec 2021 15:00:00 +0200 +Subject: [PATCH] record: Fix out of bounds access in SwapCreateRegister() + +ZDI-CAN-14952, CVE-2021-4011 + +This vulnerability was discovered and the fix was suggested by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Povilas Kanapickas +--- + record/record.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/record/record.c b/record/record.c +index be154525d..e123867a7 100644 +--- a/record/record.c ++++ b/record/record.c +@@ -2516,8 +2516,8 @@ SwapCreateRegister(ClientPtr client, xRecordRegisterClientsReq * stuff) + swapl(pClientID); + } + if (stuff->nRanges > +- client->req_len - bytes_to_int32(sz_xRecordRegisterClientsReq) +- - stuff->nClients) ++ (client->req_len - bytes_to_int32(sz_xRecordRegisterClientsReq) ++ - stuff->nClients) / bytes_to_int32(sz_xRecordRange)) + return BadLength; + RecordSwapRanges((xRecordRange *) pClientID, stuff->nRanges); + return Success; +-- +GitLab diff --git a/backport-CVE-2022-2320.patch b/backport-CVE-2022-2320.patch new file mode 100644 index 0000000000000000000000000000000000000000..f3d0318f27ab54d29eebb8947f4ee07fdbd265fc --- /dev/null +++ b/backport-CVE-2022-2320.patch @@ -0,0 +1,179 @@ +From dd8caf39e9e15d8f302e54045dd08d8ebf1025dc Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 5 Jul 2022 09:50:41 +1000 +Subject: [PATCH] xkb: swap XkbSetDeviceInfo and XkbSetDeviceInfoCheck + +XKB often uses a FooCheck and Foo function pair, the former is supposed +to check all values in the request and error out on BadLength, +BadValue, etc. The latter is then called once we're confident the values +are good (they may still fail on an individual device, but that's a +different topic). + +In the case of XkbSetDeviceInfo, those functions were incorrectly +named, with XkbSetDeviceInfo ending up as the checker function and +XkbSetDeviceInfoCheck as the setter function. As a result, the setter +function was called before the checker function, accessing request +data and modifying device state before we ensured that the data is +valid. + +In particular, the setter function relied on values being already +byte-swapped. This in turn could lead to potential OOB memory access. + +Fix this by correctly naming the functions and moving the length checks +over to the checker function. These were added in 87c64fc5b0 to the +wrong function, probably due to the incorrect naming. + +Fixes ZDI-CAN 16070, CVE-2022-2320. + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Introduced in c06e27b2f6fd9f7b9f827623a48876a225264132 + +Signed-off-by: Peter Hutterer + +Conflict:NA +Reference:https://github.com/freedesktop/xorg-xserver/commit/dd8caf39e9e15d8f302e54045dd08d8ebf1025dc +--- + xkb/xkb.c | 46 +++++++++++++++++++++++++--------------------- + 1 file changed, 25 insertions(+), 21 deletions(-) + +diff --git a/xkb/xkb.c b/xkb/xkb.c +index 64e52611ee..34b2c290be 100644 +--- a/xkb/xkb.c ++++ b/xkb/xkb.c +@@ -6550,7 +6550,8 @@ ProcXkbGetDeviceInfo(ClientPtr client) + static char * + CheckSetDeviceIndicators(char *wire, + DeviceIntPtr dev, +- int num, int *status_rtrn, ClientPtr client) ++ int num, int *status_rtrn, ClientPtr client, ++ xkbSetDeviceInfoReq * stuff) + { + xkbDeviceLedsWireDesc *ledWire; + int i; +@@ -6558,6 +6559,11 @@ CheckSetDeviceIndicators(char *wire, + + ledWire = (xkbDeviceLedsWireDesc *) wire; + for (i = 0; i < num; i++) { ++ if (!_XkbCheckRequestBounds(client, stuff, ledWire, ledWire + 1)) { ++ *status_rtrn = BadLength; ++ return (char *) ledWire; ++ } ++ + if (client->swapped) { + swaps(&ledWire->ledClass); + swaps(&ledWire->ledID); +@@ -6585,6 +6591,11 @@ CheckSetDeviceIndicators(char *wire, + atomWire = (CARD32 *) &ledWire[1]; + if (nNames > 0) { + for (n = 0; n < nNames; n++) { ++ if (!_XkbCheckRequestBounds(client, stuff, atomWire, atomWire + 1)) { ++ *status_rtrn = BadLength; ++ return (char *) atomWire; ++ } ++ + if (client->swapped) { + swapl(atomWire); + } +@@ -6596,6 +6607,10 @@ CheckSetDeviceIndicators(char *wire, + mapWire = (xkbIndicatorMapWireDesc *) atomWire; + if (nMaps > 0) { + for (n = 0; n < nMaps; n++) { ++ if (!_XkbCheckRequestBounds(client, stuff, mapWire, mapWire + 1)) { ++ *status_rtrn = BadLength; ++ return (char *) mapWire; ++ } + if (client->swapped) { + swaps(&mapWire->virtualMods); + swapl(&mapWire->ctrls); +@@ -6647,11 +6662,6 @@ SetDeviceIndicators(char *wire, + xkbIndicatorMapWireDesc *mapWire; + XkbSrvLedInfoPtr sli; + +- if (!_XkbCheckRequestBounds(client, stuff, ledWire, ledWire + 1)) { +- *status_rtrn = BadLength; +- return (char *) ledWire; +- } +- + namec = mapc = statec = 0; + sli = XkbFindSrvLedInfo(dev, ledWire->ledClass, ledWire->ledID, + XkbXI_IndicatorMapsMask); +@@ -6670,10 +6680,6 @@ SetDeviceIndicators(char *wire, + memset((char *) sli->names, 0, XkbNumIndicators * sizeof(Atom)); + for (n = 0, bit = 1; n < XkbNumIndicators; n++, bit <<= 1) { + if (ledWire->namesPresent & bit) { +- if (!_XkbCheckRequestBounds(client, stuff, atomWire, atomWire + 1)) { +- *status_rtrn = BadLength; +- return (char *) atomWire; +- } + sli->names[n] = (Atom) *atomWire; + if (sli->names[n] == None) + ledWire->namesPresent &= ~bit; +@@ -6691,10 +6697,6 @@ SetDeviceIndicators(char *wire, + if (ledWire->mapsPresent) { + for (n = 0, bit = 1; n < XkbNumIndicators; n++, bit <<= 1) { + if (ledWire->mapsPresent & bit) { +- if (!_XkbCheckRequestBounds(client, stuff, mapWire, mapWire + 1)) { +- *status_rtrn = BadLength; +- return (char *) mapWire; +- } + sli->maps[n].flags = mapWire->flags; + sli->maps[n].which_groups = mapWire->whichGroups; + sli->maps[n].groups = mapWire->groups; +@@ -6730,13 +6732,17 @@ SetDeviceIndicators(char *wire, + } + + static int +-_XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, ++_XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, + xkbSetDeviceInfoReq * stuff) + { + char *wire; + + wire = (char *) &stuff[1]; + if (stuff->change & XkbXI_ButtonActionsMask) { ++ int sz = stuff->nBtns * SIZEOF(xkbActionWireDesc); ++ if (!_XkbCheckRequestBounds(client, stuff, wire, (char *) wire + sz)) ++ return BadLength; ++ + if (!dev->button) { + client->errorValue = _XkbErrCode2(XkbErr_BadClass, ButtonClass); + return XkbKeyboardErrorCode; +@@ -6747,13 +6753,13 @@ _XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, + dev->button->numButtons); + return BadMatch; + } +- wire += (stuff->nBtns * SIZEOF(xkbActionWireDesc)); ++ wire += sz; + } + if (stuff->change & XkbXI_IndicatorsMask) { + int status = Success; + + wire = CheckSetDeviceIndicators(wire, dev, stuff->nDeviceLedFBs, +- &status, client); ++ &status, client, stuff); + if (status != Success) + return status; + } +@@ -6764,8 +6770,8 @@ _XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, + } + + static int +-_XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, +- xkbSetDeviceInfoReq * stuff) ++_XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, ++ xkbSetDeviceInfoReq * stuff) + { + char *wire; + xkbExtensionDeviceNotify ed; +@@ -6789,8 +6795,6 @@ _XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, + if (stuff->firstBtn + stuff->nBtns > nBtns) + return BadValue; + sz = stuff->nBtns * SIZEOF(xkbActionWireDesc); +- if (!_XkbCheckRequestBounds(client, stuff, wire, (char *) wire + sz)) +- return BadLength; + memcpy((char *) &acts[stuff->firstBtn], (char *) wire, sz); + wire += sz; + ed.reason |= XkbXI_ButtonActionsMask; + diff --git a/driver-abi-rebuild.sh b/driver-abi-rebuild.sh old mode 100755 new mode 100644 diff --git a/xorg-server-1.20.6.tar.bz2 b/xorg-server-1.20.8.tar.bz2 similarity index 45% rename from xorg-server-1.20.6.tar.bz2 rename to xorg-server-1.20.8.tar.bz2 index 11e51f4343060328e0b92b9d2dc5f5bb03b42e3d..aea0ef9f6e704d23f169071481cbfc3bcf98e49d 100644 Binary files a/xorg-server-1.20.6.tar.bz2 and b/xorg-server-1.20.8.tar.bz2 differ diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index b172771068a331c4eddc47b57a53cefa22943e90..0c21b505daa5169176c2c00a53f199adc1344e23 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -7,7 +7,7 @@ %global ansic_major 0 %global ansic_minor 4 %global videodrv_major 24 -%global videodrv_minor 0 +%global videodrv_minor 1 %global xinput_major 24 %global xinput_minor 1 %global extension_major 10 @@ -15,8 +15,8 @@ %global pkgname xorg-server Name: xorg-x11-server -Version: 1.20.6 -Release: 4 +Version: 1.20.8 +Release: 12 Summary: X.Org X11 X server License: MIT and GPLv2 URL: https://www.x.org @@ -34,60 +34,80 @@ Source31: xserver-sdk-abi-requires.git # maintainer convenience script Source40: driver-abi-rebuild.sh - + # From Debian use intel ddx driver only for gen4 and older chipsets -Patch6000: 06_use-intel-only-on-pre-gen4.diff +Patch0000: 06_use-intel-only-on-pre-gen4.diff # Default to xf86-video-modesetting on GeForce 8 and newer -Patch6001: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch - +Patch0001: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch + # Default to va_gl on intel i965 as we use the modesetting drv there # va_gl should probably just be the default everywhere ? -Patch6002: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch - +Patch0002: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch + # Submitted upstream, but not going anywhere -Patch6003: 0001-autobind-GPUs-to-the-screen.patch - +Patch0003: 0001-autobind-GPUs-to-the-screen.patch + # because the display-managers are not ready yet, do not upstream -Patch6004: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch - - -# https://bugzilla.redhat.com/show_bug.cgi?id=1697804 -Patch6005: 0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch - +Patch0004: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch + +# Backports from current stable "server-1.20-branch": +# Backports from "master" upstream: # Backported Xwayland randr resolution change emulation support -Patch6006: 0001-dix-Add-GetCurrentClient-helper.patch -Patch6007: 0002-xwayland-Add-wp_viewport-wayland-extension-support.patch -Patch6008: 0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch -Patch6009: 0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch -Patch6010: 0005-xwayland-Use-RandR-1.2-interface-rev-2.patch -Patch6011: 0006-xwayland-Add-per-client-private-data.patch -Patch6012: 0007-xwayland-Add-support-for-storing-per-client-per-outp.patch -Patch6013: 0008-xwayland-Add-support-for-randr-resolution-change-emu.patch -Patch6014: 0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch -Patch6015: 0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch -Patch6016: 0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch -Patch6017: 0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch -Patch6018: 0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch -Patch6019: 0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch -Patch6020: 0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch -Patch6021: 0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch -Patch6022: 0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch - - -Patch6023: xorg-s11-server-CVE-2018-20839.patch - -BuildRequires: audit-libs-devel autoconf automake bison dbus-devel flex flex-devel git -BuildRequires: systemtap-sdt-devel libtool pkgconfig xorg-x11-util-macros xorg-x11-proto-devel -BuildRequires: xorg-x11-font-utils libepoxy-devel systemd-devel xorg-x11-xtrans-devel +Patch0005: 0001-dix-Add-GetCurrentClient-helper.patch +Patch0006: 0002-xwayland-Add-wp_viewport-wayland-extension-support.patch +Patch0007: 0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch +Patch0008: 0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch +Patch0009: 0005-xwayland-Use-RandR-1.2-interface-rev-2.patch +Patch0010: 0006-xwayland-Add-per-client-private-data.patch +Patch0011: 0007-xwayland-Add-support-for-storing-per-client-per-outp.patch +Patch0012: 0008-xwayland-Add-support-for-randr-resolution-change-emu.patch +Patch0013: 0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch +Patch0014: 0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch +Patch0015: 0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch +Patch0016: 0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch +Patch0017: 0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch +Patch0018: 0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch +Patch0019: 0015-xwayland-Reuse-viewport-instead-of-recreating.patch +Patch0020: 0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch +Patch0021: 0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch +Patch0022: 0018-xwayland-Check-emulation-on-client-toplevel-resize.patch +Patch0023: 0019-xwayland-Also-check-resolution-change-emulation-when.patch +Patch0024: 0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch +Patch0025: 0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch +Patch0026: 0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch +Patch0027: 0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch +Patch0028: 0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch +Patch0029: xorg-s11-server-CVE-2018-20839.patch +Patch0030: CVE-2020-14346.patch +Patch0031: CVE-2020-14361.patch +Patch0032: CVE-2020-14362.patch +Patch0033: CVE-2020-14345.patch +Patch0034: backport-CVE-2020-25712.patch +Patch0035: backport-CVE-2020-14360.patch +Patch0036: backport-CVE-2020-14347.patch +Patch0037: backport-CVE-2021-3472.patch +Patch6000: backport-CVE-2021-4008.patch +Patch6001: backport-CVE-2021-4009.patch +Patch6002: backport-CVE-2021-4010.patch +Patch6003: backport-CVE-2021-4011.patch +Patch6004: backport-0001-CVE-2022-2319.patch +Patch6005: backport-0002-CVE-2022-2319.patch +Patch6006: backport-CVE-2022-2320.patch + +BuildRequires: audit-libs-devel autoconf automake bison dbus-devel flex flex-devel git gcc +BuildRequires: systemtap-sdt-devel libtool pkgconfig +BuildRequires: xorg-x11-font-utils libepoxy-devel systemd-devel BuildRequires: libXfont2-devel libXau-devel libxkbfile-devel libXres-devel BuildRequires: libfontenc-devel libXtst-devel libXdmcp-devel libX11-devel libXext-devel BuildRequires: libXinerama-devel libXi-devel libXt-devel libdmx-devel libXmu-devel libXrender-devel -BuildRequires: libXi-devel libXpm-devel libXaw-devel libXfixes-devel libepoxy-devel -BuildRequires: wayland-devel wayland-protocols-devel egl-wayland-devel libxshmfence-devel -BuildRequires: libXv-devel pixman-devel libpciaccess-devel openssl-devel kernel-headers -BuildRequires: mesa-libGL-devel mesa-libEGL-devel mesa-libgbm-devel libdrm-devel -BuildRequires: xcb-util-devel xcb-util-image-devel xcb-util-wm-devel libudev-devel -BuildRequires: xcb-util-keysyms-devel xcb-util-renderutil-devel libselinux-devel +BuildRequires: libXi-devel libXpm-devel libXaw-devel libXfixes-devel libepoxy-devel libXv-devel +BuildRequires: wayland-devel wayland-protocols-devel egl-wayland-devel openssl-devel kernel-headers +BuildRequires: mesa-libEGL-devel mesa-libgbm-devel libudev-devel xcb-util-devel +BuildRequires: xcb-util-image-devel xcb-util-wm-devel xcb-util-keysyms-devel xcb-util-renderutil-devel +BuildRequires: xorg-x11-xtrans-devel >= 1.3.2 xorg-x11-util-macros >= 1.17 xorg-x11-proto-devel >= 7.7 +BuildRequires: xorg-x11-font-utils >= 7.2 libselinux-devel >= 2.0.86 wayland-devel >= 1.3.0 +BuildRequires: libxshmfence-devel >= 1.1 pixman-devel >= 0.30.0 libdrm-devel >= 2.4.0 +BuildRequires: mesa-libGL-devel >= 9.2 libpciaccess-devel >= 0.13.1 %ifarch aarch64 %{arm} x86_64 BuildRequires: libunwind-devel @@ -97,12 +117,15 @@ Requires: pixman >= 0.30.0 xkeyboard-config xkbcomp Requires: system-setup-keyboard xorg-x11-drv-libinput libEGL Requires: xorg-x11-xauth -Obsoletes: %{name}-common %{name}-Xorg %{name}-Xnest %{name}-source %{name}-Xdmx %{name}-Xvfb %{name}-Xwayland -Provides: %{name}-common %{name}-Xorg %{name}-Xorg%{?_isa} %{name}-Xnest %{name}-source %{name}-Xdmx %{name}-Xvfb %{name}-Xwayland %{name}-Xwayland%{?_isa} +Obsoletes: %{name}-common < %{version}-%{release} %{name}-Xorg < %{version}-%{release} %{name}-Xnest < %{version}-%{release} %{name}-source %{name}-Xdmx < %{version}-%{release} %{name}-Xvfb < %{version}-%{release} %{name}-Xwayland < %{version}-%{release} +Provides: %{name}-common = %{version}-%{release} %{name}-Xorg = %{version}-%{release} %{name}-Xorg%{?_isa} = %{version}-%{release} %{name}-Xnest = %{version}-%{release} %{name}-source = %{version}-%{release} %{name}-Xdmx = %{version}-%{release} %{name}-Xvfb = %{version}-%{release} %{name}-Xwayland = %{version}-%{release} %{name}-Xwayland%{?_isa} = %{version}-%{release} Provides: Xorg = %{version}-%{release} -Provides: Xserver +Obsoletes: Xorg < %{version}-%{release} +Provides: Xserver = %{version}-%{release} +Obsoletes: Xserver < %{version}-%{release} Provides: xorg-x11-server-wrapper = %{version}-%{release} +Obsoletes: xorg-x11-server-wrapper < %{version}-%{release} Provides: xserver-abi(ansic-%{ansic_major}) = %{ansic_minor} Provides: xserver-abi(videodrv-%{videodrv_major}) = %{videodrv_minor} Provides: xserver-abi(xinput-%{xinput_major}) = %{xinput_minor} @@ -112,7 +135,8 @@ Provides: xorg-x11-glamor = %{version}-%{release} Obsoletes: xorg-x11-drv-modesetting < %{version}-%{release} Provides: xorg-x11-drv-modesetting = %{version}-%{release} Obsoletes: xorg-x11-drv-vmmouse < 13.1.0-4 -Provides: Xnest Xdmx Xvfb Xephyr +Provides: Xnest = %{version}-%{release} Xdmx = %{version}-%{release} Xvfb = %{version}-%{release} Xephyr = %{version}-%{release} +Obsoletes: Xnest < %{version}-%{release} Xdmx < %{version}-%{release} Xvfb < %{version}-%{release} Xephyr < %{version}-%{release} %description X.Org X11 X server @@ -178,9 +202,9 @@ test `getminor extension` == %{extension_minor} %build -export LDFLAGS="$RPM_LD_FLAGS -specs=/usr/lib/rpm/%{_vendor}/%{_vendor}-hardened-ld" -export CXXFLAGS="$RPM_OPT_FLAGS -specs=/usr/lib/rpm/%{_vendor}/%{_vendor}-hardened-cc1" -export CFLAGS="$RPM_OPT_FLAGS -specs=/usr/lib/rpm/%{_vendor}/%{_vendor}-hardened-cc1" +export LDFLAGS="$RPM_LD_FLAGS -specs=/usr/lib/rpm/generic-hardened-ld" +export CXXFLAGS="$RPM_OPT_FLAGS -specs=/usr/lib/rpm/generic-hardened-cc1" +export CFLAGS="$RPM_OPT_FLAGS -specs=/usr/lib/rpm/generic-hardened-cc1" %ifnarch %{ix86} x86_64 %global no_int10 --disable-vbe --disable-int10-module @@ -311,6 +335,66 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %{_libdir}/xorg/protocol.txt %changelog +* Wed Aug 03 2022 wangkerong - 1.20.8-12 +- fix CVE-2022-2319,CVE-2022-2320 + +* Tue Mar 22 2022 herengui - 1.20.8-11 +- rebuild for upgrade + +* Sat Dec 18 2021 yangcheng - 1.20.8-10 +- Type:CVE +- Id:CVE-2021-4008,CVE-2021-4009,CVE-2021-4010,CVE-2021-4011 +- SUG:NA +- DESC:fix CVE-2021-4008 CVE-2021-4009 CVE-2021-4010 CVE-2021-4011 + +* Tue Jun 15 2021 hanhui - 1.20.8-9 +- DESC:revert add secure compilation options + +* Tue Jun 08 2021 zhanglin - 1.20.8-8 +- Remove pam_console dependency + +* Mon Jun 07 2021 zhanzhimin - 1.20.8-7 +- Type:bugfix +- Id:NA +- SUG:NA +- DESC:add secure compilation options + +* Mon Jun 07 2021 wangkerong - 1.20.8-6 +- Type:NA +- Id:NA +- SUG:NA +- DESC:Add BuildRquires for gcc + +* Thu Jun 03 2021 zhanzhimin - 1.20.8-5 +- Type:CVE +- Id:CVE-2021-3472 +- SUG:NA +- DESC:fix CVE-2021-3472 + +* Mon Feb 01 2020 yeah_wang - 1.20.8-4 +- Type:CVE +- Id:CVE-2020-14347 CVE-2020-14360 CVE-2020-25712 +- SUG:NA +- DESC:fix CVE-2020-14347CVE-2020-14360CVE-2020-25712 + +* Wed Dec 09 2020 orange-snn - 1.20.8-3 +- Type:CVE +- Id:CVE-2020-14345 +- SUG:NA +- DESC:fix CVE-2020-14345 + +* Tue Dec 08 2020 zhanzhimin - 1.20.8-2 +- Type:CVE +- Id:CVE-2020-14346,CVE-2020-14361,CVE-2020-14362 +- SUG:NA +- DESC:fix CVE-2020-14346,CVE-2020-14361,CVE-2020-14362 + +* Tue Jul 28 2020 chengguipeng - 1.20.8-1 +- Type:enhancement +- Id:NA +- SUG:NA +- DESC:Update to 1.20.8 + * Mon Mar 16 2020 openEuler Buildteam - 1.20.6-4 - Type:enhancement - Id:NA diff --git a/xserver.pamd b/xserver.pamd index bf799304b6c401e1e92e389c3b95ecc10ed007e2..9374ff674cb7dee30102732fed0ff40594ecc0d3 100644 --- a/xserver.pamd +++ b/xserver.pamd @@ -1,5 +1,4 @@ #%PAM-1.0 auth sufficient pam_rootok.so -auth required pam_console.so account required pam_permit.so session optional pam_keyinit.so force revoke