From patchwork Mon Aug 24 12:56:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Anusuri X-Patchwork-Id: 96160 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 8366AC5DF94 for ; Mon, 24 Aug 2026 12:57:05 +0000 (UTC) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.15868.1787576224484804418 for ; Mon, 24 Aug 2026 05:57:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@mvista.com header.s=google header.b=NkKJCzwV; spf=pass (domain: mvista.com, ip: 209.85.216.49, mailfrom: vanusuri@mvista.com) Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-38ea87caafeso2437903a91.3 for ; Mon, 24 Aug 2026 05:57:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista.com; s=google; t=1787576224; x=1788181024; 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=mo5j98CimFtAVOV1tyJHeoYmciXqqAQK2n0zcNs+2L8=; b=NkKJCzwVQULGMDtlgC7ge80cOmSl3CPkAXNh5DEz2fA0zDYHnq023JgnUXatXP1dWr V/x5fFip1hrgDoxh57B+KdGH1HL6nK8aaowwfyOODBVtHowdK59KmeFArxfz3VGN8sQE hQMR3BK3EvzBglBWGmTcjh24R2s3cxD5Ycb20= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787576224; x=1788181024; 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=mo5j98CimFtAVOV1tyJHeoYmciXqqAQK2n0zcNs+2L8=; b=Qy9rakzzZdJ6q1Qm4/e2n8e/QyvEZ02wwdKPa9B8RuJ+jmlj3w8CwB4u9p0MwvrSGs USphBIEjwKjM4IwB4KO2Y1XcutV/BMB7gHl1uk0i+oLtvvxzB0tYEydCD6MBifho7MRH cX95YJN1MRhQ0Yw0u16tvMO4L3t0F4DuWnkoxXuWhzReiP42ClNJhpHAsI6IOZFbq8K6 8vOcsaKQILupDa2MF+PFEVQ+0Sv/qBiAGBn1Pt22dLGpmejPr+PEMmhBGSDHyBQ5/w8U G448cwDXOUBNZExB3nLfNJq9QJ/SrP4fhgwSziX+LhgwiNBKsasQn9LW+tycbRApaCre l5Uw== X-Gm-Message-State: AFuF++lTu4GMoaxkXsFsgjYLHZoWSGDCzNvAnzWWFrh0Y8v2Kob5iuQb J/qKNwrNXSiQnZwnY2BlFuyAY8/kJKIecFptP2c8wIZR4gKi41ax70JUbBV/AfGU97XbeueOhMr YoTV+ X-Gm-Gg: AR+sD102mfgYrzHuCaXPjjaYMhcwk0z1pY7nwhSdbM/0KM8dlUF9TF8HL38PmTEV8d9 rWKImA4fXcqAz2K5HxoNCb36P33Rfuu9RzwoCEXsuhDgQ2zx7WVMTdgpuaP/kFPSntiDZTGrRx7 T3yHZzkxP8CH43hBQUHno7W6soOasAH1XgCApmpp3zkQUoWupOCK1TLD+MhDh+VON/+4wTpOkW3 JovTzDDfOtJRTh5jd+o4Yxas8MXl5vmRz+QulEMu+U0ZvAnQZTxypCdiy8Fp9czg+ic31KjLSl8 QcGja15Asa5gxcFkVl4dTkZYiicm67HWI/7+F2taEBOb5sR5t3qtV0NzhsTkZkf7gODlGUZ6F2V 1U/fZkaB1RdjAMADKrCKnqhgTDaeXc4ftJhbwHsB+6GbJ3PMsPDeYELZI/Nt+7OmeOMVWt6ZqA7 Kb9qXkjx0a8IMC9K+mjntRweNm1uQ+/dXZGPmcjOlfMn5ap7P6GGBpWumEdswa+0o1 X-Received: by 2002:a17:90b:580f:b0:380:f389:447b with SMTP id 98e67ed59e1d1-395c386d163mr53029631a91.11.1787576223714; Mon, 24 Aug 2026 05:57:03 -0700 (PDT) Received: from MVIN00352.local ([182.74.28.237]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-141860df1dcsm22623583c88.4.2026.08.24.05.57.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2026 05:57:02 -0700 (PDT) From: Vijay Anusuri To: openembedded-core@lists.openembedded.org Cc: Vijay Anusuri Subject: [OE-core][scarthgap][patch 1/3] libxfont2: Fix CVE-2026-56001 Date: Mon, 24 Aug 2026 18:26:51 +0530 Message-ID: <20260824125653.97525-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 ; Mon, 24 Aug 2026 12:57:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/244096 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/libxfont2/CVE-2026-56001.patch | 75 +++++++++++++++++++ .../xorg-lib/libxfont2_2.0.6.bb | 3 + 2 files changed, 78 insertions(+) create mode 100644 meta/recipes-graphics/xorg-lib/libxfont2/CVE-2026-56001.patch diff --git a/meta/recipes-graphics/xorg-lib/libxfont2/CVE-2026-56001.patch b/meta/recipes-graphics/xorg-lib/libxfont2/CVE-2026-56001.patch new file mode 100644 index 0000000000..831547df29 --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libxfont2/CVE-2026-56001.patch @@ -0,0 +1,75 @@ +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 [https://gitlab.freedesktop.org/xorg/lib/libxfont/-/commit/be0b08e2d354138d3222b4490e2a77c6ee42f778] +CVE: CVE-2026-56001 +Signed-off-by: Vijay Anusuri +--- + src/bitmap/bitscale.c | 23 ++++++++++++++++++++--- + 1 file changed, 20 insertions(+), 3 deletions(-) + +diff --git a/src/bitmap/bitscale.c b/src/bitmap/bitscale.c +index e29ba96..7100138 100644 +--- a/src/bitmap/bitscale.c ++++ b/src/bitmap/bitscale.c +@@ -1460,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]; +@@ -1487,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/libxfont2_2.0.6.bb b/meta/recipes-graphics/xorg-lib/libxfont2_2.0.6.bb index 535e7f629e..1a0eb42681 100644 --- a/meta/recipes-graphics/xorg-lib/libxfont2_2.0.6.bb +++ b/meta/recipes-graphics/xorg-lib/libxfont2_2.0.6.bb @@ -15,6 +15,9 @@ XORG_PN = "libXfont2" BBCLASSEXTEND = "native" +SRC_URI += "file://CVE-2026-56001.patch \ + " + SRC_URI[sha256sum] = "74ca20017eb0fb3f56d8d5e60685f560fc85e5ff3d84c61c4cb891e40c27aef4" PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" From patchwork Mon Aug 24 12:56:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Anusuri X-Patchwork-Id: 96162 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 7A817C5DF94 for ; Mon, 24 Aug 2026 12:57:15 +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.msgproc02-g2.15871.1787576228538579732 for ; Mon, 24 Aug 2026 05:57:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@mvista.com header.s=google header.b=TtbkN+O6; 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-38e07ebd263so2283100a91.1 for ; Mon, 24 Aug 2026 05:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista.com; s=google; t=1787576228; x=1788181028; 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=9yIpwZ/z4RHs3mpV7iu33nvCcpJgxJSTtwnHxAine+o=; b=TtbkN+O65IZoDfUGBkr0RXT5Et+PIID+R2zwAuA8+K40GJ/WwF0Y5DZsfvEObmk+ta qwooU0S9AbTS+91zgcxZzAI2ODjcDHwcsxH7ErpnfWbzy6AqvLTWYk2gUQ2Ju15khne8 4g1MS0tcDxWFW9i63jrrT2gKM34tItFkw4yHo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787576228; x=1788181028; 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=9yIpwZ/z4RHs3mpV7iu33nvCcpJgxJSTtwnHxAine+o=; b=mT2qsVOkfJrWhihOAMwNFw7guyQ9y1gzLCGxrEhG1b+vtNFavGSTEETbQONQUZQCwh okJwh88r2kcRu/f7IPUY+3qiRtPuR8MjO943/vuKnHMZN+qJsvjb+T9Ejyo2l6umFZX3 S9VB4cbIlNf1N8WPpnPqx4i5/lfkuccVm4L6Wz4zDcIVpL1lshnyoIfUcfT31IYb6nEH AH5IawR6Gn3QJ+SiPrpGxjKHhOYEIMyOZmKnrNNTsdPge0Z3p3Ck/+6xrrWOa1tCWVjg wHlUL8Z4A04C1flUTACEBYskLWQRNbjGdgaBwhK3/y07Kcaiqj42gYD37315FAlFAI61 7w9Q== X-Gm-Message-State: AFuF++mszCbNehcJ1ZezELYV2YiCLviH34RlLf+rXCcmd4iStnTGQL84 hdGnXdNN+3hU3gQuBMx25emMdKUYw6CayaCYbAaGihbh3SwI0WeyOXPNCnrS3hP7LXgwPzZlRQC JdDtk X-Gm-Gg: AR+sD11glbynldFry9DOjWGdameTe7NjQYQ5MliYDP6S1CdM6wPDMOT7SEfz1CP2K65 jWGXSETvFTj8jJ+d4Y8pyT1+1btiMKmq/U0v9QPBCyMxrkshsiAqGtg2Q/E2MPixUiO0M6SnuX4 nCnXOvlgo7stDDKWGBS/9U6KHzyD59S6w3TgUpglbTcI1nQD3y5Wpgtf+pqOShOYnL26DH2ZFZh Ay5+uGPgM3oh3RU2K4L4XoPUOyR5yK2OgaFLPhNsaLXOgrnMd6yHiQRV//Mu5+3Gng4XJQCiCHF pzIAT9z3CAjHPKi3xDyCIAOUWZQYn7RMj+TuV6/HZdm0CU11AwFEdtwjGr+cNeIs/8sk+Zc4TVy GawR9QnWGYfRYa943WUNTvrrLl/teX6R4btN+OP9F4GG9EdXUzZzdRM6MAeqIZyrnGALYJhGfq0 fhQ8pBKY1Pw1rcU2E7BwiQ+BgKKh7kH/FS9e4I/mkPkwYwAqlq+CK/DH6IR8EEfaLGHuatPtRti Agg/fPhLI4hvHY= X-Received: by 2002:a17:90b:4a0d:b0:38e:5b59:c2ff with SMTP id 98e67ed59e1d1-395c3376963mr43212462a91.3.1787576227663; Mon, 24 Aug 2026 05:57:07 -0700 (PDT) Received: from MVIN00352.local ([182.74.28.237]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-141860df1dcsm22623583c88.4.2026.08.24.05.57.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2026 05:57:06 -0700 (PDT) From: Vijay Anusuri To: openembedded-core@lists.openembedded.org Cc: Vijay Anusuri Subject: [OE-core][scarthgap][patch 2/3] libxfont2: Fix CVE-2026-56002 Date: Mon, 24 Aug 2026 18:26:52 +0530 Message-ID: <20260824125653.97525-2-vanusuri@mvista.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260824125653.97525-1-vanusuri@mvista.com> References: <20260824125653.97525-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 ; Mon, 24 Aug 2026 12:57:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/244097 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/libxfont2/CVE-2026-56002.patch | 138 ++++++++++++++++++ .../xorg-lib/libxfont2_2.0.6.bb | 1 + 2 files changed, 139 insertions(+) create mode 100644 meta/recipes-graphics/xorg-lib/libxfont2/CVE-2026-56002.patch diff --git a/meta/recipes-graphics/xorg-lib/libxfont2/CVE-2026-56002.patch b/meta/recipes-graphics/xorg-lib/libxfont2/CVE-2026-56002.patch new file mode 100644 index 0000000000..c0fbb00862 --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libxfont2/CVE-2026-56002.patch @@ -0,0 +1,138 @@ +From b4389e0b1d84a690b819bb27b1439968811a3674f 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 [https://gitlab.freedesktop.org/xorg/lib/libxfont/-/commit/b4389e0b1d84a690b819bb27b1439968811a3674] +CVE: CVE-2026-56002 +Signed-off-by: Vijay Anusuri +--- + src/bitmap/pcfread.c | 59 +++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 56 insertions(+), 3 deletions(-) + +diff --git a/src/bitmap/pcfread.c b/src/bitmap/pcfread.c +index 882318b..bcb82b8 100644 +--- a/src/bitmap/pcfread.c ++++ b/src/bitmap/pcfread.c +@@ -531,25 +531,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]; +@@ -624,6 +673,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/libxfont2_2.0.6.bb b/meta/recipes-graphics/xorg-lib/libxfont2_2.0.6.bb index 1a0eb42681..29e4d3298f 100644 --- a/meta/recipes-graphics/xorg-lib/libxfont2_2.0.6.bb +++ b/meta/recipes-graphics/xorg-lib/libxfont2_2.0.6.bb @@ -16,6 +16,7 @@ XORG_PN = "libXfont2" BBCLASSEXTEND = "native" SRC_URI += "file://CVE-2026-56001.patch \ + file://CVE-2026-56002.patch \ " SRC_URI[sha256sum] = "74ca20017eb0fb3f56d8d5e60685f560fc85e5ff3d84c61c4cb891e40c27aef4" From patchwork Mon Aug 24 12:56:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Anusuri X-Patchwork-Id: 96161 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 884E6C5DF9C for ; Mon, 24 Aug 2026 12:57:15 +0000 (UTC) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.16062.1787576232358111679 for ; Mon, 24 Aug 2026 05:57:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@mvista.com header.s=google header.b=Mez3CFh2; spf=pass (domain: mvista.com, ip: 209.85.216.53, mailfrom: vanusuri@mvista.com) Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-3900e39d935so3450828a91.0 for ; Mon, 24 Aug 2026 05:57:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista.com; s=google; t=1787576232; x=1788181032; 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=6RUfWUgx7bq/X/azuFA46Ns/KRfd9aFYuDiVxssmL2c=; b=Mez3CFh2RXK+D5Aoh8jsPt5yajLW1V/cf9cfBwwN/uFX8YlZN9BuSJulCkMohTZAIf EQEHWU0inn7NxYgFuWQnjsJGYUC92UqpEj4/cOLkeDF4HOUs0a016BWl02dhG3f+MJ9W tgDUInoTBMeB1EaYAp33bOOXtPo5/rqRjSPgo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787576232; x=1788181032; 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=6RUfWUgx7bq/X/azuFA46Ns/KRfd9aFYuDiVxssmL2c=; b=qLhodYuMAyUvFwdTIAc40re9VboIUxh+YoPXWlrpeNCRrbEWhFx7OyK2zS39uF6GW0 EQ3k/d2hh4kfZo2fOGkGkszYmHkg1AZ4xjTxxD5XVcUi8h2aBmnihaNFoxHjVcNprkDX nBy3mL9IPWt5H2+RGw+1hvPWNWcXhVqZoFn5crmF4mIunMrJ0jB6YaxxdEoYtFsa2yJI /73o4bz80AHZaJbT523a0UcTiTtkyxgJTrY4nyvDt+H0f40/AwHwxYqx108xE6ep/fvv PqB3wCwuXBTG9WKMSaGG4YoNFXQWNjENeTn+1SRMKQoPzMae6j641IXZtwxfDk3RYhEt FHmw== X-Gm-Message-State: AFuF++mQJdxPN8miLq34V5HUwIbeuEzplwCngXo3DlEF/6y0FGOTh/Si xTu3aXBRvI52zP4601Cl9vsCifrN+xQIRuiFVF3J9po5g/1ve5nQsiZcRKA3+JaLu8sW9jkXtlC b9Qlw X-Gm-Gg: AR+sD13f39AAfNL0kIWbtn8cN1uB5zyzgJJD1u34jmG5pZMGV7uZcVQh79nxc4oZBqJ fHbjAPiqesgjCzCQWd+IDXKzYMi8cACxcB/qJcqU4XpOtRud3enelIcJbcDgaFVJTZXdPQ48izT i2eVjiZtGexenonebGmGe5uut3d0Mbuv7cbTibdE7fqYgRIXP+ikepBXC+wAOWiiWMRgZ/dfEkE LriO+PG2s/SGxT80ujJzVl9zSDIgc87aRMlju3fP+1WacoVKWLix/llI4hLtvGAT3Z9m/Qg9KRE Di0Lb5ELYsPluujy/0aAXi0pK03ubSw4SRnGVNoiEZ4oY+J0/eALRtjlrxosW3VBQGxC2w92INi mcEdA06YYUF7g2A8s6gyNNiLq47YxgX6X/BR+4qzcqkIZv11zkh5XcNKWszGwYFI0fhQLIOFIl9 G20lehKcf3g96vStsZZjNOMlSMpeLleCwkS5iv9xlUWDEwUbc6riSQysd35ny7dpUI X-Received: by 2002:a17:90b:580d:b0:38f:5869:387b with SMTP id 98e67ed59e1d1-395df24e757mr35576246a91.9.1787576231646; Mon, 24 Aug 2026 05:57:11 -0700 (PDT) Received: from MVIN00352.local ([182.74.28.237]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-141860df1dcsm22623583c88.4.2026.08.24.05.57.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2026 05:57:10 -0700 (PDT) From: Vijay Anusuri To: openembedded-core@lists.openembedded.org Cc: Vijay Anusuri Subject: [OE-core][scarthgap][patch 3/3] libxfont2: Fix CVE-2026-56003 Date: Mon, 24 Aug 2026 18:26:53 +0530 Message-ID: <20260824125653.97525-3-vanusuri@mvista.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260824125653.97525-1-vanusuri@mvista.com> References: <20260824125653.97525-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 ; Mon, 24 Aug 2026 12:57:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/244098 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/libxfont2/CVE-2026-56003.patch | 114 ++++++++++++++++++ .../xorg-lib/libxfont2_2.0.6.bb | 1 + 2 files changed, 115 insertions(+) create mode 100644 meta/recipes-graphics/xorg-lib/libxfont2/CVE-2026-56003.patch diff --git a/meta/recipes-graphics/xorg-lib/libxfont2/CVE-2026-56003.patch b/meta/recipes-graphics/xorg-lib/libxfont2/CVE-2026-56003.patch new file mode 100644 index 0000000000..63208116d9 --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libxfont2/CVE-2026-56003.patch @@ -0,0 +1,114 @@ +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 [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 7100138..1fd15be 100644 +--- a/src/bitmap/bitscale.c ++++ b/src/bitmap/bitscale.c +@@ -511,7 +511,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; +@@ -526,14 +527,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++; +@@ -543,18 +556,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/libxfont2_2.0.6.bb b/meta/recipes-graphics/xorg-lib/libxfont2_2.0.6.bb index 29e4d3298f..e0a951c3a4 100644 --- a/meta/recipes-graphics/xorg-lib/libxfont2_2.0.6.bb +++ b/meta/recipes-graphics/xorg-lib/libxfont2_2.0.6.bb @@ -17,6 +17,7 @@ BBCLASSEXTEND = "native" SRC_URI += "file://CVE-2026-56001.patch \ file://CVE-2026-56002.patch \ + file://CVE-2026-56003.patch \ " SRC_URI[sha256sum] = "74ca20017eb0fb3f56d8d5e60685f560fc85e5ff3d84c61c4cb891e40c27aef4"