summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49179.patch67
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.8.bb1
2 files changed, 68 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49179.patch b/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49179.patch
new file mode 100644
index 0000000000..a3d9ccbe16
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49179.patch
@@ -0,0 +1,67 @@
1From 2bde9ca49a8fd9a1e6697d5e7ef837870d66f5d4 Mon Sep 17 00:00:00 2001
2From: Olivier Fourdan <ofourdan@redhat.com>
3Date: Mon, 28 Apr 2025 11:47:15 +0200
4Subject: [PATCH] record: Check for overflow in
5 RecordSanityCheckRegisterClients()
6
7The RecordSanityCheckRegisterClients() checks for the request length,
8but does not check for integer overflow.
9
10A client might send a very large value for either the number of clients
11or the number of protocol ranges that will cause an integer overflow in
12the request length computation, defeating the check for request length.
13
14To avoid the issue, explicitly check the number of clients against the
15limit of clients (which is much lower than an maximum integer value) and
16the number of protocol ranges (multiplied by the record length) do not
17exceed the maximum integer value.
18
19This way, we ensure that the final computation for the request length
20will not overflow the maximum integer limit.
21
22CVE-2025-49179
23
24This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
25reported by Julian Suleder via ERNW Vulnerability Disclosure.
26
27Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
28Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
29Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
30
31Upstream-Status: Backport [import from debian xorg-server_21.1.7-3+deb12u10.diff.gz
32Upstream commit https://gitlab.freedesktop.org/xorg/xserver/-/commit/2bde9ca49a8fd9a1e6697d5e7ef837870d66f5d4]
33CVE: CVE-2025-49179
34Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
35---
36 record/record.c | 8 ++++++++
37 1 file changed, 8 insertions(+)
38
39diff --git a/record/record.c b/record/record.c
40index e123867..d57be5b 100644
41--- a/record/record.c
42+++ b/record/record.c
43@@ -45,6 +45,7 @@ and Jim Haggerty of Metheus.
44 #include "inputstr.h"
45 #include "eventconvert.h"
46 #include "scrnintstr.h"
47+#include "opaque.h"
48
49 #include <stdio.h>
50 #include <assert.h>
51@@ -1298,6 +1299,13 @@ RecordSanityCheckRegisterClients(RecordContextPtr pContext, ClientPtr client,
52 int i;
53 XID recordingClient;
54
55+ /* LimitClients is 2048 at max, way less that MAXINT */
56+ if (stuff->nClients > LimitClients)
57+ return BadValue;
58+
59+ if (stuff->nRanges > (MAXINT - 4 * stuff->nClients) / SIZEOF(xRecordRange))
60+ return BadValue;
61+
62 if (((client->req_len << 2) - SIZEOF(xRecordRegisterClientsReq)) !=
63 4 * stuff->nClients + SIZEOF(xRecordRange) * stuff->nRanges)
64 return BadLength;
65--
662.25.1
67
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 67e146bf97..279351eff1 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
@@ -41,6 +41,7 @@ SRC_URI += "file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.pat
41 file://CVE-2025-49176-2.patch \ 41 file://CVE-2025-49176-2.patch \
42 file://CVE-2025-49177.patch \ 42 file://CVE-2025-49177.patch \
43 file://CVE-2025-49178.patch \ 43 file://CVE-2025-49178.patch \
44 file://CVE-2025-49179.patch \
44 " 45 "
45SRC_URI[sha256sum] = "38aadb735650c8024ee25211c190bf8aad844c5f59632761ab1ef4c4d5aeb152" 46SRC_URI[sha256sum] = "38aadb735650c8024ee25211c190bf8aad844c5f59632761ab1ef4c4d5aeb152"
46 47