diff options
| author | Lee Chee Yang <chee.yang.lee@intel.com> | 2023-11-30 20:28:01 +0800 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2023-12-12 04:20:34 -1000 |
| commit | 82e76d21dcf8ca39ce1a0f7d6af9b66e665625a4 (patch) | |
| tree | fc85a55958cbd4c398136f6b50d6ec787bd6cb46 /meta | |
| parent | 006b4b976cae3f4c7a64c73983b7837832d2a3c7 (diff) | |
| download | poky-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.patch | 85 | ||||
| -rw-r--r-- | meta/recipes-graphics/xwayland/xwayland_22.1.8.bb | 4 |
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 @@ | |||
| 1 | CVE: CVE-2023-5367 | ||
| 2 | Upstream-Status: Backport [ https://gitlab.freedesktop.org/xorg/xserver/-/commit/541ab2ecd41d4d8689e71855d93e492bc554719a ] | ||
| 3 | Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> | ||
| 4 | |||
| 5 | |||
| 6 | From 541ab2ecd41d4d8689e71855d93e492bc554719a Mon Sep 17 00:00:00 2001 | ||
| 7 | From: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 8 | Date: Tue, 3 Oct 2023 11:53:05 +1000 | ||
| 9 | Subject: [PATCH] Xi/randr: fix handling of PropModeAppend/Prepend | ||
| 10 | |||
| 11 | The handling of appending/prepending properties was incorrect, with at | ||
| 12 | least two bugs: the property length was set to the length of the new | ||
| 13 | part only, i.e. appending or prepending N elements to a property with P | ||
| 14 | existing elements always resulted in the property having N elements | ||
| 15 | instead of N + P. | ||
| 16 | |||
| 17 | Second, when pre-pending a value to a property, the offset for the old | ||
| 18 | values was incorrect, leaving the new property with potentially | ||
| 19 | uninitalized values and/or resulting in OOB memory writes. | ||
| 20 | For example, prepending a 3 element value to a 5 element property would | ||
| 21 | result in this 8 value array: | ||
| 22 | [N, N, N, ?, ?, P, P, P ] P, P | ||
| 23 | ^OOB write | ||
| 24 | |||
| 25 | The XI2 code is a copy/paste of the RandR code, so the bug exists in | ||
| 26 | both. | ||
| 27 | |||
| 28 | CVE-2023-5367, ZDI-CAN-22153 | ||
| 29 | |||
| 30 | This vulnerability was discovered by: | ||
| 31 | Jan-Niklas Sohn working with Trend Micro Zero Day Initiative | ||
| 32 | |||
| 33 | Signed-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 | |||
| 39 | diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c | ||
| 40 | index 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) | ||
| 61 | diff --git a/randr/rrproperty.c b/randr/rrproperty.c | ||
| 62 | index 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 | -- | ||
| 84 | GitLab | ||
| 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" | |||
| 9 | LICENSE = "MIT" | 9 | LICENSE = "MIT" |
| 10 | LIC_FILES_CHKSUM = "file://COPYING;md5=5df87950af51ac2c5822094553ea1880" | 10 | LIC_FILES_CHKSUM = "file://COPYING;md5=5df87950af51ac2c5822094553ea1880" |
| 11 | 11 | ||
| 12 | SRC_URI = "https://www.x.org/archive/individual/xserver/xwayland-${PV}.tar.xz" | 12 | SRC_URI = "https://www.x.org/archive/individual/xserver/xwayland-${PV}.tar.xz \ |
| 13 | file://CVE-2023-5367.patch \ | ||
| 14 | " | ||
| 13 | SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73" | 15 | SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73" |
| 14 | 16 | ||
| 15 | UPSTREAM_CHECK_REGEX = "xwayland-(?P<pver>\d+(\.(?!90\d)\d+)+)\.tar" | 17 | UPSTREAM_CHECK_REGEX = "xwayland-(?P<pver>\d+(\.(?!90\d)\d+)+)\.tar" |
