[packages/xorg-lib-libXfont] - added upstream fixes for CVE-2026-109909, CVE-2026-109920 - release 4
adamg
adamg at pld-linux.org
Wed Nov 18 09:22:18 CET 2026
commit 1b2d49b10b79c7795ecd48c7dc4cc3a92900ff13
Author: Adam Gołębiowski <adamg at pld-linux.org>
Date: Wed Nov 18 09:22:11 2026 +0100
- added upstream fixes for CVE-2026-109909, CVE-2026-109920
- release 4
CVE-2026-109909.patch | 57 +++++++++++++++++++++++++++++++++++++++++++++++++
CVE-2026-109920.patch | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++
xorg-lib-libXfont.spec | 6 +++++-
3 files changed, 120 insertions(+), 1 deletion(-)
---
diff --git a/xorg-lib-libXfont.spec b/xorg-lib-libXfont.spec
index 228edae..fe35547 100644
--- a/xorg-lib-libXfont.spec
+++ b/xorg-lib-libXfont.spec
@@ -2,7 +2,7 @@ Summary: X font library used by the X server
Summary(pl.UTF-8): Używana przez X serwer biblioteka fontów X
Name: xorg-lib-libXfont
Version: 1.5.4
-Release: 3
+Release: 4
License: MIT
Group: X11/Libraries
Source0: https://xorg.freedesktop.org/releases/individual/lib/libXfont-%{version}.tar.bz2
@@ -12,6 +12,8 @@ Patch1: CVE-2026-56002.patch
Patch2: CVE-2026-56003.patch
Patch3: CVE-2026-59679.patch
Patch4: CVE-2026-44950.patch
+Patch5: CVE-2026-109909.patch
+Patch6: CVE-2026-109920.patch
URL: https://xorg.freedesktop.org/
BuildRequires: autoconf >= 2.60
BuildRequires: automake
@@ -96,6 +98,8 @@ Pakiet zawiera statyczną bibliotekę libXfont.
%patch -P2 -p1
%patch -P3 -p1
%patch -P4 -p1
+%patch -P5 -p1
+%patch -P6 -p1
%build
%{__libtoolize}
diff --git a/CVE-2026-109909.patch b/CVE-2026-109909.patch
new file mode 100644
index 0000000..7bd1296
--- /dev/null
+++ b/CVE-2026-109909.patch
@@ -0,0 +1,57 @@
+From dc6c313071c8b2929b1bc165e40c8ba62737b576 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at who-t.net>
+Date: Tue, 3 Nov 2026 15:53:12 +1000
+Subject: [PATCH] bufio,pcf: reject negative skip count in BufFileRawSkip
+
+BufFileRawSkip() takes a signed int count but never validates it for
+negative values. A crafted PCF font file can have a table offset that,
+when subtracted from the current file position, wraps to a negative
+value. This negative count passes the buffer bounds check
+(curoff + count <= fileoff is trivially true for negative count) and
+moves the buffer pointer backward past the buffer start. Subsequent
+FontFileGetc() calls then read from invalid memory, causing an
+out-of-bounds heap read or a segmentation fault.
+
+Add validation in BufFileRawSkip() to reject negative count values,
+returning BUFFILEEOF. Additionally, add defense-in-depth checks in
+pcfSeekToType() to validate that the skip distance fits in an int and
+that the position is non-negative before calling FontFileSkip.
+
+This vulnerability was discovered by:
+ Elias Myllymäki working with TrendAI Zero Day Initiative
+
+CVE-2026-109909, ZDI-CAN-33183
+
+Assisted-by: AI
+Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxfont/-/merge_requests/39>
+[backport: tests dropped, bufio.c context adjusted to libXfont 1.5.4]
+---
+diff --git a/src/bitmap/pcfread.c b/src/bitmap/pcfread.c
+index a385331..e3b6277 100644
+--- a/src/bitmap/pcfread.c
++++ b/src/bitmap/pcfread.c
+@@ -208,7 +208,9 @@ pcfSeekToType(FontFilePtr file, PCFTablePtr tables, int ntables,
+
+ for (i = 0; i < ntables; i++)
+ if (tables[i].type == type) {
+- if (position > tables[i].offset)
++ if (position < 0 || (CARD32)position > tables[i].offset)
++ return FALSE;
++ if (tables[i].offset - (CARD32)position > INT_MAX)
+ return FALSE;
+ if (!FontFileSkip(file, tables[i].offset - position))
+ return FALSE;
+diff --git a/src/fontfile/bufio.c b/src/fontfile/bufio.c
+index 7465f72..8b081e9 100644
+--- a/src/fontfile/bufio.c
++++ b/src/fontfile/bufio.c
+@@ -86,6 +86,9 @@ BufFileRawSkip (BufFilePtr f, int count)
+ int fileoff;
+ int todo;
+
++ if (count < 0)
++ return BUFFILEEOF;
++
+ curoff = f->bufp - f->buffer;
+ fileoff = curoff + f->left;
+ if (curoff + count <= fileoff) {
diff --git a/CVE-2026-109920.patch b/CVE-2026-109920.patch
new file mode 100644
index 0000000..03a3625
--- /dev/null
+++ b/CVE-2026-109920.patch
@@ -0,0 +1,58 @@
+From 539f716dabe0137097ed6b8492cae1c3321c4d69 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at who-t.net>
+Date: Mon, 9 Nov 2026 14:37:01 +1000
+Subject: [PATCH] FreeType: always initialise strike_index
+
+When FreeTypeOpenInstance() allocates FTInstanceRec, the
+instance->strike_index field is the only one left unset by default.
+
+By renaming a BDF file to a FreeType-backed .pfb file we can trick
+libXfont2 to use the FreeType backend, not its own bitmap backend,
+resulting in a "non-SFNT face". This leaves the strike_index field
+unset.
+
+Later when we call FT_Do_SBit_Metrics() strike_index is used directly as
+an array subscript, leaving us with potential OOB reads:
+
+ FT_Bitmap_Size* sz = &ft_face->available_sizes[strike_index];
+
+This vulnerability was discovered by:
+ Apex Security Research (apex-security-research at proton.me)
+
+CVE-2026-109920
+
+Assisted-by: AI
+Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxfont/-/merge_requests/39>
+[backport: tests dropped]
+---
+diff --git a/src/FreeType/ftfuncs.c b/src/FreeType/ftfuncs.c
+index 0d529a8..d6117b3 100644
+--- a/src/FreeType/ftfuncs.c
++++ b/src/FreeType/ftfuncs.c
+@@ -423,6 +423,7 @@ FreeTypeOpenInstance(FTInstancePtr *instance_return, FTFacePtr face,
+ instance->face = face;
+
+ instance->load_flags = load_flags;
++ instance->strike_index = 0xFFFFU;
+ instance->spacing = spacing; /* Actual spacing */
+ instance->pixel_size =0;
+ instance->pixel_width_unit_x =0;
+@@ -478,8 +479,6 @@ FreeTypeOpenInstance(FTInstancePtr *instance_return, FTFacePtr face,
+ FT_F26Dot6 tt_char_width, tt_char_height, tt_dim_x, tt_dim_y;
+ FT_Int nn;
+
+- instance->strike_index=0xFFFFU;
+-
+ tt_char_width = (FT_F26Dot6)(trans->scale*(1<<6) + 0.5);
+ tt_char_height = (FT_F26Dot6)(trans->scale*(1<<6) + 0.5);
+
+@@ -974,7 +973,8 @@ FT_Do_SBit_Metrics( FT_Face ft_face, FT_Size ft_size, FT_ULong strike_index,
+ int *sbitchk_incomplete_but_exist )
+ {
+ #if 1
+- if ( strike_index != 0xFFFFU && ft_face->available_sizes != NULL )
++ if ( strike_index != 0xFFFFU && ft_face->available_sizes != NULL &&
++ strike_index < (FT_ULong) ft_face->num_fixed_sizes )
+ {
+ FT_Error error;
+ FT_Bitmap_Size* sz = &ft_face->available_sizes[strike_index];
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/xorg-lib-libXfont.git/commitdiff/1b2d49b10b79c7795ecd48c7dc4cc3a92900ff13
More information about the pld-cvs-commit
mailing list