diff mbox series

[meta-oe,scarthgap,RFC,08/14] tigervnc: patch CVE-2025-26595

Message ID 20260127130116.1902238-9-skandigraun@gmail.com
State New
Headers show
Series TigerVNC CVEs | expand

Commit Message

Gyorgy Sarvari Jan. 27, 2026, 1:01 p.m. UTC
Details: https://nvd.nist.gov/vuln/detail/CVE-2025-26595

Pick the patch that explicitly references the CVE ID in its
commit message.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 .../tigervnc/files/CVE-2025-26595.patch       | 67 +++++++++++++++++++
 .../tigervnc/tigervnc_1.11.0.bb               |  1 +
 2 files changed, 68 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/tigervnc/files/CVE-2025-26595.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-graphics/tigervnc/files/CVE-2025-26595.patch b/meta-oe/recipes-graphics/tigervnc/files/CVE-2025-26595.patch
new file mode 100644
index 0000000000..b21689ff3c
--- /dev/null
+++ b/meta-oe/recipes-graphics/tigervnc/files/CVE-2025-26595.patch
@@ -0,0 +1,67 @@ 
+From e50f21138e458bde06469502d196780eb07fc689 Mon Sep 17 00:00:00 2001
+From: Gyorgy Sarvari <skandigraun@gmail.com>
+Date: Wed, 27 Nov 2024 14:41:45 +0100
+Subject: [PATCH] xkb: Fix buffer overflow in XkbVModMaskText()
+
+From: Olivier Fourdan <ofourdan@redhat.com>
+
+The code in XkbVModMaskText() allocates a fixed sized buffer on the
+stack and copies the virtual mod name.
+
+There's actually two issues in the code that can lead to a buffer
+overflow.
+
+First, the bound check mixes pointers and integers using misplaced
+parenthesis, defeating the bound check.
+
+But even though, if the check fails, the data is still copied, so the
+stack overflow will occur regardless.
+
+Change the logic to skip the copy entirely if the bound check fails.
+
+CVE-2025-26595, ZDI-CAN-25545
+
+This vulnerability was discovered by:
+Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
+
+Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+(cherry picked from commit 11fcda8753e994e15eb915d28cf487660ec8e722)
+
+Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1830>
+(cherry picked from commit ea526ccb20d222196494b2adf9da52dab68a8997)
+
+CVE: CVE-2025-26595
+Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/ea526ccb20d222196494b2adf9da52dab68a8997]
+Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
+---
+ xkb/xkbtext.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/xkb/xkbtext.c b/xkb/xkbtext.c
+index d2a2567fc..002626450 100644
+--- a/xkb/xkbtext.c
++++ b/xkb/xkbtext.c
+@@ -175,14 +175,14 @@ XkbVModMaskText(XkbDescPtr xkb,
+                 len = strlen(tmp) + 1 + (str == buf ? 0 : 1);
+                 if (format == XkbCFile)
+                     len += 4;
+-                if ((str - (buf + len)) <= VMOD_BUFFER_SIZE) {
+-                    if (str != buf) {
+-                        if (format == XkbCFile)
+-                            *str++ = '|';
+-                        else
+-                            *str++ = '+';
+-                        len--;
+-                    }
++                if ((str - buf) + len > VMOD_BUFFER_SIZE)
++                    continue; /* Skip */
++                if (str != buf) {
++                    if (format == XkbCFile)
++                        *str++ = '|';
++                    else
++                        *str++ = '+';
++                    len--;
+                 }
+                 if (format == XkbCFile)
+                     sprintf(str, "%sMask", tmp);
diff --git a/meta-oe/recipes-graphics/tigervnc/tigervnc_1.11.0.bb b/meta-oe/recipes-graphics/tigervnc/tigervnc_1.11.0.bb
index 3e657ea6a8..1b6b965fc7 100644
--- a/meta-oe/recipes-graphics/tigervnc/tigervnc_1.11.0.bb
+++ b/meta-oe/recipes-graphics/tigervnc/tigervnc_1.11.0.bb
@@ -27,6 +27,7 @@  SRC_URI = "git://github.com/TigerVNC/tigervnc.git;branch=1.11-branch;protocol=ht
            file://CVE-2024-0409.patch;patchdir=${XORG_S} \
            file://CVE-2025-26594-1.patch;patchdir=${XORG_S} \
            file://CVE-2025-26594-2.patch;patchdir=${XORG_S} \
+           file://CVE-2025-26595.patch;patchdir=${XORG_S} \
 "
 
 # Keep sync with xorg-server in oe-core