diff options
| author | Vijay Anusuri <vanusuri@mvista.com> | 2025-03-04 17:49:12 +0530 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-03-08 06:35:36 -0800 |
| commit | b48431c424acc38d722c6ed81ae08ad919f4f03e (patch) | |
| tree | d8801fb93e0a06434b6b759cc72d8abf59cf09c3 /meta/recipes-graphics | |
| parent | 3cc6f0bb5cd5d00d5e400323aca8a9cef3dbbc30 (diff) | |
| download | poky-b48431c424acc38d722c6ed81ae08ad919f4f03e.tar.gz | |
xwayland: Fix CVE-2025-26595
Patch copied from xserver-xorg recipe.
CVE reported for both and patch apply on both.
Upstream-Commit: https://gitlab.freedesktop.org/xorg/xserver/-/commit/11fcda87
(From OE-Core rev: e0768162f0ece29392d4f387d263d62dd4083836)
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-graphics')
| -rw-r--r-- | meta/recipes-graphics/xwayland/xwayland/CVE-2025-26595.patch | 65 | ||||
| -rw-r--r-- | meta/recipes-graphics/xwayland/xwayland_22.1.8.bb | 1 |
2 files changed, 66 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xwayland/xwayland/CVE-2025-26595.patch b/meta/recipes-graphics/xwayland/xwayland/CVE-2025-26595.patch new file mode 100644 index 0000000000..a7478d9e2a --- /dev/null +++ b/meta/recipes-graphics/xwayland/xwayland/CVE-2025-26595.patch | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | From 11fcda8753e994e15eb915d28cf487660ec8e722 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Olivier Fourdan <ofourdan@redhat.com> | ||
| 3 | Date: Wed, 27 Nov 2024 14:41:45 +0100 | ||
| 4 | Subject: [PATCH] xkb: Fix buffer overflow in XkbVModMaskText() | ||
| 5 | |||
| 6 | The code in XkbVModMaskText() allocates a fixed sized buffer on the | ||
| 7 | stack and copies the virtual mod name. | ||
| 8 | |||
| 9 | There's actually two issues in the code that can lead to a buffer | ||
| 10 | overflow. | ||
| 11 | |||
| 12 | First, the bound check mixes pointers and integers using misplaced | ||
| 13 | parenthesis, defeating the bound check. | ||
| 14 | |||
| 15 | But even though, if the check fails, the data is still copied, so the | ||
| 16 | stack overflow will occur regardless. | ||
| 17 | |||
| 18 | Change the logic to skip the copy entirely if the bound check fails. | ||
| 19 | |||
| 20 | CVE-2025-26595, ZDI-CAN-25545 | ||
| 21 | |||
| 22 | This vulnerability was discovered by: | ||
| 23 | Jan-Niklas Sohn working with Trend Micro Zero Day Initiative | ||
| 24 | |||
| 25 | Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> | ||
| 26 | Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 27 | Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828> | ||
| 28 | |||
| 29 | Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/11fcda87] | ||
| 30 | CVE: CVE-2025-26595 | ||
| 31 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
| 32 | --- | ||
| 33 | xkb/xkbtext.c | 16 ++++++++-------- | ||
| 34 | 1 file changed, 8 insertions(+), 8 deletions(-) | ||
| 35 | |||
| 36 | diff --git a/xkb/xkbtext.c b/xkb/xkbtext.c | ||
| 37 | index 0184664207..93262528bb 100644 | ||
| 38 | --- a/xkb/xkbtext.c | ||
| 39 | +++ b/xkb/xkbtext.c | ||
| 40 | @@ -173,14 +173,14 @@ XkbVModMaskText(XkbDescPtr xkb, | ||
| 41 | len = strlen(tmp) + 1 + (str == buf ? 0 : 1); | ||
| 42 | if (format == XkbCFile) | ||
| 43 | len += 4; | ||
| 44 | - if ((str - (buf + len)) <= VMOD_BUFFER_SIZE) { | ||
| 45 | - if (str != buf) { | ||
| 46 | - if (format == XkbCFile) | ||
| 47 | - *str++ = '|'; | ||
| 48 | - else | ||
| 49 | - *str++ = '+'; | ||
| 50 | - len--; | ||
| 51 | - } | ||
| 52 | + if ((str - buf) + len > VMOD_BUFFER_SIZE) | ||
| 53 | + continue; /* Skip */ | ||
| 54 | + if (str != buf) { | ||
| 55 | + if (format == XkbCFile) | ||
| 56 | + *str++ = '|'; | ||
| 57 | + else | ||
| 58 | + *str++ = '+'; | ||
| 59 | + len--; | ||
| 60 | } | ||
| 61 | if (format == XkbCFile) | ||
| 62 | sprintf(str, "%sMask", tmp); | ||
| 63 | -- | ||
| 64 | GitLab | ||
| 65 | |||
diff --git a/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb b/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb index 814fc1ce40..452bae8c8d 100644 --- a/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb +++ b/meta/recipes-graphics/xwayland/xwayland_22.1.8.bb | |||
| @@ -31,6 +31,7 @@ SRC_URI = "https://www.x.org/archive/individual/xserver/xwayland-${PV}.tar.xz \ | |||
| 31 | file://CVE-2024-9632.patch \ | 31 | file://CVE-2024-9632.patch \ |
| 32 | file://CVE-2025-26594-1.patch \ | 32 | file://CVE-2025-26594-1.patch \ |
| 33 | file://CVE-2025-26594-2.patch \ | 33 | file://CVE-2025-26594-2.patch \ |
| 34 | file://CVE-2025-26595.patch \ | ||
| 34 | " | 35 | " |
| 35 | SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73" | 36 | SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73" |
| 36 | 37 | ||
