summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijay Anusuri <vanusuri@mvista.com>2025-03-05 19:02:11 +0530
committerSteve Sakoman <steve@sakoman.com>2025-03-08 06:22:56 -0800
commita797ef3ea06dcb09e0b849bb0c458715588ae1d8 (patch)
tree27ea0a6ffafd2d503b47d92b23f8563aba2142f6
parentcfa84dcc1a4921cccb06fca369a8a42f376ec3e6 (diff)
downloadpoky-a797ef3ea06dcb09e0b849bb0c458715588ae1d8.tar.gz
xwayland: Fix CVE-2025-26598
Upstream-Status: Backport from https://gitlab.freedesktop.org/xorg/xserver/-/commit/bba9df1a (From OE-Core rev: b58fe3b82168502e29f500e42ca8d140934f5b1a) Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-graphics/xwayland/xwayland/CVE-2025-26598.patch120
-rw-r--r--meta/recipes-graphics/xwayland/xwayland_23.2.5.bb1
2 files changed, 121 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xwayland/xwayland/CVE-2025-26598.patch b/meta/recipes-graphics/xwayland/xwayland/CVE-2025-26598.patch
new file mode 100644
index 0000000000..210a76262a
--- /dev/null
+++ b/meta/recipes-graphics/xwayland/xwayland/CVE-2025-26598.patch
@@ -0,0 +1,120 @@
1From bba9df1a9d57234c76c0b93f88dacb143d01bca2 Mon Sep 17 00:00:00 2001
2From: Olivier Fourdan <ofourdan@redhat.com>
3Date: Mon, 16 Dec 2024 11:25:11 +0100
4Subject: [PATCH] Xi: Fix barrier device search
5
6The function GetBarrierDevice() would search for the pointer device
7based on its device id and return the matching value, or supposedly NULL
8if no match was found.
9
10Unfortunately, as written, it would return the last element of the list
11if no matching device id was found which can lead to out of bounds
12memory access.
13
14Fix the search function to return NULL if not matching device is found,
15and adjust the callers to handle the case where the device cannot be
16found.
17
18CVE-2025-26598, ZDI-CAN-25740
19
20This vulnerability was discovered by:
21Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
22
23Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
24Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
25Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
26
27Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/bba9df1a]
28CVE: CVE-2025-26598
29Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
30---
31 Xi/xibarriers.c | 27 +++++++++++++++++++++++----
32 1 file changed, 23 insertions(+), 4 deletions(-)
33
34diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
35index 700b2b8c53..6761bcb49a 100644
36--- a/Xi/xibarriers.c
37+++ b/Xi/xibarriers.c
38@@ -132,14 +132,15 @@ static void FreePointerBarrierClient(struct PointerBarrierClient *c)
39
40 static struct PointerBarrierDevice *GetBarrierDevice(struct PointerBarrierClient *c, int deviceid)
41 {
42- struct PointerBarrierDevice *pbd = NULL;
43+ struct PointerBarrierDevice *p, *pbd = NULL;
44
45- xorg_list_for_each_entry(pbd, &c->per_device, entry) {
46- if (pbd->deviceid == deviceid)
47+ xorg_list_for_each_entry(p, &c->per_device, entry) {
48+ if (p->deviceid == deviceid) {
49+ pbd = p;
50 break;
51+ }
52 }
53
54- BUG_WARN(!pbd);
55 return pbd;
56 }
57
58@@ -340,6 +341,9 @@ barrier_find_nearest(BarrierScreenPtr cs, DeviceIntPtr dev,
59 double distance;
60
61 pbd = GetBarrierDevice(c, dev->id);
62+ if (!pbd)
63+ continue;
64+
65 if (pbd->seen)
66 continue;
67
68@@ -448,6 +452,9 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
69 nearest = &c->barrier;
70
71 pbd = GetBarrierDevice(c, master->id);
72+ if (!pbd)
73+ continue;
74+
75 new_sequence = !pbd->hit;
76
77 pbd->seen = TRUE;
78@@ -488,6 +495,9 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
79 int flags = 0;
80
81 pbd = GetBarrierDevice(c, master->id);
82+ if (!pbd)
83+ continue;
84+
85 pbd->seen = FALSE;
86 if (!pbd->hit)
87 continue;
88@@ -682,6 +692,9 @@ BarrierFreeBarrier(void *data, XID id)
89 continue;
90
91 pbd = GetBarrierDevice(c, dev->id);
92+ if (!pbd)
93+ continue;
94+
95 if (!pbd->hit)
96 continue;
97
98@@ -741,6 +754,8 @@ static void remove_master_func(void *res, XID id, void *devid)
99 barrier = container_of(b, struct PointerBarrierClient, barrier);
100
101 pbd = GetBarrierDevice(barrier, *deviceid);
102+ if (!pbd)
103+ return;
104
105 if (pbd->hit) {
106 BarrierEvent ev = {
107@@ -905,6 +920,10 @@ ProcXIBarrierReleasePointer(ClientPtr client)
108 barrier = container_of(b, struct PointerBarrierClient, barrier);
109
110 pbd = GetBarrierDevice(barrier, dev->id);
111+ if (!pbd) {
112+ client->errorValue = dev->id;
113+ return BadDevice;
114+ }
115
116 if (pbd->barrier_event_id == event_id)
117 pbd->release_event_id = event_id;
118--
119GitLab
120
diff --git a/meta/recipes-graphics/xwayland/xwayland_23.2.5.bb b/meta/recipes-graphics/xwayland/xwayland_23.2.5.bb
index 7f94c5e2e2..b46a02e5c3 100644
--- a/meta/recipes-graphics/xwayland/xwayland_23.2.5.bb
+++ b/meta/recipes-graphics/xwayland/xwayland_23.2.5.bb
@@ -16,6 +16,7 @@ SRC_URI = "https://www.x.org/archive/individual/xserver/xwayland-${PV}.tar.xz \
16 file://CVE-2025-26595.patch \ 16 file://CVE-2025-26595.patch \
17 file://CVE-2025-26596.patch \ 17 file://CVE-2025-26596.patch \
18 file://CVE-2025-26597.patch \ 18 file://CVE-2025-26597.patch \
19 file://CVE-2025-26598.patch \
19" 20"
20SRC_URI[sha256sum] = "33ec7ff2687a59faaa52b9b09aa8caf118e7ecb6aed8953f526a625ff9f4bd90" 21SRC_URI[sha256sum] = "33ec7ff2687a59faaa52b9b09aa8caf118e7ecb6aed8953f526a625ff9f4bd90"
21 22