summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArchana Polampalli <archana.polampalli@windriver.com>2025-07-03 15:53:49 +0530
committerSteve Sakoman <steve@sakoman.com>2025-07-09 08:23:23 -0700
commit152e759cb6744f9faa3ac6e0e0e590524a8d6e52 (patch)
tree5a4e41cac29dcec24877800ed5a75d7c5e8ae416
parent50856ee7a62ac5ef4fda6f3613f0f3f8ec688d79 (diff)
downloadpoky-152e759cb6744f9faa3ac6e0e0e590524a8d6e52.tar.gz
xwayland: fix CVE-2025-49175
A flaw was found in the X Rendering extension's handling of animated cursors. If a client provides no cursors, the server assumes at least one is present, leading to an out-of-bounds read and potential crash. (From OE-Core rev: 2c8e82f860792e7fb99c78c512be57ce74774a34) Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-graphics/xwayland/xwayland/CVE-2025-49175.patch92
-rw-r--r--meta/recipes-graphics/xwayland/xwayland_22.1.8.bb1
2 files changed, 93 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xwayland/xwayland/CVE-2025-49175.patch b/meta/recipes-graphics/xwayland/xwayland/CVE-2025-49175.patch
new file mode 100644
index 0000000000..bfb37fcea0
--- /dev/null
+++ b/meta/recipes-graphics/xwayland/xwayland/CVE-2025-49175.patch
@@ -0,0 +1,92 @@
1From 0885e0b26225c90534642fe911632ec0779eebee Sep 17 00:00:00 2001
2From: Olivier Fourdan <ofourdan@redhat.com>
3Date: Fri, 28 Mar 2025 09:43:52 +0100
4Subject: [PATCH] render: Avoid 0 or less animated cursors
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Animated cursors use a series of cursors that the client can set.
10
11By default, the Xserver assumes at least one cursor is specified
12while a client may actually pass no cursor at all.
13
14That causes an out-of-bound read creating the animated cursor and a
15crash of the Xserver:
16
17 | Invalid read of size 8
18 | at 0x5323F4: AnimCursorCreate (animcur.c:325)
19 | by 0x52D4C5: ProcRenderCreateAnimCursor (render.c:1817)
20 | by 0x52DC80: ProcRenderDispatch (render.c:1999)
21 | by 0x4A1E9D: Dispatch (dispatch.c:560)
22 | by 0x4B0169: dix_main (main.c:284)
23 | by 0x4287F5: main (stubmain.c:34)
24 | Address 0x59aa010 is 0 bytes after a block of size 0 alloc'd
25 | at 0x48468D3: reallocarray (vg_replace_malloc.c:1803)
26 | by 0x52D3DA: ProcRenderCreateAnimCursor (render.c:1802)
27 | by 0x52DC80: ProcRenderDispatch (render.c:1999)
28 | by 0x4A1E9D: Dispatch (dispatch.c:560)
29 | by 0x4B0169: dix_main (main.c:284)
30 | by 0x4287F5: main (stubmain.c:34)
31 |
32 | Invalid read of size 2
33 | at 0x5323F7: AnimCursorCreate (animcur.c:325)
34 | by 0x52D4C5: ProcRenderCreateAnimCursor (render.c:1817)
35 | by 0x52DC80: ProcRenderDispatch (render.c:1999)
36 | by 0x4A1E9D: Dispatch (dispatch.c:560)
37 | by 0x4B0169: dix_main (main.c:284)
38 | by 0x4287F5: main (stubmain.c:34)
39 | Address 0x8 is not stack'd, malloc'd or (recently) free'd
40
41To avoid the issue, check the number of cursors specified and return a
42BadValue error in both the proc handler (early) and the animated cursor
43creation (as this is a public function) if there is 0 or less cursor.
44
45CVE-2025-49175
46
47This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
48reported by Julian Suleder via ERNW Vulnerability Disclosure.
49
50Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
51Reviewed-by: José Expósito <jexposit@redhat.com>
52Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
53
54CVE: CVE-2025-49175
55
56Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/0885e0b26225c90534642fe911632ec0779eebee]
57
58Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
59---
60 render/animcur.c | 3 +++
61 render/render.c | 2 ++
62 2 files changed, 5 insertions(+)
63
64diff --git a/render/animcur.c b/render/animcur.c
65index ef27bda..77942d8 100644
66--- a/render/animcur.c
67+++ b/render/animcur.c
68@@ -304,6 +304,9 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor,
69 int rc = BadAlloc, i;
70 AnimCurPtr ac;
71
72+ if (ncursor <= 0)
73+ return BadValue;
74+
75 for (i = 0; i < screenInfo.numScreens; i++)
76 if (!GetAnimCurScreen(screenInfo.screens[i]))
77 return BadImplementation;
78diff --git a/render/render.c b/render/render.c
79index 5bc2a20..a8c2da0 100644
80--- a/render/render.c
81+++ b/render/render.c
82@@ -1795,6 +1795,8 @@ ProcRenderCreateAnimCursor(ClientPtr client)
83 ncursor =
84 (client->req_len -
85 (bytes_to_int32(sizeof(xRenderCreateAnimCursorReq)))) >> 1;
86+ if (ncursor <= 0)
87+ return BadValue;
88 cursors = xallocarray(ncursor, sizeof(CursorPtr) + sizeof(CARD32));
89 if (!cursors)
90 return BadAlloc;
91--
922.40.0
diff --git a/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb b/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb
index 8b1fc85aab..55d381f868 100644
--- a/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb
+++ b/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb
@@ -43,6 +43,7 @@ SRC_URI = "https://www.x.org/archive/individual/xserver/xwayland-${PV}.tar.xz \
43 file://CVE-2025-26601-3.patch \ 43 file://CVE-2025-26601-3.patch \
44 file://CVE-2025-26601-4.patch \ 44 file://CVE-2025-26601-4.patch \
45 file://CVE-2022-49737.patch \ 45 file://CVE-2022-49737.patch \
46 file://CVE-2025-49175.patch \
46" 47"
47SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73" 48SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73"
48 49