diff options
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 @@ | |||
| 1 | From 01642f263f12becf803b19be4db95a4a83f94acc Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Olivier Fourdan <ofourdan@redhat.com> | ||
| 3 | Date: Wed, 27 Nov 2024 11:27:05 +0100 | ||
| 4 | Subject: [PATCH] Cursor: Refuse to free the root cursor | ||
| 5 | |||
| 6 | If a cursor reference count drops to 0, the cursor is freed. | ||
| 7 | |||
| 8 | The root cursor however is referenced with a specific global variable, | ||
| 9 | and when the root cursor is freed, the global variable may still point | ||
| 10 | to freed memory. | ||
| 11 | |||
| 12 | Make sure to prevent the rootCursor from being explicitly freed by a | ||
| 13 | client. | ||
| 14 | |||
| 15 | CVE-2025-26594, ZDI-CAN-25544 | ||
| 16 | |||
| 17 | This vulnerability was discovered by: | ||
| 18 | Jan-Niklas Sohn working with Trend Micro Zero Day Initiative | ||
| 19 | |||
| 20 | v2: Explicitly forbid XFreeCursor() on the root cursor (Peter Hutterer | ||
| 21 | <peter.hutterer@who-t.net>) | ||
| 22 | v3: Return BadCursor instead of BadValue (Michel Danzer | ||
| 23 | <michel@daenzer.net>) | ||
| 24 | |||
| 25 | Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> | ||
| 26 | Suggested-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 27 | Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 28 | Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828> | ||
| 29 | |||
| 30 | Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/01642f26] | ||
| 31 | CVE: CVE-2025-26594 | ||
| 32 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
| 33 | --- | ||
| 34 | dix/dispatch.c | 4 ++++ | ||
| 35 | 1 file changed, 4 insertions(+) | ||
| 36 | |||
| 37 | diff --git a/dix/dispatch.c b/dix/dispatch.c | ||
| 38 | index 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 | -- | ||
| 53 | 2.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 @@ | |||
| 1 | From b0a09ba6020147961acc62d9c73d807b4cccd9f7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 3 | Date: Wed, 4 Dec 2024 15:49:43 +1000 | ||
| 4 | Subject: [PATCH] dix: keep a ref to the rootCursor | ||
| 5 | |||
| 6 | CreateCursor returns a cursor with refcount 1 - that refcount is used by | ||
| 7 | the resource system, any caller needs to call RefCursor to get their own | ||
| 8 | reference. That happens correctly for normal cursors but for our | ||
| 9 | rootCursor we keep a variable to the cursor despite not having a ref for | ||
| 10 | ourselves. | ||
| 11 | |||
| 12 | Fix this by reffing/unreffing the rootCursor to ensure our pointer is | ||
| 13 | valid. | ||
| 14 | |||
| 15 | Related to CVE-2025-26594, ZDI-CAN-25544 | ||
| 16 | |||
| 17 | Reviewed-by: Olivier Fourdan <ofourdan@redhat.com> | ||
| 18 | Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828> | ||
| 19 | |||
| 20 | Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/b0a09ba6] | ||
| 21 | CVE: CVE-2025-26594 | ||
| 22 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
| 23 | --- | ||
| 24 | dix/main.c | 4 ++++ | ||
| 25 | 1 file changed, 4 insertions(+) | ||
| 26 | |||
| 27 | diff --git a/dix/main.c b/dix/main.c | ||
| 28 | index 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 | -- | ||
| 50 | 2.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 | " |
| 33 | SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73" | 35 | SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73" |
| 34 | 36 | ||
