From patchwork Wed Dec 2 06:59:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco)" X-Patchwork-Id: 106924 Received: from aer-iport-2.cisco.com (aer-iport-2.cisco.com [173.38.203.52]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.30784.1796194753942389272 for ; Tue, 01 Dec 2026 22:59:14 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: message contains an insecure body length tag" header.i=@cisco.com header.s=iport01 header.b=F4Mn7+U/; spf=pass (domain: cisco.com, ip: 173.38.203.52, mailfrom: dkelaiya@cisco.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.com; i=@cisco.com; l=10269; q=dns/txt; s=iport01; t=1796194754; x=1797404354; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=p3VWCPmDW6y0xy/6jQ8CiM7Jfkqtv7kDkhVv9CLVoNQ=; b=F4Mn7+U/ENW9pRL/7V+8Jvddp7Aq3Px8+8BuHFYpjDkpVMxWCwvZUrOE e18aEWDf/ebtpi0Ogwi0kWZkeNb5V12+FVA+GXt2JKA9xHZQnd+ZvRe+W uBPVBGAnKci5znrjht2PLfGHhyR1QG6SyVjuJk7kayPGYXCBZS73BOAT6 2Vtu/RPefEUtPSIqYAlVuRwp50rperX6ohzZGo8hlqXeYt7uo9oHzjkU+ T54vtC2lgvPJP1G7TYP1iY528ErJd1AgDjo5hUjQ7I1PXow2Tw5SfKgyL tofTos6jnc5uwWcKIzPC/E5B832VSLWMkzR6wY1QAOdr/Aah1PAK8vDEI g==; X-CSE-ConnectionGUID: LM3vJwjhRxKISyysPKDlmw== X-CSE-MsgGUID: /0mk4WmqRmO3PjOLyzHghw== X-IPAS-Result: A0BMAgBawQ9r/9VK/pBaglmCGD91YENJA5ZKmiiEBYF+DwEBAQ8uFg0EAQGFBY4lAi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Cw4 TrD/DjGBwggMfvE8Tii1mO+puDPgnauMG4VPPjinhJwu3WU3mEVBRgcWFe3rPX8gUmkVvpbK lcI4WwptaU0+UmhQ9XxUhH+p2SL1iPwQPJZHvd/7ESGzbDZpl/DQGMFVTVGLtchsafaWAAX6 7NApPuxbRQHjVFfYSv1Gmu8xd9qBRUoEA== IronPort-HdrOrdr: A9a23:s9YtW6xHxzvzP0gyEY20KrPwGr1zdoMgy1knxilNoNJuHfBw8P re+cjzuiWUtN98YhwdcLO7Scu9qA3nlaKdiLN5VdzJYOCMggWVxe9ZgbcKuweQeBHWx6p6yb pqdbR4BZnbCFh3itu/3SyDeuxQpOVuNMuT9IHjJ7AHd3AMV51d X-Talos-CUID: 9a23:6i+zxGv84exMqp5bc8fEIxhS6IsBVybD7mjSI3WoKkdSWayOcXy8/KZ7xp8= X-Talos-MUID: 9a23:0mLqeAlvZdJ1vXSjk8gVdnolbMJrv5urEXoIts4+ue6gJD5QNDeC2WE= X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="6.27,246,1787011200"; d="scan'208";a="64106629" Received: from aer-l-core-12.cisco.com ([144.254.74.213]) by aer-iport-2.cisco.com with ESMTP/TLS/TLS_AES_256_GCM_SHA384; 02 Dec 2026 06:59:10 +0000 Received: from sjc-ads-5675.cisco.com (sjc-ads-5675.cisco.com [10.28.88.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aer-l-core-12.cisco.com (Postfix) with ESMTPS id CA9DD1800034F; Wed, 2 Dec 2026 06:59:09 +0000 (GMT) Received: by sjc-ads-5675.cisco.com (Postfix, from userid 1887444) id 7022DCC1611; Tue, 1 Dec 2026 22:59:08 -0800 (PST) From: "Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco)" To: openembedded-core@lists.openembedded.org Cc: Darsh Kelaiya Subject: [OE-core][wrynose][PATCH 1/2] perl: fix CVE-2026-15534 Date: Tue, 1 Dec 2026 22:59:00 -0800 Message-Id: <20261202065901.211525-1-dkelaiya@cisco.com> X-Mailer: git-send-email 2.35.6 MIME-Version: 1.0 X-Outbound-Client-TLS: ANONYMOUS;sjc-ads-5675.cisco.com [10.28.88.189];TLSv1.3;TLS_AES_256_GCM_SHA384;256 X-Outbound-SMTP-Client: 10.28.88.189, sjc-ads-5675.cisco.com X-Outbound-Node: aer-l-core-12.cisco.com List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Wed, 02 Dec 2026 06:59:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251785 From: Darsh Kelaiya Backport the two upstream regex cache changes [1,2] identified in the CVE announcement [3]. The first adjusts the countdown states so the second can use STRLEN counters and guard cache allocation arithmetic. The follow-up discussion clarifies the affected version range [4]. Include local corrections for gaps retained by the upstream fixes: compute and save cache indexes as STRLEN, cast the pointer difference before multiplication, and skip cache processing when the allocation guard rejects the requested size. [1] https://github.com/Perl/perl5/commit/568e6fd238867bb9e99fa3f47cba3169009239e0 [2] https://github.com/Perl/perl5/commit/54cf3d44cbbedd17d774e9a37921963e8fd5d0cb [3] https://www.openwall.com/lists/oss-security/2026/08/09/12 [4] https://www.openwall.com/lists/oss-security/2026/08/09/13 Signed-off-by: Darsh Kelaiya --- .../perl/files/CVE-2026-15534_p1.patch | 79 +++++++++++ .../perl/files/CVE-2026-15534_p2.patch | 132 ++++++++++++++++++ meta/recipes-devtools/perl/perl_5.42.3.bb | 2 + 3 files changed, 213 insertions(+) create mode 100644 meta/recipes-devtools/perl/files/CVE-2026-15534_p1.patch create mode 100644 meta/recipes-devtools/perl/files/CVE-2026-15534_p2.patch diff --git a/meta/recipes-devtools/perl/files/CVE-2026-15534_p1.patch b/meta/recipes-devtools/perl/files/CVE-2026-15534_p1.patch new file mode 100644 index 0000000..5cfd64e --- /dev/null +++ b/meta/recipes-devtools/perl/files/CVE-2026-15534_p1.patch @@ -0,0 +1,79 @@ +From 568e6fd238867bb9e99fa3f47cba3169009239e0 Mon Sep 17 00:00:00 2001 +From: David Mitchell +Date: Tue, 30 Jun 2026 11:19:45 +0100 +Subject: [PATCH] regex super-linear cache: make countdown unsigned + +The super-linear cache is a block of flag bits malloc()ed during regex +execution for patterns such as: + + ((aaa)+)+ + +which can go exponential in run time. The idea is that after the pattern +has been executing for a while, the cache is malloced(), and subsequent +failed iterations set a flag in the cache indicating a fail at this +position, so that it can be failed quickly if a similar point is +reached again after backtracking. + +The "executing for a while" bit is determined by setting a counter to a +largish value, then counting down each time a WHILEM node is executed. +When the count reaches zero, the cache is malloc()ed. When the count +reaches -1, the cache becomes active, and no more decrements are done. + +This commit changes it so that the zero and -1 above become 1 and 0. +This will allow the counter be made unsigned. + +This commit's only side effect is that the SLC will become active one +iteration earlier than it did before. This isn't really an issue, as the +current count start value is an extremely vague heuristic: the value +used at the moment is (string length) x (the number of WHILEM nodes +which can participate in the SLC). + +Actually changing the counter's type to unsigned will be done in the +next commit. + +CVE: CVE-2026-15534 +Upstream-Status: Backport [https://github.com/Perl/perl5/commit/568e6fd238867bb9e99fa3f47cba3169009239e0] + +Signed-off-by: Darsh Kelaiya +--- + regexec.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/regexec.c b/regexec.c +index 61b5c4a..53987b7 100644 +--- a/regexec.c ++++ b/regexec.c +@@ -9142,7 +9142,8 @@ NULL + reginfo->poscache_iter = reginfo->poscache_maxiter; + } + +- if (reginfo->poscache_iter-- == 0) { ++ if (reginfo->poscache_iter == 1) { ++ reginfo->poscache_iter--; + /* initialise cache */ + const SSize_t size = (reginfo->poscache_maxiter + 7)/8; + regmatch_info_aux *const aux = reginfo->info_aux; +@@ -9163,11 +9164,10 @@ NULL + ); + } + +- if (reginfo->poscache_iter < 0) { ++ if (reginfo->poscache_iter == 0) { + /* have we already failed at this position? */ + SSize_t offset, mask; + +- reginfo->poscache_iter = -1; /* stop eventual underflow */ + offset = (FLAGS(scan) & 0xf) - 1 + + (locinput - reginfo->strbeg) + * (FLAGS(scan)>>4); +@@ -9183,6 +9183,8 @@ NULL + ST.cache_offset = offset; + ST.cache_mask = mask; + } ++ else ++ reginfo->poscache_iter--; + } + + /* Prefer B over A for minimal matching. */ +-- +2.35.6 diff --git a/meta/recipes-devtools/perl/files/CVE-2026-15534_p2.patch b/meta/recipes-devtools/perl/files/CVE-2026-15534_p2.patch new file mode 100644 index 0000000..bfbbb36 --- /dev/null +++ b/meta/recipes-devtools/perl/files/CVE-2026-15534_p2.patch @@ -0,0 +1,132 @@ +From 54cf3d44cbbedd17d774e9a37921963e8fd5d0cb Mon Sep 17 00:00:00 2001 +From: David Mitchell +Date: Tue, 30 Jun 2026 12:14:52 +0100 +Subject: [PATCH] regex: make superlinear cache 64-bit clean + +(See the previous commit for an explanation of what the SLC is). + +The iter and maxiter variables associated with the SLC are currently +declared as I32. This causes various possible issues, including +potential out of bounds reads and writes of the cache in the presence of +very large strings and many WHILEM nodes: for example when the string is +over 128Mb and there are 16 nodes (the max). + +Following on from the previous commit which made iter never be negative, +this commit changes the variables' type to STRLEN (typically equal to +U64 on 64-bit systems) and does calculations in a way to avoid potential +overflows. If an overflow *could* occur, the cache isn't enabled. + +Previously, a -ve overflow was "fixed" by setting maxiter to I32_MAX, and ++ve overflows weren't detected. + +No tests are added, since this code only affects very large strings +using lots of memory and iterations, and such tests would crash on small +memory machines. + +CVE: CVE-2026-15534 +Upstream-Status: Backport [https://github.com/Perl/perl5/commit/54cf3d44cbbedd17d774e9a37921963e8fd5d0cb] + +Backport Changes: +- Correct upstream index-width gaps: use STRLEN for computed and + saved cache indexes, and cast the pointer difference before + multiplication. +- Skip cache processing when the allocation guard rejects caching, + before reading or decrementing an uninitialized or stale countdown. + +Signed-off-by: Darsh Kelaiya +--- + regexec.c | 31 ++++++++++++++++++++----------- + regexp.h | 6 +++--- + 2 files changed, 23 insertions(+), 14 deletions(-) + +diff --git a/regexec.c b/regexec.c +index 53987b7..e265e95 100644 +--- a/regexec.c ++++ b/regexec.c +@@ -9133,22 +9133,29 @@ NULL + if (!reginfo->poscache_maxiter) { + /* start the countdown: Postpone detection until we + * know the match is not *that* much linear. */ +- reginfo->poscache_maxiter +- = (reginfo->strend - reginfo->strbeg + 1) +- * (FLAGS(scan)>>4); +- /* possible overflow for long strings and many CURLYX's */ +- if (reginfo->poscache_maxiter < 0) +- reginfo->poscache_maxiter = I32_MAX; +- reginfo->poscache_iter = reginfo->poscache_maxiter; ++ STRLEN len = reginfo->strend - reginfo->strbeg; ++ /* number of participating WHILEMs */ ++ U8 n = (FLAGS(scan)>>4); ++ ++ /* Only do the calculations and enable the cache if it ++ * won't overflow. This test is equivalent to: ++ * ((len + 1) * n + 7) <= max(STRLEN) ++ */ ++ if (len < ((~(STRLEN)0) - 7)/n) { ++ reginfo->poscache_maxiter = (len + 1) * n; ++ reginfo->poscache_iter = reginfo->poscache_maxiter; ++ } ++ else ++ goto whilem_no_cache; + } + + if (reginfo->poscache_iter == 1) { + reginfo->poscache_iter--; + /* initialise cache */ +- const SSize_t size = (reginfo->poscache_maxiter + 7)/8; ++ const STRLEN size = (reginfo->poscache_maxiter + 7)/8; + regmatch_info_aux *const aux = reginfo->info_aux; + if (aux->poscache) { +- if ((SSize_t)reginfo->poscache_size < size) { ++ if (reginfo->poscache_size < size) { + Renew(aux->poscache, size, char); + reginfo->poscache_size = size; + } +@@ -9166,10 +9173,11 @@ NULL + + if (reginfo->poscache_iter == 0) { + /* have we already failed at this position? */ +- SSize_t offset, mask; ++ STRLEN offset; ++ SSize_t mask; + + offset = (FLAGS(scan) & 0xf) - 1 +- + (locinput - reginfo->strbeg) ++ + (STRLEN)(locinput - reginfo->strbeg) + * (FLAGS(scan)>>4); + mask = 1 << (offset % 8); + offset /= 8; +@@ -9187,6 +9195,7 @@ NULL + reginfo->poscache_iter--; + } + ++ whilem_no_cache: + /* Prefer B over A for minimal matching. */ + + if (cur_curlyx->u.curlyx.minmod) { +diff --git a/regexp.h b/regexp.h +index fbe89eb..6d8fc6f 100644 +--- a/regexp.h ++++ b/regexp.h +@@ -830,8 +830,8 @@ typedef struct { + char *cutpoint; /* (*COMMIT) position (if any) */ + regmatch_info_aux *info_aux; /* extra fields that need cleanup */ + regmatch_info_aux_eval *info_aux_eval; /* extra saved state for (?{}) */ +- I32 poscache_maxiter; /* how many whilems todo before S-L cache kicks in */ +- I32 poscache_iter; /* current countdown from _maxiter to zero */ ++ STRLEN poscache_maxiter; /* how many whilems todo before S-L cache kicks in */ ++ STRLEN poscache_iter; /* current countdown from _maxiter to zero */ + STRLEN poscache_size; /* size of regmatch_info_aux.poscache */ + bool intuit; /* re_intuit_start() is the top-level caller */ + bool is_utf8_pat; /* regex is utf8 */ +@@ -1044,7 +1044,7 @@ typedef struct regmatch_state { + CHECKPOINT cp; /* see note above "struct branchlike" */ + CHECKPOINT lastcp; /* see note above "struct branchlike" */ + char *save_lastloc; /* previous curlyx.lastloc */ +- I32 cache_offset; ++ STRLEN cache_offset; + I32 cache_mask; + } whilem; + +-- +2.35.6 diff --git a/meta/recipes-devtools/perl/perl_5.42.3.bb b/meta/recipes-devtools/perl/perl_5.42.3.bb index 1a8b0e1..d118e4d 100644 --- a/meta/recipes-devtools/perl/perl_5.42.3.bb +++ b/meta/recipes-devtools/perl/perl_5.42.3.bb @@ -16,6 +16,8 @@ SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \ file://0002-Constant-Fix-up-shebang.patch \ file://determinism.patch \ file://0001-cpan-Sys-Syslog-Makefile.PL-Fix-_PATH_LOG-for-determ.patch \ + file://CVE-2026-15534_p1.patch \ + file://CVE-2026-15534_p2.patch \ " SRC_URI:append:class-native = " \ file://perl-configpm-switch.patch \ From patchwork Wed Dec 2 06:59:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco)" X-Patchwork-Id: 106925 Received: from aer-iport-4.cisco.com (aer-iport-4.cisco.com [173.38.203.54]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.30785.1796194754402378589 for ; Tue, 01 Dec 2026 22:59:14 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: message contains an insecure body length tag" header.i=@cisco.com header.s=iport01 header.b=QgxCJ4ZT; spf=pass (domain: cisco.com, ip: 173.38.203.54, mailfrom: dkelaiya@cisco.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.com; i=@cisco.com; l=18527; q=dns/txt; s=iport01; t=1796194754; x=1797404354; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LiLqjsK4C2o1bVZFcTZT+mrm5OgQtujZHjcaZ3GjNfo=; b=QgxCJ4ZTI+SRNIsDLubF/xZMFuSaPperk+H2qOZP00pphnlt0Gc7mZsd Hzj1m9iF7BA6UpXeCZxj1/yn33ogcaTzuQs0u54R+ga6KDkWZQcadzOG/ JvYVWkP0REHBSQdrZIcqbUqHwPSD06HRBn+DxHFjt/ipvEXYzrIEofEUd 19Fe5CUjh4D+Q/SiOfLDylrOhxjV11q8GXItTu1SS0bnhiKtjpDRULvAO Lz/o527yXo0WJPjKWyVsZ217yPVuUPP0DZvk8mN4xLazy8EctDv8+zAQ+ Cdv2wLsqBAV8M2E6DaqAOpDZdto+xVuN/1lUi47E5NhUDaXrJGct47rBt Q==; X-CSE-ConnectionGUID: zgcqxE3mQband7Wdok3VBA== X-CSE-MsgGUID: Bep0u8ixTxiQ49IPs6QWsA== X-IPAS-Result: A0BLAgChwA9r/8xK/pBaglmCV3VgQ0kDlkoDnioUgWoPAQEBDy4WDQQBAYISgi1GAo4jAiY0CQ4BAgQDAgMBAQEBAQEBAQEBAQEKAQEFAQEBAgEHBYEOE4ZPDZASAQIBAwEmCwEYAS0QHAM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BEbWR6wpuO0okq/QM5Eb UsM9ywjqKI/+ECmQp/6RRLQnZKflhcRQZ9UVuY98gzIkvGS6AeCDW9CRTlEADA7iPILqfUR/ gfht7vU6fZH69V5lVr1Gm+okA6P IronPort-HdrOrdr: A9a23:6An05K4I4+HOdOpEFgPXwOrXdLJyesId70hD6qm+c3Nom6uj5q eTdZsgtCMc5Ax9ZJhko6HjBEDiewK5yXcK2+ks1N6ZNWGM0ldAbrsSiLcKqAePJ8SRzIJgPN 9bAstDIey1K0RmhsDn5wT9OdMhzN6btJ2Mv47lvhFQpcUAUdAZ0++/YTzra3FLeA== X-Talos-CUID: 9a23:dch1HGhgstaVVrTsFUdyWigwCjJuYHLW1Wf9eEqBA29vROKqRViTo51Oup87 X-Talos-MUID: 9a23:Hv/1vwgsLGEtjusCXQXpGcMpHspwu7n+CVAxgZQ/55ilDTcuAgiGpWHi X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="6.27,246,1787011200"; d="scan'208";a="64035122" Received: from aer-l-core-03.cisco.com ([144.254.74.204]) by aer-iport-4.cisco.com with ESMTP/TLS/TLS_AES_256_GCM_SHA384; 02 Dec 2026 06:59:10 +0000 Received: from sjc-ads-5675.cisco.com (sjc-ads-5675.cisco.com [10.28.88.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aer-l-core-03.cisco.com (Postfix) with ESMTPS id CD95A180006D7; Wed, 2 Dec 2026 06:59:09 +0000 (GMT) Received: by sjc-ads-5675.cisco.com (Postfix, from userid 1887444) id 72190CBF201; Tue, 1 Dec 2026 22:59:08 -0800 (PST) From: "Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco)" To: openembedded-core@lists.openembedded.org Cc: Darsh Kelaiya Subject: [OE-core][wrynose][PATCH 2/2] perl: fix CVE-2026-82560 Date: Tue, 1 Dec 2026 22:59:01 -0800 Message-Id: <20261202065901.211525-2-dkelaiya@cisco.com> X-Mailer: git-send-email 2.35.6 In-Reply-To: <20261202065901.211525-1-dkelaiya@cisco.com> References: <20261202065901.211525-1-dkelaiya@cisco.com> MIME-Version: 1.0 X-Outbound-Client-TLS: ANONYMOUS;sjc-ads-5675.cisco.com [10.28.88.189];TLSv1.3;TLS_AES_256_GCM_SHA384;256 X-Outbound-SMTP-Client: 10.28.88.189, sjc-ads-5675.cisco.com X-Outbound-Node: aer-l-core-03.cisco.com List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Wed, 02 Dec 2026 06:59:21 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251786 From: Darsh Kelaiya Backport the Pod::Text margin fix [1] for the bundled podlators 6.0.2 modules so malformed POD cannot loop indefinitely when indentation leaves no usable output width. Include the required follow-up [2], which fixes Overstrike wrapping exposed by the new regression tests, and carry its four renderer fixtures and test registrations. [1] https://github.com/rra/podlators/commit/70510174f69eb54aa6d617bde4e1402cd9b7c61f [2] https://github.com/rra/podlators/commit/092070954c04cffeb6ffd57a78d796eed2f66e9c [3] https://www.openwall.com/lists/oss-security/2026/09/19/6 Signed-off-by: Darsh Kelaiya --- .../perl/files/CVE-2026-82560_p1.patch | 147 +++++++++ .../perl/files/CVE-2026-82560_p2.patch | 298 ++++++++++++++++++ meta/recipes-devtools/perl/perl_5.42.3.bb | 2 + 3 files changed, 447 insertions(+) create mode 100644 meta/recipes-devtools/perl/files/CVE-2026-82560_p1.patch create mode 100644 meta/recipes-devtools/perl/files/CVE-2026-82560_p2.patch diff --git a/meta/recipes-devtools/perl/files/CVE-2026-82560_p1.patch b/meta/recipes-devtools/perl/files/CVE-2026-82560_p1.patch new file mode 100644 index 0000000..301e2c9 --- /dev/null +++ b/meta/recipes-devtools/perl/files/CVE-2026-82560_p1.patch @@ -0,0 +1,147 @@ +From 70510174f69eb54aa6d617bde4e1402cd9b7c61f Mon Sep 17 00:00:00 2001 +From: Russ Allbery +Date: Sat, 29 Aug 2026 10:29:37 -0700 +Subject: [PATCH] Handle pathological margins in Pod::Text + +If the margin equals or exceeds the output width, Pod::Text and its +subclasses could hang forever in the wrapping regular expression, +since it would successfully match zero characters. Catch this case, +report an error, and force the margin to zero. + +CVE: CVE-2026-82560 +Upstream-Status: Backport [https://github.com/rra/podlators/commit/70510174f69eb54aa6d617bde4e1402cd9b7c61f] + +Signed-off-by: Darsh Kelaiya +--- + cpan/podlators/lib/Pod/Text.pm | 18 ++++++++++++++++++ + cpan/podlators/lib/Pod/Text/Color.pm | 11 ++++++++++- + cpan/podlators/lib/Pod/Text/Overstrike.pm | 12 +++++++++++- + cpan/podlators/lib/Pod/Text/Termcap.pm | 11 ++++++++++- + 4 files changed, 49 insertions(+), 3 deletions(-) + +diff --git a/cpan/podlators/lib/Pod/Text.pm b/cpan/podlators/lib/Pod/Text.pm +index e89b01d..1c95d26 100644 +--- a/cpan/podlators/lib/Pod/Text.pm ++++ b/cpan/podlators/lib/Pod/Text.pm +@@ -248,6 +248,17 @@ sub wrap { + my $output = ''; + my $spaces = ' ' x $$self{MARGIN}; + my $width = $$self{opt_width} - $$self{MARGIN}; ++ ++ # Pathological margins make wrapping impossible. In this case, complain ++ # to the user and reset the margin to 0. ++ if ($width <= 0) { ++ my $error = 'Margin is wider than the output width'; ++ $self->whine($self->line_count(), $error); ++ $spaces = q{}; ++ $width = $self->{opt_width}; ++ } ++ ++ # Perform the wrapping. + while (length > $width) { + if (s/^([^\n]{0,$width})[ \t\n]+// || s/^([^\n]{$width})//) { + $output .= $spaces . $1 . "\n"; +@@ -1163,6 +1174,13 @@ and the input file it was given could not be opened. + constructor) was invalid. A quote specification must be either one + character long or an even number (greater than one) characters long. + ++=item Margin is wider than the output width ++ ++(W) The requested margin width, determined from the sum of indentations ++requested by C<=over> and the baseline indentation for text, is equal to or ++wider than the desired output width specified with C. The text will ++be formatted as if the margin was set to zero. ++ + =item POD document had syntax errors + + (F) The POD document being formatted had syntax errors and the C +diff --git a/cpan/podlators/lib/Pod/Text/Color.pm b/cpan/podlators/lib/Pod/Text/Color.pm +index 5212763..16e02ff 100644 +--- a/cpan/podlators/lib/Pod/Text/Color.pm ++++ b/cpan/podlators/lib/Pod/Text/Color.pm +@@ -85,6 +85,15 @@ sub wrap { + my $spaces = ' ' x $$self{MARGIN}; + my $width = $$self{opt_width} - $$self{MARGIN}; + ++ # Pathological margins make wrapping impossible. In this case, complain to ++ # the user and reset the margin to 0. ++ if ($width <= 0) { ++ my $error = 'Margin is wider than the output width'; ++ $self->whine($self->line_count(), $error); ++ $spaces = q{}; ++ $width = $self->{opt_width}; ++ } ++ + # $codes matches a single special sequence. $char matches any number of + # special sequences preceding a single character other than a newline. + # $shortchar matches some sequence of $char ending in codes followed by +@@ -191,7 +200,7 @@ Russ Allbery . + + =head1 COPYRIGHT AND LICENSE + +-Copyright 1999, 2001, 2004, 2006, 2008, 2009, 2018-2019, 2022, 2024 Russ ++Copyright 1999, 2001, 2004, 2006, 2008, 2009, 2018-2019, 2022, 2024, 2026 Russ + Allbery + + This program is free software; you may redistribute it and/or modify it +diff --git a/cpan/podlators/lib/Pod/Text/Overstrike.pm b/cpan/podlators/lib/Pod/Text/Overstrike.pm +index 8982c42..f24a32c 100644 +--- a/cpan/podlators/lib/Pod/Text/Overstrike.pm ++++ b/cpan/podlators/lib/Pod/Text/Overstrike.pm +@@ -103,6 +103,16 @@ sub wrap { + my $output = ''; + my $spaces = ' ' x $$self{MARGIN}; + my $width = $$self{opt_width} - $$self{MARGIN}; ++ ++ # Pathological margins make wrapping impossible. In this case, complain to ++ # the user and reset the margin to 0. ++ if ($width <= 0) { ++ my $error = 'Margin is wider than the output width'; ++ $self->whine($self->line_count(), $error); ++ $spaces = q{}; ++ $width = $self->{opt_width}; ++ } ++ + while (length > $width) { + # This regex represents a single character, that's possibly underlined + # or in bold (in which case, it's three characters; the character, a +@@ -198,7 +208,7 @@ created by Russ Allbery . Subsequently updated by Russ Allbery. + + Copyright 2000 Joe Smith + +-Copyright 2001, 2004, 2008, 2014, 2018-2019, 2022, 2024 Russ Allbery ++Copyright 2001, 2004, 2008, 2014, 2018-2019, 2022, 2024, 2026 Russ Allbery + + + This program is free software; you may redistribute it and/or modify it +diff --git a/cpan/podlators/lib/Pod/Text/Termcap.pm b/cpan/podlators/lib/Pod/Text/Termcap.pm +index b628d7a..902edd4 100644 +--- a/cpan/podlators/lib/Pod/Text/Termcap.pm ++++ b/cpan/podlators/lib/Pod/Text/Termcap.pm +@@ -147,6 +147,15 @@ sub wrap { + return $self->SUPER::wrap($_); + } + ++ # Pathological margins make wrapping impossible. In this case, complain to ++ # the user and reset the margin to 0. ++ if ($width <= 0) { ++ my $error = 'Margin is wider than the output width'; ++ $self->whine($self->line_count(), $error); ++ $spaces = q{}; ++ $width = $self->{opt_width}; ++ } ++ + # $code matches a single special sequence. $char matches any number of + # special sequences preceding a single character other than a newline. + # $shortchar matches some sequence of $char ending in codes followed by +@@ -263,7 +272,7 @@ Russ Allbery + =head1 COPYRIGHT AND LICENSE + + Copyright 1999, 2001-2002, 2004, 2006, 2008-2009, 2014-2015, 2018-2019, 2022, +-2024 Russ Allbery ++2024, 2026 Russ Allbery + + This program is free software; you may redistribute it and/or modify it + under the same terms as Perl itself. +-- +2.35.6 diff --git a/meta/recipes-devtools/perl/files/CVE-2026-82560_p2.patch b/meta/recipes-devtools/perl/files/CVE-2026-82560_p2.patch new file mode 100644 index 0000000..7a872af --- /dev/null +++ b/meta/recipes-devtools/perl/files/CVE-2026-82560_p2.patch @@ -0,0 +1,298 @@ +From 092070954c04cffeb6ffd57a78d796eed2f66e9c Mon Sep 17 00:00:00 2001 +From: Russ Allbery +Date: Sat, 29 Aug 2026 10:38:02 -0700 +Subject: [PATCH] Test wrapping and fix Pod::Text::Overstrike + +Add tests for wrapping in Pod::Text and subclasses when the margin +equals or exceeds the output width, and fix another bug discovered +via that test in Pod::Text::Overstrike wrapping at a formatted space. +Remove any partial space formatting or bold or underlined spaces from +the start of the subsequent line. + +CVE: CVE-2026-82560 +Upstream-Status: Backport [https://github.com/rra/podlators/commit/092070954c04cffeb6ffd57a78d796eed2f66e9c] + +Backport Changes: +- Omit the podlators 6.1.1 release-note hunk from Changes; Perl's + bundled copy retains its 6.0.2 distribution version and changelog. +- Use a 71-test plan for the plain-text suite, which lacks upstream's + unrelated c-with-newline snippet and its two checks. +- Apply that suite's copyright update to its existing 2024 notice. + +Signed-off-by: Darsh Kelaiya +--- + cpan/podlators/lib/Pod/Text/Overstrike.pm | 15 ++++++++++----- + cpan/podlators/t/data/snippets/color/wrap-width | 21 +++++++++++++++++++++ + .../podlators/t/data/snippets/overstrike/wrap-width | 21 +++++++++++++++++++++ + cpan/podlators/t/data/snippets/termcap/wrap-width | 20 ++++++++++++++++++++ + cpan/podlators/t/data/snippets/text/wrap-width | 21 +++++++++++++++++++++ + cpan/podlators/t/text/color.t | 7 ++++--- + cpan/podlators/t/text/overstrike.t | 6 +++--- + cpan/podlators/t/text/snippets.t | 6 +++--- + cpan/podlators/t/text/termcap.t | 7 ++++--- + 9 files changed, 107 insertions(+), 17 deletions(-) + +diff --git a/cpan/podlators/lib/Pod/Text/Overstrike.pm b/cpan/podlators/lib/Pod/Text/Overstrike.pm +index f24a32c..b91f116 100644 +--- a/cpan/podlators/lib/Pod/Text/Overstrike.pm ++++ b/cpan/podlators/lib/Pod/Text/Overstrike.pm +@@ -113,14 +113,19 @@ sub wrap { + $width = $self->{opt_width}; + } + ++ # This regex represents a single character, that's possibly underlined or ++ # in bold (in which case, it's three characters; the character, a ++ # backspace, and a character). Use [^\n] rather than . to protect against ++ # odd settings of $*. ++ my $char = '(?:[^\n][\b])?[^\n]'; ++ ++ # Perform the wrapping. After we find a break point, remove any ++ # underlined or bold spaces left over in the input text after the break ++ # point. + while (length > $width) { +- # This regex represents a single character, that's possibly underlined +- # or in bold (in which case, it's three characters; the character, a +- # backspace, and a character). Use [^\n] rather than . to protect +- # against odd settings of $*. +- my $char = '(?:[^\n][\b])?[^\n]'; + if (s/^((?>$char){0,$width})(?:\Z|[ \t\n]+)//) { + $output .= $spaces . $1 . "\n"; ++ s/^(?:[\b][ _])?(?:[ ][\b][ ])*//; + } else { + last; + } +diff --git a/cpan/podlators/t/data/snippets/color/wrap-width b/cpan/podlators/t/data/snippets/color/wrap-width +new file mode 100644 +index 0000000..0ca0e66 +--- /dev/null ++++ b/cpan/podlators/t/data/snippets/color/wrap-width +@@ -0,0 +1,21 @@ ++[name] ++Wrap with too-long indent ++ ++[input] ++=over 72 ++ ++This paragraph cannot be wrapped because the total margin is equal to the ++maximum width. ++ ++=back ++ ++[output] ++This paragraph cannot be wrapped because the total margin is equal to the ++maximum width. ++ ++POD ERRORS ++ Hey! The above document had some coding errors, which are explained ++ below: ++ ++ Around line 6: ++ Margin is wider than the output width +diff --git a/cpan/podlators/t/data/snippets/overstrike/wrap-width b/cpan/podlators/t/data/snippets/overstrike/wrap-width +new file mode 100644 +index 0000000..4643b86 +--- /dev/null ++++ b/cpan/podlators/t/data/snippets/overstrike/wrap-width +@@ -0,0 +1,21 @@ ++[name] ++Wrap with too-long indent ++ ++[input] ++=over 72 ++ ++This paragraph cannot be wrapped because the total margin is equal to the ++maximum width. ++ ++=back ++ ++[output] ++This paragraph cannot be wrapped because the total margin is equal to the ++maximum width. ++ ++PPOODD  EERRRROORRSS ++ Hey! TThhee  aabboovvee  ddooccuummeenntt  hhaadd  ssoommee  ccooddiinngg  eerrrroorrss,,  wwhhiicchh  aarree  eexxppllaaiinneedd ++ bbeellooww:: ++ ++ Around line 6: ++ Margin is wider than the output width +diff --git a/cpan/podlators/t/data/snippets/termcap/wrap-width b/cpan/podlators/t/data/snippets/termcap/wrap-width +new file mode 100644 +index 0000000..251dce5 +--- /dev/null ++++ b/cpan/podlators/t/data/snippets/termcap/wrap-width +@@ -0,0 +1,20 @@ ++[name] ++Wrap with too-long indent ++ ++[input] ++=over 76 ++ ++This paragraph cannot be wrapped because the total margin is equal to the ++maximum width. ++ ++=back ++ ++[output] ++This paragraph cannot be wrapped because the total margin is equal to the ++maximum width. ++ ++POD ERRORS ++ Hey! The above document had some coding errors, which are explained below: ++ ++ Around line 6: ++ Margin is wider than the output width +diff --git a/cpan/podlators/t/data/snippets/text/wrap-width b/cpan/podlators/t/data/snippets/text/wrap-width +new file mode 100644 +index 0000000..2e3e45f +--- /dev/null ++++ b/cpan/podlators/t/data/snippets/text/wrap-width +@@ -0,0 +1,21 @@ ++[name] ++Wrap with too-long indent ++ ++[input] ++=over 72 ++ ++This paragraph cannot be wrapped because the total margin is equal to the ++maximum width. ++ ++=back ++ ++[output] ++This paragraph cannot be wrapped because the total margin is equal to the ++maximum width. ++ ++POD ERRORS ++ Hey! The above document had some coding errors, which are explained ++ below: ++ ++ Around line 6: ++ Margin is wider than the output width +diff --git a/cpan/podlators/t/text/color.t b/cpan/podlators/t/text/color.t +index e0edb79..2679c03 +--- a/cpan/podlators/t/text/color.t ++++ b/cpan/podlators/t/text/color.t +@@ -2,7 +2,7 @@ + # + # Test Pod::Text::Color behavior with various snippets. + # +-# Copyright 2002, 2004, 2006, 2009, 2012-2013, 2018-2019, 2023-2024 ++# Copyright 2002, 2004, 2006, 2009, 2012-2013, 2018-2019, 2023-2024, 2026 + # Russ Allbery + # + # This program is free software; you may redistribute it and/or modify it +@@ -13,7 +13,7 @@ use warnings; + + use lib 't/lib'; + +-use Test::More tests => 13; ++use Test::More tests => 15; + use Test::Podlators qw(test_snippet); + + # Load the module. +@@ -26,7 +26,8 @@ delete $ENV{NO_COLOR}; + + # List of snippets run by this test. + my @snippets = qw( +- escape-wrapping nonbreaking-wrap tag-width tag-wrapping width wrapping ++ escape-wrapping nonbreaking-wrap tag-width tag-wrapping width wrap-width ++ wrapping + ); + + # Run all the tests. +diff --git a/cpan/podlators/t/text/overstrike.t b/cpan/podlators/t/text/overstrike.t +index 16bd29d..ebb3ae5 +--- a/cpan/podlators/t/text/overstrike.t ++++ b/cpan/podlators/t/text/overstrike.t +@@ -2,7 +2,7 @@ + # + # Test Pod::Text::Overstrike with various snippets. + # +-# Copyright 2002, 2004, 2006, 2009, 2012-2013, 2018-2019, 2024 ++# Copyright 2002, 2004, 2006, 2009, 2012-2013, 2018-2019, 2024, 2026 + # Russ Allbery + # + # This program is free software; you may redistribute it and/or modify it +@@ -15,7 +15,7 @@ use warnings; + + use lib 't/lib'; + +-use Test::More tests => 7; ++use Test::More tests => 9; + use Test::Podlators qw(test_snippet); + + BEGIN { +@@ -23,7 +23,7 @@ BEGIN { + } + + # List of snippets run by this test. +-my @snippets = qw(nonbreaking-wrap tag-width wrapping); ++my @snippets = qw(nonbreaking-wrap tag-width wrap-width wrapping); + + # Run all the tests. + for my $snippet (@snippets) { +diff --git a/cpan/podlators/t/text/snippets.t b/cpan/podlators/t/text/snippets.t +index 83e8ad0..f0532e3 100644 +--- a/cpan/podlators/t/text/snippets.t ++++ b/cpan/podlators/t/text/snippets.t +@@ -2,7 +2,7 @@ + # + # Test Pod::Text behavior with various snippets. + # +-# Copyright 2002, 2004, 2006-2009, 2012, 2018-2020, 2022, 2024 ++# Copyright 2002, 2004, 2006-2009, 2012, 2018-2020, 2022, 2024-2026 + # Russ Allbery + # + # This program is free software; you may redistribute it and/or modify it +@@ -15,7 +15,7 @@ use warnings; + + use lib 't/lib'; + +-use Test::More tests => 69; ++use Test::More tests => 71; + use Test::Podlators qw(test_snippet); + + # Load the module. +@@ -30,7 +30,7 @@ my @snippets = qw( + guesswork-no-quoting late-encoding link-rt link-url margin naive + name-quotes name-quotes-none non-latin nonbreaking-space + nonbreaking-space-l nonbreaking-wrap nourls periods quotes-opt +- s-whitespace sentence-spacing utf8 verbatim ++ s-whitespace sentence-spacing utf8 verbatim wrap-width + ); + + # Run all the tests. +diff --git a/cpan/podlators/t/text/termcap.t b/cpan/podlators/t/text/termcap.t +index 57688ed..1914dd0 +--- a/cpan/podlators/t/text/termcap.t ++++ b/cpan/podlators/t/text/termcap.t +@@ -2,7 +2,7 @@ + # + # Test Pod::Text::Termcap behavior with various snippets. + # +-# Copyright 2002, 2004, 2006, 2009, 2012-2014, 2018-2019, 2022, 2024 ++# Copyright 2002, 2004, 2006, 2009, 2012-2014, 2018-2019, 2022, 2024, 2026 + # Russ Allbery + # + # This program is free software; you may redistribute it and/or modify it +@@ -15,7 +15,7 @@ use warnings; + + use lib 't/lib'; + +-use Test::More tests => 17; ++use Test::More tests => 19; + use Test::Podlators qw(test_snippet); + + # Load the module. +@@ -35,7 +35,8 @@ is($parser->format_regex(), "\\\e\\[1m|\\\e\\[4m|\\\e\\[m", 'Character regex'); + + # List of snippets run by this test. + my @snippets = qw( +- escape-wrapping nonbreaking-wrap tag-width tag-wrapping width wrapping ++ escape-wrapping nonbreaking-wrap tag-width tag-wrapping width wrap-width ++ wrapping + ); + + # Run all the tests. +-- +2.35.6 diff --git a/meta/recipes-devtools/perl/perl_5.42.3.bb b/meta/recipes-devtools/perl/perl_5.42.3.bb index d118e4d..08491e6 100644 --- a/meta/recipes-devtools/perl/perl_5.42.3.bb +++ b/meta/recipes-devtools/perl/perl_5.42.3.bb @@ -18,6 +18,8 @@ SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \ file://0001-cpan-Sys-Syslog-Makefile.PL-Fix-_PATH_LOG-for-determ.patch \ file://CVE-2026-15534_p1.patch \ file://CVE-2026-15534_p2.patch \ + file://CVE-2026-82560_p1.patch \ + file://CVE-2026-82560_p2.patch \ " SRC_URI:append:class-native = " \ file://perl-configpm-switch.patch \