summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijay Anusuri <vanusuri@mvista.com>2025-03-04 17:49:15 +0530
committerSteve Sakoman <steve@sakoman.com>2025-03-08 06:35:36 -0800
commitd828f38a4e24a42e46f4a6457fbdad36fea71e29 (patch)
tree080b11e0f78a010f9d708b06504176c4e8b095ab
parentd99c2b9b65b2886cff63f626b2316e8130e4c96f (diff)
downloadpoky-d828f38a4e24a42e46f4a6457fbdad36fea71e29.tar.gz
xwayland: Fix CVE-2025-26598
Patch copied from xserver-xorg recipe. CVE reported for both and patch apply on both. Upstream-Commit: https://gitlab.freedesktop.org/xorg/xserver/-/commit/bba9df1a (From OE-Core rev: f01c281b94ff137003ef108e33a8c3230c541c46) 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_22.1.8.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_22.1.8.bb b/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb
index 0303e39de4..9138e1dd0e 100644
--- a/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb
+++ b/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb
@@ -34,6 +34,7 @@ SRC_URI = "https://www.x.org/archive/individual/xserver/xwayland-${PV}.tar.xz \
34 file://CVE-2025-26595.patch \ 34 file://CVE-2025-26595.patch \
35 file://CVE-2025-26596.patch \ 35 file://CVE-2025-26596.patch \
36 file://CVE-2025-26597.patch \ 36 file://CVE-2025-26597.patch \
37 file://CVE-2025-26598.patch \
37" 38"
38SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73" 39SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73"
39 40