From patchwork Tue Aug 25 06:20:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Anusuri X-Patchwork-Id: 96245 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96FDDC5DF94 for ; Tue, 25 Aug 2026 06:20:35 +0000 (UTC) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.15926.1787638830494121392 for ; Mon, 24 Aug 2026 23:20:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@mvista.com header.s=google header.b=Zb/wg9Dk; spf=pass (domain: mvista.com, ip: 209.85.216.48, mailfrom: vanusuri@mvista.com) Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-3964e480f76so590664a91.1 for ; Mon, 24 Aug 2026 23:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista.com; s=google; t=1787638830; x=1788243630; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=nJ4xGI57ALodFvjVeEziR8lclBBpZReLYfgJmJp/w9Q=; b=Zb/wg9DknCRknMIJhbyVboTVuMeo3GbRSnCdQ3VBWE8mBwUEfkKzT+2QxBklYzfvQ9 2U+KRuzKYUbnT4+viFPhCyvSIarIa9g+sy1wUc8sUrAbsg412imck9p0bDGd8hIqm4td ISd8bI2S1GE10XcomFwW6FeQCuM80I8p2c59Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787638830; x=1788243630; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=nJ4xGI57ALodFvjVeEziR8lclBBpZReLYfgJmJp/w9Q=; b=qhGcdozlOKF9W68ZCTAERBHYzF7N4bKJU7/vJvh9jxggUbwEfMorvsCp1vmHQqb7ss DR35uLvmTkrpl5Z/vAdXEJSa24Fs3+20mp/vyM0bUxuM45tgUsev/ASGpMbPvq8U/QQR Q454eAOnNNwVPW5h/WHqiWdGqGHgyIZUluQDl9A1NJ9mg6sZUCTZsFRN26FLiPVq91f2 T0WyFMN6XH1oNbSm4xdMHCO9xtAkshNgE/lOFBatQU/s1UB1lC/QI/YZcFQ1wUiE9gQG dxRLwE0ir6vCk5mB87dlfh8Z28u2nInNH6GQ69Dx9/xe3vg9mbK6V7CJTWWvz9Mo2uHP BaoA== X-Gm-Message-State: AFuF++l46J/66a26C1tTlZLlVT12zTSW/8xG96V2M3IVv9oLbA9qA6fE dpADCOLoghkYsrxARjbwSZWqgA8Q9bwqGjUNy/9TRFT6Z+Xzwvsq79Hv1gBV475lALxMGsyZCyM OOHwU X-Gm-Gg: AR+sD12vYiEeNwTMdu0cnFtTftAudJ6rHNrqOdKkQX1vE4rS2k2dYJBcxVoeBf9bkk4 g0S1ryOZ1zuBiXvfA8er/3y9AojBl9//Aa0M+UeFs3lNMzX3qBwDzRUKsfIKWYXwMbrtzfnAA3Z s7s5U8u/U9zYir+NbvVwvTDAPipZw7Z2zczLMflLbWGXVZwGsYDaBFcvDs9ZrGtzY+7vEn3UbqK cUZbE345glFvvdxJIAhMNtFuA+5FAMxWJpOjM7NlH8Ly/klk5sZWruDbzeWrxYHI2pq1RAATLO/ tf0GrHinGa7BhEPs4SvhWtCASPGUauB8S/Z7DYBayIGujaxp40WW4dtOJmh1q3lLy7CPngFjk5j qog4B7lP7kcfrVMOlv+z4BYd7mRoanK5t5YHEwmTgdrUkolG5CZFdnySumH+fPO5rzYh6OugDS9 dT14PzNBeXbDBZ+lh/xEZhSVdZRfj9q7eaag45cQTbFBTPBbLzOXjNKtVf8vwOEiqqRC7PTwaz9 2Dd X-Received: by 2002:a17:90b:3949:b0:390:b41a:b92b with SMTP id 98e67ed59e1d1-3964634a8b0mr9379377a91.4.1787638829767; Mon, 24 Aug 2026 23:20:29 -0700 (PDT) Received: from MVIN00352.mvista.com ([2401:4900:1cc4:8284:a2bd:b8ae:b7dd:5272]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327f9099ce7sm30844589eec.5.2026.08.24.23.20.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2026 23:20:28 -0700 (PDT) From: Vijay Anusuri To: openembedded-core@lists.openembedded.org Cc: Vijay Anusuri Subject: [OE-core][scarthgap][patch 1/3] libxfont: Fix CVE-2026-56001 Date: Tue, 25 Aug 2026 11:50:10 +0530 Message-ID: <20260825062012.39336-1-vanusuri@mvista.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 25 Aug 2026 06:20:35 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/244200 Pick patch according to [2] [1] https://nvd.nist.gov/vuln/detail/CVE-2026-56001 [2] https://security-tracker.debian.org/tracker/CVE-2026-56001 Signed-off-by: Vijay Anusuri --- .../xorg-lib/libxfont/CVE-2026-56001.patch | 84 +++++++++++++++++++ .../xorg-lib/libxfont_1.5.4.bb | 3 + 2 files changed, 87 insertions(+) create mode 100644 meta/recipes-graphics/xorg-lib/libxfont/CVE-2026-56001.patch diff --git a/meta/recipes-graphics/xorg-lib/libxfont/CVE-2026-56001.patch b/meta/recipes-graphics/xorg-lib/libxfont/CVE-2026-56001.patch new file mode 100644 index 0000000000..506a2dc22a --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libxfont/CVE-2026-56001.patch @@ -0,0 +1,84 @@ +From be0b08e2d354138d3222b4490e2a77c6ee42f778 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 1 Jun 2026 16:46:10 +1000 +Subject: [PATCH] bitscale: fix integer overflow in BitmapScaleBitmaps + bytestoalloc + +bytestoalloc is declared as unsigned int (32-bit). When the sum of +per-glyph byte counts exceeds 2^32, the value wraps around and calloc() +allocates a buffer that is too small. The subsequent ScaleBitmap loop +then writes past the end of the allocated buffer. + +Change bytestoalloc from unsigned int to size_t to match the actual +allocation size type, and add an explicit overflow check in the +accumulation loop to bail out if the total would exceed SIZE_MAX. + +This vulnerability was discovered by: +Anonymous working with TrendAI Zero Day Initiative + +CVE-2026-56001/ZDI-CAN-30558 + +Assisted-by: Claude:claude-opus-4-6 +Signed-off-by: Peter Hutterer +Part-of: + +Upstream-Status: Backport [import from debian libxfont1 1.5.2-4+deb9u1 +Upstream commit https://gitlab.freedesktop.org/xorg/lib/libxfont/-/commit/be0b08e2d354138d3222b4490e2a77c6ee42f778] +CVE: CVE-2026-56001 +Signed-off-by: Vijay Anusuri +--- + src/bitmap/bitscale.c | 24 +++++++++++++++++++++--- + 1 file changed, 21 insertions(+), 3 deletions(-) + +diff --git a/src/bitmap/bitscale.c b/src/bitmap/bitscale.c +index 13ed924..c87fa96 100644 +--- a/src/bitmap/bitscale.c ++++ b/src/bitmap/bitscale.c +@@ -38,6 +38,7 @@ from The Open Group. + #include + #include + #include ++#include + + #ifndef MAX + #define MAX(a,b) (((a)>(b)) ? a : b) +@@ -1459,7 +1460,7 @@ BitmapScaleBitmaps(FontPtr pf, /* scaled font */ + opci; + FontInfoPtr pfi; + int glyph; +- unsigned bytestoalloc = 0; ++ size_t bytestoalloc = 0; + int firstCol, lastCol, firstRow, lastRow; + + double xform[4], inv_xform[4]; +@@ -1486,8 +1487,25 @@ BitmapScaleBitmaps(FontPtr pf, /* scaled font */ + glyph = pf->glyph; + for (i = 0; i < nchars; i++) + { +- if ((pci = ACCESSENCODING(bitmapFont->encoding, i))) +- bytestoalloc += BYTES_FOR_GLYPH(pci, glyph); ++ if ((pci = ACCESSENCODING(bitmapFont->encoding, i))) { ++ size_t glyphsize = BYTES_FOR_GLYPH(pci, glyph); ++ if (bytestoalloc > SIZE_MAX - glyphsize) { ++ fprintf(stderr, ++ "Error: bitmap allocation overflow for scaled font\n"); ++ goto bail; ++ } ++ bytestoalloc += glyphsize; ++ } ++ } ++ ++ /* Reject unreasonably large bitmap allocations that could result ++ * from malicious fonts with extreme scale factors. 256 MiB is ++ * far beyond any legitimate scaled bitmap font. */ ++#define BITMAP_SCALE_MAX_ALLOC (256 * 1024 * 1024) ++ if (bytestoalloc > BITMAP_SCALE_MAX_ALLOC) { ++ fprintf(stderr, ++ "Error: scaled bitmap size %zu exceeds limit\n", bytestoalloc); ++ goto bail; + } + + /* Do we add the font malloc stuff for VALUE ADDED ? */ +-- +2.43.0 + diff --git a/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb b/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb index fa6585d6dc..1173794f8d 100644 --- a/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb +++ b/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb @@ -19,6 +19,9 @@ XORG_EXT = "tar.bz2" BBCLASSEXTEND = "native" +SRC_URI += "file://CVE-2026-56001.patch \ + " + SRC_URI[md5sum] = "16eaf156edd79b68038b6a7c44aa9e9b" SRC_URI[sha256sum] = "1a7f7490774c87f2052d146d1e0e64518d32e6848184a18654e8d0bb57883242" From patchwork Tue Aug 25 06:20:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Anusuri X-Patchwork-Id: 96247 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 775FEC5DF94 for ; Tue, 25 Aug 2026 06:20:45 +0000 (UTC) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.15928.1787638835970037680 for ; Mon, 24 Aug 2026 23:20:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@mvista.com header.s=google header.b=MDyf3hGE; spf=pass (domain: mvista.com, ip: 209.85.215.176, mailfrom: vanusuri@mvista.com) Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-cc11a30a259so4553086a12.3 for ; Mon, 24 Aug 2026 23:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista.com; s=google; t=1787638835; x=1788243635; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1N3T6VWM5TIWBKbJ6NOus4rAIn2QrEY1xRu+vHebZn0=; b=MDyf3hGERo7KQ2XuP9ePvLkhKkgt55O3XlBptN540bZnCtpxJbCF5GEfdRCMPbEJlv JLSoqK3SbkcV1E+wCTItJIXP0T8FHBhp23fzMFdFFJ/zZeSr1qiGpWW98OX4NgBizCoe /7FdSdr/xFJrDo9/f69kRDg3adM6IWi4nVtgQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787638835; x=1788243635; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=1N3T6VWM5TIWBKbJ6NOus4rAIn2QrEY1xRu+vHebZn0=; b=VDBHoU9FRhgiO+4CE6TYMye0qA8sCE2eaWymLD3PTGQXJrpSH117yTVDQJBrGZFapG 8bkRc/sml0tfyEHfAiT29vjpu6SgyVWjDV2qVBYrz8/gEKOtNi3NLeZGKC+Je7TmUlHT V761ZIIOs+ymPeOT8bqNrMJj/Nm/DXxdT5cCS+Gpx9BsZtdKAvb5L+eOzUYS4ApMjFac NVP7c6uytMUnyN6qCb+hlDnZGopyjm7YATk4ehIpc7f2mqxr0s2K9V0giriPtZLGAyzb hhXvklFUV3BJXpIHf3D0/PxkrfcqyqncPKeKlljUVKd0A0rhcDVbw03SK0s6b1qcCQdZ NkRA== X-Gm-Message-State: AFuF++lhjsdnwvzCWjPhn0GciHhmgJ5hol/RWSeHPbkKJjYBvZWPdrF+ rrlbPpDbeqjV3c27HRlooci8o6OxQQZs5zK8/SAVRPSiT5RFIsiES7pP3Fd/YNvIc8k+N2QzCeM 5CdSC X-Gm-Gg: AR+sD10adiUi6VpgnB0/oemOvX1gJqpmNGK0CjTp7p19ianOoll7FnIlCX13veWTaO8 8TpCAat/oZ38XmciGDoM8EnsvCFwlqtWOBksk3h4HYroudnhOdyShM2bXHV3KqClHdaRWcKm+ao 50Lm/Fut72gEnNf/Ie1NV+5C+6EY+AsiZ+R6XAKACWproVrXnrYx5VPkiQK+o0jZ315zSBg0vIo jOe2LREFoVzokMDYXdRbaw+4/JvdwObeF6b6G3JR2stfdqPc5dJu/wU/qMKqD3YiE6HBgL3yTLV imPI+fLiefWeEBwFBtzlskNJ2IlnfFUKp95CO+I03ZpNOhJGY4TuVdbmS5Ybe0diqLihG3Pdy/P mbxybDVvsdWx/LX0VKs8L1zKAUpehX24MhVIxNwr2d99CaYOtii6wm4YEPFLxrnfBuLLY2xTiCC 1rbxx5t2j08ituvXfQmC8VbfeDFAtS9kwyjOP6Szuxw2ItjV/M2aFj+Gb9aiKUyvbt/88T8xVwe P1zBA== X-Received: by 2002:a05:6a21:a93:b0:3c3:a140:9392 with SMTP id adf61e73a8af0-3cd4b6850aemr50793698637.0.1787638835181; Mon, 24 Aug 2026 23:20:35 -0700 (PDT) Received: from MVIN00352.mvista.com ([2401:4900:1cc4:8284:a2bd:b8ae:b7dd:5272]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327f9099ce7sm30844589eec.5.2026.08.24.23.20.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2026 23:20:34 -0700 (PDT) From: Vijay Anusuri To: openembedded-core@lists.openembedded.org Cc: Vijay Anusuri Subject: [OE-core][scarthgap][patch 2/3] libxfont: Fix CVE-2026-56002 Date: Tue, 25 Aug 2026 11:50:11 +0530 Message-ID: <20260825062012.39336-2-vanusuri@mvista.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260825062012.39336-1-vanusuri@mvista.com> References: <20260825062012.39336-1-vanusuri@mvista.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 25 Aug 2026 06:20:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/244201 Pick patch according to [2] [1] https://nvd.nist.gov/vuln/detail/CVE-2026-56002 [2] https://security-tracker.debian.org/tracker/CVE-2026-56002 Signed-off-by: Vijay Anusuri --- .../xorg-lib/libxfont/CVE-2026-56002.patch | 147 ++++++++++++++++++ .../xorg-lib/libxfont_1.5.4.bb | 1 + 2 files changed, 148 insertions(+) create mode 100644 meta/recipes-graphics/xorg-lib/libxfont/CVE-2026-56002.patch diff --git a/meta/recipes-graphics/xorg-lib/libxfont/CVE-2026-56002.patch b/meta/recipes-graphics/xorg-lib/libxfont/CVE-2026-56002.patch new file mode 100644 index 0000000000..a615c21a2f --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libxfont/CVE-2026-56002.patch @@ -0,0 +1,147 @@ +From b4389e0b1d84a690b819bb27b1439968811a3674 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 1 Jun 2026 16:48:40 +1000 +Subject: [PATCH] pcfread: validate bitmap sizes and offsets against per-glyph + metrics + +pcfReadFont() uses bitmapSizes[] read directly from the PCF file to +allocate the repadded bitmap buffer. However, per-glyph metrics (also +from the file) control how much data RepadBitmap() writes. A malicious +PCF font can declare a small bitmapSizes[] value while having per-glyph +metrics that require more space, causing a heap buffer overflow. + +A similar issue happens with the encoding offsets: pcfReadFont reads +encoding offsets from the PCF file and uses them to index into the +metrics array without bounds checking. A crafted font can set an +encoding offset larger than nmetrics, causing an out-of-bounds pointer +that is later dereferenced when glyphs are accessed through the encoding +table. + +And the no-repad bitmap path (when PCF_GLYPH_PAD matches the requested +glyph pad) only validated that each glyph's offset was within the bitmap +buffer, but did not check that the full glyph extent (offset + +BYTES_PER_ROW * height) fits within the buffer. A crafted font with a +glyph offset near the end of a small bitmap buffer but large glyph +metrics causes a heap buffer over-read when the glyph is later rendered. + +This vulnerability was discovered by: + Anonymous working with TrendAI Zero Day Initiative + +CVE-2026-56002/ZDI-CAN-30559 + +Assisted-by: Claude:claude-opus-4-6 +Signed-off-by: Peter Hutterer +Part-of: + +Upstream-Status: Backport [import from debian libxfont1 1.5.2-4+deb9u1 +Upstream commit https://gitlab.freedesktop.org/xorg/lib/libxfont/-/commit/b4389e0b1d84a690b819bb27b1439968811a3674] +CVE: CVE-2026-56002 +Signed-off-by: Vijay Anusuri +--- + src/bitmap/pcfread.c | 60 +++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 57 insertions(+), 3 deletions(-) + +diff --git a/src/bitmap/pcfread.c b/src/bitmap/pcfread.c +index 4a372c5..0cc9777 100644 +--- a/src/bitmap/pcfread.c ++++ b/src/bitmap/pcfread.c +@@ -45,6 +45,7 @@ from The Open Group. + #include + #include + #include ++#include + + void + pcfError(const char* message, ...) +@@ -529,25 +530,74 @@ pcfReadFont(FontPtr pFont, FontFilePtr file, + int old, + new; + xCharInfo *metric; ++ int srcPad = PCF_GLYPH_PAD(format); + +- sizepadbitmaps = bitmapSizes[PCF_SIZE_TO_INDEX(glyph)]; +- padbitmaps = malloc(sizepadbitmaps); ++ /* Compute the actual required size from per-glyph metrics instead ++ * of trusting the file's bitmapSizes[] value, which may be smaller ++ * than the actual data written by RepadBitmap. */ ++ sizepadbitmaps = 0; ++ for (i = 0; i < nbitmaps; i++) { ++ int w, h, glyphBytes; ++ metric = &metrics[i].metrics; ++ w = metric->rightSideBearing - metric->leftSideBearing; ++ h = metric->ascent + metric->descent; ++ glyphBytes = BYTES_PER_ROW(w, glyph) * h; ++ if (glyphBytes < 0 || (glyphBytes > 0 && sizepadbitmaps > INT_MAX - glyphBytes)) { ++ pcfError("pcfReadFont(): bitmap size overflow\n"); ++ goto Bail; ++ } ++ sizepadbitmaps += glyphBytes; ++ } ++ padbitmaps = malloc(sizepadbitmaps ? sizepadbitmaps : 1); + if (!padbitmaps) { + pcfError("pcfReadFont(): Couldn't allocate padbitmaps (%d)\n", sizepadbitmaps); + goto Bail; + } + new = 0; + for (i = 0; i < nbitmaps; i++) { ++ int srcGlyphBytes; ++ + old = offsets[i]; + metric = &metrics[i].metrics; ++ ++ /* Validate source offset and source glyph size against the ++ * source bitmap buffer to prevent out-of-bounds reads. */ ++ srcGlyphBytes = BYTES_PER_ROW( ++ metric->rightSideBearing - metric->leftSideBearing, ++ srcPad) * (metric->ascent + metric->descent); ++ if (old < 0 || old > sizebitmaps || ++ srcGlyphBytes < 0 || srcGlyphBytes > sizebitmaps - old) { ++ pcfError("pcfReadFont(): bitmap offset/size out of bounds\n"); ++ free(padbitmaps); ++ goto Bail; ++ } ++ + offsets[i] = new; + new += RepadBitmap(bitmaps + old, padbitmaps + new, +- PCF_GLYPH_PAD(format), glyph, ++ srcPad, glyph, + metric->rightSideBearing - metric->leftSideBearing, + metric->ascent + metric->descent); + } + free(bitmaps); + bitmaps = padbitmaps; ++ } else { ++ /* Validate offsets and full glyph extents against bitmap buffer */ ++ for (i = 0; i < nbitmaps; i++) { ++ int glyphBytes; ++ xCharInfo *metric = &metrics[i].metrics; ++ ++ glyphBytes = BYTES_PER_ROW( ++ metric->rightSideBearing - metric->leftSideBearing, ++ glyph) * (metric->ascent + metric->descent); ++ if (offsets[i] >= (CARD32)sizebitmaps || ++ glyphBytes < 0 || ++ glyphBytes > sizebitmaps - (int)offsets[i]) { ++ pcfError("pcfReadFont(): bitmap offset/size out of bounds " ++ "(offset %u, size %d, total %d)\n", ++ offsets[i], glyphBytes, sizebitmaps); ++ goto Bail; ++ } ++ } + } + for (i = 0; i < nbitmaps; i++) + metrics[i].bits = bitmaps + offsets[i]; +@@ -622,6 +672,10 @@ pcfReadFont(FontPtr pFont, FontFilePtr file, + if (IS_EOF(file)) goto Bail; + if (encodingOffset == 0xFFFF) { + pFont->info.allExist = FALSE; ++ } else if (encodingOffset >= nmetrics) { ++ pcfError("pcfReadFont(): encoding offset %d out of range (nmetrics=%d)\n", ++ encodingOffset, nmetrics); ++ goto Bail; + } else { + if(!encoding[SEGMENT_MAJOR(i)]) { + encoding[SEGMENT_MAJOR(i)]= +-- +2.43.0 + diff --git a/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb b/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb index 1173794f8d..e7a426c32a 100644 --- a/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb +++ b/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb @@ -20,6 +20,7 @@ XORG_EXT = "tar.bz2" BBCLASSEXTEND = "native" SRC_URI += "file://CVE-2026-56001.patch \ + file://CVE-2026-56002.patch \ " SRC_URI[md5sum] = "16eaf156edd79b68038b6a7c44aa9e9b" From patchwork Tue Aug 25 06:20:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Anusuri X-Patchwork-Id: 96246 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79370C5DF9C for ; Tue, 25 Aug 2026 06:20:45 +0000 (UTC) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.15931.1787638841118746339 for ; Mon, 24 Aug 2026 23:20:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@mvista.com header.s=google header.b=LZZkqzGI; spf=pass (domain: mvista.com, ip: 209.85.214.181, mailfrom: vanusuri@mvista.com) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2d6b5aa7535so16978395ad.2 for ; Mon, 24 Aug 2026 23:20:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista.com; s=google; t=1787638840; x=1788243640; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hEpS0LghRbcRCGc4VGRr1894xvr0IXB9+rZ8lzC5Aj8=; b=LZZkqzGI0F94kGfx/6IKB2EElg3HMIL1ax2+J/4wIvJ3ogC/h5nHnx54ziSMocqaSi oFhvlwH1tGiZ2D1pjiVUISYqwVdXXh8c2OVoOYXRW06+TobwXBYctCi0WdTdwhTlk7Km oBPairf/kscENY4V19nB2zcYsO2kDEEAFnMzA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787638840; x=1788243640; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=hEpS0LghRbcRCGc4VGRr1894xvr0IXB9+rZ8lzC5Aj8=; b=PBhA9GFoVj5MG5LKRAk+GJAo5h5tTZGOMVeP2ZOFFG/33ig8jCTfudO6KipLIUcNVv OpicsgKLPPrIeopsRdF5z7MWyVB7tRCpCA/DleYrBjSqzJA9nVqKnbfaiKruR6tOuCnD lPLMxQxXGBJyrF2lbY124mCJ/zaEc/v/NjEbIci+Kr2v8xGtK3VTMpZmCdQiDWBm9XQd q0c2BHR43yZG3i+VHyEUnAgkqdrPS0YTXKmf29kGzEYLY1o33t+GIUImsUnj9oIfZhsr yffXsvzRscGZMrtRBctJaYUuuElkejnLfYSQwrjQELNO9FEgtkW/Mfz5ds8eKB7s6fyi 0ROw== X-Gm-Message-State: AFuF++l+Fq2OLW++o3jGjoMhpS9Fy63D0gGK+AE+gYoVHTRmnV9W1FLT 12ZWTXl6BobWc43g9Z8yBTp06/aJadxjSqZxj1r3FsddUfPCMwZ98hmxWiMx6N6HlNAvlXFmSPb OFm+x X-Gm-Gg: AR+sD10djyQurwunsC99V9McQB6C/+LuOVLiurFLwBtv5C2fWFHn/DfPPmUcJT8QreQ TOzaLAIoEECAWpD/P/CHvplWb8endStrjf+I+v2b8Sn2LuIkcZ4RIPxNINa1EBUcQ2Ei4i9zfQj tCiadbm3WJZTcNODpYLv/nQ91lnVbmHYmjQzYedzYwFcWCkYnqB7Mg/8S6t87TmtOJUNHBreJau kBxS//M9WuKWsldZPngYI0w8ctTw+i6xgFjg12Tc1yp2RG6LOqSqL2/a//T1JXvXLVHcWyZ4dWI H9ltLD7zwkSQguwoj2zuoe56ciwp7xiNK5aG5CGZdSJe5ltXavUpfutdwmNe5ZmffvrsfzIBsNc jUxCkTCvmXuKFL3x475QdxkZZpSU5Af8cXeAmtZ6jNYjTha4vgTq8JxFy3JBI8qlsFw8stgvNF5 fZf6T30NtzZ54QppWj3pCQjqemRflYMU0GemO5F/x5HI3umHQsBqVjqE5fZ4fz+ttgNJdMiTEeW FkXBE6gVEmVSIA= X-Received: by 2002:a17:902:fd8c:b0:2cc:864b:539 with SMTP id d9443c01a7336-2d64addb782mr612420795ad.6.1787638840553; Mon, 24 Aug 2026 23:20:40 -0700 (PDT) Received: from MVIN00352.mvista.com ([2401:4900:1cc4:8284:a2bd:b8ae:b7dd:5272]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327f9099ce7sm30844589eec.5.2026.08.24.23.20.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2026 23:20:39 -0700 (PDT) From: Vijay Anusuri To: openembedded-core@lists.openembedded.org Cc: Vijay Anusuri Subject: [OE-core][scarthgap][patch 3/3] libxfont: Fix CVE-2026-56003 Date: Tue, 25 Aug 2026 11:50:12 +0530 Message-ID: <20260825062012.39336-3-vanusuri@mvista.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260825062012.39336-1-vanusuri@mvista.com> References: <20260825062012.39336-1-vanusuri@mvista.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 25 Aug 2026 06:20:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/244202 Pick patch according to [2] [1] https://nvd.nist.gov/vuln/detail/CVE-2026-56003 [2] https://security-tracker.debian.org/tracker/CVE-2026-56003 Signed-off-by: Vijay Anusuri --- .../xorg-lib/libxfont/CVE-2026-56003.patch | 115 ++++++++++++++++++ .../xorg-lib/libxfont_1.5.4.bb | 1 + 2 files changed, 116 insertions(+) create mode 100644 meta/recipes-graphics/xorg-lib/libxfont/CVE-2026-56003.patch diff --git a/meta/recipes-graphics/xorg-lib/libxfont/CVE-2026-56003.patch b/meta/recipes-graphics/xorg-lib/libxfont/CVE-2026-56003.patch new file mode 100644 index 0000000000..4a9a72e152 --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libxfont/CVE-2026-56003.patch @@ -0,0 +1,115 @@ +From dff957a5158da038a282a59a31fe736702732939 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 1 Jun 2026 16:49:55 +1000 +Subject: [PATCH] bitscale: add bounds check to computeProps for property + buffer + +ComputeScaledProperties allocates a fixed-size property buffer of 70 +slots. computeProps iterates the source font's properties and writes 1 +slot for unscaled properties or 2 slots for scaledX/scaledY properties, +with no bounds check. A malicious font with many duplicate properties +matching fontPropTable entries can overflow the allocated buffer. + +Fix this by passing the remaining buffer capacity to computeProps and +checking it before each write. Properties that would exceed the buffer +are silently skipped. + +The function is also restructured to handle the buffer writes for +scaledX/scaledY inside the switch cases directly, rather than in a +separate block after the switch. This makes the control flow clearer and +ensures the bounds check covers all writes. + +This vulnerability was discovered by: +Anonymous working with TrendAI Zero Day Initiative + +CVE-2026-56003/ZDI-CAN-30560 + +Assisted-by: Claude:claude-opus-4-6 +Signed-off-by: Peter Hutterer +Part-of: + +Upstream-Status: Backport [import from debian libxfont1 1.5.2-4+deb9u1 +Upstream commit https://gitlab.freedesktop.org/xorg/lib/libxfont/-/commit/dff957a5158da038a282a59a31fe736702732939] +CVE: CVE-2026-56003 +Signed-off-by: Vijay Anusuri +--- + src/bitmap/bitscale.c | 39 ++++++++++++++++++++------------------- + 1 file changed, 20 insertions(+), 19 deletions(-) + +diff --git a/src/bitmap/bitscale.c b/src/bitmap/bitscale.c +index c87fa96..012b207 100644 +--- a/src/bitmap/bitscale.c ++++ b/src/bitmap/bitscale.c +@@ -513,7 +513,8 @@ static int + computeProps(FontPropPtr pf, char *wasStringProp, + FontPropPtr npf, char *isStringProp, + unsigned int nprops, double xfactor, double yfactor, +- double sXfactor, double sYfactor) ++ double sXfactor, double sYfactor, ++ int maxprops) + { + int n; + int count; +@@ -528,14 +529,26 @@ computeProps(FontPropPtr pf, char *wasStringProp, + + switch (t->type) { + case scaledX: +- npf->value = doround(xfactor * (double)pf->value); +- rawfactor = sXfactor; +- break; + case scaledY: +- npf->value = doround(yfactor * (double)pf->value); +- rawfactor = sYfactor; ++ if (count + 2 > maxprops) ++ continue; ++ npf->value = (t->type == scaledX) ++ ? doround(xfactor * (double)pf->value) ++ : doround(yfactor * (double)pf->value); ++ rawfactor = (t->type == scaledX) ? sXfactor : sYfactor; ++ npf->name = pf->name; ++ npf++; ++ count++; ++ npf->value = doround(rawfactor * (double)pf->value); ++ npf->name = rawFontPropTable[t - fontPropTable].atom; ++ npf++; ++ count++; ++ *isStringProp++ = *wasStringProp; ++ *isStringProp++ = *wasStringProp; + break; + case unscaled: ++ if (count + 1 > maxprops) ++ continue; + npf->value = pf->value; + npf->name = pf->name; + npf++; +@@ -545,18 +558,6 @@ computeProps(FontPropPtr pf, char *wasStringProp, + default: + break; + } +- if (t->type != unscaled) +- { +- npf->name = pf->name; +- npf++; +- count++; +- npf->value = doround(rawfactor * (double)pf->value); +- npf->name = rawFontPropTable[t - fontPropTable].atom; +- npf++; +- count++; +- *isStringProp++ = *wasStringProp; +- *isStringProp++ = *wasStringProp; +- } + } + return count; + } +@@ -671,7 +672,7 @@ ComputeScaledProperties(FontInfoPtr sourceFontInfo, /* the font to be scaled */ + n = NPROPS; + n += computeProps(sourceFontInfo->props, sourceFontInfo->isStringProp, + fp, isStringProp, sourceFontInfo->nprops, dx, dy, +- sdx, sdy); ++ sdx, sdy, nProps - NPROPS); + return n; + } + +-- +2.43.0 + diff --git a/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb b/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb index e7a426c32a..5f1af82ac4 100644 --- a/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb +++ b/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb @@ -21,6 +21,7 @@ BBCLASSEXTEND = "native" SRC_URI += "file://CVE-2026-56001.patch \ file://CVE-2026-56002.patch \ + file://CVE-2026-56003.patch \ " SRC_URI[md5sum] = "16eaf156edd79b68038b6a7c44aa9e9b"