summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorLee Chee Yang <chee.yang.lee@intel.com>2023-11-30 20:28:01 +0800
committerSteve Sakoman <steve@sakoman.com>2023-12-12 04:20:34 -1000
commit82e76d21dcf8ca39ce1a0f7d6af9b66e665625a4 (patch)
treefc85a55958cbd4c398136f6b50d6ec787bd6cb46 /meta
parent006b4b976cae3f4c7a64c73983b7837832d2a3c7 (diff)
downloadpoky-82e76d21dcf8ca39ce1a0f7d6af9b66e665625a4.tar.gz
xwayland: fix CVE-2023-5367
(From OE-Core rev: 9c21b08c18414bb61abebcbbb8704946ea288a7b) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-graphics/xwayland/xwayland/CVE-2023-5367.patch85
-rw-r--r--meta/recipes-graphics/xwayland/xwayland_22.1.8.bb4
2 files changed, 88 insertions, 1 deletions
diff --git a/meta/recipes-graphics/xwayland/xwayland/CVE-2023-5367.patch b/meta/recipes-graphics/xwayland/xwayland/CVE-2023-5367.patch
new file mode 100644
index 0000000000..d4da1ecb4b
--- /dev/null
+++ b/meta/recipes-graphics/xwayland/xwayland/CVE-2023-5367.patch
@@ -0,0 +1,85 @@
1CVE: CVE-2023-5367
2Upstream-Status: Backport [ https://gitlab.freedesktop.org/xorg/xserver/-/commit/541ab2ecd41d4d8689e71855d93e492bc554719a ]
3Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
4
5
6From 541ab2ecd41d4d8689e71855d93e492bc554719a Mon Sep 17 00:00:00 2001
7From: Peter Hutterer <peter.hutterer@who-t.net>
8Date: Tue, 3 Oct 2023 11:53:05 +1000
9Subject: [PATCH] Xi/randr: fix handling of PropModeAppend/Prepend
10
11The handling of appending/prepending properties was incorrect, with at
12least two bugs: the property length was set to the length of the new
13part only, i.e. appending or prepending N elements to a property with P
14existing elements always resulted in the property having N elements
15instead of N + P.
16
17Second, when pre-pending a value to a property, the offset for the old
18values was incorrect, leaving the new property with potentially
19uninitalized values and/or resulting in OOB memory writes.
20For example, prepending a 3 element value to a 5 element property would
21result in this 8 value array:
22 [N, N, N, ?, ?, P, P, P ] P, P
23 ^OOB write
24
25The XI2 code is a copy/paste of the RandR code, so the bug exists in
26both.
27
28CVE-2023-5367, ZDI-CAN-22153
29
30This vulnerability was discovered by:
31Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
32
33Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
34---
35 Xi/xiproperty.c | 4 ++--
36 randr/rrproperty.c | 4 ++--
37 2 files changed, 4 insertions(+), 4 deletions(-)
38
39diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
40index 066ba21fba..d315f04d0e 100644
41--- a/Xi/xiproperty.c
42+++ b/Xi/xiproperty.c
43@@ -730,7 +730,7 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type,
44 XIDestroyDeviceProperty(prop);
45 return BadAlloc;
46 }
47- new_value.size = len;
48+ new_value.size = total_len;
49 new_value.type = type;
50 new_value.format = format;
51
52@@ -747,7 +747,7 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type,
53 case PropModePrepend:
54 new_data = new_value.data;
55 old_data = (void *) (((char *) new_value.data) +
56- (prop_value->size * size_in_bytes));
57+ (len * size_in_bytes));
58 break;
59 }
60 if (new_data)
61diff --git a/randr/rrproperty.c b/randr/rrproperty.c
62index c2fb9585c6..25469f57b2 100644
63--- a/randr/rrproperty.c
64+++ b/randr/rrproperty.c
65@@ -209,7 +209,7 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
66 RRDestroyOutputProperty(prop);
67 return BadAlloc;
68 }
69- new_value.size = len;
70+ new_value.size = total_len;
71 new_value.type = type;
72 new_value.format = format;
73
74@@ -226,7 +226,7 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
75 case PropModePrepend:
76 new_data = new_value.data;
77 old_data = (void *) (((char *) new_value.data) +
78- (prop_value->size * size_in_bytes));
79+ (len * size_in_bytes));
80 break;
81 }
82 if (new_data)
83--
84GitLab
85
diff --git a/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb b/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb
index 6919ba421b..94797be8e0 100644
--- a/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb
+++ b/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb
@@ -9,7 +9,9 @@ HOMEPAGE = "https://fedoraproject.org/wiki/Changes/XwaylandStandalone"
9LICENSE = "MIT" 9LICENSE = "MIT"
10LIC_FILES_CHKSUM = "file://COPYING;md5=5df87950af51ac2c5822094553ea1880" 10LIC_FILES_CHKSUM = "file://COPYING;md5=5df87950af51ac2c5822094553ea1880"
11 11
12SRC_URI = "https://www.x.org/archive/individual/xserver/xwayland-${PV}.tar.xz" 12SRC_URI = "https://www.x.org/archive/individual/xserver/xwayland-${PV}.tar.xz \
13 file://CVE-2023-5367.patch \
14"
13SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73" 15SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73"
14 16
15UPSTREAM_CHECK_REGEX = "xwayland-(?P<pver>\d+(\.(?!90\d)\d+)+)\.tar" 17UPSTREAM_CHECK_REGEX = "xwayland-(?P<pver>\d+(\.(?!90\d)\d+)+)\.tar"