summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-graphics/xwayland/xwayland/CVE-2025-26594-1.patch54
-rw-r--r--meta/recipes-graphics/xwayland/xwayland/CVE-2025-26594-2.patch51
-rw-r--r--meta/recipes-graphics/xwayland/xwayland_22.1.8.bb2
3 files changed, 107 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xwayland/xwayland/CVE-2025-26594-1.patch b/meta/recipes-graphics/xwayland/xwayland/CVE-2025-26594-1.patch
new file mode 100644
index 0000000000..f34a89e6ea
--- /dev/null
+++ b/meta/recipes-graphics/xwayland/xwayland/CVE-2025-26594-1.patch
@@ -0,0 +1,54 @@
1From 01642f263f12becf803b19be4db95a4a83f94acc Mon Sep 17 00:00:00 2001
2From: Olivier Fourdan <ofourdan@redhat.com>
3Date: Wed, 27 Nov 2024 11:27:05 +0100
4Subject: [PATCH] Cursor: Refuse to free the root cursor
5
6If a cursor reference count drops to 0, the cursor is freed.
7
8The root cursor however is referenced with a specific global variable,
9and when the root cursor is freed, the global variable may still point
10to freed memory.
11
12Make sure to prevent the rootCursor from being explicitly freed by a
13client.
14
15CVE-2025-26594, ZDI-CAN-25544
16
17This vulnerability was discovered by:
18Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
19
20v2: Explicitly forbid XFreeCursor() on the root cursor (Peter Hutterer
21<peter.hutterer@who-t.net>)
22v3: Return BadCursor instead of BadValue (Michel Danzer
23<michel@daenzer.net>)
24
25Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
26Suggested-by: Peter Hutterer <peter.hutterer@who-t.net>
27Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
28Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
29
30Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/01642f26]
31CVE: CVE-2025-26594
32Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
33---
34 dix/dispatch.c | 4 ++++
35 1 file changed, 4 insertions(+)
36
37diff --git a/dix/dispatch.c b/dix/dispatch.c
38index 4602961..30b95c1 100644
39--- a/dix/dispatch.c
40+++ b/dix/dispatch.c
41@@ -3107,6 +3107,10 @@ ProcFreeCursor(ClientPtr client)
42 rc = dixLookupResourceByType((void **) &pCursor, stuff->id, RT_CURSOR,
43 client, DixDestroyAccess);
44 if (rc == Success) {
45+ if (pCursor == rootCursor) {
46+ client->errorValue = stuff->id;
47+ return BadCursor;
48+ }
49 FreeResource(stuff->id, RT_NONE);
50 return Success;
51 }
52--
532.25.1
54
diff --git a/meta/recipes-graphics/xwayland/xwayland/CVE-2025-26594-2.patch b/meta/recipes-graphics/xwayland/xwayland/CVE-2025-26594-2.patch
new file mode 100644
index 0000000000..6ebf540ab9
--- /dev/null
+++ b/meta/recipes-graphics/xwayland/xwayland/CVE-2025-26594-2.patch
@@ -0,0 +1,51 @@
1From b0a09ba6020147961acc62d9c73d807b4cccd9f7 Mon Sep 17 00:00:00 2001
2From: Peter Hutterer <peter.hutterer@who-t.net>
3Date: Wed, 4 Dec 2024 15:49:43 +1000
4Subject: [PATCH] dix: keep a ref to the rootCursor
5
6CreateCursor returns a cursor with refcount 1 - that refcount is used by
7the resource system, any caller needs to call RefCursor to get their own
8reference. That happens correctly for normal cursors but for our
9rootCursor we keep a variable to the cursor despite not having a ref for
10ourselves.
11
12Fix this by reffing/unreffing the rootCursor to ensure our pointer is
13valid.
14
15Related to CVE-2025-26594, ZDI-CAN-25544
16
17Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
18Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
19
20Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/b0a09ba6]
21CVE: CVE-2025-26594
22Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
23---
24 dix/main.c | 4 ++++
25 1 file changed, 4 insertions(+)
26
27diff --git a/dix/main.c b/dix/main.c
28index bfc8add..38e29ce 100644
29--- a/dix/main.c
30+++ b/dix/main.c
31@@ -231,6 +231,8 @@ dix_main(int argc, char *argv[], char *envp[])
32 FatalError("could not open default cursor font");
33 }
34
35+ rootCursor = RefCursor(rootCursor);
36+
37 #ifdef PANORAMIX
38 /*
39 * Consolidate window and colourmap information for each screen
40@@ -271,6 +273,8 @@ dix_main(int argc, char *argv[], char *envp[])
41
42 Dispatch();
43
44+ UnrefCursor(rootCursor);
45+
46 UndisplayDevices();
47 DisableAllDevices();
48
49--
502.25.1
51
diff --git a/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb b/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb
index 23575b387e..814fc1ce40 100644
--- a/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb
+++ b/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb
@@ -29,6 +29,8 @@ SRC_URI = "https://www.x.org/archive/individual/xserver/xwayland-${PV}.tar.xz \
29 file://CVE-2024-31083-0001.patch \ 29 file://CVE-2024-31083-0001.patch \
30 file://CVE-2024-31083-0002.patch \ 30 file://CVE-2024-31083-0002.patch \
31 file://CVE-2024-9632.patch \ 31 file://CVE-2024-9632.patch \
32 file://CVE-2025-26594-1.patch \
33 file://CVE-2025-26594-2.patch \
32" 34"
33SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73" 35SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73"
34 36