From: Steve Sakoman <steve@sakoman.com>
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][scarthgap 04/16] xwayland: Fix CVE-2025-26594
Date: Wed, 5 Mar 2025 14:11:03 -0800 [thread overview]
Message-ID: <f6af10075bc8bf7e8ffb9054500529608d3bb8ba.1741206348.git.steve@sakoman.com> (raw)
In-Reply-To: <cover.1741206348.git.steve@sakoman.com>
From: Vijay Anusuri <vanusuri@mvista.com>
Upstream-Status: Backport from
https://gitlab.freedesktop.org/xorg/xserver/-/commit/01642f26 & https://gitlab.freedesktop.org/xorg/xserver/-/commit/b0a09ba6
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
.../xwayland/xwayland/CVE-2025-26594-1.patch | 54 +++++++++++++++++++
.../xwayland/xwayland/CVE-2025-26594-2.patch | 51 ++++++++++++++++++
.../xwayland/xwayland_23.2.5.bb | 2 +
3 files changed, 107 insertions(+)
create mode 100644 meta/recipes-graphics/xwayland/xwayland/CVE-2025-26594-1.patch
create mode 100644 meta/recipes-graphics/xwayland/xwayland/CVE-2025-26594-2.patch
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 @@
+From 01642f263f12becf803b19be4db95a4a83f94acc Mon Sep 17 00:00:00 2001
+From: Olivier Fourdan <ofourdan@redhat.com>
+Date: Wed, 27 Nov 2024 11:27:05 +0100
+Subject: [PATCH] Cursor: Refuse to free the root cursor
+
+If a cursor reference count drops to 0, the cursor is freed.
+
+The root cursor however is referenced with a specific global variable,
+and when the root cursor is freed, the global variable may still point
+to freed memory.
+
+Make sure to prevent the rootCursor from being explicitly freed by a
+client.
+
+CVE-2025-26594, ZDI-CAN-25544
+
+This vulnerability was discovered by:
+Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
+
+v2: Explicitly forbid XFreeCursor() on the root cursor (Peter Hutterer
+<peter.hutterer@who-t.net>)
+v3: Return BadCursor instead of BadValue (Michel Danzer
+<michel@daenzer.net>)
+
+Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+Suggested-by: Peter Hutterer <peter.hutterer@who-t.net>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
+
+Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/01642f26]
+CVE: CVE-2025-26594
+Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
+---
+ dix/dispatch.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/dix/dispatch.c b/dix/dispatch.c
+index 4602961..30b95c1 100644
+--- a/dix/dispatch.c
++++ b/dix/dispatch.c
+@@ -3107,6 +3107,10 @@ ProcFreeCursor(ClientPtr client)
+ rc = dixLookupResourceByType((void **) &pCursor, stuff->id, RT_CURSOR,
+ client, DixDestroyAccess);
+ if (rc == Success) {
++ if (pCursor == rootCursor) {
++ client->errorValue = stuff->id;
++ return BadCursor;
++ }
+ FreeResource(stuff->id, RT_NONE);
+ return Success;
+ }
+--
+2.25.1
+
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 @@
+From b0a09ba6020147961acc62d9c73d807b4cccd9f7 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Wed, 4 Dec 2024 15:49:43 +1000
+Subject: [PATCH] dix: keep a ref to the rootCursor
+
+CreateCursor returns a cursor with refcount 1 - that refcount is used by
+the resource system, any caller needs to call RefCursor to get their own
+reference. That happens correctly for normal cursors but for our
+rootCursor we keep a variable to the cursor despite not having a ref for
+ourselves.
+
+Fix this by reffing/unreffing the rootCursor to ensure our pointer is
+valid.
+
+Related to CVE-2025-26594, ZDI-CAN-25544
+
+Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
+Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
+
+Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/b0a09ba6]
+CVE: CVE-2025-26594
+Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
+---
+ dix/main.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/dix/main.c b/dix/main.c
+index bfc8add..38e29ce 100644
+--- a/dix/main.c
++++ b/dix/main.c
+@@ -231,6 +231,8 @@ dix_main(int argc, char *argv[], char *envp[])
+ FatalError("could not open default cursor font");
+ }
+
++ rootCursor = RefCursor(rootCursor);
++
+ #ifdef PANORAMIX
+ /*
+ * Consolidate window and colourmap information for each screen
+@@ -271,6 +273,8 @@ dix_main(int argc, char *argv[], char *envp[])
+
+ Dispatch();
+
++ UnrefCursor(rootCursor);
++
+ UndisplayDevices();
+ DisableAllDevices();
+
+--
+2.25.1
+
diff --git a/meta/recipes-graphics/xwayland/xwayland_23.2.5.bb b/meta/recipes-graphics/xwayland/xwayland_23.2.5.bb
index c88fdb6e9f..3af0bb9012 100644
--- a/meta/recipes-graphics/xwayland/xwayland_23.2.5.bb
+++ b/meta/recipes-graphics/xwayland/xwayland_23.2.5.bb
@@ -11,6 +11,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=5df87950af51ac2c5822094553ea1880"
SRC_URI = "https://www.x.org/archive/individual/xserver/xwayland-${PV}.tar.xz \
file://CVE-2024-9632.patch \
+ file://CVE-2025-26594-1.patch \
+ file://CVE-2025-26594-2.patch \
"
SRC_URI[sha256sum] = "33ec7ff2687a59faaa52b9b09aa8caf118e7ecb6aed8953f526a625ff9f4bd90"
--
2.43.0
next prev parent reply other threads:[~2025-03-05 22:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-05 22:10 [OE-core][scarthgap 00/16] Patch review Steve Sakoman
2025-03-05 22:11 ` [OE-core][scarthgap 01/16] openssh: Fix CVE-2025-26466 Steve Sakoman
2025-03-05 22:11 ` [OE-core][scarthgap 02/16] curl: ignore CVE-2025-0725 Steve Sakoman
2025-03-05 22:11 ` [OE-core][scarthgap 03/16] xwayland: Fix CVE-2024-9632 Steve Sakoman
2025-03-05 22:11 ` Steve Sakoman [this message]
2025-03-05 22:11 ` [OE-core][scarthgap 05/16] xwayland: Fix CVE-2025-26595 Steve Sakoman
2025-03-05 22:11 ` [OE-core][scarthgap 06/16] xwayland: Fix CVE-2025-26596 Steve Sakoman
2025-03-05 22:11 ` [OE-core][scarthgap 07/16] xwayland: Fix CVE-2025-26597 Steve Sakoman
2025-03-05 22:11 ` [OE-core][scarthgap 08/16] xwayland: Fix CVE-2025-26598 Steve Sakoman
2025-03-05 22:11 ` [OE-core][scarthgap 09/16] xwayland: Fix CVE-2025-26599 Steve Sakoman
2025-03-05 22:11 ` [OE-core][scarthgap 10/16] xwayland: Fix CVE-2025-26600 Steve Sakoman
2025-03-05 22:11 ` [OE-core][scarthgap 11/16] xwayland: Fix CVE-2025-26601 Steve Sakoman
2025-03-05 22:11 ` [OE-core][scarthgap 12/16] ffmpeg: fix CVE-2025-25473 Steve Sakoman
2025-03-05 22:11 ` [OE-core][scarthgap 13/16] ffmpeg: fix CVE-2025-25471 Steve Sakoman
2025-03-05 22:11 ` [OE-core][scarthgap 14/16] ffmpeg: fix CVE-2025-22921 Steve Sakoman
2025-03-05 22:11 ` [OE-core][scarthgap 15/16] ffmpeg: fix CVE-2025-0518 Steve Sakoman
2025-03-05 22:11 ` [OE-core][scarthgap 16/16] systemd: add libpcre2 as RRECOMMENDS if pcre2 is enabled Steve Sakoman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f6af10075bc8bf7e8ffb9054500529608d3bb8ba.1741206348.git.steve@sakoman.com \
--to=steve@sakoman.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox