From patchwork Fri Aug 21 14:52:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Anusuri X-Patchwork-Id: 96008 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 33CF8C5DF89 for ; Fri, 21 Aug 2026 14:52:55 +0000 (UTC) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.9179.1787323974264845285 for ; Fri, 21 Aug 2026 07:52:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@mvista.com header.s=google header.b=AVv55lsJ; spf=pass (domain: mvista.com, ip: 209.85.210.179, mailfrom: vanusuri@mvista.com) Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-84faf0fa17eso1024476b3a.2 for ; Fri, 21 Aug 2026 07:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista.com; s=google; t=1787323973; x=1787928773; 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=G08mCVh+i3ESNLtwlP3IFoe0N/s6HvPznGBFt9B25Ec=; b=AVv55lsJUXrAa9Z56KMwGXhO0o7+dfStZ8s1meWvTb66cqLnZ/u95yLb1mm21xzjxb n0YvF5bmxt9rliZGmsE4Kxg7uf4/T3IV3OquPxvtV7ZIEO1lPnfBAEvF5ZSgaWdrezjZ 6HVNykT/ctN+mtq8/AfRFlbHgLPPODx/o2iSg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787323973; x=1787928773; 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=G08mCVh+i3ESNLtwlP3IFoe0N/s6HvPznGBFt9B25Ec=; b=R1Eqg4sseSgtEQaGtrmWn2YLekuUBv6v843Zg7/bWP0fB0q185ZdrZHLnL+IJxFvPy U8FqGYRwdwUcAdap9fwbCGmG8WPaQbdMErYH0rUPhhExPnKW8nNjJBSSr5afuc+qSexq zf/CtFPXhQK4VSKglrOZYa/z4z2ba/ZfbAfNcQePLROWc/52rKzF43f5rmkC5N0cSKKT yuluFfA4VE73rbPR9e/7ceb2bO8SkFVjgaGpunlYrT3Xd7i/aCXdnd0GQCwhsJFQeZrZ ZdQ2hOlRmnJP3oNQgT0CEXpoW0CqhWZckJuv5GB8tFUQVh05pMg9eIwfRo12d79eDqFY W8HA== X-Gm-Message-State: AOJu0YwfYiQ7dwGWRmgB8TCdiCo+Zr2U7ir4NWPyRetFCJu+CV9FCDdo NWDoXCK4C1VzCeWXgj52TQaAlvLhxfEK5PY3eH5HH3KKCSQlD7JBpTHkVeJ4Jpqvst/1BYyCXGy xlskt X-Gm-Gg: AR+sD13QeC/zXIkbc2VgLoNb7n7uL34AMls4TqW+ViURzWjbWb2pOQQ+fuMgtLKIzDQ njTXrdNkv0secLW5YVuZca42QLkUGaOYqsPxZNemHkdCA++bb8YVAbSob3eU/OGAw8Ama7UB4uF wwKQvIkH9Jh4wlpj58DAOswHyjEQ0jKAkpMIAscW0Tt2dqlPLHsbAdJvNWMyrpYqRwv0cIT5POT 4SignTTMv5r1h6/jN7JxK9JZeg3I8k7ffchw30JqHx8lWXhV2GBpjs1uHCqtVq+3nH0OmLzrpUe knGpmzuqKid0xd2c8/UvmtiiFc/ZplGjAMinBzp0+2XH3hhxGiM0BOg/vQR6t2HnTwbXocGPV+7 yHN8+JUUfig5z65FJsVWe73yVBUanRGzZZB/PD6O0wJQxQkrDZv8maZQBwe4n27nsatXumgDi3a ojrdTBu2VlwruiInyfHO73zlw/fWlU6h4xegDRgC7qstAbEb7TMTcrYxQpGqEj3bvP+2Z8ZulsX mhv X-Received: by 2002:a05:6a21:398f:b0:3cc:927e:354c with SMTP id adf61e73a8af0-3cd2ff856eemr14096565637.9.1787323973542; Fri, 21 Aug 2026 07:52:53 -0700 (PDT) Received: from MVIN00352.mvista.com ([2401:4900:1cc4:8284:9dd5:5a04:5eb2:4372]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327bef6ec40sm29820194eec.7.2026.08.21.07.52.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2026 07:52:52 -0700 (PDT) From: Vijay Anusuri To: openembedded-core@lists.openembedded.org Cc: Vijay Anusuri Subject: [OE-core][wrynose][patch 1/3] libxfont2: Fix CVE-2026-56001 Date: Fri, 21 Aug 2026 20:22:38 +0530 Message-ID: <20260821145240.137814-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 ; Fri, 21 Aug 2026 14:52:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/243943 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.7.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..58a1881442 --- /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 3f3c10e..5f465d1 100644 +--- a/src/bitmap/bitscale.c ++++ b/src/bitmap/bitscale.c +@@ -1456,7 +1456,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]; +@@ -1483,8 +1483,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 ? */ +-- +GitLab + diff --git a/meta/recipes-graphics/xorg-lib/libxfont2_2.0.7.bb b/meta/recipes-graphics/xorg-lib/libxfont2_2.0.7.bb index bf49d728b9..bc6990576f 100644 --- a/meta/recipes-graphics/xorg-lib/libxfont2_2.0.7.bb +++ b/meta/recipes-graphics/xorg-lib/libxfont2_2.0.7.bb @@ -15,6 +15,9 @@ XORG_PN = "libXfont2" BBCLASSEXTEND = "native" +SRC_URI += "file://CVE-2026-56001.patch \ + " + SRC_URI[sha256sum] = "8b7b82fdeba48769b69433e8e3fbb984a5f6bf368b0d5f47abeec49de3e58efb" PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" From patchwork Fri Aug 21 14:52:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Anusuri X-Patchwork-Id: 96009 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 169ADC5DF93 for ; Fri, 21 Aug 2026 14:53:05 +0000 (UTC) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.9141.1787323980324321152 for ; Fri, 21 Aug 2026 07:53:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@mvista.com header.s=google header.b=URymaV30; spf=pass (domain: mvista.com, ip: 209.85.214.182, mailfrom: vanusuri@mvista.com) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2cab973140bso14497955ad.3 for ; Fri, 21 Aug 2026 07:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista.com; s=google; t=1787323980; x=1787928780; 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=akIp6u0Sf83G0inWiEP3IEw3bqwwvPDEJkk0o0/LurM=; b=URymaV30d032iQYvuxeI65HDsHkL96dbyma8cdrpz9aTn13WhBLlwpuXV26tOO5UUY z1Nxk1X80cCXwzSckOdKNixMATvYmnj5Nl6Mrll2TU81/IQOykJQ4IN47v0o8K38xHwl baGui8UKSCuWSTeR5obs2dXhVCXqofcGXXHqI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787323980; x=1787928780; 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=akIp6u0Sf83G0inWiEP3IEw3bqwwvPDEJkk0o0/LurM=; b=GAXCm8bFToT5OvmrCyvskzbG0HwCGF0Va2EGAEghVHBRRSB5qbb6s3LUKQjZiA5/Ii 15KyoILoMgTE6h264vgNUQTqbOVC/duXytl00plDCkCD6mRu22hfxcDqTDBlfDkYQ9KJ 8SGUTJJXWO1xlA7WI5JIcJrGNs+aMwPqhrBXF2KfjCA6h/N0Ug+oH9Zda7U9oDDC/gjf 0IsZLY51hDvJHlaU1BsF42a58aa2uGjz6WV5WrdP/LLPRL+N3KuMdjruqeKh52XlBM0h fNILxEckTv5okjXrfZJ63fqeG+ypifUeAXirFT3Gixga+o6vm77IqD/O1NHRtSQh40yu qxPg== X-Gm-Message-State: AFuF++kN9vgG+EFoJe1x3IDuxPlZ8IsTQezbvhLulISMg6/yH4Bb0Wdv R9s5e9xYj6ObjYt8jc5aIOAyKwsuy47kw/dV4sHJzW2FIEz6hU6kcm1buZY7QGZJioYiqRgDXHK Ch3r8 X-Gm-Gg: AR+sD10UQCLjjxRhDp1vyzUmjfEIu2JPDotBnaHj6qzzInN8UBO7nNd8OQHkl9bVTWk JHly+K3yvAuRM6DLaLI9FwMDemQPFebXbk/XRGrP+YEtRI2hsOy5OnmKPzGls5LQj7KcNqST1uw LYg8EV+0x/alxG5nGqZTux49n8sLfNM+zImdVV3jBAZsJwFe5hiBFhd/p6i6PdH7x2bywDdiM2i wdtOCxi44mD4doD+hNe9ZNr0uphu6Wnni+P3lW0X4q/QzCGsB4c+HZn98gZggEU2JFS8fmDNYQ4 Z0WQcINtcq1KGI68XZHPNJPS3mWFC6d2hk/UTTryce8Z01BTmVyZTm0XOAtzk42LR5TcHxvE/mJ Fn0WIGX7aRh6V76oSNjQlxyIR9Vzl6lSy2E1Fv8UZi1/sjml+TaIU3e0M+oKtO/+dQdg/e51OxA BsCsrgrGgxalc9xRvb/K44h0wW2wRtaYpap9tzGImNheIF5uiIys5N68l9SE/2ZoSyDBpZZl9yV nJH X-Received: by 2002:a17:902:fdb0:b0:2cc:6018:f030 with SMTP id d9443c01a7336-2d64b0b5652mr152787175ad.14.1787323979283; Fri, 21 Aug 2026 07:52:59 -0700 (PDT) Received: from MVIN00352.mvista.com ([2401:4900:1cc4:8284:9dd5:5a04:5eb2:4372]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327bef6ec40sm29820194eec.7.2026.08.21.07.52.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2026 07:52:58 -0700 (PDT) From: Vijay Anusuri To: openembedded-core@lists.openembedded.org Cc: Vijay Anusuri Subject: [OE-core][wrynose][patch 2/3] libxfont2: Fix CVE-2026-56002 Date: Fri, 21 Aug 2026 20:22:39 +0530 Message-ID: <20260821145240.137814-2-vanusuri@mvista.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260821145240.137814-1-vanusuri@mvista.com> References: <20260821145240.137814-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 ; Fri, 21 Aug 2026 14:53:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/243944 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.7.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..b2874c7c77 --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libxfont2/CVE-2026-56002.patch @@ -0,0 +1,138 @@ +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 [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 7c2e7e1..a385331 100644 +--- a/src/bitmap/pcfread.c ++++ b/src/bitmap/pcfread.c +@@ -532,25 +532,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]; +@@ -625,6 +674,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)]= +-- +GitLab + diff --git a/meta/recipes-graphics/xorg-lib/libxfont2_2.0.7.bb b/meta/recipes-graphics/xorg-lib/libxfont2_2.0.7.bb index bc6990576f..e004ac044c 100644 --- a/meta/recipes-graphics/xorg-lib/libxfont2_2.0.7.bb +++ b/meta/recipes-graphics/xorg-lib/libxfont2_2.0.7.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] = "8b7b82fdeba48769b69433e8e3fbb984a5f6bf368b0d5f47abeec49de3e58efb" From patchwork Fri Aug 21 14:52:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Anusuri X-Patchwork-Id: 96010 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 16F52C5DF93 for ; Fri, 21 Aug 2026 14:53:15 +0000 (UTC) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.9144.1787323985370059936 for ; Fri, 21 Aug 2026 07:53:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@mvista.com header.s=google header.b=JROrUMjN; spf=pass (domain: mvista.com, ip: 209.85.216.52, mailfrom: vanusuri@mvista.com) Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-38dc4553f62so1311035a91.0 for ; Fri, 21 Aug 2026 07:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista.com; s=google; t=1787323985; x=1787928785; 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=wYJu27qUpUpyUHXEBDveX5NhH4iADzw4PmMN9M6nUh0=; b=JROrUMjNvHCXJYpYnIHXTxo9XTz0Cvht+wjH5t6ssgx03EnExTLPQ1VRSBs0Ao1kRY bkiKQvkozk7xtGCx13dPhMb9LOJ16xpgFeg3A0q+iihTz3EWXpsyDW7ugexqE3Yepmhw oUWqekux2I+SF/yqION1rs1C6vtfsWmjbE+0c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787323985; x=1787928785; 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=wYJu27qUpUpyUHXEBDveX5NhH4iADzw4PmMN9M6nUh0=; b=rflOFhMfnu7/pUEAIp7ztZm5gYdMU7rUDSPo3/yEgAWThC5jpDMoqwQ7u0airrXMa5 N7UKLoPqDF/J4/kx9ErKIJvvapWCTywDH2SPpNmZ7oWILklzwh97EpgzDfZsbq23XlO/ y89X24AvVyNfciYRgt7MdD2JR6mGWQVpQIBeumObP1QYeFBsOLdaxYzOKYBt9vGSsUN2 s9mHt81DsJtZMGd4I/CaJ16q+jkRO5OTfGfml1ibjsTo7LlKZodlFbsHEAg8wFnFWfcR ZHpYLaif3yzA9q/kbsRxco51rEJkOwqg1xdxpd0aandMzOFrSj8DIdnVF/D/jMJkZ8g8 nnkA== X-Gm-Message-State: AFuF++l/fZmcqhovflJzTAePb5Ua1k1uNc7W7fv0vsYyZ1UqgElq8NUF jV9tnSVDDBypEX7GJ0KsKAny9qRqE+kZhCo0ZjTYdaUYgHBXRb5I/mXOJ2VzDNGFU3lkAQcmXPg Vz12E X-Gm-Gg: AR+sD11Ur2Whv+FDE9MTcPQACk/L6aKfEm5Z0ExH2Zcfvk+3MDK3vLEGGQ2cVW/0CRN QDZmsyYgTj/bQQ4Wu6tOXiCSRVko9vwBDAhuv/CSHyLCB8hvNYMboWgHm+urVwH6vYB+4hzUDHz zV/Z1n3Hguqvm8QJ9+o/5YSI7WgWZCO8SkE1sSe9kTatfKqsef5u/+6lMkJMtgyle+bhfIU12JD ZZOmWoGM5sTAKoD3C8q4zTWeFvDerMnfye9bsGaT6O5FqIorqDcR9Zf172h1Pdk+48AfZoZph4C It2qqQGgwx4roRO1FmwnlyHFiRdpdcjCaRZrQnmzQEKeqzHTI/cK/e1yvJcswwyyjRdDv/E4L/V AAEoTMduEyaWfxuiR2hHWa855CpWsuF90KvF1HgL8Vs6vMg3A0xmBSLSIorUE5JFN6OyS7luP/F uKpYo9XSsLq/jydJUh+Fey4gkcn3D34OPQS2l20sMUwgQIO2RQPNt1zHmvSCrQkGtYJ5qsJwyjT l8k X-Received: by 2002:a17:90b:164e:b0:38e:57a3:f218 with SMTP id 98e67ed59e1d1-395c3733afdmr11382799a91.13.1787323984663; Fri, 21 Aug 2026 07:53:04 -0700 (PDT) Received: from MVIN00352.mvista.com ([2401:4900:1cc4:8284:9dd5:5a04:5eb2:4372]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327bef6ec40sm29820194eec.7.2026.08.21.07.53.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2026 07:53:04 -0700 (PDT) From: Vijay Anusuri To: openembedded-core@lists.openembedded.org Cc: Vijay Anusuri Subject: [OE-core][wrynose][patch 3/3] libxfont2: Fix CVE-2026-56003 Date: Fri, 21 Aug 2026 20:22:40 +0530 Message-ID: <20260821145240.137814-3-vanusuri@mvista.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260821145240.137814-1-vanusuri@mvista.com> References: <20260821145240.137814-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 ; Fri, 21 Aug 2026 14:53:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/243945 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.7.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..dacfa9d638 --- /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 5f465d1..ec57f55 100644 +--- a/src/bitmap/bitscale.c ++++ b/src/bitmap/bitscale.c +@@ -507,7 +507,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; +@@ -522,14 +523,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++; +@@ -539,18 +552,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; + } +@@ -667,7 +668,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; + } + +-- +GitLab + diff --git a/meta/recipes-graphics/xorg-lib/libxfont2_2.0.7.bb b/meta/recipes-graphics/xorg-lib/libxfont2_2.0.7.bb index e004ac044c..de6418b11a 100644 --- a/meta/recipes-graphics/xorg-lib/libxfont2_2.0.7.bb +++ b/meta/recipes-graphics/xorg-lib/libxfont2_2.0.7.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] = "8b7b82fdeba48769b69433e8e3fbb984a5f6bf368b0d5f47abeec49de3e58efb"