diff options
-rw-r--r-- | meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49175.patch | 91 | ||||
-rw-r--r-- | meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.8.bb | 1 |
2 files changed, 92 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49175.patch b/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49175.patch new file mode 100644 index 0000000000..2f56a8f6b9 --- /dev/null +++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49175.patch | |||
@@ -0,0 +1,91 @@ | |||
1 | From 0885e0b26225c90534642fe911632ec0779eebee Mon Sep 17 00:00:00 2001 | ||
2 | From: Olivier Fourdan <ofourdan@redhat.com> | ||
3 | Date: Fri, 28 Mar 2025 09:43:52 +0100 | ||
4 | Subject: [PATCH] render: Avoid 0 or less animated cursors | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Animated cursors use a series of cursors that the client can set. | ||
10 | |||
11 | By default, the Xserver assumes at least one cursor is specified | ||
12 | while a client may actually pass no cursor at all. | ||
13 | |||
14 | That causes an out-of-bound read creating the animated cursor and a | ||
15 | crash 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 | |||
41 | To avoid the issue, check the number of cursors specified and return a | ||
42 | BadValue error in both the proc handler (early) and the animated cursor | ||
43 | creation (as this is a public function) if there is 0 or less cursor. | ||
44 | |||
45 | CVE-2025-49175 | ||
46 | |||
47 | This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and | ||
48 | reported by Julian Suleder via ERNW Vulnerability Disclosure. | ||
49 | |||
50 | Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> | ||
51 | Reviewed-by: José Expósito <jexposit@redhat.com> | ||
52 | Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024> | ||
53 | |||
54 | Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/0885e0b26225c90534642fe911632ec0779eebee] | ||
55 | CVE: CVE-2025-49175 | ||
56 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
57 | --- | ||
58 | render/animcur.c | 3 +++ | ||
59 | render/render.c | 2 ++ | ||
60 | 2 files changed, 5 insertions(+) | ||
61 | |||
62 | diff --git a/render/animcur.c b/render/animcur.c | ||
63 | index f906cd8130..1194cee7e7 100644 | ||
64 | --- a/render/animcur.c | ||
65 | +++ b/render/animcur.c | ||
66 | @@ -305,6 +305,9 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor, | ||
67 | int rc = BadAlloc, i; | ||
68 | AnimCurPtr ac; | ||
69 | |||
70 | + if (ncursor <= 0) | ||
71 | + return BadValue; | ||
72 | + | ||
73 | for (i = 0; i < screenInfo.numScreens; i++) | ||
74 | if (!GetAnimCurScreen(screenInfo.screens[i])) | ||
75 | return BadImplementation; | ||
76 | diff --git a/render/render.c b/render/render.c | ||
77 | index 113f6e0c5a..fe9f03c8c8 100644 | ||
78 | --- a/render/render.c | ||
79 | +++ b/render/render.c | ||
80 | @@ -1799,6 +1799,8 @@ ProcRenderCreateAnimCursor(ClientPtr client) | ||
81 | ncursor = | ||
82 | (client->req_len - | ||
83 | (bytes_to_int32(sizeof(xRenderCreateAnimCursorReq)))) >> 1; | ||
84 | + if (ncursor <= 0) | ||
85 | + return BadValue; | ||
86 | cursors = xallocarray(ncursor, sizeof(CursorPtr) + sizeof(CARD32)); | ||
87 | if (!cursors) | ||
88 | return BadAlloc; | ||
89 | -- | ||
90 | GitLab | ||
91 | |||
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.8.bb b/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.8.bb index 6790eb0921..565489a926 100644 --- a/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.8.bb +++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.8.bb | |||
@@ -36,6 +36,7 @@ SRC_URI += "file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.pat | |||
36 | file://CVE-2025-26601-3.patch \ | 36 | file://CVE-2025-26601-3.patch \ |
37 | file://CVE-2025-26601-4.patch \ | 37 | file://CVE-2025-26601-4.patch \ |
38 | file://CVE-2022-49737.patch \ | 38 | file://CVE-2022-49737.patch \ |
39 | file://CVE-2025-49175.patch \ | ||
39 | " | 40 | " |
40 | SRC_URI[sha256sum] = "38aadb735650c8024ee25211c190bf8aad844c5f59632761ab1ef4c4d5aeb152" | 41 | SRC_URI[sha256sum] = "38aadb735650c8024ee25211c190bf8aad844c5f59632761ab1ef4c4d5aeb152" |
41 | 42 | ||