mirror of
https://git.yoctoproject.org/poky
synced 2026-09-16 00:49:32 +02:00
Compare commits
82 Commits
yocto-5.0.
...
scarthgap
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77d1feb37e | ||
|
|
586e5ddf26 | ||
|
|
260984ba5e | ||
|
|
b13a89f19d | ||
|
|
ba7e6744c6 | ||
|
|
1cd648c9ed | ||
|
|
b03c6042db | ||
|
|
09b541c432 | ||
|
|
81c4f97c54 | ||
|
|
ce5d6b9653 | ||
|
|
011c32f047 | ||
|
|
7be1953871 | ||
|
|
96afd71237 | ||
|
|
1e39c2a5e3 | ||
|
|
ab57645a22 | ||
|
|
f65ce1d326 | ||
|
|
73e1a3a8a5 | ||
|
|
6e376f5f1a | ||
|
|
7a00748477 | ||
|
|
26a34ca08b | ||
|
|
9c548130d4 | ||
|
|
492fbe84e8 | ||
|
|
35a3f1bb5d | ||
|
|
815238195b | ||
|
|
5f2d0ad996 | ||
|
|
13d8cd57a7 | ||
|
|
1e77c861bc | ||
|
|
235c6f7619 | ||
|
|
8cddf22d4d | ||
|
|
4e5fdf25e3 | ||
|
|
bd2ef0458c | ||
|
|
28e31d5c6b | ||
|
|
04cc7f252d | ||
|
|
c71dd3cb0d | ||
|
|
abef4d0701 | ||
|
|
3ffe50e092 | ||
|
|
b2c16f1e69 | ||
|
|
4db046100a | ||
|
|
bab7cf95b3 | ||
|
|
e8c7805f25 | ||
|
|
33f791f326 | ||
|
|
1003ae5fab | ||
|
|
07c7fba6d0 | ||
|
|
00e6a3df8c | ||
|
|
f03efa1107 | ||
|
|
dc97ef25ad | ||
|
|
b3092dd954 | ||
|
|
4d706214f7 | ||
|
|
7d5a2907dd | ||
|
|
7a38ffe737 | ||
|
|
d4b6cf3a61 | ||
|
|
68da6e5e76 | ||
|
|
ce0d6f7939 | ||
|
|
4957a62a52 | ||
|
|
56161d9fc4 | ||
|
|
23aff30de0 | ||
|
|
a3df9d6274 | ||
|
|
1a7b2e6b68 | ||
|
|
68cfa8f4db | ||
|
|
f4fecd5a7b | ||
|
|
1045aca106 | ||
|
|
bf5d6de552 | ||
|
|
fd0ffc6666 | ||
|
|
88843705b1 | ||
|
|
72055be747 | ||
|
|
d78b160b6c | ||
|
|
a2d922f58f | ||
|
|
3dcbd1b54b | ||
|
|
83b4945732 | ||
|
|
ca1fb3108c | ||
|
|
69ae79bf5a | ||
|
|
7759e1bf21 | ||
|
|
f4caf6cd58 | ||
|
|
c80225aad3 | ||
|
|
5b35d2e634 | ||
|
|
1d390a4e04 | ||
|
|
8cf593c04e | ||
|
|
2a1e2de813 | ||
|
|
5c215d3c91 | ||
|
|
d93c5f476f | ||
|
|
e0d7b71bd7 | ||
|
|
04d688a25e |
@@ -22,7 +22,7 @@ these instances.
|
||||
a local Git repository based on this upstream
|
||||
repository as follows:
|
||||
|
||||
git clone git://git.yoctoproject.org/yocto-docs
|
||||
git clone https://git.yoctoproject.org/yocto-docs
|
||||
|
||||
Changes and patches are first pushed to the
|
||||
yocto-docs Git repository. Later, they make it
|
||||
|
||||
@@ -60,7 +60,7 @@ repository unto itself and clicking on the layer name displays two URLs
|
||||
from which you can clone the layer's repository to your local system.
|
||||
Here is an example that clones the Raspberry Pi BSP layer::
|
||||
|
||||
$ git clone git://git.yoctoproject.org/meta-raspberrypi
|
||||
$ git clone https://git.yoctoproject.org/meta-raspberrypi
|
||||
|
||||
In addition to BSP layers, the ``meta-yocto-bsp`` layer is part of the
|
||||
shipped ``poky`` repository. The ``meta-yocto-bsp`` layer maintains
|
||||
@@ -181,7 +181,7 @@ section.
|
||||
|
||||
#. *Clone the Layer:* ::
|
||||
|
||||
$ git clone git://git.yoctoproject.org/meta-intel.git
|
||||
$ git clone https://git.yoctoproject.org/meta-intel.git
|
||||
Cloning into 'meta-intel'...
|
||||
remote: Counting objects: 15585, done.
|
||||
remote: Compressing objects: 100% (5056/5056), done.
|
||||
@@ -217,7 +217,7 @@ section.
|
||||
your hardware most closely matches the ``meta-raspberrypi``, clone
|
||||
that layer::
|
||||
|
||||
$ git clone git://git.yoctoproject.org/meta-raspberrypi
|
||||
$ git clone https://git.yoctoproject.org/meta-raspberrypi
|
||||
Cloning into 'meta-raspberrypi'...
|
||||
remote: Counting objects: 4743, done.
|
||||
remote: Compressing objects: 100% (2185/2185), done.
|
||||
|
||||
@@ -985,13 +985,13 @@ above:
|
||||
|
||||
Setting up source meta-intel, revision 15.0-hardknott-3.3-310-g0a96edae, branch master
|
||||
Running 'git init -q /srv/work/alex/my-build/meta-intel'
|
||||
Running 'git remote remove origin > /dev/null 2>&1; git remote add origin git://git.yoctoproject.org/meta-intel' in /srv/work/alex/my-build/meta-intel
|
||||
Running 'git remote remove origin > /dev/null 2>&1; git remote add origin https://git.yoctoproject.org/meta-intel' in /srv/work/alex/my-build/meta-intel
|
||||
Running 'git fetch -q origin || true' in /srv/work/alex/my-build/meta-intel
|
||||
Running 'git checkout -q 0a96edae609a3f48befac36af82cf1eed6786b4a' in /srv/work/alex/my-build/meta-intel
|
||||
|
||||
Setting up source poky, revision 4.1_M1-372-g55483d28f2, branch akanavin/setup-layers
|
||||
Running 'git init -q /srv/work/alex/my-build/poky'
|
||||
Running 'git remote remove origin > /dev/null 2>&1; git remote add origin git://git.yoctoproject.org/poky' in /srv/work/alex/my-build/poky
|
||||
Running 'git remote remove origin > /dev/null 2>&1; git remote add origin https://git.yoctoproject.org/poky' in /srv/work/alex/my-build/poky
|
||||
Running 'git fetch -q origin || true' in /srv/work/alex/my-build/poky
|
||||
Running 'git remote remove poky-contrib > /dev/null 2>&1; git remote add poky-contrib ssh://git@push.yoctoproject.org/poky-contrib' in /srv/work/alex/my-build/poky
|
||||
Running 'git fetch -q poky-contrib || true' in /srv/work/alex/my-build/poky
|
||||
|
||||
@@ -1043,7 +1043,7 @@ correctly trigger an upgrade.
|
||||
In order to ensure the versions compare properly, the recommended
|
||||
convention is to use a tilde (``~``) character as follows::
|
||||
|
||||
PV = 0.8.16~rc1
|
||||
PV = "0.8.16~rc1"
|
||||
|
||||
This way ``0.8.16~rc1`` sorts before ``0.8.16``. See the
|
||||
":ref:`contributor-guide/recipe-style-guide:version policy`" section in the
|
||||
@@ -1626,7 +1626,7 @@ in the BitBake User Manual.
|
||||
You indicate Python code using the ``${@python_code}`` syntax for the
|
||||
variable assignment::
|
||||
|
||||
SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@d.getVar('PV',1).replace('.', '')}.tgz
|
||||
SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@d.getVar('PV',1).replace('.', '')}.tgz"
|
||||
|
||||
- *Shell Function Syntax:* Write shell functions as if you were writing
|
||||
a shell script when you describe a list of actions to take. You
|
||||
|
||||
@@ -73,7 +73,7 @@ The following steps describe how to set up the AUH utility:
|
||||
onto your development host. The following command uses Git to create
|
||||
a local copy of the repository on your system::
|
||||
|
||||
$ git clone git://git.yoctoproject.org/auto-upgrade-helper
|
||||
$ git clone https://git.yoctoproject.org/auto-upgrade-helper
|
||||
Cloning into 'auto-upgrade-helper'... remote: Counting objects: 768, done.
|
||||
remote: Compressing objects: 100% (300/300), done.
|
||||
remote: Total 768 (delta 499), reused 703 (delta 434)
|
||||
|
||||
@@ -731,8 +731,8 @@ Metadata to the build as a "type=kmeta" repository through the
|
||||
example, consider the following :term:`SRC_URI` statement from the
|
||||
``linux-yocto_5.15.bb`` kernel recipe::
|
||||
|
||||
SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH};protocol=https \
|
||||
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.15;destsuffix=${KMETA};protocol=https"
|
||||
SRC_URI = "https://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH};protocol=https \
|
||||
https://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.15;destsuffix=${KMETA};protocol=https"
|
||||
|
||||
``${KMETA}``, in this context, is simply used to name the directory into
|
||||
which the Git fetcher places the Metadata. This behavior is no different
|
||||
|
||||
@@ -246,7 +246,7 @@ section:
|
||||
``linux-yocto-4.12`` kernel and be in the ``standard/base`` branch::
|
||||
|
||||
$ cd ~
|
||||
$ git clone git://git.yoctoproject.org/linux-yocto-4.12 --branch standard/base
|
||||
$ git clone https://git.yoctoproject.org/linux-yocto-4.12 --branch standard/base
|
||||
Cloning into 'linux-yocto-4.12'...
|
||||
remote: Counting objects: 6097195, done.
|
||||
remote: Compressing objects: 100% (901026/901026), done.
|
||||
@@ -273,7 +273,7 @@ section:
|
||||
``yocto-kernel-cache`` and switch to the ``yocto-4.12`` branch::
|
||||
|
||||
$ cd ~
|
||||
$ git clone git://git.yoctoproject.org/yocto-kernel-cache --branch yocto-4.12
|
||||
$ git clone https://git.yoctoproject.org/yocto-kernel-cache --branch yocto-4.12
|
||||
Cloning into 'yocto-kernel-cache'...
|
||||
remote: Counting objects: 22639, done.
|
||||
remote: Compressing objects: 100% (9761/9761), done.
|
||||
|
||||
@@ -30,8 +30,8 @@ example, the following commands clone the Yocto Project baseline Linux
|
||||
kernel that branches off ``linux.org`` version 4.12 and the
|
||||
``yocto-kernel-cache``, which contains stores of kernel Metadata::
|
||||
|
||||
$ git clone git://git.yoctoproject.org/linux-yocto-4.12
|
||||
$ git clone git://git.yoctoproject.org/linux-kernel-cache
|
||||
$ git clone https://git.yoctoproject.org/linux-yocto-4.12
|
||||
$ git clone https://git.yoctoproject.org/linux-kernel-cache
|
||||
|
||||
For more information on
|
||||
how to set up a local Git repository of the Yocto Project Linux kernel
|
||||
|
||||
@@ -424,7 +424,7 @@ development branch in the repository. To help illustrate, consider the
|
||||
following example Git commands::
|
||||
|
||||
$ cd ~
|
||||
$ git clone git://git.yoctoproject.org/poky -b &DISTRO_NAME_NO_CAP;
|
||||
$ git clone https://git.yoctoproject.org/poky -b &DISTRO_NAME_NO_CAP;
|
||||
|
||||
In the previous example
|
||||
after moving to the home directory, the ``git clone`` command creates a
|
||||
@@ -464,7 +464,7 @@ The most common use is to check out a working branch that matches a
|
||||
specific Yocto Project release. Here is an example::
|
||||
|
||||
$ cd ~
|
||||
$ git clone git://git.yoctoproject.org/poky
|
||||
$ git clone https://git.yoctoproject.org/poky
|
||||
$ cd poky
|
||||
$ git fetch --tags
|
||||
$ git checkout tags/rocko-18.0.0 -b my_rocko-18.0.0
|
||||
|
||||
@@ -3640,6 +3640,31 @@ This class is enabled by default because it is inherited by the
|
||||
The :ref:`ref-classes-vala` class supports recipes that need to build software written
|
||||
using the Vala programming language.
|
||||
|
||||
.. _ref-classes-vex:
|
||||
|
||||
``vex``
|
||||
========
|
||||
|
||||
The :ref:`ref-classes-vex` class is used to generate metadata needed by external
|
||||
tools to check for vulnerabilities, for example CVEs. It can be used as a
|
||||
replacement for :ref:`ref-classes-cve-check`.
|
||||
|
||||
In order to use this class, inherit the class in the ``local.conf`` file and it
|
||||
will add the ``generate_vex`` task for every recipe::
|
||||
|
||||
INHERIT += "vex"
|
||||
|
||||
If an image is built it will generate a report in :term:`DEPLOY_DIR_IMAGE` for
|
||||
all the packages used, it will also generate a file for all recipes used in the
|
||||
build.
|
||||
|
||||
Variables use the ``CVE_CHECK`` prefix to keep compatibility with the
|
||||
:ref:`ref-classes-cve-check` class.
|
||||
|
||||
Example usage::
|
||||
|
||||
bitbake -c generate_vex openssl
|
||||
|
||||
.. _ref-classes-waf:
|
||||
|
||||
``waf``
|
||||
|
||||
@@ -7555,12 +7555,12 @@ system and gives an overview of their function and contents.
|
||||
:term:`QB_SMP`
|
||||
|
||||
When using ``runqemu``, the :term:`QB_SMP` variable controls
|
||||
amount of CPU cores made availalble inside the QEMU guest, each mapped to
|
||||
amount of CPU cores made available inside the QEMU guest, each mapped to
|
||||
a thread on the host.
|
||||
|
||||
For example::
|
||||
|
||||
QB_SMP = "-smp 8".
|
||||
QB_SMP = "-smp 8"
|
||||
|
||||
:term:`QB_TAP_OPT`
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ release selection:
|
||||
<!-- Bitbake versions which correspond to the metadata release -->
|
||||
<object model="orm.bitbakeversion" pk="1">
|
||||
<field type="CharField" name="name">&DISTRO_NAME_NO_CAP;</field>
|
||||
<field type="CharField" name="giturl">git://git.yoctoproject.org/poky</field>
|
||||
<field type="CharField" name="giturl">https://git.yoctoproject.org/poky</field>
|
||||
<field type="CharField" name="branch">&DISTRO_NAME_NO_CAP;</field>
|
||||
<field type="CharField" name="dirpath">bitbake</field>
|
||||
</object>
|
||||
@@ -331,7 +331,7 @@ that includes the layer. In general all releases include the layer.
|
||||
<object model="orm.layer" pk="1">
|
||||
<field type="CharField" name="name">openembedded-core</field>
|
||||
<field type="CharField" name="layer_index_url"></field>
|
||||
<field type="CharField" name="vcs_url">git://git.yoctoproject.org/poky</field>
|
||||
<field type="CharField" name="vcs_url">https://git.yoctoproject.org/poky</field>
|
||||
<field type="CharField" name="vcs_web_url">https://git.yoctoproject.org/cgit/cgit.cgi/poky</field>
|
||||
<field type="CharField" name="vcs_web_tree_base_url">https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%</field>
|
||||
<field type="CharField" name="vcs_web_file_base_url">https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%</field>
|
||||
@@ -408,7 +408,7 @@ itemizes all builds in progress. This file includes the time in seconds since
|
||||
each respective build started as well as the progress of the cloning, parsing,
|
||||
and task execution. Here is sample output for a build in progress:
|
||||
|
||||
.. code-block:: JSON
|
||||
.. code-block:: json
|
||||
|
||||
{"count": 1,
|
||||
"building": [
|
||||
@@ -442,7 +442,7 @@ Be sure to provide values for host and port. The output is a JSON file that
|
||||
itemizes all complete builds, and includes build summary information. Here
|
||||
is sample output for a completed build:
|
||||
|
||||
.. code-block:: JSON
|
||||
.. code-block:: json
|
||||
|
||||
{"count": 1,
|
||||
"builds": [
|
||||
@@ -481,7 +481,7 @@ The output is a JSON file that itemizes the specific build and includes
|
||||
build summary information. Here is sample output for a specific
|
||||
build:
|
||||
|
||||
.. code-block:: JSON
|
||||
.. code-block:: json
|
||||
|
||||
{"build":
|
||||
{"distro": "poky",
|
||||
|
||||
@@ -236,7 +236,7 @@ Perform the following steps to install Toaster:
|
||||
#. Checkout a copy of ``poky`` into the web server directory. You will
|
||||
be using ``/var/www/toaster``::
|
||||
|
||||
$ git clone git://git.yoctoproject.org/poky
|
||||
$ git clone https://git.yoctoproject.org/poky
|
||||
$ git checkout &DISTRO_NAME_NO_CAP;
|
||||
|
||||
#. Install Toaster dependencies using the ``--user`` flag which keeps the
|
||||
|
||||
@@ -786,9 +786,9 @@ export PKG_CONFIG_DISABLE_UNINSTALLED = "yes"
|
||||
export PKG_CONFIG_SYSTEM_LIBRARY_PATH = "${base_libdir}:${libdir}"
|
||||
export PKG_CONFIG_SYSTEM_INCLUDE_PATH = "${includedir}"
|
||||
|
||||
# Don't allow git to chdir up past WORKDIR so that it doesn't detect the OE
|
||||
# repository when building a recipe
|
||||
export GIT_CEILING_DIRECTORIES = "${WORKDIR}"
|
||||
# Don't allow git to chdir up past WORKDIR or TMPDIR so that it doesn't detect the OE
|
||||
# repository when building a recipe.
|
||||
export GIT_CEILING_DIRECTORIES = "${WORKDIR}:${TMPDIR}"
|
||||
|
||||
###
|
||||
### Config file processing
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From 3033625d5a67514e3d74021fc39f7fcb542d7f2d Mon Sep 17 00:00:00 2001
|
||||
From: Gerhard Rieger <gerhard@dest-unreach.org>
|
||||
Date: Wed, 11 Feb 2026 14:06:25 +0100
|
||||
Subject: [PATCH] Fixed strchr with const for new glibc
|
||||
|
||||
Upstream-Status: Backport [https://repo.or.cz/socat.git/commit/a7058c9340db0bf90bf4372de0ae87ad37f57735]
|
||||
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
|
||||
---
|
||||
filan.c | 2 +-
|
||||
xio-ip6.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/filan.c b/filan.c
|
||||
index 36def50..e256f74 100644
|
||||
--- a/filan.c
|
||||
+++ b/filan.c
|
||||
@@ -1055,7 +1055,7 @@ const char *getfiletypestring(int st_mode) {
|
||||
}
|
||||
|
||||
static int printtime(FILE *outfile, time_t time) {
|
||||
- const char *s;
|
||||
+ char *s;
|
||||
|
||||
if (filan_rawoutput) {
|
||||
fprintf(outfile, "\t"F_time, time);
|
||||
diff --git a/xio-ip6.c b/xio-ip6.c
|
||||
index bd94bdd..09abdd1 100644
|
||||
--- a/xio-ip6.c
|
||||
+++ b/xio-ip6.c
|
||||
@@ -114,7 +114,7 @@ int xioparsenetwork_ip6(
|
||||
struct xiorange *range,
|
||||
const int ai_flags[2])
|
||||
{
|
||||
- char *delimpos; /* absolute address of delimiter */
|
||||
+ const char *delimpos; /* absolute address of delimiter */
|
||||
size_t delimind; /* index of delimiter in string */
|
||||
unsigned int bits; /* netmask bits */
|
||||
char *endptr;
|
||||
@@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
|
||||
|
||||
SRC_URI = "http://www.dest-unreach.org/socat/download/socat-${PV}.tar.bz2 \
|
||||
file://0001-fix-compile-procan.c-failed.patch \
|
||||
file://0001-Fixed-strchr-with-const-for-new-glibc.patch \
|
||||
file://CVE-2024-54661.patch \
|
||||
file://CVE-2026-56123.patch \
|
||||
"
|
||||
|
||||
51
meta/recipes-core/busybox/busybox/CVE-2024-58251.patch
Normal file
51
meta/recipes-core/busybox/busybox/CVE-2024-58251.patch
Normal file
@@ -0,0 +1,51 @@
|
||||
From: Valery Ushakov <valery.ushakov@bell-sw.com>
|
||||
Date: Thu, 21 Aug 2025 12:31:53 +0000
|
||||
Subject: netstat: CVE-2024-58251 - sanitize argv0 for -p
|
||||
Bug-Debian: https://bugs.debian.org/1104009
|
||||
|
||||
Signed-off-by: Valery Ushakov <valery.ushakov@bell-sw.com>
|
||||
|
||||
CVE: CVE-2024-58251
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
networking/netstat.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/networking/netstat.c b/networking/netstat.c
|
||||
index 807800a62..d979f6079 100644
|
||||
--- a/networking/netstat.c
|
||||
+++ b/networking/netstat.c
|
||||
@@ -41,6 +41,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
#include "inet_common.h"
|
||||
+#include "unicode.h"
|
||||
|
||||
//usage:#define netstat_trivial_usage
|
||||
//usage: "[-"IF_ROUTE("r")"al] [-tuwx] [-en"IF_FEATURE_NETSTAT_WIDE("W")IF_FEATURE_NETSTAT_PRG("p")"]"
|
||||
@@ -314,9 +315,12 @@ static int FAST_FUNC dir_act(struct recursive_state *state,
|
||||
return FALSE;
|
||||
cmdline_buf[n] = '\0';
|
||||
|
||||
+ /* don't write process-controlled argv[0] to the user's terminal as-is */
|
||||
+ const char *argv0base = printable_string(bb_basename(cmdline_buf));
|
||||
+
|
||||
/* go through all files in /proc/PID/fd and check whether they are sockets */
|
||||
strcpy(proc_pid_fname + len - (sizeof("cmdline")-1), "fd");
|
||||
- pid_slash_progname = concat_path_file(pid, bb_basename(cmdline_buf)); /* "PID/argv0" */
|
||||
+ pid_slash_progname = concat_path_file(pid, argv0base); /* "PID/argv0" */
|
||||
n = recursive_action(proc_pid_fname,
|
||||
ACTION_RECURSE | ACTION_QUIET,
|
||||
add_to_prg_cache_if_socket,
|
||||
@@ -686,6 +690,7 @@ int netstat_main(int argc UNUSED_PARAM, char **argv)
|
||||
unsigned opt;
|
||||
|
||||
INIT_G();
|
||||
+ init_unicode();
|
||||
|
||||
/* Option string must match NETSTAT_xxx constants */
|
||||
opt = getopt32(argv, NETSTAT_OPTS);
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -67,6 +67,7 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
|
||||
file://CVE-2026-29004-01.patch \
|
||||
file://CVE-2026-29004-02.patch \
|
||||
file://CVE-2026-38754.patch \
|
||||
file://CVE-2024-58251.patch \
|
||||
"
|
||||
SRC_URI:append:libc-musl = " file://musl.cfg "
|
||||
# TODO http://lists.busybox.net/pipermail/busybox/2023-January/090078.html
|
||||
|
||||
@@ -99,3 +99,6 @@ do_install_ptest:class-target() {
|
||||
BBCLASSEXTEND += "native nativesdk"
|
||||
|
||||
CVE_PRODUCT = "expat libexpat"
|
||||
|
||||
CVE_STATUS[CVE-2026-72522] = "not-applicable-config: Needs Expat compiled with 16bit character support , Issue only affects firefox/Windows. \
|
||||
EXPAT_CHAR_TYPE:STRING=char is for Yocto builds"
|
||||
|
||||
97
meta/recipes-core/glib-2.0/glib-2.0/CVE-2026-58015_p1.patch
Normal file
97
meta/recipes-core/glib-2.0/glib-2.0/CVE-2026-58015_p1.patch
Normal file
@@ -0,0 +1,97 @@
|
||||
From 1d0d0dc891399e8572a6c96b116149d076e2de28 Mon Sep 17 00:00:00 2001
|
||||
From: Philip Withnall <pwithnall@gnome.org>
|
||||
Date: Tue, 28 Apr 2026 15:47:30 +0100
|
||||
Subject: [PATCH 1/4] gdbusauthmechanismsha1: Validate cookie context
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Without validation, the server could send a malicious context which
|
||||
contains path traversal characters, allowing it to exfiltrate a SHA-1
|
||||
hashed copy of arbitrary data from the client’s file system.
|
||||
|
||||
To exploit this successfully would require the client to choose to
|
||||
connect peer-to-peer to a malicious D-Bus server and to choose the SHA-1
|
||||
authentication mechanism in preference to all the other mechanisms. This
|
||||
is vanishingly unlikely.
|
||||
|
||||
CVE: CVE-2026-58015
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/db9c8fae398b0c457e660ce63dd5afec8993046a]
|
||||
|
||||
Backport Changes:
|
||||
- Added <stdint.h> include because the target branch does not otherwise
|
||||
expose uint8_t used by the upstream validation code during native builds.
|
||||
|
||||
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
|
||||
|
||||
Fixes: #3931
|
||||
(cherry picked from commit db9c8fae398b0c457e660ce63dd5afec8993046a)
|
||||
Signed-off-by: Deepak Rathore <deeratho@cisco.com>
|
||||
---
|
||||
gio/gdbusauthmechanismsha1.c | 37 ++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 37 insertions(+)
|
||||
|
||||
diff --git a/gio/gdbusauthmechanismsha1.c b/gio/gdbusauthmechanismsha1.c
|
||||
index c8aa08977..7d8fc1922 100644
|
||||
--- a/gio/gdbusauthmechanismsha1.c
|
||||
+++ b/gio/gdbusauthmechanismsha1.c
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
+#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
@@ -1198,6 +1199,34 @@ mechanism_client_initiate (GDBusAuthMechanism *mechanism,
|
||||
return initial_response;
|
||||
}
|
||||
|
||||
+/* Context names must be valid ASCII, nonzero length, and may not contain the
|
||||
+ * characters slash ("/"), backslash ("\"), space (" "), newline ("\n"),
|
||||
+ * carriage return ("\r"), tab ("\t"), or period (".").
|
||||
+ *
|
||||
+ * See https://dbus.freedesktop.org/doc/dbus-specification.html#auth-mechanisms-sha */
|
||||
+static gboolean
|
||||
+validate_cookie_context (const char *cookie_context)
|
||||
+{
|
||||
+ size_t i = 0;
|
||||
+
|
||||
+ g_return_val_if_fail (cookie_context != NULL, FALSE);
|
||||
+
|
||||
+ for (i = 0; cookie_context[i] != '\0'; i++)
|
||||
+ {
|
||||
+ if ((uint8_t) cookie_context[i] >= 128 ||
|
||||
+ cookie_context[i] == '/' ||
|
||||
+ cookie_context[i] == '\\' ||
|
||||
+ cookie_context[i] == ' ' ||
|
||||
+ cookie_context[i] == '\n' ||
|
||||
+ cookie_context[i] == '\r' ||
|
||||
+ cookie_context[i] == '\t' ||
|
||||
+ cookie_context[i] == '.')
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ return (i > 0);
|
||||
+}
|
||||
+
|
||||
static void
|
||||
mechanism_client_data_receive (GDBusAuthMechanism *mechanism,
|
||||
const gchar *data,
|
||||
@@ -1232,6 +1261,14 @@ mechanism_client_data_receive (GDBusAuthMechanism *mechanism,
|
||||
}
|
||||
|
||||
cookie_context = tokens[0];
|
||||
+ if (!validate_cookie_context (tokens[0]))
|
||||
+ {
|
||||
+ g_free (m->priv->reject_reason);
|
||||
+ m->priv->reject_reason = g_strdup_printf ("Malformed cookie_context '%s'", tokens[0]);
|
||||
+ m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_REJECTED;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
cookie_id = g_ascii_strtoll (tokens[1], &endp, 10);
|
||||
if (*endp != '\0')
|
||||
{
|
||||
--
|
||||
2.35.6
|
||||
55
meta/recipes-core/glib-2.0/glib-2.0/CVE-2026-58015_p2.patch
Normal file
55
meta/recipes-core/glib-2.0/glib-2.0/CVE-2026-58015_p2.patch
Normal file
@@ -0,0 +1,55 @@
|
||||
From a94b2df7e2bc5f49661e53c2781ce99ae48d18aa Mon Sep 17 00:00:00 2001
|
||||
From: Philip Withnall <pwithnall@gnome.org>
|
||||
Date: Tue, 28 Apr 2026 15:49:54 +0100
|
||||
Subject: [PATCH 2/4] gdbusauthmechanismsha1: Improve validation of cookie ID
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The D-Bus specification says the cookie ID has to be non-negative, but
|
||||
we weren’t checking that (or checking that it was non-empty).
|
||||
|
||||
CVE: CVE-2026-58015
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/c0531125344bb25fd66ffb7435ed6c285de09aeb]
|
||||
|
||||
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
|
||||
(cherry picked from commit c0531125344bb25fd66ffb7435ed6c285de09aeb)
|
||||
Signed-off-by: Deepak Rathore <deeratho@cisco.com>
|
||||
---
|
||||
gio/gdbusauthmechanismsha1.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/gio/gdbusauthmechanismsha1.c b/gio/gdbusauthmechanismsha1.c
|
||||
index 7d8fc1922..e753d139d 100644
|
||||
--- a/gio/gdbusauthmechanismsha1.c
|
||||
+++ b/gio/gdbusauthmechanismsha1.c
|
||||
@@ -1235,7 +1235,7 @@ mechanism_client_data_receive (GDBusAuthMechanism *mechanism,
|
||||
GDBusAuthMechanismSha1 *m = G_DBUS_AUTH_MECHANISM_SHA1 (mechanism);
|
||||
gchar **tokens;
|
||||
const gchar *cookie_context;
|
||||
- guint cookie_id;
|
||||
+ int64_t cookie_id;
|
||||
const gchar *server_challenge;
|
||||
gchar *client_challenge;
|
||||
gchar *endp;
|
||||
@@ -1270,7 +1270,7 @@ mechanism_client_data_receive (GDBusAuthMechanism *mechanism,
|
||||
}
|
||||
|
||||
cookie_id = g_ascii_strtoll (tokens[1], &endp, 10);
|
||||
- if (*endp != '\0')
|
||||
+ if (*endp != '\0' || endp == tokens[1] || cookie_id < 0 || cookie_id > UINT32_MAX)
|
||||
{
|
||||
g_free (m->priv->reject_reason);
|
||||
m->priv->reject_reason = g_strdup_printf ("Malformed cookie_id '%s'", tokens[1]);
|
||||
@@ -1280,7 +1280,7 @@ mechanism_client_data_receive (GDBusAuthMechanism *mechanism,
|
||||
server_challenge = tokens[2];
|
||||
|
||||
error = NULL;
|
||||
- cookie = keyring_lookup_entry (cookie_context, cookie_id, &error);
|
||||
+ cookie = keyring_lookup_entry (cookie_context, (unsigned int) cookie_id, &error);
|
||||
if (cookie == NULL)
|
||||
{
|
||||
g_free (m->priv->reject_reason);
|
||||
--
|
||||
2.35.6
|
||||
|
||||
198
meta/recipes-core/glib-2.0/glib-2.0/CVE-2026-58015_p3.patch
Normal file
198
meta/recipes-core/glib-2.0/glib-2.0/CVE-2026-58015_p3.patch
Normal file
@@ -0,0 +1,198 @@
|
||||
From 99c7abffbd1d549f6c625de6f2028efcdeea5c49 Mon Sep 17 00:00:00 2001
|
||||
From: Philip Withnall <pwithnall@gnome.org>
|
||||
Date: Tue, 28 Apr 2026 15:51:00 +0100
|
||||
Subject: [PATCH 3/4] gdbusauthmechanism: Expose client reject reason as a new
|
||||
vfunc
|
||||
|
||||
We can do this because `gdbusauthmechanism.h` is a private header.
|
||||
|
||||
Hook it up to the existing `reject_reason` code in each
|
||||
`GDBusAuthMechanism` implementation, as all three implementations
|
||||
currently intermingle reject reasons from the server and client code, so
|
||||
there would currently be no benefit to having a separate server and
|
||||
client implementation of `*_get_reject_reason()`.
|
||||
|
||||
This new private API will be used in a new unit test in the following
|
||||
commit.
|
||||
|
||||
CVE: CVE-2026-58015
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/060aea67de7517d531b8fe2cdc07aa1a00ddeb22]
|
||||
|
||||
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
|
||||
(cherry picked from commit 060aea67de7517d531b8fe2cdc07aa1a00ddeb22)
|
||||
Signed-off-by: Deepak Rathore <deeratho@cisco.com>
|
||||
---
|
||||
gio/gdbusauthmechanism.c | 7 +++++++
|
||||
gio/gdbusauthmechanism.h | 2 ++
|
||||
gio/gdbusauthmechanismanon.c | 8 ++++----
|
||||
gio/gdbusauthmechanismexternal.c | 8 ++++----
|
||||
gio/gdbusauthmechanismsha1.c | 8 ++++----
|
||||
5 files changed, 21 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/gio/gdbusauthmechanism.c b/gio/gdbusauthmechanism.c
|
||||
index 6e494dbd9..0d4ef4389 100644
|
||||
--- a/gio/gdbusauthmechanism.c
|
||||
+++ b/gio/gdbusauthmechanism.c
|
||||
@@ -328,6 +328,13 @@ _g_dbus_auth_mechanism_client_data_send (GDBusAuthMechanism *mechanism,
|
||||
return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_data_send (mechanism, out_data_len);
|
||||
}
|
||||
|
||||
+gchar *
|
||||
+_g_dbus_auth_mechanism_client_get_reject_reason (GDBusAuthMechanism *mechanism)
|
||||
+{
|
||||
+ g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL);
|
||||
+ return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_get_reject_reason (mechanism);
|
||||
+}
|
||||
+
|
||||
void
|
||||
_g_dbus_auth_mechanism_client_shutdown (GDBusAuthMechanism *mechanism)
|
||||
{
|
||||
diff --git a/gio/gdbusauthmechanism.h b/gio/gdbusauthmechanism.h
|
||||
index f0edd19a3..e906a47ac 100644
|
||||
--- a/gio/gdbusauthmechanism.h
|
||||
+++ b/gio/gdbusauthmechanism.h
|
||||
@@ -100,6 +100,7 @@ struct _GDBusAuthMechanismClass
|
||||
gsize data_len);
|
||||
gchar *(*client_data_send) (GDBusAuthMechanism *mechanism,
|
||||
gsize *out_data_len);
|
||||
+ gchar *(*client_get_reject_reason) (GDBusAuthMechanism *mechanism);
|
||||
void (*client_shutdown) (GDBusAuthMechanism *mechanism);
|
||||
};
|
||||
|
||||
@@ -148,6 +149,7 @@ void _g_dbus_auth_mechanism_client_data_receive (GDBus
|
||||
gsize data_len);
|
||||
gchar *_g_dbus_auth_mechanism_client_data_send (GDBusAuthMechanism *mechanism,
|
||||
gsize *out_data_len);
|
||||
+gchar *_g_dbus_auth_mechanism_client_get_reject_reason (GDBusAuthMechanism *mechanism);
|
||||
void _g_dbus_auth_mechanism_client_shutdown (GDBusAuthMechanism *mechanism);
|
||||
|
||||
|
||||
diff --git a/gio/gdbusauthmechanismanon.c b/gio/gdbusauthmechanismanon.c
|
||||
index 5f59d4a61..3d80ec15f 100644
|
||||
--- a/gio/gdbusauthmechanismanon.c
|
||||
+++ b/gio/gdbusauthmechanismanon.c
|
||||
@@ -56,7 +56,7 @@ static void mechanism_server_data_receive (GDBusAuthMe
|
||||
gsize data_len);
|
||||
static gchar *mechanism_server_data_send (GDBusAuthMechanism *mechanism,
|
||||
gsize *out_data_len);
|
||||
-static gchar *mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism);
|
||||
+static gchar *mechanism_server_or_client_get_reject_reason (GDBusAuthMechanism *mechanism);
|
||||
static void mechanism_server_shutdown (GDBusAuthMechanism *mechanism);
|
||||
static GDBusAuthMechanismState mechanism_client_get_state (GDBusAuthMechanism *mechanism);
|
||||
static gchar *mechanism_client_initiate (GDBusAuthMechanism *mechanism,
|
||||
@@ -103,12 +103,13 @@ _g_dbus_auth_mechanism_anon_class_init (GDBusAuthMechanismAnonClass *klass)
|
||||
mechanism_class->server_initiate = mechanism_server_initiate;
|
||||
mechanism_class->server_data_receive = mechanism_server_data_receive;
|
||||
mechanism_class->server_data_send = mechanism_server_data_send;
|
||||
- mechanism_class->server_get_reject_reason = mechanism_server_get_reject_reason;
|
||||
+ mechanism_class->server_get_reject_reason = mechanism_server_or_client_get_reject_reason;
|
||||
mechanism_class->server_shutdown = mechanism_server_shutdown;
|
||||
mechanism_class->client_get_state = mechanism_client_get_state;
|
||||
mechanism_class->client_initiate = mechanism_client_initiate;
|
||||
mechanism_class->client_data_receive = mechanism_client_data_receive;
|
||||
mechanism_class->client_data_send = mechanism_client_data_send;
|
||||
+ mechanism_class->client_get_reject_reason = mechanism_server_or_client_get_reject_reason;
|
||||
mechanism_class->client_shutdown = mechanism_client_shutdown;
|
||||
}
|
||||
|
||||
@@ -222,12 +223,11 @@ mechanism_server_data_send (GDBusAuthMechanism *mechanism,
|
||||
}
|
||||
|
||||
static gchar *
|
||||
-mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism)
|
||||
+mechanism_server_or_client_get_reject_reason (GDBusAuthMechanism *mechanism)
|
||||
{
|
||||
GDBusAuthMechanismAnon *m = G_DBUS_AUTH_MECHANISM_ANON (mechanism);
|
||||
|
||||
g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_ANON (mechanism), NULL);
|
||||
- g_return_val_if_fail (m->priv->is_server && !m->priv->is_client, NULL);
|
||||
g_return_val_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_REJECTED, NULL);
|
||||
|
||||
/* can never end up here because we are never in the REJECTED state */
|
||||
diff --git a/gio/gdbusauthmechanismexternal.c b/gio/gdbusauthmechanismexternal.c
|
||||
index 6fe8b1bed..b223ead04 100644
|
||||
--- a/gio/gdbusauthmechanismexternal.c
|
||||
+++ b/gio/gdbusauthmechanismexternal.c
|
||||
@@ -64,7 +64,7 @@ static void mechanism_server_data_receive (GDBusAuthMe
|
||||
gsize data_len);
|
||||
static gchar *mechanism_server_data_send (GDBusAuthMechanism *mechanism,
|
||||
gsize *out_data_len);
|
||||
-static gchar *mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism);
|
||||
+static gchar *mechanism_server_or_client_get_reject_reason (GDBusAuthMechanism *mechanism);
|
||||
static void mechanism_server_shutdown (GDBusAuthMechanism *mechanism);
|
||||
static GDBusAuthMechanismState mechanism_client_get_state (GDBusAuthMechanism *mechanism);
|
||||
static gchar *mechanism_client_initiate (GDBusAuthMechanism *mechanism,
|
||||
@@ -111,12 +111,13 @@ _g_dbus_auth_mechanism_external_class_init (GDBusAuthMechanismExternalClass *kla
|
||||
mechanism_class->server_initiate = mechanism_server_initiate;
|
||||
mechanism_class->server_data_receive = mechanism_server_data_receive;
|
||||
mechanism_class->server_data_send = mechanism_server_data_send;
|
||||
- mechanism_class->server_get_reject_reason = mechanism_server_get_reject_reason;
|
||||
+ mechanism_class->server_get_reject_reason = mechanism_server_or_client_get_reject_reason;
|
||||
mechanism_class->server_shutdown = mechanism_server_shutdown;
|
||||
mechanism_class->client_get_state = mechanism_client_get_state;
|
||||
mechanism_class->client_initiate = mechanism_client_initiate;
|
||||
mechanism_class->client_data_receive = mechanism_client_data_receive;
|
||||
mechanism_class->client_data_send = mechanism_client_data_send;
|
||||
+ mechanism_class->client_get_reject_reason = mechanism_server_or_client_get_reject_reason;
|
||||
mechanism_class->client_shutdown = mechanism_client_shutdown;
|
||||
}
|
||||
|
||||
@@ -321,12 +322,11 @@ mechanism_server_data_send (GDBusAuthMechanism *mechanism,
|
||||
}
|
||||
|
||||
static gchar *
|
||||
-mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism)
|
||||
+mechanism_server_or_client_get_reject_reason (GDBusAuthMechanism *mechanism)
|
||||
{
|
||||
GDBusAuthMechanismExternal *m = G_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism);
|
||||
|
||||
g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism), NULL);
|
||||
- g_return_val_if_fail (m->priv->is_server && !m->priv->is_client, NULL);
|
||||
g_return_val_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_REJECTED, NULL);
|
||||
|
||||
/* can never end up here because we are never in the REJECTED state */
|
||||
diff --git a/gio/gdbusauthmechanismsha1.c b/gio/gdbusauthmechanismsha1.c
|
||||
index e753d139d..6c1682d3a 100644
|
||||
--- a/gio/gdbusauthmechanismsha1.c
|
||||
+++ b/gio/gdbusauthmechanismsha1.c
|
||||
@@ -120,7 +120,7 @@ static void mechanism_server_data_receive (GDBusAuthMe
|
||||
gsize data_len);
|
||||
static gchar *mechanism_server_data_send (GDBusAuthMechanism *mechanism,
|
||||
gsize *out_data_len);
|
||||
-static gchar *mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism);
|
||||
+static gchar *mechanism_server_or_client_get_reject_reason (GDBusAuthMechanism *mechanism);
|
||||
static void mechanism_server_shutdown (GDBusAuthMechanism *mechanism);
|
||||
static GDBusAuthMechanismState mechanism_client_get_state (GDBusAuthMechanism *mechanism);
|
||||
static gchar *mechanism_client_initiate (GDBusAuthMechanism *mechanism,
|
||||
@@ -173,12 +173,13 @@ _g_dbus_auth_mechanism_sha1_class_init (GDBusAuthMechanismSha1Class *klass)
|
||||
mechanism_class->server_initiate = mechanism_server_initiate;
|
||||
mechanism_class->server_data_receive = mechanism_server_data_receive;
|
||||
mechanism_class->server_data_send = mechanism_server_data_send;
|
||||
- mechanism_class->server_get_reject_reason = mechanism_server_get_reject_reason;
|
||||
+ mechanism_class->server_get_reject_reason = mechanism_server_or_client_get_reject_reason;
|
||||
mechanism_class->server_shutdown = mechanism_server_shutdown;
|
||||
mechanism_class->client_get_state = mechanism_client_get_state;
|
||||
mechanism_class->client_initiate = mechanism_client_initiate;
|
||||
mechanism_class->client_data_receive = mechanism_client_data_receive;
|
||||
mechanism_class->client_data_send = mechanism_client_data_send;
|
||||
+ mechanism_class->client_get_reject_reason = mechanism_server_or_client_get_reject_reason;
|
||||
mechanism_class->client_shutdown = mechanism_client_shutdown;
|
||||
}
|
||||
|
||||
@@ -1129,12 +1130,11 @@ mechanism_server_data_send (GDBusAuthMechanism *mechanism,
|
||||
}
|
||||
|
||||
static gchar *
|
||||
-mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism)
|
||||
+mechanism_server_or_client_get_reject_reason (GDBusAuthMechanism *mechanism)
|
||||
{
|
||||
GDBusAuthMechanismSha1 *m = G_DBUS_AUTH_MECHANISM_SHA1 (mechanism);
|
||||
|
||||
g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_SHA1 (mechanism), NULL);
|
||||
- g_return_val_if_fail (m->priv->is_server && !m->priv->is_client, NULL);
|
||||
g_return_val_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_REJECTED, NULL);
|
||||
|
||||
return g_strdup (m->priv->reject_reason);
|
||||
--
|
||||
2.35.6
|
||||
|
||||
222
meta/recipes-core/glib-2.0/glib-2.0/CVE-2026-58015_p4.patch
Normal file
222
meta/recipes-core/glib-2.0/glib-2.0/CVE-2026-58015_p4.patch
Normal file
@@ -0,0 +1,222 @@
|
||||
From 80d2edcc14f476d0ec82dc0733964afa6e9ca74d Mon Sep 17 00:00:00 2001
|
||||
From: Philip Withnall <pwithnall@gnome.org>
|
||||
Date: Tue, 28 Apr 2026 15:52:53 +0100
|
||||
Subject: [PATCH 4/4] tests: Add a unit test for GDBusAuthMechanismSha1 cookie
|
||||
context parsing
|
||||
|
||||
This checks for regressions in the fixes from the previous few commits.
|
||||
|
||||
CVE: CVE-2026-58015
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/0919301962291a712067ee0c5d273cc392f33277]
|
||||
|
||||
Backport Changes:
|
||||
- Replaced the literal U+1F600 test string with its UTF-8 byte escapes to
|
||||
avoid the observed Patchwork mbox truncation. The test input is unchanged.
|
||||
|
||||
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
|
||||
Helps: #3931
|
||||
(cherry picked from commit 0919301962291a712067ee0c5d273cc392f33277)
|
||||
Signed-off-by: Deepak Rathore <deeratho@cisco.com>
|
||||
---
|
||||
gio/tests/gdbus-auth-mechanism-sha1.c | 177 ++++++++++++++++++++++++++
|
||||
gio/tests/meson.build | 1 +
|
||||
2 files changed, 178 insertions(+)
|
||||
create mode 100644 gio/tests/gdbus-auth-mechanism-sha1.c
|
||||
|
||||
diff --git a/gio/tests/gdbus-auth-mechanism-sha1.c b/gio/tests/gdbus-auth-mechanism-sha1.c
|
||||
new file mode 100644
|
||||
index 000000000..abcdb4e3e
|
||||
--- /dev/null
|
||||
+++ b/gio/tests/gdbus-auth-mechanism-sha1.c
|
||||
@@ -0,0 +1,177 @@
|
||||
+/* GLib testing framework examples and tests
|
||||
+ *
|
||||
+ * Copyright (C) 2026 Philip Withnall
|
||||
+ *
|
||||
+ * SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General
|
||||
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
+ *
|
||||
+ * Author: Philip Withnall <pwithnall@gnome.org>
|
||||
+ */
|
||||
+
|
||||
+#include <locale.h>
|
||||
+#include <gio/gio.h>
|
||||
+
|
||||
+#include <string.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+#include "gdbus-tests.h"
|
||||
+
|
||||
+#ifdef G_OS_UNIX
|
||||
+#include <gio/gunixconnection.h>
|
||||
+#include <gio/gnetworkingprivate.h>
|
||||
+#include <gio/gunixsocketaddress.h>
|
||||
+#include <gio/gunixfdlist.h>
|
||||
+#endif
|
||||
+
|
||||
+#define GIO_COMPILATION 1
|
||||
+#include "gdbusauthmechanism.h"
|
||||
+#include "gdbusauthmechanismsha1.h"
|
||||
+
|
||||
+/* Vfunc wrappers copied from gdbusauthmechanism.c as they are not public. */
|
||||
+static gboolean
|
||||
+dbus_auth_mechanism_is_supported (GDBusAuthMechanism *mechanism)
|
||||
+{
|
||||
+ return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->is_supported (mechanism);
|
||||
+}
|
||||
+
|
||||
+static GDBusAuthMechanismState
|
||||
+dbus_auth_mechanism_client_get_state (GDBusAuthMechanism *mechanism)
|
||||
+{
|
||||
+ return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_get_state (mechanism);
|
||||
+}
|
||||
+
|
||||
+static gchar *
|
||||
+dbus_auth_mechanism_client_initiate (GDBusAuthMechanism *mechanism,
|
||||
+ GDBusConnectionFlags conn_flags,
|
||||
+ size_t *out_initial_response_len)
|
||||
+{
|
||||
+ return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_initiate (mechanism,
|
||||
+ conn_flags,
|
||||
+ out_initial_response_len);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+dbus_auth_mechanism_client_data_receive (GDBusAuthMechanism *mechanism,
|
||||
+ const char *data,
|
||||
+ size_t data_len)
|
||||
+{
|
||||
+ G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_data_receive (mechanism, data, data_len);
|
||||
+}
|
||||
+
|
||||
+static char *
|
||||
+dbus_auth_mechanism_client_get_reject_reason (GDBusAuthMechanism *mechanism)
|
||||
+{
|
||||
+ return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_get_reject_reason (mechanism);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+dbus_auth_mechanism_client_shutdown (GDBusAuthMechanism *mechanism)
|
||||
+{
|
||||
+ G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_shutdown (mechanism);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+test_server_challenge_validation (void)
|
||||
+{
|
||||
+ const struct
|
||||
+ {
|
||||
+ const char *server_challenge;
|
||||
+ const char *expected_reject_reason_prefix;
|
||||
+ }
|
||||
+ vectors[] = {
|
||||
+ { "valid_context 123 456", "Problems looking up entry in keyring" },
|
||||
+ { "invalid/context 123 456", "Malformed cookie_context" },
|
||||
+ { "invalid.context 123 456", "Malformed cookie_context" },
|
||||
+ { " 123 456", "Malformed cookie_context" },
|
||||
+ { "\xF0\x9F\x98\x80" " 123 456", "Malformed cookie_context" },
|
||||
+ { "invalid\ncontext 123 456", "Malformed cookie_context" },
|
||||
+ { "invalid\rcontext 123 456", "Malformed cookie_context" },
|
||||
+ { "invalid\tcontext 123 456", "Malformed cookie_context" },
|
||||
+ { "invalid\\context 123 456", "Malformed cookie_context" },
|
||||
+ { "valid_context 456", "Malformed cookie_id" },
|
||||
+ { "valid_context 123notanumber 456", "Malformed cookie_id" },
|
||||
+ { "valid_context -1 456", "Malformed cookie_id" },
|
||||
+ { "valid_context 4294967296 456", "Malformed cookie_id" },
|
||||
+ { "valid_context 123 ", "Malformed data" },
|
||||
+ { "valid_context ", "Malformed data" },
|
||||
+ };
|
||||
+ GType mechanism_type;
|
||||
+ GDBusConnection *connection = NULL;
|
||||
+
|
||||
+ g_test_summary ("Test that GDBusAuthMechanismSha1 rejects various malformed server data lines");
|
||||
+
|
||||
+ /* Briefly connect to the actual bus to ensure the GDBusAuth mechanisms are
|
||||
+ * all registered. */
|
||||
+ session_bus_up ();
|
||||
+
|
||||
+ connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
|
||||
+ g_assert_nonnull (connection);
|
||||
+ g_clear_object (&connection);
|
||||
+
|
||||
+ session_bus_down ();
|
||||
+
|
||||
+ /* Check that we now have the type ID for GDBusAuthMechanismSha1 */
|
||||
+ mechanism_type = g_type_from_name ("GDBusAuthMechanismSha1");
|
||||
+ g_assert_cmpint (mechanism_type, !=, 0);
|
||||
+
|
||||
+ for (size_t i = 0; i < G_N_ELEMENTS (vectors); i++)
|
||||
+ {
|
||||
+ GDBusAuthMechanism *mechanism = NULL;
|
||||
+ char *data = NULL;
|
||||
+ size_t data_len = 0;
|
||||
+ char *reject_reason = NULL;
|
||||
+
|
||||
+ mechanism = g_object_new (mechanism_type, NULL);
|
||||
+
|
||||
+ if (!dbus_auth_mechanism_is_supported (mechanism))
|
||||
+ {
|
||||
+ g_test_skip ("Mechanism not supported");
|
||||
+ g_clear_object (&mechanism);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ data = dbus_auth_mechanism_client_initiate (mechanism,
|
||||
+ G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT,
|
||||
+ &data_len);
|
||||
+ g_free (data);
|
||||
+
|
||||
+ dbus_auth_mechanism_client_data_receive (mechanism, vectors[i].server_challenge, strlen (vectors[i].server_challenge));
|
||||
+
|
||||
+ g_assert_cmpint (dbus_auth_mechanism_client_get_state (mechanism), ==, G_DBUS_AUTH_MECHANISM_STATE_REJECTED);
|
||||
+
|
||||
+ reject_reason = dbus_auth_mechanism_client_get_reject_reason (mechanism);
|
||||
+ g_assert_true (g_str_has_prefix (reject_reason, vectors[i].expected_reject_reason_prefix));
|
||||
+ g_free (reject_reason);
|
||||
+
|
||||
+ dbus_auth_mechanism_client_shutdown (mechanism);
|
||||
+
|
||||
+ g_clear_object (&mechanism);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (int argc,
|
||||
+ char *argv[])
|
||||
+{
|
||||
+ setlocale (LC_ALL, "C");
|
||||
+
|
||||
+ g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||
+
|
||||
+ g_test_dbus_unset ();
|
||||
+
|
||||
+ g_test_add_func ("/gdbus/auth-mechanism-sha1/server-challenge-validation", test_server_challenge_validation);
|
||||
+
|
||||
+ return g_test_run ();
|
||||
+}
|
||||
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
|
||||
index e7699c336..74ea481ff 100644
|
||||
--- a/gio/tests/meson.build
|
||||
+++ b/gio/tests/meson.build
|
||||
@@ -418,6 +418,7 @@ if host_system != 'windows'
|
||||
},
|
||||
'fdo-notification-backend': {},
|
||||
'gdbus-auth' : {'extra_sources' : extra_sources},
|
||||
+ 'gdbus-auth-mechanism-sha1': {'extra_sources' : extra_sources},
|
||||
'gdbus-bz627724' : {'extra_sources' : extra_sources},
|
||||
'gdbus-close-pending' : {'extra_sources' : extra_sources},
|
||||
'gdbus-connection' : {
|
||||
--
|
||||
2.35.6
|
||||
@@ -54,6 +54,10 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
|
||||
file://CVE-2026-58012.patch \
|
||||
file://CVE-2026-58013.patch \
|
||||
file://CVE-2026-58014.patch \
|
||||
file://CVE-2026-58015_p1.patch \
|
||||
file://CVE-2026-58015_p2.patch \
|
||||
file://CVE-2026-58015_p3.patch \
|
||||
file://CVE-2026-58015_p4.patch \
|
||||
"
|
||||
SRC_URI:append:class-native = " file://relocate-modules.patch \
|
||||
file://0001-meson.build-do-not-enable-pidfd-features-on-native-g.patch \
|
||||
|
||||
@@ -39,7 +39,7 @@ PACKAGECONFIG ??= "libmount \
|
||||
PACKAGECONFIG[libmount] = "-Dlibmount=enabled,-Dlibmount=disabled,util-linux"
|
||||
PACKAGECONFIG[manpages] = "-Dman=true, -Dman=false, libxslt-native xmlto-native"
|
||||
PACKAGECONFIG[libelf] = "-Dlibelf=enabled,-Dlibelf=disabled,elfutils"
|
||||
PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false,"
|
||||
PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false,dbus-native"
|
||||
PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux"
|
||||
|
||||
EXTRA_OEMESON = "-Ddtrace=false -Dsystemtap=false"
|
||||
|
||||
137
meta/recipes-core/glibc/glibc/0024-CVE-2026-5435.patch
Normal file
137
meta/recipes-core/glibc/glibc/0024-CVE-2026-5435.patch
Normal file
@@ -0,0 +1,137 @@
|
||||
From 5d41b8e5aaec3580e4a05d93c5ff2fc69bb3d5a7 Mon Sep 17 00:00:00 2001
|
||||
From: Florian Weimer <fweimer@redhat.com>
|
||||
Date: Fri, 19 Jun 2026 18:22:20 +0200
|
||||
Subject: [PATCH] resolv: More types as unknown in ns_sprintrrf (CVE-2026-5435)
|
||||
|
||||
Specifically, CERT, TKEY, TSIG, OPT. This removes the buggy
|
||||
implementations of TSIG, fixing bug 34033, and partially
|
||||
fixing bug 34069.
|
||||
|
||||
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
|
||||
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||
|
||||
CVE: CVE-2026-5435
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=glibc.git;a=patch;h=ca44a6609c29a683b03575fa035c6d17aa591e72]
|
||||
|
||||
Signed-off-by: Hemanth Kumar M D <Hemanth.KumarMD@windriver.com>
|
||||
---
|
||||
resolv/ns_print.c | 96 -----------------------------------------------
|
||||
1 file changed, 96 deletions(-)
|
||||
|
||||
diff --git a/resolv/ns_print.c b/resolv/ns_print.c
|
||||
index cef2212fd2..882a86e58e 100644
|
||||
--- a/resolv/ns_print.c
|
||||
+++ b/resolv/ns_print.c
|
||||
@@ -434,96 +434,6 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
|
||||
break;
|
||||
}
|
||||
|
||||
- case ns_t_cert: {
|
||||
- u_int c_type, key_tag, alg;
|
||||
- int n;
|
||||
- unsigned int siz;
|
||||
- char base64_cert[8192], tmp[40];
|
||||
- const char *leader;
|
||||
-
|
||||
- c_type = ns_get16(rdata); rdata += NS_INT16SZ;
|
||||
- key_tag = ns_get16(rdata); rdata += NS_INT16SZ;
|
||||
- alg = (u_int) *rdata++;
|
||||
-
|
||||
- len = SPRINTF((tmp, "%d %d %d ", c_type, key_tag, alg));
|
||||
- T(addstr(tmp, len, &buf, &buflen));
|
||||
- siz = (edata-rdata)*4/3 + 4; /* "+4" accounts for trailing \0 */
|
||||
- if (siz > sizeof(base64_cert) * 3/4) {
|
||||
- const char *str = "record too long to print";
|
||||
- T(addstr(str, strlen(str), &buf, &buflen));
|
||||
- }
|
||||
- else {
|
||||
- len = b64_ntop(rdata, edata-rdata, base64_cert, siz);
|
||||
-
|
||||
- if (len < 0)
|
||||
- goto formerr;
|
||||
- else if (len > 15) {
|
||||
- T(addstr(" (", 2, &buf, &buflen));
|
||||
- leader = "\n\t\t";
|
||||
- spaced = 0;
|
||||
- }
|
||||
- else
|
||||
- leader = " ";
|
||||
-
|
||||
- for (n = 0; n < len; n += 48) {
|
||||
- T(addstr(leader, strlen(leader),
|
||||
- &buf, &buflen));
|
||||
- T(addstr(base64_cert + n, MIN(len - n, 48),
|
||||
- &buf, &buflen));
|
||||
- }
|
||||
- if (len > 15)
|
||||
- T(addstr(" )", 2, &buf, &buflen));
|
||||
- }
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- case ns_t_tkey: {
|
||||
- /* KJD - need to complete this */
|
||||
- u_long t;
|
||||
- int mode, err, keysize;
|
||||
-
|
||||
- /* Algorithm name. */
|
||||
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
|
||||
- T(addstr(" ", 1, &buf, &buflen));
|
||||
-
|
||||
- /* Inception. */
|
||||
- t = ns_get32(rdata); rdata += NS_INT32SZ;
|
||||
- len = SPRINTF((tmp, "%lu ", t));
|
||||
- T(addstr(tmp, len, &buf, &buflen));
|
||||
-
|
||||
- /* Expiration. */
|
||||
- t = ns_get32(rdata); rdata += NS_INT32SZ;
|
||||
- len = SPRINTF((tmp, "%lu ", t));
|
||||
- T(addstr(tmp, len, &buf, &buflen));
|
||||
-
|
||||
- /* Mode , Error, Key Size. */
|
||||
- /* Priority, Weight, Port. */
|
||||
- mode = ns_get16(rdata); rdata += NS_INT16SZ;
|
||||
- err = ns_get16(rdata); rdata += NS_INT16SZ;
|
||||
- keysize = ns_get16(rdata); rdata += NS_INT16SZ;
|
||||
- len = SPRINTF((tmp, "%u %u %u ", mode, err, keysize));
|
||||
- T(addstr(tmp, len, &buf, &buflen));
|
||||
-
|
||||
- /* XXX need to dump key, print otherdata length & other data */
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- case ns_t_tsig: {
|
||||
- /* BEW - need to complete this */
|
||||
- int n;
|
||||
-
|
||||
- T(len = addname(msg, msglen, &rdata, origin, &buf, &buflen));
|
||||
- T(addstr(" ", 1, &buf, &buflen));
|
||||
- rdata += 8; /*%< time */
|
||||
- n = ns_get16(rdata); rdata += INT16SZ;
|
||||
- rdata += n; /*%< sig */
|
||||
- n = ns_get16(rdata); rdata += INT16SZ; /*%< original id */
|
||||
- sprintf(buf, "%d", ns_get16(rdata));
|
||||
- rdata += INT16SZ;
|
||||
- addlen(strlen(buf), &buf, &buflen);
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
case ns_t_a6: {
|
||||
struct in6_addr a;
|
||||
int pbyte, pbit;
|
||||
@@ -557,12 +467,6 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
|
||||
break;
|
||||
}
|
||||
|
||||
- case ns_t_opt: {
|
||||
- len = SPRINTF((tmp, "%u bytes", class));
|
||||
- T(addstr(tmp, len, &buf, &buflen));
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
default:
|
||||
snprintf (errbuf, sizeof (errbuf), "unknown RR type %d", type);
|
||||
comment = errbuf;
|
||||
--
|
||||
2.49.0
|
||||
|
||||
@@ -56,6 +56,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
|
||||
file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \
|
||||
file://0023-qemu-stale-process.patch \
|
||||
file://0001-stdlib-Add-single-threaded-fast-path-to-rand.patch \
|
||||
file://0024-CVE-2026-5435.patch \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
B = "${WORKDIR}/build-${TARGET_SYS}"
|
||||
|
||||
@@ -26,7 +26,7 @@ inherit core-image setuptools3 features_check
|
||||
|
||||
REQUIRED_DISTRO_FEATURES += "xattr"
|
||||
|
||||
SRCREV ?= "b70aeb3af5a866b2299a273b099b6ca0abb99ae3"
|
||||
SRCREV ?= "586e5ddf269e701828d989f9ac421109e6c08ae6"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=scarthgap;protocol=https \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
|
||||
@@ -13,7 +13,7 @@ PACKAGECONFIG ??= ""
|
||||
PACKAGECONFIG += "${@bb.utils.contains('MACHINE_FEATURES', 'tpm', 'tpm', '', d)}"
|
||||
PACKAGECONFIG += "${@bb.utils.contains('MACHINE_FEATURES', 'tpm2', 'tpm', '', d)}"
|
||||
PACKAGECONFIG[secureboot] = ",,,"
|
||||
PACKAGECONFIG[tpm] = "-D TPM_ENABLE=TRUE,-D TPM_ENABLE=FALSE,,"
|
||||
PACKAGECONFIG[tpm] = "-D TPM2_ENABLE=TRUE,-D TPM2_ENABLE=FALSE,,"
|
||||
|
||||
# GCC12 trips on it
|
||||
#see https://src.fedoraproject.org/rpms/edk2/blob/rawhide/f/0032-Basetools-turn-off-gcc12-warning.patch
|
||||
|
||||
@@ -15,7 +15,7 @@ LICENSE:libsystemd = "LGPL-2.1-or-later"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
|
||||
file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
|
||||
|
||||
SRCREV = "70500d37992a01d3275b1c414c3ed161d6f91f9e"
|
||||
SRCREV = "356c54394add8c6a1d52773852c23656590dc33b"
|
||||
SRCBRANCH = "v255-stable"
|
||||
SRC_URI = "git://github.com/systemd/systemd-stable.git;protocol=https;branch=${SRCBRANCH}"
|
||||
|
||||
|
||||
170
meta/recipes-core/systemd/systemd/CVE-2026-29111-01.patch
Normal file
170
meta/recipes-core/systemd/systemd/CVE-2026-29111-01.patch
Normal file
@@ -0,0 +1,170 @@
|
||||
From 284fd279f9e9c199982aea51aee59a02e90a2eda Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Mon, 19 May 2025 12:58:52 +0200
|
||||
Subject: [PATCH 1/4] path-util: add flavour of path_startswith() that leaves a
|
||||
leading slash in place
|
||||
|
||||
(cherry picked from commit ee19edbb9f3455db3f750089082f3e5a925e3a0c)
|
||||
|
||||
Note: The test uses assert_se(streq_ptr()) instead of the upstream
|
||||
ASSERT_STREQ() macro because ASSERT_STREQ was introduced in systemd v256
|
||||
and is not available in v255.
|
||||
|
||||
CVE: CVE-2026-29111
|
||||
Upstream-Status: Backport [https://github.com/systemd/systemd/commit/20021e7686426052e3a7505425d7e12085feb2a6]
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
src/basic/fs-util.c | 2 +-
|
||||
src/basic/mkdir.c | 2 +-
|
||||
src/basic/path-util.c | 39 ++++++++++++++++++++++++++++-----------
|
||||
src/basic/path-util.h | 10 ++++++++--
|
||||
src/test/test-path-util.c | 16 ++++++++++++++++
|
||||
5 files changed, 54 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c
|
||||
index 5bc7d2f95b..4633a5cd72 100644
|
||||
--- a/src/basic/fs-util.c
|
||||
+++ b/src/basic/fs-util.c
|
||||
@@ -65,7 +65,7 @@ int rmdir_parents(const char *path, const char *stop) {
|
||||
assert(*slash == '/');
|
||||
*slash = '\0';
|
||||
|
||||
- if (path_startswith_full(stop, p, /* accept_dot_dot= */ false))
|
||||
+ if (path_startswith_full(stop, p, /* flags= */ 0))
|
||||
return 0;
|
||||
|
||||
if (rmdir(p) < 0 && errno != ENOENT)
|
||||
diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c
|
||||
index c770e5ed32..7bc73361a5 100644
|
||||
--- a/src/basic/mkdir.c
|
||||
+++ b/src/basic/mkdir.c
|
||||
@@ -155,7 +155,7 @@ int mkdir_parents_internal(const char *prefix, const char *path, mode_t mode, ui
|
||||
assert(_mkdirat != mkdirat);
|
||||
|
||||
if (prefix) {
|
||||
- p = path_startswith_full(path, prefix, /* accept_dot_dot= */ false);
|
||||
+ p = path_startswith_full(path, prefix, /* flags= */ 0);
|
||||
if (!p)
|
||||
return -ENOTDIR;
|
||||
} else
|
||||
diff --git a/src/basic/path-util.c b/src/basic/path-util.c
|
||||
index 6810bf66aa..e73f5d708e 100644
|
||||
--- a/src/basic/path-util.c
|
||||
+++ b/src/basic/path-util.c
|
||||
@@ -403,8 +403,8 @@ char* path_simplify_full(char *path, PathSimplifyFlags flags) {
|
||||
return path;
|
||||
}
|
||||
|
||||
-char* path_startswith_full(const char *path, const char *prefix, bool accept_dot_dot) {
|
||||
- assert(path);
|
||||
+char* path_startswith_full(const char *original_path, const char *prefix, PathStartWithFlags flags) {
|
||||
+ assert(original_path);
|
||||
assert(prefix);
|
||||
|
||||
/* Returns a pointer to the start of the first component after the parts matched by
|
||||
@@ -417,28 +417,45 @@ char* path_startswith_full(const char *path, const char *prefix, bool accept_dot
|
||||
* Returns NULL otherwise.
|
||||
*/
|
||||
|
||||
+ const char *path = original_path;
|
||||
+
|
||||
if ((path[0] == '/') != (prefix[0] == '/'))
|
||||
return NULL;
|
||||
|
||||
for (;;) {
|
||||
const char *p, *q;
|
||||
- int r, k;
|
||||
+ int m, n;
|
||||
|
||||
- r = path_find_first_component(&path, accept_dot_dot, &p);
|
||||
- if (r < 0)
|
||||
+ m = path_find_first_component(&path, FLAGS_SET(flags, PATH_STARTSWITH_ACCEPT_DOT_DOT), &p);
|
||||
+ if (m < 0)
|
||||
return NULL;
|
||||
|
||||
- k = path_find_first_component(&prefix, accept_dot_dot, &q);
|
||||
- if (k < 0)
|
||||
+ n = path_find_first_component(&prefix, FLAGS_SET(flags, PATH_STARTSWITH_ACCEPT_DOT_DOT), &q);
|
||||
+ if (n < 0)
|
||||
return NULL;
|
||||
|
||||
- if (k == 0)
|
||||
- return (char*) (p ?: path);
|
||||
+ if (n == 0) {
|
||||
+ if (!p)
|
||||
+ p = path;
|
||||
+
|
||||
+ if (FLAGS_SET(flags, PATH_STARTSWITH_RETURN_LEADING_SLASH)) {
|
||||
+
|
||||
+ if (p <= original_path)
|
||||
+ return NULL;
|
||||
+
|
||||
+ p--;
|
||||
+
|
||||
+ if (*p != '/')
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ return (char*) p;
|
||||
+ }
|
||||
|
||||
- if (r != k)
|
||||
+ if (m != n)
|
||||
return NULL;
|
||||
|
||||
- if (!strneq(p, q, r))
|
||||
+ if (!strneq(p, q, m))
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
diff --git a/src/basic/path-util.h b/src/basic/path-util.h
|
||||
index 6d943e967f..e0ec05f4db 100644
|
||||
--- a/src/basic/path-util.h
|
||||
+++ b/src/basic/path-util.h
|
||||
@@ -53,9 +53,15 @@ int safe_getcwd(char **ret);
|
||||
int path_make_absolute_cwd(const char *p, char **ret);
|
||||
int path_make_relative(const char *from, const char *to, char **ret);
|
||||
int path_make_relative_parent(const char *from_child, const char *to, char **ret);
|
||||
-char* path_startswith_full(const char *path, const char *prefix, bool accept_dot_dot) _pure_;
|
||||
+
|
||||
+typedef enum PathStartWithFlags {
|
||||
+ PATH_STARTSWITH_ACCEPT_DOT_DOT = 1U << 0,
|
||||
+ PATH_STARTSWITH_RETURN_LEADING_SLASH = 1U << 1,
|
||||
+} PathStartWithFlags;
|
||||
+
|
||||
+char* path_startswith_full(const char *path, const char *prefix, PathStartWithFlags flags) _pure_;
|
||||
static inline char* path_startswith(const char *path, const char *prefix) {
|
||||
- return path_startswith_full(path, prefix, true);
|
||||
+ return path_startswith_full(path, prefix, PATH_STARTSWITH_ACCEPT_DOT_DOT);
|
||||
}
|
||||
|
||||
int path_compare(const char *a, const char *b) _pure_;
|
||||
diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c
|
||||
index f5a425689a..71056b08c1 100644
|
||||
--- a/src/test/test-path-util.c
|
||||
+++ b/src/test/test-path-util.c
|
||||
@@ -754,6 +754,22 @@ TEST(path_startswith) {
|
||||
test_path_startswith_one("/foo/bar/barfoo/", "/fo", NULL, NULL);
|
||||
}
|
||||
|
||||
+static void test_path_startswith_return_leading_slash_one(const char *path, const char *prefix, const char *expected) {
|
||||
+ const char *p;
|
||||
+
|
||||
+ log_debug("/* %s(%s, %s) */", __func__, path, prefix);
|
||||
+
|
||||
+ p = path_startswith_full(path, prefix, PATH_STARTSWITH_RETURN_LEADING_SLASH);
|
||||
+ assert_se(streq_ptr(p, expected));
|
||||
+}
|
||||
+
|
||||
+TEST(path_startswith_return_leading_slash) {
|
||||
+ test_path_startswith_return_leading_slash_one("/foo/bar", "/", "/foo/bar");
|
||||
+ test_path_startswith_return_leading_slash_one("/foo/bar", "/foo", "/bar");
|
||||
+ test_path_startswith_return_leading_slash_one("/foo/bar", "/foo/bar", NULL);
|
||||
+ test_path_startswith_return_leading_slash_one("/foo/bar/", "/foo/bar", "/");
|
||||
+}
|
||||
+
|
||||
static void test_prefix_root_one(const char *r, const char *p, const char *expected) {
|
||||
_cleanup_free_ char *s = NULL;
|
||||
const char *t;
|
||||
--
|
||||
2.43.0
|
||||
85
meta/recipes-core/systemd/systemd/CVE-2026-29111-02.patch
Normal file
85
meta/recipes-core/systemd/systemd/CVE-2026-29111-02.patch
Normal file
@@ -0,0 +1,85 @@
|
||||
From ed86ee8a7cc82fe1c68e3fb17be71c9c8e62ca87 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Fri, 23 May 2025 06:45:40 +0200
|
||||
Subject: [PATCH 2/4] path-util: invert PATH_STARTSWITH_ACCEPT_DOT_DOT flag
|
||||
|
||||
As requested: https://github.com/systemd/systemd/pull/37572#pullrequestreview-2861928094
|
||||
|
||||
(cherry picked from commit ceed11e465f1c8efff1931412a85924d9de7c08d)
|
||||
|
||||
CVE: CVE-2026-29111
|
||||
Upstream-Status: Backport [https://github.com/systemd/systemd/commit/7ac3220213690e8a8d6d2a6e81e43bd1dce01d69]
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
src/basic/fs-util.c | 2 +-
|
||||
src/basic/mkdir.c | 2 +-
|
||||
src/basic/path-util.c | 4 ++--
|
||||
src/basic/path-util.h | 4 ++--
|
||||
4 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c
|
||||
index 4633a5cd72..21cd6ddcde 100644
|
||||
--- a/src/basic/fs-util.c
|
||||
+++ b/src/basic/fs-util.c
|
||||
@@ -65,7 +65,7 @@ int rmdir_parents(const char *path, const char *stop) {
|
||||
assert(*slash == '/');
|
||||
*slash = '\0';
|
||||
|
||||
- if (path_startswith_full(stop, p, /* flags= */ 0))
|
||||
+ if (path_startswith_full(stop, p, PATH_STARTSWITH_REFUSE_DOT_DOT))
|
||||
return 0;
|
||||
|
||||
if (rmdir(p) < 0 && errno != ENOENT)
|
||||
diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c
|
||||
index 7bc73361a5..8f14c47214 100644
|
||||
--- a/src/basic/mkdir.c
|
||||
+++ b/src/basic/mkdir.c
|
||||
@@ -155,7 +155,7 @@ int mkdir_parents_internal(const char *prefix, const char *path, mode_t mode, ui
|
||||
assert(_mkdirat != mkdirat);
|
||||
|
||||
if (prefix) {
|
||||
- p = path_startswith_full(path, prefix, /* flags= */ 0);
|
||||
+ p = path_startswith_full(path, prefix, PATH_STARTSWITH_REFUSE_DOT_DOT);
|
||||
if (!p)
|
||||
return -ENOTDIR;
|
||||
} else
|
||||
diff --git a/src/basic/path-util.c b/src/basic/path-util.c
|
||||
index e73f5d708e..a65a5c32f6 100644
|
||||
--- a/src/basic/path-util.c
|
||||
+++ b/src/basic/path-util.c
|
||||
@@ -426,11 +426,11 @@ char* path_startswith_full(const char *original_path, const char *prefix, PathSt
|
||||
const char *p, *q;
|
||||
int m, n;
|
||||
|
||||
- m = path_find_first_component(&path, FLAGS_SET(flags, PATH_STARTSWITH_ACCEPT_DOT_DOT), &p);
|
||||
+ m = path_find_first_component(&path, !FLAGS_SET(flags, PATH_STARTSWITH_REFUSE_DOT_DOT), &p);
|
||||
if (m < 0)
|
||||
return NULL;
|
||||
|
||||
- n = path_find_first_component(&prefix, FLAGS_SET(flags, PATH_STARTSWITH_ACCEPT_DOT_DOT), &q);
|
||||
+ n = path_find_first_component(&prefix, !FLAGS_SET(flags, PATH_STARTSWITH_REFUSE_DOT_DOT), &q);
|
||||
if (n < 0)
|
||||
return NULL;
|
||||
|
||||
diff --git a/src/basic/path-util.h b/src/basic/path-util.h
|
||||
index e0ec05f4db..11a1078df9 100644
|
||||
--- a/src/basic/path-util.h
|
||||
+++ b/src/basic/path-util.h
|
||||
@@ -55,13 +55,13 @@ int path_make_relative(const char *from, const char *to, char **ret);
|
||||
int path_make_relative_parent(const char *from_child, const char *to, char **ret);
|
||||
|
||||
typedef enum PathStartWithFlags {
|
||||
- PATH_STARTSWITH_ACCEPT_DOT_DOT = 1U << 0,
|
||||
+ PATH_STARTSWITH_REFUSE_DOT_DOT = 1U << 0,
|
||||
PATH_STARTSWITH_RETURN_LEADING_SLASH = 1U << 1,
|
||||
} PathStartWithFlags;
|
||||
|
||||
char* path_startswith_full(const char *path, const char *prefix, PathStartWithFlags flags) _pure_;
|
||||
static inline char* path_startswith(const char *path, const char *prefix) {
|
||||
- return path_startswith_full(path, prefix, PATH_STARTSWITH_ACCEPT_DOT_DOT);
|
||||
+ return path_startswith_full(path, prefix, 0);
|
||||
}
|
||||
|
||||
int path_compare(const char *a, const char *b) _pure_;
|
||||
--
|
||||
2.43.0
|
||||
106
meta/recipes-core/systemd/systemd/CVE-2026-29111-03.patch
Normal file
106
meta/recipes-core/systemd/systemd/CVE-2026-29111-03.patch
Normal file
@@ -0,0 +1,106 @@
|
||||
From 7a1749753b4853866f90ef25d48192e4d1563543 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Yuan <me@yhndnzj.com>
|
||||
Date: Thu, 26 Feb 2026 11:06:00 +0100
|
||||
Subject: [PATCH 3/4] core/cgroup: avoid one unnecessary strjoina()
|
||||
|
||||
(cherry picked from commit 42aee39107fbdd7db1ccd402a2151822b2805e9f)
|
||||
(cherry picked from commit 80acea4ef80a4bb78560ed970c34952299b890d6)
|
||||
(cherry picked from commit b5fd14693057e5f2c9b4a49603be64ec3608ff6c)
|
||||
|
||||
Note: This backport uses u->cgroup_path directly instead of the upstream
|
||||
CGroupRuntime *crt / crt->cgroup_path pattern because the CGroupRuntime
|
||||
struct was introduced in systemd v256 (commit 1d9cc876). In v255, the
|
||||
cgroup_path is still a direct member of the Unit struct.
|
||||
|
||||
CVE: CVE-2026-29111
|
||||
Upstream-Status: Backport [https://github.com/systemd/systemd/commit/21167006574d6b83813c7596759b474f56562412]
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
src/core/cgroup.c | 27 +++++++++++++--------------
|
||||
1 file changed, 13 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
|
||||
index d398655b0a..e5e7f032c2 100644
|
||||
--- a/src/core/cgroup.c
|
||||
+++ b/src/core/cgroup.c
|
||||
@@ -2568,12 +2568,13 @@ static int unit_update_cgroup(
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int unit_attach_pid_to_cgroup_via_bus(Unit *u, pid_t pid, const char *suffix_path) {
|
||||
+static int unit_attach_pid_to_cgroup_via_bus(Unit *u, const char *cgroup_path, pid_t pid) {
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
- char *pp;
|
||||
int r;
|
||||
|
||||
assert(u);
|
||||
+ assert(cgroup_path);
|
||||
+ assert(pid_is_valid(pid));
|
||||
|
||||
if (MANAGER_IS_SYSTEM(u->manager))
|
||||
return -EINVAL;
|
||||
@@ -2581,17 +2582,13 @@ static int unit_attach_pid_to_cgroup_via_bus(Unit *u, pid_t pid, const char *suf
|
||||
if (!u->manager->system_bus)
|
||||
return -EIO;
|
||||
|
||||
- if (!u->cgroup_path)
|
||||
- return -EINVAL;
|
||||
-
|
||||
/* Determine this unit's cgroup path relative to our cgroup root */
|
||||
- pp = path_startswith(u->cgroup_path, u->manager->cgroup_root);
|
||||
+ const char *pp = path_startswith_full(cgroup_path,
|
||||
+ u->manager->cgroup_root,
|
||||
+ PATH_STARTSWITH_RETURN_LEADING_SLASH|PATH_STARTSWITH_REFUSE_DOT_DOT);
|
||||
if (!pp)
|
||||
return -EINVAL;
|
||||
|
||||
- pp = strjoina("/", pp, suffix_path);
|
||||
- path_simplify(pp);
|
||||
-
|
||||
r = bus_call_method(u->manager->system_bus,
|
||||
bus_systemd_mgr,
|
||||
"AttachProcessesToUnit",
|
||||
@@ -2630,8 +2627,10 @@ int unit_attach_pids_to_cgroup(Unit *u, Set *pids, const char *suffix_path) {
|
||||
return r;
|
||||
|
||||
if (isempty(suffix_path))
|
||||
- p = u->cgroup_path;
|
||||
+ p = empty_to_root(u->cgroup_path);
|
||||
else {
|
||||
+ assert(path_is_absolute(suffix_path));
|
||||
+
|
||||
joined = path_join(u->cgroup_path, suffix_path);
|
||||
if (!joined)
|
||||
return -ENOMEM;
|
||||
@@ -2649,7 +2648,7 @@ int unit_attach_pids_to_cgroup(Unit *u, Set *pids, const char *suffix_path) {
|
||||
* before we use it */
|
||||
r = pidref_verify(pid);
|
||||
if (r < 0) {
|
||||
- log_unit_info_errno(u, r, "PID " PID_FMT " vanished before we could move it to target cgroup '%s', skipping: %m", pid->pid, empty_to_root(p));
|
||||
+ log_unit_info_errno(u, r, "PID " PID_FMT " vanished before we could move it to target cgroup '%s', skipping: %m", pid->pid, p);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2660,7 +2659,7 @@ int unit_attach_pids_to_cgroup(Unit *u, Set *pids, const char *suffix_path) {
|
||||
|
||||
log_unit_full_errno(u, again ? LOG_DEBUG : LOG_INFO, r,
|
||||
"Couldn't move process "PID_FMT" to%s requested cgroup '%s': %m",
|
||||
- pid->pid, again ? " directly" : "", empty_to_root(p));
|
||||
+ pid->pid, again ? " directly" : "", p);
|
||||
|
||||
if (again) {
|
||||
int z;
|
||||
@@ -2670,9 +2669,9 @@ int unit_attach_pids_to_cgroup(Unit *u, Set *pids, const char *suffix_path) {
|
||||
* Since it's more privileged it might be able to move the process across the
|
||||
* leaves of a subtree whose top node is not owned by us. */
|
||||
|
||||
- z = unit_attach_pid_to_cgroup_via_bus(u, pid->pid, suffix_path);
|
||||
+ z = unit_attach_pid_to_cgroup_via_bus(u, p, pid->pid);
|
||||
if (z < 0)
|
||||
- log_unit_info_errno(u, z, "Couldn't move process "PID_FMT" to requested cgroup '%s' (directly or via the system bus): %m", pid->pid, empty_to_root(p));
|
||||
+ log_unit_info_errno(u, z, "Couldn't move process "PID_FMT" to requested cgroup '%s' (directly or via the system bus): %m", pid->pid, p);
|
||||
else {
|
||||
if (ret >= 0)
|
||||
ret++; /* Count successful additions */
|
||||
--
|
||||
2.43.0
|
||||
35
meta/recipes-core/systemd/systemd/CVE-2026-29111-04.patch
Normal file
35
meta/recipes-core/systemd/systemd/CVE-2026-29111-04.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
From 0d2c41d0f024088a275ac0c02d50205c800dec8a Mon Sep 17 00:00:00 2001
|
||||
From: Mike Yuan <me@yhndnzj.com>
|
||||
Date: Thu, 26 Feb 2026 11:06:34 +0100
|
||||
Subject: [PATCH 4/4] core: validate input cgroup path more prudently
|
||||
|
||||
(cherry picked from commit efa6ba2ab625aaa160ac435a09e6482fc63bdbe8)
|
||||
(cherry picked from commit 3cee294fe8cf4fa0eff933ab21416d099942cabd)
|
||||
(cherry picked from commit 1d22f706bd04f45f8422e17fbde3f56ece17758a)
|
||||
|
||||
CVE: CVE-2026-29111
|
||||
Upstream-Status: Backport [https://github.com/systemd/systemd/commit/54588d2dedff54bfb6036670820650e4ea74628f]
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
src/core/dbus-manager.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
|
||||
index c7372ca033..cb84ba9866 100644
|
||||
--- a/src/core/dbus-manager.c
|
||||
+++ b/src/core/dbus-manager.c
|
||||
@@ -646,6 +646,12 @@ static int method_get_unit_by_control_group(sd_bus_message *message, void *userd
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
+ if (!path_is_absolute(cgroup))
|
||||
+ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Control group path is not absolute: %s", cgroup);
|
||||
+
|
||||
+ if (!path_is_normalized(cgroup))
|
||||
+ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Control group path is not normalized: %s", cgroup);
|
||||
+
|
||||
u = manager_get_unit_by_cgroup(m, cgroup);
|
||||
if (!u)
|
||||
return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT,
|
||||
--
|
||||
2.43.0
|
||||
@@ -33,6 +33,10 @@ SRC_URI += " \
|
||||
file://CVE-2026-40225-02.patch \
|
||||
file://CVE-2026-40226-01.patch \
|
||||
file://CVE-2026-40226-02.patch \
|
||||
file://CVE-2026-29111-01.patch \
|
||||
file://CVE-2026-29111-02.patch \
|
||||
file://CVE-2026-29111-03.patch \
|
||||
file://CVE-2026-29111-04.patch \
|
||||
"
|
||||
|
||||
# patches needed by musl
|
||||
@@ -48,6 +48,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin
|
||||
file://CVE-2025-14104-02.patch \
|
||||
file://CVE-2026-27456.patch \
|
||||
file://CVE-2026-13595.patch \
|
||||
file://CVE-2026-3184.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "7b6605e48d1a49f43cc4b4cfc59f313d0dd5402fa40b96810bd572e167dfed0f"
|
||||
|
||||
61
meta/recipes-core/util-linux/util-linux/CVE-2026-3184.patch
Normal file
61
meta/recipes-core/util-linux/util-linux/CVE-2026-3184.patch
Normal file
@@ -0,0 +1,61 @@
|
||||
From 3fb64ddbffbc9442dca56eb6d4f263d525708b64 Mon Sep 17 00:00:00 2001
|
||||
From: Karel Zak <kzak@redhat.com>
|
||||
Date: Thu, 19 Feb 2026 12:20:28 +0100
|
||||
Subject: [PATCH] login: use original FQDN for PAM_RHOST
|
||||
|
||||
When login -h <remotehost> is invoked, init_remote_info() strips the
|
||||
local domain suffix from the hostname (FQDN to short name) before
|
||||
storing it in cxt->hostname. This truncated value is then used for
|
||||
PAM_RHOST, which can bypass pam_access host deny rules that match on
|
||||
the FQDN.
|
||||
|
||||
Preserve the original -h hostname in a new cmd_hostname field and use
|
||||
it for PAM_RHOST, while keeping the truncated hostname for utmp/wtmp
|
||||
and logging unchanged.
|
||||
|
||||
Note, the real-world impact is low -- login -h is only used by legacy
|
||||
telnet/rlogin daemons, and exploitation requires FQDN-specific
|
||||
pam_access rules on a system still using these obsolete services.
|
||||
|
||||
Reported-by: Asim Viladi Oglu Manizada <manizada@pm.me>
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
(cherry picked from commit 8b29aeb081e297e48c4c1ac53d88ae07e1331984)
|
||||
|
||||
CVE: CVE-2026-3184
|
||||
Upstream-Status: Backport [https://github.com/util-linux/util-linux/commit/8b29aeb081e297e48c4c1ac53d88ae07e1331984]
|
||||
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
login-utils/login.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/login-utils/login.c b/login-utils/login.c
|
||||
index 321f9d6ce..0c5c805aa 100644
|
||||
--- a/login-utils/login.c
|
||||
+++ b/login-utils/login.c
|
||||
@@ -128,6 +128,7 @@ struct login_context {
|
||||
char *thishost; /* this machine */
|
||||
char *thisdomain; /* this machine's domain */
|
||||
char *hostname; /* remote machine */
|
||||
+ char *cmd_hostname; /* remote machine as specified on command line */
|
||||
char hostaddress[16]; /* remote address */
|
||||
|
||||
pid_t pid;
|
||||
@@ -906,7 +907,7 @@ static pam_handle_t *init_loginpam(struct login_context *cxt)
|
||||
|
||||
/* hostname & tty are either set to NULL or their correct values,
|
||||
* depending on how much we know. */
|
||||
- rc = pam_set_item(pamh, PAM_RHOST, cxt->hostname);
|
||||
+ rc = pam_set_item(pamh, PAM_RHOST, cxt->cmd_hostname);
|
||||
if (is_pam_failure(rc))
|
||||
loginpam_err(pamh, rc);
|
||||
|
||||
@@ -1249,6 +1250,8 @@ static void init_remote_info(struct login_context *cxt, char *remotehost)
|
||||
|
||||
get_thishost(cxt, &domain);
|
||||
|
||||
+ cxt->cmd_hostname = xstrdup(remotehost);
|
||||
+
|
||||
if (domain && (p = strchr(remotehost, '.')) &&
|
||||
strcasecmp(p + 1, domain) == 0)
|
||||
*p = '\0';
|
||||
@@ -38,6 +38,9 @@ UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/"
|
||||
# to express 'divisible by 4 plus 2' in regex (that I know of), let's hardcode a few.
|
||||
UPSTREAM_CHECK_REGEX = "[^\d\.](?P<pver>((2\.2)|(2\.6)|(3\.0)|(3\.4)|(3\.8)|(4\.2))(\.\d+)+)\.tar"
|
||||
|
||||
# Not applicable: Debian vendor configuration does not enable apt-key net-update.
|
||||
CVE_STATUS[CVE-2011-3374] = "not-applicable-config: apt-key net-update is disabled by default and Debian vendor configuration has no archive keyring URI"
|
||||
|
||||
inherit cmake perlnative bash-completion useradd
|
||||
|
||||
# User is added to allow apt to drop privs, will runtime warn without
|
||||
|
||||
@@ -78,5 +78,9 @@ SRC_URI = "\
|
||||
file://CVE-2025-69652.patch \
|
||||
file://CVE-2026-6846.patch \
|
||||
file://CVE-2025-69645.patch \
|
||||
file://CVE-2025-1147.patch \
|
||||
file://CVE-2025-8224.patch \
|
||||
file://CVE-2026-15003.patch \
|
||||
file://CVE-2026-18220.patch \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
110
meta/recipes-devtools/binutils/binutils/CVE-2025-1147.patch
Normal file
110
meta/recipes-devtools/binutils/binutils/CVE-2025-1147.patch
Normal file
@@ -0,0 +1,110 @@
|
||||
From 7be4186c22f89a87fff048c28910f5d26a0f61ce Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Klochkov <dmitry.klochkov@bell-sw.com>
|
||||
Date: Tue, 9 Sep 2025 12:06:25 +0200
|
||||
Subject: [PATCH] nm: fix treating an ifunc symbol as a stab if
|
||||
'--ifunc-chars=--' is given
|
||||
|
||||
If an ifunc symbol is processed in print_symbol(), a 'type' field of a
|
||||
'syminfo' structure is set to any character specified by a user with an
|
||||
'--ifunc-chars' option. But afterwards the 'type' field is used to
|
||||
check whether a symbol is a stab in print_symbol_info_{bsd,sysv}()
|
||||
functions in order to print additional stab related data. If the 'type'
|
||||
field equals '-', a symbol is treated as a stab. If '--ifunc-chars=--'
|
||||
is given, all ifunc symbols will be treated as stab symbols and
|
||||
uninitialized stab related fields of the 'syminfo' structure will be
|
||||
printed which can lead to segmentation fault.
|
||||
|
||||
To fix this, check if a symbol is a stab before override the 'type'
|
||||
field. Also, add a test case for this fix.
|
||||
|
||||
PR binutils/32556
|
||||
* nm.c (extended_symbol_info): Add is_stab.
|
||||
(print_symbol): Check if a symbol is a stab.
|
||||
(print_symbol_info_bsd): Use info->is_stab.
|
||||
(print_symbol_info_sysv): Use info->is_stab.
|
||||
* testsuite/binutils-all/nm.exp: Test nm --ifunc-chars=--.
|
||||
|
||||
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32556
|
||||
Fixes: e6f6aa8d184 ("Add option to nm to change the characters displayed for ifunc symbols")
|
||||
Signed-off-by: Dmitry Klochkov <dmitry.klochkov@bell-sw.com>
|
||||
|
||||
CVE: CVE-2025-1147
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=7be4186c22f89a87fff048c28910f5d26a0f61ce]
|
||||
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
binutils/nm.c | 10 +++++++---
|
||||
binutils/testsuite/binutils-all/nm.exp | 17 +++++++++++++++++
|
||||
2 files changed, 24 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/binutils/nm.c b/binutils/nm.c
|
||||
index dce9207f44f..c3d118a93c3 100644
|
||||
--- a/binutils/nm.c
|
||||
+++ b/binutils/nm.c
|
||||
@@ -70,6 +70,7 @@ struct extended_symbol_info
|
||||
bfd_vma ssize;
|
||||
elf_symbol_type *elfinfo;
|
||||
coff_symbol_type *coffinfo;
|
||||
+ bool is_stab;
|
||||
/* FIXME: We should add more fields for Type, Line, Section. */
|
||||
};
|
||||
#define SYM_VALUE(sym) (sym->sinfo->value)
|
||||
@@ -1208,8 +1209,11 @@ print_symbol (bfd * abfd,
|
||||
|
||||
bfd_get_symbol_info (abfd, sym, &syminfo);
|
||||
|
||||
+ info.is_stab = false;
|
||||
+ if (syminfo.type == '-')
|
||||
+ info.is_stab = true;
|
||||
/* PR 22967 - Distinguish between local and global ifunc symbols. */
|
||||
- if (syminfo.type == 'i'
|
||||
+ else if (syminfo.type == 'i'
|
||||
&& sym->flags & BSF_GNU_INDIRECT_FUNCTION)
|
||||
{
|
||||
if (ifunc_type_chars == NULL || ifunc_type_chars[0] == 0)
|
||||
@@ -1873,7 +1877,7 @@ print_symbol_info_bsd (struct extended_symbol_info *info, bfd *abfd)
|
||||
|
||||
printf (" %c", SYM_TYPE (info));
|
||||
|
||||
- if (SYM_TYPE (info) == '-')
|
||||
+ if (info->is_stab)
|
||||
{
|
||||
/* A stab. */
|
||||
printf (" ");
|
||||
@@ -1902,7 +1906,7 @@ print_symbol_info_sysv (struct extended_symbol_info *info, bfd *abfd)
|
||||
|
||||
printf ("| %c |", SYM_TYPE (info));
|
||||
|
||||
- if (SYM_TYPE (info) == '-')
|
||||
+ if (info->is_stab)
|
||||
{
|
||||
/* A stab. */
|
||||
printf ("%18s| ", SYM_STAB_NAME (info)); /* (C) Type. */
|
||||
diff --git a/binutils/testsuite/binutils-all/nm.exp b/binutils/testsuite/binutils-all/nm.exp
|
||||
index fea68bf76bc..1feb8578fba 100644
|
||||
--- a/binutils/testsuite/binutils-all/nm.exp
|
||||
+++ b/binutils/testsuite/binutils-all/nm.exp
|
||||
@@ -329,6 +329,23 @@ if [is_elf_format] {
|
||||
fail "$testname (local ifunc)"
|
||||
}
|
||||
|
||||
+ # PR 32556
|
||||
+ # Test nm --ifunc-chars=--
|
||||
+
|
||||
+ set got [binutils_run $NM "$NMFLAGS --ifunc-chars=-- $tmpfile"]
|
||||
+
|
||||
+ if [regexp -line "^\\S+ - global_foo$" $got] then {
|
||||
+ pass "$testname=-- (global ifunc)"
|
||||
+ } else {
|
||||
+ fail "$testname=-- (global ifunc)"
|
||||
+ }
|
||||
+
|
||||
+ if [regexp -line "^\\S+ - local_foo$" $got] then {
|
||||
+ pass "$testname=-- (local ifunc)"
|
||||
+ } else {
|
||||
+ fail "$testname=-- (local ifunc)"
|
||||
+ }
|
||||
+
|
||||
if { $verbose < 1 } {
|
||||
remote_file host delete "tmpdir/ifunc.o"
|
||||
}
|
||||
54
meta/recipes-devtools/binutils/binutils/CVE-2025-8224.patch
Normal file
54
meta/recipes-devtools/binutils/binutils/CVE-2025-8224.patch
Normal file
@@ -0,0 +1,54 @@
|
||||
From db856d41004301b3a56438efd957ef5cabb91530 Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Sun, 25 Aug 2024 15:20:21 +0930
|
||||
Subject: [PATCH] PR32109, aborting at bfd/bfd.c:1236 in int _bfd_doprnt
|
||||
|
||||
Since bfd_section for .strtab isn't set, print the section index
|
||||
instead. Also, don't return NULL on this error as that results in
|
||||
multiple mmap/read of the string table. (We could return NULL if we
|
||||
arranged to set sh_size zero first, but just what we do with fuzzed
|
||||
object files is of no concern, and terminating the table might make a
|
||||
faulty object file usable.)
|
||||
|
||||
PR 32109
|
||||
* elf.c (bfd_elf_get_str_section): Remove outdated comment, and
|
||||
tweak shstrtabsize test to suit. Don't use string tab bfd_section
|
||||
in error message, use index instead. Don't return NULL on
|
||||
unterminated string section, terminate it.
|
||||
(_bfd_elf_get_dynamic_symbols): Similarly terminate string table
|
||||
section.
|
||||
|
||||
[Backport note: Adapted for binutils 2.42. The upstream commit targets
|
||||
a newer codebase that uses _bfd_mmap_readonly_persistent and has an
|
||||
explicit unterminated-string error path with return NULL. In 2.42 the
|
||||
code uses _bfd_alloc_and_read with shstrtabsize+1 allocation and
|
||||
unconditionally null-terminates via shstrtab[shstrtabsize] = '\0'.
|
||||
Only the shstrtabsize overflow check fix applies here (shstrtabsize + 1 <= 1
|
||||
changed to shstrtabsize == 0). The second upstream hunk (DT_STRTAB
|
||||
error_return -> terminate) does not apply as 2.42 already
|
||||
unconditionally null-terminates the dynamic string table.]
|
||||
|
||||
CVE: CVE-2025-8224
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=db856d41004301b3a56438efd957ef5cabb91530]
|
||||
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
bfd/elf.c | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf.c b/bfd/elf.c
|
||||
--- a/bfd/elf.c
|
||||
+++ b/bfd/elf.c
|
||||
@@ -285,9 +285,7 @@ bfd_elf_get_str_section (bfd *abfd, unsigned int shindex)
|
||||
offset = i_shdrp[shindex]->sh_offset;
|
||||
shstrtabsize = i_shdrp[shindex]->sh_size;
|
||||
|
||||
- /* Allocate and clear an extra byte at the end, to prevent crashes
|
||||
- in case the string table is not terminated. */
|
||||
- if (shstrtabsize + 1 <= 1
|
||||
+ if (shstrtabsize == 0
|
||||
|| bfd_seek (abfd, offset, SEEK_SET) != 0
|
||||
|| (shstrtab = _bfd_alloc_and_read (abfd, shstrtabsize + 1,
|
||||
shstrtabsize)) == NULL)
|
||||
--
|
||||
2.43.7
|
||||
400
meta/recipes-devtools/binutils/binutils/CVE-2026-15003.patch
Normal file
400
meta/recipes-devtools/binutils/binutils/CVE-2026-15003.patch
Normal file
@@ -0,0 +1,400 @@
|
||||
From 23acf2f003f81b2f8d9d1997ea45d822d33d386c Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Thu, 9 Apr 2026 09:06:27 +0930
|
||||
Subject: [PATCH] PR 34053 buffer overflow in xcoff_link_add_symbols
|
||||
|
||||
This patch adds two sanity checks with error reporting in
|
||||
xcoff_link_add_symbols before reading symbol aux entries, add extends
|
||||
assertions in later functions. A whole lot of unnecessary casts are
|
||||
also tidied.
|
||||
|
||||
PR 34053
|
||||
* xcofflink.c: Remove unnecessary casts throughout.
|
||||
(xcoff_link_add_symbols): Sanity check aux entries are within
|
||||
symbol buffer.
|
||||
(bfd_xcoff_build_dynamic_sections): Assert the above is true.
|
||||
(xcoff_link_input_bfd): Likewise.
|
||||
|
||||
CVE: CVE-2026-15003
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=23acf2f003f81b2f8d9d1997ea45d822d33d386c]
|
||||
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
bfd/xcofflink.c | 132 +++++++++++++++++++++++-------------------------
|
||||
1 file changed, 62 insertions(+), 70 deletions(-)
|
||||
|
||||
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
|
||||
index 7f1c0df760f..cf3b33e7202 100644
|
||||
--- a/bfd/xcofflink.c
|
||||
+++ b/bfd/xcofflink.c
|
||||
@@ -371,7 +371,7 @@ _bfd_xcoff_canonicalize_dynamic_symtab (bfd *abfd, asymbol **psyms)
|
||||
{
|
||||
char *c;
|
||||
|
||||
- c = bfd_alloc (abfd, (bfd_size_type) SYMNMLEN + 1);
|
||||
+ c = bfd_alloc (abfd, SYMNMLEN + 1);
|
||||
if (c == NULL)
|
||||
return -1;
|
||||
memcpy (c, ldsym._l._l_name, SYMNMLEN);
|
||||
@@ -1038,7 +1038,7 @@ xcoff_link_add_dynamic_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
{
|
||||
char *dsnm;
|
||||
|
||||
- dsnm = bfd_malloc ((bfd_size_type) strlen (name) + 2);
|
||||
+ dsnm = bfd_malloc (strlen (name) + 2);
|
||||
if (dsnm == NULL)
|
||||
return false;
|
||||
dsnm[0] = '.';
|
||||
@@ -1081,7 +1081,7 @@ xcoff_link_add_dynamic_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
coff_section_data (abfd, lsec)->contents = NULL;
|
||||
|
||||
/* Record this file in the import files. */
|
||||
- n = bfd_alloc (abfd, (bfd_size_type) sizeof (struct xcoff_import_file));
|
||||
+ n = bfd_alloc (abfd, sizeof (*n));
|
||||
if (n == NULL)
|
||||
return false;
|
||||
n->next = NULL;
|
||||
@@ -1477,7 +1477,7 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
bfd_vma value;
|
||||
struct xcoff_link_hash_entry *set_toc;
|
||||
|
||||
- bfd_coff_swap_sym_in (abfd, (void *) esym, (void *) &sym);
|
||||
+ bfd_coff_swap_sym_in (abfd, esym, &sym);
|
||||
|
||||
/* In this pass we are only interested in symbols with csect
|
||||
information. */
|
||||
@@ -1523,9 +1523,12 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
{
|
||||
union internal_auxent auxlin;
|
||||
|
||||
- bfd_coff_swap_aux_in (abfd, (void *) (esym + symesz),
|
||||
+ if (symesz >= (size_t) (esym_end - esym))
|
||||
+ goto badaux;
|
||||
+
|
||||
+ bfd_coff_swap_aux_in (abfd, esym + symesz,
|
||||
sym.n_type, sym.n_sclass,
|
||||
- 0, sym.n_numaux, (void *) &auxlin);
|
||||
+ 0, sym.n_numaux, &auxlin);
|
||||
|
||||
if (auxlin.x_sym.x_fcnary.x_fcn.x_lnnoptr != 0)
|
||||
{
|
||||
@@ -1552,7 +1555,7 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
|
||||
linpstart = (reloc_info[enclosing->target_index].linenos
|
||||
+ linoff);
|
||||
- bfd_coff_swap_lineno_in (abfd, (void *) linpstart, (void *) &lin);
|
||||
+ bfd_coff_swap_lineno_in (abfd, linpstart, &lin);
|
||||
if (lin.l_lnno == 0
|
||||
&& ((bfd_size_type) lin.l_addr.l_symndx
|
||||
== ((esym
|
||||
@@ -1567,8 +1570,7 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
linp < linpend;
|
||||
linp += linesz)
|
||||
{
|
||||
- bfd_coff_swap_lineno_in (abfd, (void *) linp,
|
||||
- (void *) &lin);
|
||||
+ bfd_coff_swap_lineno_in (abfd, linp, &lin);
|
||||
if (lin.l_lnno == 0)
|
||||
break;
|
||||
}
|
||||
@@ -1589,21 +1591,21 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
visibility = sym.n_type & SYM_V_MASK;
|
||||
|
||||
/* Pick up the csect auxiliary information. */
|
||||
- if (sym.n_numaux == 0)
|
||||
+ if (sym.n_numaux < 1
|
||||
+ || sym.n_numaux * symesz >= (size_t) (esym_end - esym))
|
||||
{
|
||||
+ badaux:
|
||||
_bfd_error_handler
|
||||
/* xgettext:c-format */
|
||||
- (_("%pB: class %d symbol `%s' has no aux entries"),
|
||||
+ (_("%pB: class %d symbol '%s' has missing aux entries"),
|
||||
abfd, sym.n_sclass, name);
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
- bfd_coff_swap_aux_in (abfd,
|
||||
- (void *) (esym + symesz * sym.n_numaux),
|
||||
+ bfd_coff_swap_aux_in (abfd, esym + symesz * sym.n_numaux,
|
||||
sym.n_type, sym.n_sclass,
|
||||
- sym.n_numaux - 1, sym.n_numaux,
|
||||
- (void *) &aux);
|
||||
+ sym.n_numaux - 1, sym.n_numaux, &aux);
|
||||
|
||||
smtyp = SMTYP_SMTYP (aux.x_csect.x_smtyp);
|
||||
|
||||
@@ -1726,7 +1728,7 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
|
||||
erelsym = ((bfd_byte *) obj_coff_external_syms (abfd)
|
||||
+ rel->r_symndx * symesz);
|
||||
- bfd_coff_swap_sym_in (abfd, (void *) erelsym, (void *) &relsym);
|
||||
+ bfd_coff_swap_sym_in (abfd, erelsym, &relsym);
|
||||
if (EXTERN_SYM_P (relsym.n_sclass))
|
||||
{
|
||||
const char *relname;
|
||||
@@ -2507,7 +2509,7 @@ xcoff_link_check_ar_symbols (bfd *abfd,
|
||||
{
|
||||
struct internal_syment sym;
|
||||
|
||||
- bfd_coff_swap_sym_in (abfd, (void *) esym, (void *) &sym);
|
||||
+ bfd_coff_swap_sym_in (abfd, esym, &sym);
|
||||
esym += (sym.n_numaux + 1) * symesz;
|
||||
|
||||
if (EXTERN_SYM_P (sym.n_sclass) && sym.n_scnum != N_UNDEF)
|
||||
@@ -4005,7 +4007,7 @@ bfd_xcoff_size_dynamic_sections (bfd *output_bfd,
|
||||
return true;
|
||||
|
||||
xcoff_link_hash_traverse (xcoff_hash_table (info), xcoff_post_gc_symbol,
|
||||
- (void *) ldinfo);
|
||||
+ ldinfo);
|
||||
if (ldinfo->failed)
|
||||
goto error_return;
|
||||
|
||||
@@ -4216,7 +4218,8 @@ bfd_xcoff_build_dynamic_sections (bfd *output_bfd,
|
||||
/* Read in the csect information, if any. */
|
||||
if (CSECT_SYM_P (sym.n_sclass))
|
||||
{
|
||||
- BFD_ASSERT (sym.n_numaux > 0);
|
||||
+ BFD_ASSERT (sym.n_numaux > 0
|
||||
+ && symesz * sym.n_numaux < (size_t) (esymend - esym));
|
||||
bfd_coff_swap_aux_in (sub, esym + symesz * sym.n_numaux,
|
||||
sym.n_type, sym.n_sclass,
|
||||
sym.n_numaux - 1, sym.n_numaux, &aux);
|
||||
@@ -4307,7 +4310,7 @@ bfd_xcoff_link_generate_rtinit (bfd *abfd,
|
||||
{
|
||||
struct bfd_in_memory *bim;
|
||||
|
||||
- bim = bfd_malloc ((bfd_size_type) sizeof (* bim));
|
||||
+ bim = bfd_malloc (sizeof (*bim));
|
||||
if (bim == NULL)
|
||||
return false;
|
||||
|
||||
@@ -4316,7 +4319,7 @@ bfd_xcoff_link_generate_rtinit (bfd *abfd,
|
||||
|
||||
abfd->link.next = 0;
|
||||
abfd->format = bfd_object;
|
||||
- abfd->iostream = (void *) bim;
|
||||
+ abfd->iostream = bim;
|
||||
abfd->flags = BFD_IN_MEMORY;
|
||||
abfd->iovec = &_bfd_memory_iovec;
|
||||
abfd->direction = write_direction;
|
||||
@@ -4876,8 +4879,8 @@ bfd_xcoff_size_stubs (struct bfd_link_info *info)
|
||||
}
|
||||
|
||||
bfd_coff_swap_sym_in (input_bfd,
|
||||
- (void *) esyms + irel->r_symndx * symesz,
|
||||
- (void *) &sym);
|
||||
+ esyms + irel->r_symndx * symesz,
|
||||
+ &sym);
|
||||
|
||||
sym_sec = xcoff_data (input_bfd)->csects[irel->r_symndx];
|
||||
sym_value = sym.n_value - sym_sec->vma;
|
||||
@@ -5250,17 +5253,16 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo,
|
||||
int smtyp = 0;
|
||||
int add;
|
||||
|
||||
- bfd_coff_swap_sym_in (input_bfd, (void *) esym, (void *) isymp);
|
||||
+ bfd_coff_swap_sym_in (input_bfd, esym, isymp);
|
||||
|
||||
/* Read in the csect information, if any. */
|
||||
if (CSECT_SYM_P (isymp->n_sclass))
|
||||
{
|
||||
- BFD_ASSERT (isymp->n_numaux > 0);
|
||||
- bfd_coff_swap_aux_in (input_bfd,
|
||||
- (void *) (esym + isymesz * isymp->n_numaux),
|
||||
+ BFD_ASSERT (isymp->n_numaux > 0
|
||||
+ && isymesz * isymp->n_numaux < (size_t) (esym_end - esym));
|
||||
+ bfd_coff_swap_aux_in (input_bfd, esym + isymesz * isymp->n_numaux,
|
||||
isymp->n_type, isymp->n_sclass,
|
||||
- isymp->n_numaux - 1, isymp->n_numaux,
|
||||
- (void *) &aux);
|
||||
+ isymp->n_numaux - 1, isymp->n_numaux, &aux);
|
||||
|
||||
smtyp = SMTYP_SMTYP (aux.x_csect.x_smtyp);
|
||||
}
|
||||
@@ -5475,12 +5477,10 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo,
|
||||
if ((bfd_size_type) flinfo->last_file_index >= syment_base)
|
||||
{
|
||||
/* The last C_FILE symbol is in this input file. */
|
||||
- bfd_coff_swap_sym_out (output_bfd,
|
||||
- (void *) &flinfo->last_file,
|
||||
- (void *) (flinfo->outsyms
|
||||
- + ((flinfo->last_file_index
|
||||
- - syment_base)
|
||||
- * osymesz)));
|
||||
+ bfd_coff_swap_sym_out
|
||||
+ (output_bfd, &flinfo->last_file,
|
||||
+ flinfo->outsyms + (flinfo->last_file_index
|
||||
+ - syment_base) * osymesz);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5489,9 +5489,8 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo,
|
||||
borrow *outsym temporarily. */
|
||||
file_ptr pos;
|
||||
|
||||
- bfd_coff_swap_sym_out (output_bfd,
|
||||
- (void *) &flinfo->last_file,
|
||||
- (void *) outsym);
|
||||
+ bfd_coff_swap_sym_out (output_bfd, &flinfo->last_file,
|
||||
+ outsym);
|
||||
|
||||
pos = obj_sym_filepos (output_bfd);
|
||||
pos += flinfo->last_file_index * osymesz;
|
||||
@@ -5557,7 +5556,7 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo,
|
||||
}
|
||||
|
||||
/* Output the symbol. */
|
||||
- bfd_coff_swap_sym_out (output_bfd, (void *) &isym, (void *) outsym);
|
||||
+ bfd_coff_swap_sym_out (output_bfd, &isym, outsym);
|
||||
|
||||
esym += isymesz;
|
||||
outsym += osymesz;
|
||||
@@ -5566,9 +5565,9 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo,
|
||||
{
|
||||
union internal_auxent aux;
|
||||
|
||||
- bfd_coff_swap_aux_in (input_bfd, (void *) esym, isymp->n_type,
|
||||
- isymp->n_sclass, i, isymp->n_numaux,
|
||||
- (void *) &aux);
|
||||
+ bfd_coff_swap_aux_in (input_bfd, esym,
|
||||
+ isymp->n_type, isymp->n_sclass, i,
|
||||
+ isymp->n_numaux, &aux);
|
||||
|
||||
if (isymp->n_sclass == C_FILE)
|
||||
{
|
||||
@@ -5796,9 +5795,9 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo,
|
||||
}
|
||||
}
|
||||
|
||||
- bfd_coff_swap_aux_out (output_bfd, (void *) &aux, isymp->n_type,
|
||||
+ bfd_coff_swap_aux_out (output_bfd, &aux, isymp->n_type,
|
||||
isymp->n_sclass, i, isymp->n_numaux,
|
||||
- (void *) outsym);
|
||||
+ outsym);
|
||||
outsym += osymesz;
|
||||
esym += isymesz;
|
||||
}
|
||||
@@ -5820,10 +5819,9 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo,
|
||||
&& (bfd_size_type) flinfo->last_file_index >= syment_base)
|
||||
{
|
||||
flinfo->last_file.n_value = output_index;
|
||||
- bfd_coff_swap_sym_out (output_bfd, (void *) &flinfo->last_file,
|
||||
- (void *) (flinfo->outsyms
|
||||
- + ((flinfo->last_file_index - syment_base)
|
||||
- * osymesz)));
|
||||
+ bfd_coff_swap_sym_out (output_bfd, &flinfo->last_file,
|
||||
+ flinfo->outsyms + (flinfo->last_file_index
|
||||
+ - syment_base) * osymesz);
|
||||
}
|
||||
|
||||
/* Write the modified symbols to the output file. */
|
||||
@@ -6036,16 +6034,13 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo,
|
||||
void * auxptr;
|
||||
union internal_auxent aux;
|
||||
|
||||
- auxptr = ((void *)
|
||||
- (((bfd_byte *)
|
||||
- obj_coff_external_syms (input_bfd))
|
||||
- + ((r_symndx + is->n_numaux)
|
||||
- * isymesz)));
|
||||
+ auxptr = ((bfd_byte *)
|
||||
+ obj_coff_external_syms (input_bfd)
|
||||
+ + (r_symndx + is->n_numaux) * isymesz);
|
||||
bfd_coff_swap_aux_in (input_bfd, auxptr,
|
||||
is->n_type, is->n_sclass,
|
||||
is->n_numaux - 1,
|
||||
- is->n_numaux,
|
||||
- (void *) &aux);
|
||||
+ is->n_numaux, &aux);
|
||||
if (SMTYP_SMTYP (aux.x_csect.x_smtyp) == XTY_SD
|
||||
&& aux.x_csect.x_smclas == XMC_TC0)
|
||||
indx = flinfo->toc_symindx;
|
||||
@@ -6564,12 +6559,12 @@ xcoff_write_global_symbol (struct bfd_hash_entry *bh, void * inf)
|
||||
irsym.n_type = T_NULL;
|
||||
irsym.n_numaux = 1;
|
||||
|
||||
- bfd_coff_swap_sym_out (output_bfd, (void *) &irsym, (void *) outsym);
|
||||
+ bfd_coff_swap_sym_out (output_bfd, &irsym, outsym);
|
||||
outsym += bfd_coff_symesz (output_bfd);
|
||||
|
||||
/* Note : iraux is initialized above. */
|
||||
- bfd_coff_swap_aux_out (output_bfd, (void *) &iraux, T_NULL, C_HIDEXT,
|
||||
- 0, 1, (void *) outsym);
|
||||
+ bfd_coff_swap_aux_out (output_bfd, &iraux, T_NULL, C_HIDEXT,
|
||||
+ 0, 1, outsym);
|
||||
outsym += bfd_coff_auxesz (output_bfd);
|
||||
|
||||
if (h->indx >= 0)
|
||||
@@ -6807,12 +6802,11 @@ xcoff_write_global_symbol (struct bfd_hash_entry *bh, void * inf)
|
||||
isym.n_type = T_NULL;
|
||||
isym.n_numaux = 1;
|
||||
|
||||
- bfd_coff_swap_sym_out (output_bfd, (void *) &isym, (void *) outsym);
|
||||
+ bfd_coff_swap_sym_out (output_bfd, &isym, outsym);
|
||||
outsym += bfd_coff_symesz (output_bfd);
|
||||
|
||||
aux.x_csect.x_smclas = h->smclas;
|
||||
- bfd_coff_swap_aux_out (output_bfd, (void *) &aux, T_NULL, isym.n_sclass, 0, 1,
|
||||
- (void *) outsym);
|
||||
+ bfd_coff_swap_aux_out (output_bfd, &aux, T_NULL, isym.n_sclass, 0, 1, outsym);
|
||||
outsym += bfd_coff_auxesz (output_bfd);
|
||||
|
||||
if ((h->root.type == bfd_link_hash_defined
|
||||
@@ -6827,13 +6821,12 @@ xcoff_write_global_symbol (struct bfd_hash_entry *bh, void * inf)
|
||||
isym.n_sclass = C_WEAKEXT;
|
||||
else
|
||||
isym.n_sclass = C_EXT;
|
||||
- bfd_coff_swap_sym_out (output_bfd, (void *) &isym, (void *) outsym);
|
||||
+ bfd_coff_swap_sym_out (output_bfd, &isym, outsym);
|
||||
outsym += bfd_coff_symesz (output_bfd);
|
||||
|
||||
aux.x_csect.x_smtyp = XTY_LD;
|
||||
aux.x_csect.x_scnlen.u64 = obj_raw_syment_count (output_bfd);
|
||||
- bfd_coff_swap_aux_out (output_bfd, (void *) &aux, T_NULL, C_EXT, 0, 1,
|
||||
- (void *) outsym);
|
||||
+ bfd_coff_swap_aux_out (output_bfd, &aux, T_NULL, C_EXT, 0, 1, outsym);
|
||||
outsym += bfd_coff_auxesz (output_bfd);
|
||||
}
|
||||
|
||||
@@ -6929,8 +6922,8 @@ xcoff_reloc_link_order (bfd *output_bfd,
|
||||
howto->name, addend, NULL, NULL, (bfd_vma) 0);
|
||||
break;
|
||||
}
|
||||
- ok = bfd_set_section_contents (output_bfd, output_section, (void *) buf,
|
||||
- (file_ptr) link_order->offset, size);
|
||||
+ ok = bfd_set_section_contents (output_bfd, output_section, buf,
|
||||
+ link_order->offset, size);
|
||||
free (buf);
|
||||
if (! ok)
|
||||
return false;
|
||||
@@ -7395,8 +7388,7 @@ _bfd_xcoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
|
||||
if (flinfo.last_file_index != -1)
|
||||
{
|
||||
flinfo.last_file.n_value = -(bfd_vma) 1;
|
||||
- bfd_coff_swap_sym_out (abfd, (void *) &flinfo.last_file,
|
||||
- (void *) flinfo.outsyms);
|
||||
+ bfd_coff_swap_sym_out (abfd, &flinfo.last_file, flinfo.outsyms);
|
||||
pos = obj_sym_filepos (abfd) + flinfo.last_file_index * symesz;
|
||||
if (bfd_seek (abfd, pos, SEEK_SET) != 0
|
||||
|| bfd_write (flinfo.outsyms, symesz, abfd) != symesz)
|
||||
@@ -7480,7 +7472,7 @@ _bfd_xcoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
|
||||
appear in the symbol table, which is not necessarily by
|
||||
address. So we sort them here. There may be a better way to
|
||||
do this. */
|
||||
- qsort ((void *) flinfo.section_info[o->target_index].relocs,
|
||||
+ qsort (flinfo.section_info[o->target_index].relocs,
|
||||
o->reloc_count, sizeof (struct internal_reloc),
|
||||
xcoff_sort_relocs);
|
||||
|
||||
@@ -7488,7 +7480,7 @@ _bfd_xcoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
|
||||
irelend = irel + o->reloc_count;
|
||||
erel = external_relocs;
|
||||
for (; irel < irelend; irel++, rel_hash++, erel += relsz)
|
||||
- bfd_coff_swap_reloc_out (abfd, (void *) irel, (void *) erel);
|
||||
+ bfd_coff_swap_reloc_out (abfd, irel, erel);
|
||||
|
||||
rel_size = relsz * o->reloc_count;
|
||||
if (bfd_seek (abfd, o->rel_filepos, SEEK_SET) != 0
|
||||
65
meta/recipes-devtools/binutils/binutils/CVE-2026-18220.patch
Normal file
65
meta/recipes-devtools/binutils/binutils/CVE-2026-18220.patch
Normal file
@@ -0,0 +1,65 @@
|
||||
From 114e3aae2b7e34057c8909301eaf78c15687e8e5 Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Sun, 28 Jun 2026 09:11:46 +0930
|
||||
Subject: [PATCH] asan: buffer overflow in elf32_dlx_relocate26
|
||||
|
||||
* elf32-dlx.c (elf32_dlx_relocate26): Sanity check reloc offset.
|
||||
(elf32_dlx_relocate16): Likewise.
|
||||
(_bfd_dlx_elf_hi16_reloc): Likewise, and remove ineffective
|
||||
existing check.
|
||||
|
||||
CVE: CVE-2026-18220
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=114e3aae2b7e34057c8909301eaf78c15687e8e5]
|
||||
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
bfd/elf32-dlx.c | 15 ++++++++++++---
|
||||
1 file changed, 12 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf32-dlx.c b/bfd/elf32-dlx.c
|
||||
index 2dfeb4d7390..0f9a49695d7 100644
|
||||
--- a/bfd/elf32-dlx.c
|
||||
+++ b/bfd/elf32-dlx.c
|
||||
@@ -77,6 +77,10 @@ _bfd_dlx_elf_hi16_reloc (bfd *abfd,
|
||||
return bfd_reloc_ok;
|
||||
}
|
||||
|
||||
+ if (!bfd_reloc_offset_in_range (reloc_entry->howto, abfd,
|
||||
+ input_section, reloc_entry->address))
|
||||
+ return bfd_reloc_outofrange;
|
||||
+
|
||||
ret = bfd_reloc_ok;
|
||||
|
||||
if (bfd_is_und_section (symbol->section)
|
||||
@@ -89,9 +93,6 @@ _bfd_dlx_elf_hi16_reloc (bfd *abfd,
|
||||
relocation += reloc_entry->addend;
|
||||
relocation += bfd_get_16 (abfd, (bfd_byte *)data + reloc_entry->address);
|
||||
|
||||
- if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
|
||||
- return bfd_reloc_outofrange;
|
||||
-
|
||||
bfd_put_16 (abfd, (short)((relocation >> 16) & 0xFFFF),
|
||||
(bfd_byte *)data + reloc_entry->address);
|
||||
|
||||
@@ -143,6 +144,10 @@ elf32_dlx_relocate16 (bfd *abfd,
|
||||
return bfd_reloc_undefined;
|
||||
}
|
||||
|
||||
+ if (!bfd_reloc_offset_in_range (reloc_entry->howto, abfd,
|
||||
+ input_section, reloc_entry->address))
|
||||
+ return bfd_reloc_outofrange;
|
||||
+
|
||||
insn = bfd_get_32 (abfd, (bfd_byte *)data + reloc_entry->address);
|
||||
allignment = 1 << (input_section->output_section->alignment_power - 1);
|
||||
vallo = insn & 0x0000FFFF;
|
||||
@@ -206,6 +211,10 @@ elf32_dlx_relocate26 (bfd *abfd,
|
||||
return bfd_reloc_undefined;
|
||||
}
|
||||
|
||||
+ if (!bfd_reloc_offset_in_range (reloc_entry->howto, abfd,
|
||||
+ input_section, reloc_entry->address))
|
||||
+ return bfd_reloc_outofrange;
|
||||
+
|
||||
insn = bfd_get_32 (abfd, (bfd_byte *)data + reloc_entry->address);
|
||||
allignment = 1 << (input_section->output_section->alignment_power - 1);
|
||||
vallo = insn & 0x03FFFFFF;
|
||||
56
meta/recipes-devtools/bison/bison/CVE-2026-56389.patch
Normal file
56
meta/recipes-devtools/bison/bison/CVE-2026-56389.patch
Normal file
@@ -0,0 +1,56 @@
|
||||
From 3169c1e7a2c6acc4c59dfcf8b089896d6881925b Mon Sep 17 00:00:00 2001
|
||||
From: Paul Eggert <eggert@cs.ucla.edu>
|
||||
Date: Thu, 23 Apr 2026 09:20:43 -0700
|
||||
Subject: [PATCH] html: use xsltproc from PATH
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
* src/print-xml.c (print_html):
|
||||
* src/reader.c (prepare_percent_define_front_end_variables):
|
||||
Drop undocumented support for lines like ‘%define tool.xsltproc
|
||||
"whatever"’, as this can cause more trouble than it cures.
|
||||
|
||||
CVE: CVE-2026-56389
|
||||
Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/bison.git/commit/?id=3169c1e7a2c6acc4c59dfcf8b089896d6881925b]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
src/print-xml.c | 4 +---
|
||||
src/reader.c | 1 -
|
||||
2 files changed, 1 insertion(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/print-xml.c b/src/print-xml.c
|
||||
index 8da6da0d..79bfa88d 100644
|
||||
--- a/src/print-xml.c
|
||||
+++ b/src/print-xml.c
|
||||
@@ -543,10 +543,9 @@ print_html (void)
|
||||
assert (xml_flag);
|
||||
|
||||
char *xml2html = xpath_join (pkgdatadir (), "xslt/xml2xhtml.xsl");
|
||||
- char *xsltproc = muscle_percent_define_get ("tool.xsltproc");
|
||||
char const *argv[11];
|
||||
int i = 0;
|
||||
- argv[i++] = xsltproc;
|
||||
+ argv[i++] = "xsltproc";
|
||||
argv[i++] = "-o";
|
||||
argv[i++] = spec_html_file;
|
||||
argv[i++] = xml2html;
|
||||
@@ -572,6 +571,5 @@ print_html (void)
|
||||
/* termsigp */ NULL);
|
||||
if (status)
|
||||
complain (NULL, complaint, _("%s failed with status %d"), argv[0], status);
|
||||
- free (xsltproc);
|
||||
free (xml2html);
|
||||
}
|
||||
diff --git a/src/reader.c b/src/reader.c
|
||||
index 862d7293..cb2a7f69 100644
|
||||
--- a/src/reader.c
|
||||
+++ b/src/reader.c
|
||||
@@ -788,7 +788,6 @@ prepare_percent_define_front_end_variables (void)
|
||||
muscle_percent_define_default ("lr.default-reduction", "accepting");
|
||||
free (lr_type);
|
||||
}
|
||||
- muscle_percent_define_default ("tool.xsltproc", "xsltproc");
|
||||
|
||||
/* Check %define front-end variables. */
|
||||
{
|
||||
@@ -12,6 +12,7 @@ DEPENDS = "bison-native flex-native"
|
||||
SRC_URI = "${GNU_MIRROR}/bison/bison-${PV}.tar.xz \
|
||||
file://autoconf-2.73.patch \
|
||||
file://add-with-bisonlocaledir.patch \
|
||||
file://CVE-2026-56389.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "9bba0214ccf7f1079c5d59210045227bcf619519840ebfa80cd3849cff5a5bf2"
|
||||
|
||||
|
||||
75
meta/recipes-devtools/patch/patch/CVE-2026-56288.patch
Normal file
75
meta/recipes-devtools/patch/patch/CVE-2026-56288.patch
Normal file
@@ -0,0 +1,75 @@
|
||||
From f98fd4b5f696d1fcc9d86f81555370cf4b21150f Mon Sep 17 00:00:00 2001
|
||||
From: Paul Eggert <eggert@cs.ucla.edu>
|
||||
Date: Tue, 21 Apr 2026 10:05:02 -0700
|
||||
Subject: [PATCH] Avoid null pointer derefence with bad hunks
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Problem reported by Michał Majchrowicz.
|
||||
* src/pch.c (another_hunk): Keep chars_read positive
|
||||
even with malformed hunks.
|
||||
|
||||
CVE: CVE-2026-56288
|
||||
Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/patch.git/commit/?id=e6d6a4e021660679d7fc9150f981d4920f722313]
|
||||
|
||||
(cherry picked from commit e6d6a4e021660679d7fc9150f981d4920f722313)
|
||||
Signed-off-by: Hetvi Thakar <hthakar@cisco.com>
|
||||
---
|
||||
src/pch.c | 15 ++++++++++-----
|
||||
1 file changed, 10 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/pch.c b/src/pch.c
|
||||
index 6f9f36f..0a31f72 100644
|
||||
--- a/src/pch.c
|
||||
+++ b/src/pch.c
|
||||
@@ -1728,7 +1728,8 @@ another_hunk (enum diff difftype, bool rev)
|
||||
p_end = filldst-1;
|
||||
malformed ();
|
||||
}
|
||||
- chars_read -= fillsrc == p_ptrn_lines && incomplete_line ();
|
||||
+ chars_read -= (1 < chars_read && fillsrc == p_ptrn_lines
|
||||
+ && incomplete_line ());
|
||||
p_Char[fillsrc] = ch;
|
||||
p_line[fillsrc] = s;
|
||||
p_len[fillsrc++] = chars_read;
|
||||
@@ -1745,7 +1746,8 @@ another_hunk (enum diff difftype, bool rev)
|
||||
malformed ();
|
||||
}
|
||||
context++;
|
||||
- chars_read -= fillsrc == p_ptrn_lines && incomplete_line ();
|
||||
+ chars_read -= (1 < chars_read && fillsrc == p_ptrn_lines
|
||||
+ && incomplete_line ());
|
||||
p_Char[fillsrc] = ch;
|
||||
p_line[fillsrc] = s;
|
||||
p_len[fillsrc++] = chars_read;
|
||||
@@ -1765,7 +1767,8 @@ another_hunk (enum diff difftype, bool rev)
|
||||
p_end = fillsrc-1;
|
||||
malformed ();
|
||||
}
|
||||
- chars_read -= filldst == p_end && incomplete_line ();
|
||||
+ chars_read -= (1 < chars_read && filldst == p_end
|
||||
+ && incomplete_line ());
|
||||
p_Char[filldst] = ch;
|
||||
p_line[filldst] = s;
|
||||
p_len[filldst++] = chars_read;
|
||||
@@ -1852,7 +1855,8 @@ another_hunk (enum diff difftype, bool rev)
|
||||
if (buf[0] != '<' || (buf[1] != ' ' && buf[1] != '\t'))
|
||||
fatal ("'<' followed by space or tab expected at line %s of patch",
|
||||
format_linenum (numbuf0, p_input_line));
|
||||
- chars_read -= 2 + (i == p_ptrn_lines && incomplete_line ());
|
||||
+ chars_read -= 2 + (3 < chars_read && i == p_ptrn_lines
|
||||
+ && incomplete_line ());
|
||||
p_len[i] = chars_read;
|
||||
p_line[i] = savebuf (buf + 2, chars_read);
|
||||
if (chars_read && ! p_line[i]) {
|
||||
@@ -1897,7 +1901,8 @@ another_hunk (enum diff difftype, bool rev)
|
||||
if (buf[0] != '>' || (buf[1] != ' ' && buf[1] != '\t'))
|
||||
fatal ("'>' followed by space or tab expected at line %s of patch",
|
||||
format_linenum (numbuf0, p_input_line));
|
||||
- chars_read -= 2 + (i == p_end && incomplete_line ());
|
||||
+ chars_read -= 2 + (3 < chars_read && i == p_end
|
||||
+ && incomplete_line ());
|
||||
p_len[i] = chars_read;
|
||||
p_line[i] = savebuf (buf + 2, chars_read);
|
||||
if (chars_read && ! p_line[i]) {
|
||||
36
meta/recipes-devtools/patch/patch/CVE-2026-56289.patch
Normal file
36
meta/recipes-devtools/patch/patch/CVE-2026-56289.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
From a40c835ab06314526d623e62ae27830d0ad88752 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Eggert <eggert@cs.ucla.edu>
|
||||
Date: Tue, 21 Apr 2026 13:16:10 -0700
|
||||
Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20infloop=20on=20null=20ranges?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Problem reported by Michał Majchrowicz.
|
||||
* src/patch.c (locate_hunk): Don’t attempt to optimize
|
||||
matches of a null range. Instead, apply all the checks
|
||||
we apply to non-null ranges.
|
||||
|
||||
CVE: CVE-2026-56289
|
||||
Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/patch.git/commit/?id=faba04ef4f2b410257f76c1b9dc85e350929c4b9]
|
||||
|
||||
(cherry picked from commit faba04ef4f2b410257f76c1b9dc85e350929c4b9)
|
||||
Signed-off-by: Hetvi Thakar <hthakar@cisco.com>
|
||||
---
|
||||
src/patch.c | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/src/patch.c b/src/patch.c
|
||||
index b348b5c..0e8d5c9 100644
|
||||
--- a/src/patch.c
|
||||
+++ b/src/patch.c
|
||||
@@ -1146,9 +1146,6 @@ locate_hunk (lin fuzz)
|
||||
lin max_offset = MAX(max_pos_offset, max_neg_offset);
|
||||
lin min_offset;
|
||||
|
||||
- if (!pat_lines) /* null range matches always */
|
||||
- return first_guess;
|
||||
-
|
||||
/* Do not try lines <= 0. */
|
||||
if (first_guess <= max_neg_offset)
|
||||
max_neg_offset = first_guess - 1;
|
||||
@@ -11,6 +11,8 @@ SRC_URI += "file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
|
||||
file://0001-Don-t-leak-temporary-file-on-failed-ed-style-patch.patch \
|
||||
file://0001-Don-t-leak-temporary-file-on-failed-multi-file-ed.patch \
|
||||
file://CVE-2019-20633.patch \
|
||||
file://CVE-2026-56289.patch \
|
||||
file://CVE-2026-56288.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "4c68cee989d83c87b00a3860bcd05600"
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From f702c387e6940fab3801d7562a668b974a2b3a8f Mon Sep 17 00:00:00 2001
|
||||
From: Audrey Dutcher <audrey@rhelmot.io>
|
||||
Date: Fri, 30 May 2025 12:29:54 -0700
|
||||
Subject: [PATCH] add d_fdopendir configuration
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/arsv/perl-cross/pull/159]
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
cnf/configure_func.sh | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/cnf/configure_func.sh b/cnf/configure_func.sh
|
||||
index 4c13e4c..b24fe03 100644
|
||||
--- a/cnf/configure_func.sh
|
||||
+++ b/cnf/configure_func.sh
|
||||
@@ -83,6 +83,7 @@ checkfunc d_fchmodat 'fchmodat' "0,NULL,0,0" 'unistd.h sys/stat.h'
|
||||
checkfunc d_fchown 'fchown' "0,0,0" 'unistd.h'
|
||||
checkfunc d_fcntl 'fcntl' "0,0" 'unistd.h fcntl.h'
|
||||
checkfunc d_fdclose 'fdclose' "NULL,NULL" 'stdio.h'
|
||||
+checkfunc d_fdopendir 'fdopendir' "0" 'dirent.h'
|
||||
checkfunc d_ffs 'ffs' "0" 'strings.h'
|
||||
checkfunc d_ffsl 'ffsl' "0" 'strings.h'
|
||||
checkfunc d_fgetpos 'fgetpos' "NULL, 0" 'stdio.h'
|
||||
--
|
||||
2.43.0
|
||||
@@ -15,6 +15,7 @@ SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/perl-cross-${PV}.tar.gz;name=perl-c
|
||||
file://0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch \
|
||||
file://determinism.patch \
|
||||
file://0001-Makefile-check-the-file-if-patched-or-not.patch \
|
||||
file://CVE-2025-40909-dep.patch \
|
||||
"
|
||||
GITHUB_BASE_URI = "https://github.com/arsv/perl-cross/releases/"
|
||||
|
||||
|
||||
412
meta/recipes-devtools/perl/files/CVE-2025-40909.patch
Normal file
412
meta/recipes-devtools/perl/files/CVE-2025-40909.patch
Normal file
@@ -0,0 +1,412 @@
|
||||
From 918bfff86ca8d6d4e4ec5b30994451e0bd74aba9 Mon Sep 17 00:00:00 2001
|
||||
From: Leon Timmermans <fawaka@gmail.com>
|
||||
Date: Fri, 23 May 2025 15:40:41 +0200
|
||||
Subject: [PATCH] CVE-2025-40909: Clone dirhandles without fchdir
|
||||
|
||||
This uses fdopendir and dup to dirhandles. This means it won't change
|
||||
working directory during thread cloning, which prevents race conditions
|
||||
that can happen if a third thread is active at the same time.
|
||||
|
||||
CVE: CVE-2025-40909
|
||||
Upstream-Status: Backport [https://github.com/Perl/perl5/commit/918bfff86ca8d6d4e4ec5b30994451e0bd74aba9]
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
Configure | 6 ++
|
||||
Cross/config.sh-arm-linux | 1 +
|
||||
Cross/config.sh-arm-linux-n770 | 1 +
|
||||
Porting/Glossary | 5 ++
|
||||
Porting/config.sh | 1 +
|
||||
config_h.SH | 6 ++
|
||||
configure.com | 1 +
|
||||
plan9/config_sh.sample | 1 +
|
||||
sv.c | 91 +----------------------------
|
||||
t/op/threads-dirh.t | 104 +--------------------------------
|
||||
win32/config.gc | 1 +
|
||||
win32/config.vc | 1 +
|
||||
12 files changed, 28 insertions(+), 191 deletions(-)
|
||||
|
||||
diff --git a/Configure b/Configure
|
||||
index 44c12ced4014..7a13249caa96 100755
|
||||
--- a/Configure
|
||||
+++ b/Configure
|
||||
@@ -478,6 +478,7 @@ d_fd_set=''
|
||||
d_fds_bits=''
|
||||
d_fdclose=''
|
||||
d_fdim=''
|
||||
+d_fdopendir=''
|
||||
d_fegetround=''
|
||||
d_ffs=''
|
||||
d_ffsl=''
|
||||
@@ -13344,6 +13345,10 @@ esac
|
||||
set i_fcntl
|
||||
eval $setvar
|
||||
|
||||
+: see if fdopendir exists
|
||||
+set fdopendir d_fdopendir
|
||||
+eval $inlibc
|
||||
+
|
||||
: see if fork exists
|
||||
set fork d_fork
|
||||
eval $inlibc
|
||||
@@ -25052,6 +25057,7 @@ d_flockproto='$d_flockproto'
|
||||
d_fma='$d_fma'
|
||||
d_fmax='$d_fmax'
|
||||
d_fmin='$d_fmin'
|
||||
+d_fdopendir='$d_fdopendir'
|
||||
d_fork='$d_fork'
|
||||
d_fp_class='$d_fp_class'
|
||||
d_fp_classify='$d_fp_classify'
|
||||
diff --git a/Cross/config.sh-arm-linux b/Cross/config.sh-arm-linux
|
||||
index bfa0b00d5f0f..9e056539198b 100644
|
||||
--- a/Cross/config.sh-arm-linux
|
||||
+++ b/Cross/config.sh-arm-linux
|
||||
@@ -212,6 +212,7 @@ d_fd_macros='define'
|
||||
d_fd_set='define'
|
||||
d_fdclose='undef'
|
||||
d_fdim='undef'
|
||||
+d_fdopendir=undef
|
||||
d_fds_bits='undef'
|
||||
d_fegetround='define'
|
||||
d_ffs='undef'
|
||||
diff --git a/Cross/config.sh-arm-linux-n770 b/Cross/config.sh-arm-linux-n770
|
||||
index 47ad5c37e3fd..365e4c4f9671 100644
|
||||
--- a/Cross/config.sh-arm-linux-n770
|
||||
+++ b/Cross/config.sh-arm-linux-n770
|
||||
@@ -211,6 +211,7 @@ d_fd_macros='define'
|
||||
d_fd_set='define'
|
||||
d_fdclose='undef'
|
||||
d_fdim='undef'
|
||||
+d_fdopendir=undef
|
||||
d_fds_bits='undef'
|
||||
d_fegetround='define'
|
||||
d_ffs='undef'
|
||||
diff --git a/Porting/Glossary b/Porting/Glossary
|
||||
index bb505c653b0b..8b2965ca99c6 100644
|
||||
--- a/Porting/Glossary
|
||||
+++ b/Porting/Glossary
|
||||
@@ -947,6 +947,11 @@ d_fmin (d_fmin.U):
|
||||
This variable conditionally defines the HAS_FMIN symbol, which
|
||||
indicates to the C program that the fmin() routine is available.
|
||||
|
||||
+d_fdopendir (d_fdopendir.U):
|
||||
+ This variable conditionally defines the HAS_FORK symbol, which
|
||||
+ indicates that the fdopen routine is available to open a
|
||||
+ directory descriptor.
|
||||
+
|
||||
d_fork (d_fork.U):
|
||||
This variable conditionally defines the HAS_FORK symbol, which
|
||||
indicates to the C program that the fork() routine is available.
|
||||
diff --git a/Porting/config.sh b/Porting/config.sh
|
||||
index a921f7e1c79a..6231ea0f31ea 100644
|
||||
--- a/Porting/config.sh
|
||||
+++ b/Porting/config.sh
|
||||
@@ -223,6 +223,7 @@ d_fd_macros='define'
|
||||
d_fd_set='define'
|
||||
d_fdclose='undef'
|
||||
d_fdim='define'
|
||||
+d_fdopendir='define'
|
||||
d_fds_bits='define'
|
||||
d_fegetround='define'
|
||||
d_ffs='define'
|
||||
diff --git a/config_h.SH b/config_h.SH
|
||||
index da0f2dbcd7b7..5a0f81cf2011 100755
|
||||
--- a/config_h.SH
|
||||
+++ b/config_h.SH
|
||||
@@ -142,6 +142,12 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
|
||||
*/
|
||||
#$d_fcntl HAS_FCNTL /**/
|
||||
|
||||
+/* HAS_FDOPENDIR:
|
||||
+ * This symbol, if defined, indicates that the fdopen routine is
|
||||
+ * available to open a directory descriptor.
|
||||
+ */
|
||||
+#$d_fdopendir HAS_FDOPENDIR /**/
|
||||
+
|
||||
/* HAS_FGETPOS:
|
||||
* This symbol, if defined, indicates that the fgetpos routine is
|
||||
* available to get the file position indicator, similar to ftell().
|
||||
diff --git a/configure.com b/configure.com
|
||||
index 99527c180bfc..7c38711bb85d 100644
|
||||
--- a/configure.com
|
||||
+++ b/configure.com
|
||||
@@ -6010,6 +6010,7 @@ $ WC "d_fd_set='" + d_fd_set + "'"
|
||||
$ WC "d_fd_macros='define'"
|
||||
$ WC "d_fdclose='undef'"
|
||||
$ WC "d_fdim='" + d_fdim + "'"
|
||||
+$ WC "d_fdopendir='undef'"
|
||||
$ WC "d_fds_bits='define'"
|
||||
$ WC "d_fegetround='undef'"
|
||||
$ WC "d_ffs='undef'"
|
||||
diff --git a/plan9/config_sh.sample b/plan9/config_sh.sample
|
||||
index 636acbdf6db3..246bad954424 100644
|
||||
--- a/plan9/config_sh.sample
|
||||
+++ b/plan9/config_sh.sample
|
||||
@@ -212,6 +212,7 @@ d_fd_macros='undef'
|
||||
d_fd_set='undef'
|
||||
d_fdclose='undef'
|
||||
d_fdim='undef'
|
||||
+d_fdopendir=undef
|
||||
d_fds_bits='undef'
|
||||
d_fegetround='undef'
|
||||
d_ffs='undef'
|
||||
diff --git a/sv.c b/sv.c
|
||||
index ae6d09dea28a..8a005b2d165b 100644
|
||||
--- a/sv.c
|
||||
+++ b/sv.c
|
||||
@@ -14096,15 +14096,6 @@ Perl_dirp_dup(pTHX_ DIR *const dp, CLONE_PARAMS *const param)
|
||||
{
|
||||
DIR *ret;
|
||||
|
||||
-#if defined(HAS_FCHDIR) && defined(HAS_TELLDIR) && defined(HAS_SEEKDIR)
|
||||
- DIR *pwd;
|
||||
- const Direntry_t *dirent;
|
||||
- char smallbuf[256]; /* XXX MAXPATHLEN, surely? */
|
||||
- char *name = NULL;
|
||||
- STRLEN len = 0;
|
||||
- long pos;
|
||||
-#endif
|
||||
-
|
||||
PERL_UNUSED_CONTEXT;
|
||||
PERL_ARGS_ASSERT_DIRP_DUP;
|
||||
|
||||
@@ -14116,89 +14107,13 @@ Perl_dirp_dup(pTHX_ DIR *const dp, CLONE_PARAMS *const param)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
-#if defined(HAS_FCHDIR) && defined(HAS_TELLDIR) && defined(HAS_SEEKDIR)
|
||||
+#ifdef HAS_FDOPENDIR
|
||||
|
||||
PERL_UNUSED_ARG(param);
|
||||
|
||||
- /* create anew */
|
||||
-
|
||||
- /* open the current directory (so we can switch back) */
|
||||
- if (!(pwd = PerlDir_open("."))) return (DIR *)NULL;
|
||||
-
|
||||
- /* chdir to our dir handle and open the present working directory */
|
||||
- if (fchdir(my_dirfd(dp)) < 0 || !(ret = PerlDir_open("."))) {
|
||||
- PerlDir_close(pwd);
|
||||
- return (DIR *)NULL;
|
||||
- }
|
||||
- /* Now we should have two dir handles pointing to the same dir. */
|
||||
-
|
||||
- /* Be nice to the calling code and chdir back to where we were. */
|
||||
- /* XXX If this fails, then what? */
|
||||
- PERL_UNUSED_RESULT(fchdir(my_dirfd(pwd)));
|
||||
+ ret = fdopendir(dup(my_dirfd(dp)));
|
||||
|
||||
- /* We have no need of the pwd handle any more. */
|
||||
- PerlDir_close(pwd);
|
||||
-
|
||||
-#ifdef DIRNAMLEN
|
||||
-# define d_namlen(d) (d)->d_namlen
|
||||
-#else
|
||||
-# define d_namlen(d) strlen((d)->d_name)
|
||||
-#endif
|
||||
- /* Iterate once through dp, to get the file name at the current posi-
|
||||
- tion. Then step back. */
|
||||
- pos = PerlDir_tell(dp);
|
||||
- if ((dirent = PerlDir_read(dp))) {
|
||||
- len = d_namlen(dirent);
|
||||
- if (len > sizeof(dirent->d_name) && sizeof(dirent->d_name) > PTRSIZE) {
|
||||
- /* If the len is somehow magically longer than the
|
||||
- * maximum length of the directory entry, even though
|
||||
- * we could fit it in a buffer, we could not copy it
|
||||
- * from the dirent. Bail out. */
|
||||
- PerlDir_close(ret);
|
||||
- return (DIR*)NULL;
|
||||
- }
|
||||
- if (len <= sizeof smallbuf) name = smallbuf;
|
||||
- else Newx(name, len, char);
|
||||
- Move(dirent->d_name, name, len, char);
|
||||
- }
|
||||
- PerlDir_seek(dp, pos);
|
||||
-
|
||||
- /* Iterate through the new dir handle, till we find a file with the
|
||||
- right name. */
|
||||
- if (!dirent) /* just before the end */
|
||||
- for(;;) {
|
||||
- pos = PerlDir_tell(ret);
|
||||
- if (PerlDir_read(ret)) continue; /* not there yet */
|
||||
- PerlDir_seek(ret, pos); /* step back */
|
||||
- break;
|
||||
- }
|
||||
- else {
|
||||
- const long pos0 = PerlDir_tell(ret);
|
||||
- for(;;) {
|
||||
- pos = PerlDir_tell(ret);
|
||||
- if ((dirent = PerlDir_read(ret))) {
|
||||
- if (len == (STRLEN)d_namlen(dirent)
|
||||
- && memEQ(name, dirent->d_name, len)) {
|
||||
- /* found it */
|
||||
- PerlDir_seek(ret, pos); /* step back */
|
||||
- break;
|
||||
- }
|
||||
- /* else we are not there yet; keep iterating */
|
||||
- }
|
||||
- else { /* This is not meant to happen. The best we can do is
|
||||
- reset the iterator to the beginning. */
|
||||
- PerlDir_seek(ret, pos0);
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-#undef d_namlen
|
||||
-
|
||||
- if (name && name != smallbuf)
|
||||
- Safefree(name);
|
||||
-#endif
|
||||
-
|
||||
-#ifdef WIN32
|
||||
+#elif defined(WIN32)
|
||||
ret = win32_dirp_dup(dp, param);
|
||||
#endif
|
||||
|
||||
diff --git a/t/op/threads-dirh.t b/t/op/threads-dirh.t
|
||||
index bb4bcfc14184..14c399ca19cd 100644
|
||||
--- a/t/op/threads-dirh.t
|
||||
+++ b/t/op/threads-dirh.t
|
||||
@@ -13,16 +13,12 @@ BEGIN {
|
||||
skip_all_if_miniperl("no dynamic loading on miniperl, no threads");
|
||||
skip_all("runs out of memory on some EBCDIC") if $ENV{PERL_SKIP_BIG_MEM_TESTS};
|
||||
|
||||
- plan(6);
|
||||
+ plan(1);
|
||||
}
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use threads;
|
||||
-use threads::shared;
|
||||
-use File::Path;
|
||||
-use File::Spec::Functions qw 'updir catdir';
|
||||
-use Cwd 'getcwd';
|
||||
|
||||
# Basic sanity check: make sure this does not crash
|
||||
fresh_perl_is <<'# this is no comment', 'ok', {}, 'crash when duping dirh';
|
||||
@@ -31,101 +27,3 @@ fresh_perl_is <<'# this is no comment', 'ok', {}, 'crash when duping dirh';
|
||||
async{}->join for 1..2;
|
||||
print "ok";
|
||||
# this is no comment
|
||||
-
|
||||
-my $dir;
|
||||
-SKIP: {
|
||||
- skip "telldir or seekdir not defined on this platform", 5
|
||||
- if !$Config::Config{d_telldir} || !$Config::Config{d_seekdir};
|
||||
- my $skip = sub {
|
||||
- chdir($dir);
|
||||
- chdir updir;
|
||||
- skip $_[0], 5
|
||||
- };
|
||||
-
|
||||
- if(!$Config::Config{d_fchdir} && $^O ne "MSWin32") {
|
||||
- $::TODO = 'dir handle cloning currently requires fchdir on non-Windows platforms';
|
||||
- }
|
||||
-
|
||||
- my @w :shared; # warnings accumulator
|
||||
- local $SIG{__WARN__} = sub { push @w, $_[0] };
|
||||
-
|
||||
- $dir = catdir getcwd(), "thrext$$" . int rand() * 100000;
|
||||
-
|
||||
- rmtree($dir) if -d $dir;
|
||||
- mkdir($dir);
|
||||
-
|
||||
- # Create a dir structure like this:
|
||||
- # $dir
|
||||
- # |
|
||||
- # `- toberead
|
||||
- # |
|
||||
- # +---- thrit
|
||||
- # |
|
||||
- # +---- rile
|
||||
- # |
|
||||
- # `---- zor
|
||||
-
|
||||
- chdir($dir);
|
||||
- mkdir 'toberead';
|
||||
- chdir 'toberead';
|
||||
- {open my $fh, ">thrit" or &$skip("Cannot create file thrit")}
|
||||
- {open my $fh, ">rile" or &$skip("Cannot create file rile")}
|
||||
- {open my $fh, ">zor" or &$skip("Cannot create file zor")}
|
||||
- chdir updir;
|
||||
-
|
||||
- # Then test that dir iterators are cloned correctly.
|
||||
-
|
||||
- opendir my $toberead, 'toberead';
|
||||
- my $start_pos = telldir $toberead;
|
||||
- my @first_2 = (scalar readdir $toberead, scalar readdir $toberead);
|
||||
- my @from_thread = @{; async { [readdir $toberead ] } ->join };
|
||||
- my @from_main = readdir $toberead;
|
||||
- is join('-', sort @from_thread), join('-', sort @from_main),
|
||||
- 'dir iterator is copied from one thread to another';
|
||||
- like
|
||||
- join('-', "", sort(@first_2, @from_thread), ""),
|
||||
- qr/(?<!-rile)-rile-thrit-zor-(?!zor-)/i,
|
||||
- 'cloned iterator iterates exactly once over everything not already seen';
|
||||
-
|
||||
- seekdir $toberead, $start_pos;
|
||||
- readdir $toberead for 1 .. @first_2+@from_thread;
|
||||
- {
|
||||
- local $::TODO; # This always passes when dir handles are not cloned.
|
||||
- is
|
||||
- async { readdir $toberead // 'undef' } ->join, 'undef',
|
||||
- 'cloned dir iterator that points to the end of the directory'
|
||||
- ;
|
||||
- }
|
||||
-
|
||||
- # Make sure the cloning code can handle file names longer than 255 chars
|
||||
- SKIP: {
|
||||
- chdir 'toberead';
|
||||
- open my $fh,
|
||||
- ">floccipaucinihilopilification-"
|
||||
- . "pneumonoultramicroscopicsilicovolcanoconiosis-"
|
||||
- . "lopadotemachoselachogaleokranioleipsanodrimypotrimmatosilphiokarabo"
|
||||
- . "melitokatakechymenokichlepikossyphophattoperisteralektryonoptokephal"
|
||||
- . "liokinklopeleiolagoiosiraiobaphetraganopterygon"
|
||||
- or
|
||||
- chdir updir,
|
||||
- skip("OS does not support long file names (and I mean *long*)", 1);
|
||||
- chdir updir;
|
||||
- opendir my $dirh, "toberead";
|
||||
- my $test_name
|
||||
- = "dir iterators can be cloned when the next fn > 255 chars";
|
||||
- while() {
|
||||
- my $pos = telldir $dirh;
|
||||
- my $fn = readdir($dirh);
|
||||
- if(!defined $fn) { fail($test_name); last SKIP; }
|
||||
- if($fn =~ 'lagoio') {
|
||||
- seekdir $dirh, $pos;
|
||||
- last;
|
||||
- }
|
||||
- }
|
||||
- is length async { scalar readdir $dirh } ->join, 258, $test_name;
|
||||
- }
|
||||
-
|
||||
- is scalar @w, 0, 'no warnings during all that' or diag @w;
|
||||
- chdir updir;
|
||||
-}
|
||||
-rmtree($dir);
|
||||
diff --git a/win32/config.gc b/win32/config.gc
|
||||
index f8776188c09c..34aa8de6ed75 100644
|
||||
--- a/win32/config.gc
|
||||
+++ b/win32/config.gc
|
||||
@@ -199,6 +199,7 @@ d_fd_macros='define'
|
||||
d_fd_set='define'
|
||||
d_fdclose='undef'
|
||||
d_fdim='undef'
|
||||
+d_fdopendir='undef'
|
||||
d_fds_bits='define'
|
||||
d_fegetround='undef'
|
||||
d_ffs='undef'
|
||||
diff --git a/win32/config.vc b/win32/config.vc
|
||||
index 619979e22b53..536085fe94e0 100644
|
||||
--- a/win32/config.vc
|
||||
+++ b/win32/config.vc
|
||||
@@ -199,6 +199,7 @@ d_fd_macros='define'
|
||||
d_fd_set='define'
|
||||
d_fdclose='undef'
|
||||
d_fdim='undef'
|
||||
+d_fdopendir='undef'
|
||||
d_fds_bits='define'
|
||||
d_fegetround='undef'
|
||||
d_ffs='undef'
|
||||
75
meta/recipes-devtools/perl/files/CVE-2026-13221.patch
Normal file
75
meta/recipes-devtools/perl/files/CVE-2026-13221.patch
Normal file
@@ -0,0 +1,75 @@
|
||||
From 03f74bbbd3a68350d926ee93d56ee4808c28c4c7 Mon Sep 17 00:00:00 2001
|
||||
From: Karl Williamson <khw@cpan.org>
|
||||
Date: Thu, 26 Mar 2026 10:13:49 -0600
|
||||
Subject: [PATCH] regcomp_study: Don't create a trie that would overflow
|
||||
|
||||
This addresses GH #23388
|
||||
|
||||
The design of the trie compiling code is to batch extra long tries into
|
||||
smaller chunks that fit into whatever limitations there are. However,
|
||||
this ticket shows that that isn't always being done.
|
||||
|
||||
In this case, a bunch of branches that have TAIL operands can be
|
||||
combined together, and the final TAIL is used. And the code requires
|
||||
that the delta between the first branch and this final TAIL fit into a
|
||||
16-bit field. That is the root cause of this bug.
|
||||
|
||||
I'm not familiar enough with the trie construction code to easily
|
||||
understand why the final tail needs to be used here. So this patch
|
||||
simply doesn't optimize a sequence of branches into a trie that would
|
||||
overflow.
|
||||
|
||||
This could be revisited by someone who knows more about this than I, or
|
||||
earlier in the development cycle.
|
||||
|
||||
CVE: CVE-2026-13221
|
||||
Upstream-Status: Backport [https://github.com/Perl/perl5/commit/03f74bbbd3a68350d926ee93d56ee4808c28c4c7]
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
regcomp_study.c | 10 ++++++++++
|
||||
t/re/pat_advanced.t | 9 +++++++++
|
||||
2 files changed, 19 insertions(+)
|
||||
|
||||
diff --git a/regcomp_study.c b/regcomp_study.c
|
||||
index db7ab3a409..a1b2c3d4e5 100644
|
||||
--- a/regcomp_study.c
|
||||
+++ b/regcomp_study.c
|
||||
@@ -1933,6 +1933,16 @@ Perl_study_chunk(pTHX_
|
||||
tail = regnext( tail );
|
||||
}
|
||||
|
||||
+ /* The code below currently saves the difference from
|
||||
+ * start to finish in a 16-bit field, causing
|
||||
+ * GH #23388. This defeats the design of batching
|
||||
+ * tries into chunks that each fit. khw thinks it is
|
||||
+ * too late in the 5.44 cycle to relook at the design,
|
||||
+ * so for now anyway, don't make a trie that would
|
||||
+ * overflow */
|
||||
+ if (tail - startbranch >= U16_MAX) {
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
DEBUG_TRIE_COMPILE_r({
|
||||
regprop(RExC_rx, RExC_mysv, tail, NULL, pRExC_state);
|
||||
diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t
|
||||
index 398680838d..c9e389ecb3 100644
|
||||
--- a/t/re/pat_advanced.t
|
||||
+++ b/t/re/pat_advanced.t
|
||||
@@ -4898,6 +4898,15 @@ EOF_DEBUG_OUT
|
||||
$x =~ s/^[\x{0301}\x{030C}]+//;
|
||||
}
|
||||
|
||||
+ { # GH #23388
|
||||
+ fresh_perl_is(<<~'PROG', , "", {}, "Avoid trie overflow");
|
||||
+ my $x = join "|", "aaa".."mzz";
|
||||
+ my $y = join "|", "naa".."zzz";
|
||||
+ use re 'Debug';
|
||||
+ "fnord" =~ m/(?:$x)|(?:$y)/;
|
||||
+ PROG
|
||||
+ }
|
||||
+
|
||||
|
||||
# !!! NOTE that tests that aren't at all likely to crash perl should go
|
||||
# a ways above, above these last ones. There's a comment there that, like
|
||||
--
|
||||
2.43.0
|
||||
52
meta/recipes-devtools/perl/files/CVE-2026-57432-01.patch
Normal file
52
meta/recipes-devtools/perl/files/CVE-2026-57432-01.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From 5f7eb6bbbe0510964e3fb1d6bb691e5445913e55 Mon Sep 17 00:00:00 2001
|
||||
From: "Paul \"LeoNerd\" Evans" <leonerd@leonerd.org.uk>
|
||||
Date: Sat, 9 May 2026 17:18:43 +0100
|
||||
Subject: [PATCH] pp_pack.c: Avoid ssize_t overflow when calculating the size
|
||||
of a structure
|
||||
|
||||
If the user has requested a size that would overflow a SSize_t, then the
|
||||
only sensible thing to do is throw an exception, because the structure
|
||||
this implies couldn't possibly fit into memory anyway.
|
||||
|
||||
CVE: CVE-2026-57432
|
||||
Upstream-Status: Backport [https://github.com/Perl/perl5/commit/5f7eb6bbbe0510964e3fb1d6bb691e5445913e55]
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
pod/perldiag.pod | 6 ++++++
|
||||
pp_pack.c | 4 ++++
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
|
||||
index 841e22d580..d9231077363d 100644
|
||||
--- a/pod/perldiag.pod
|
||||
+++ b/pod/perldiag.pod
|
||||
@@ -4880,6 +4880,12 @@ mixed-case attribute name, instead. See L<attributes>.
|
||||
(F) You can't specify a repeat count so large that it overflows your
|
||||
signed integers. See L<perlfunc/pack>.
|
||||
|
||||
+=item Pack template structure size is too large
|
||||
+
|
||||
+(F) You called C<pack> or C<unpack> to operate on a structure, whose
|
||||
+computed size is too large to fit in memory. This usually happens as a
|
||||
+result of embedding a large number as the repeat count for an item.
|
||||
+
|
||||
=item page overflow
|
||||
|
||||
(W io) A single call to write() produced more lines than can fit on a
|
||||
diff --git a/pp_pack.c b/pp_pack.c
|
||||
index b5c0b261ef..6075e83aac 100644
|
||||
--- a/pp_pack.c
|
||||
+++ b/pp_pack.c
|
||||
@@ -528,6 +528,10 @@ S_measure_struct(pTHX_ tempsym_t* symptr)
|
||||
break;
|
||||
}
|
||||
}
|
||||
+ if ((size > 0) &&
|
||||
+ ((len > SSize_t_MAX / size) || /* detect overflow of len * size */
|
||||
+ (len * size > SSize_t_MAX - total))) /* detect overflow of total + len * size */
|
||||
+ croak("Pack template structure size is too large");
|
||||
total += len * size;
|
||||
}
|
||||
return total;
|
||||
--
|
||||
2.43.0
|
||||
34
meta/recipes-devtools/perl/files/CVE-2026-57432-02.patch
Normal file
34
meta/recipes-devtools/perl/files/CVE-2026-57432-02.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
From 40754edc72dd3e513d758153c0e2f0215897740e Mon Sep 17 00:00:00 2001
|
||||
From: "Paul \"LeoNerd\" Evans" <leonerd@leonerd.org.uk>
|
||||
Date: Mon, 11 May 2026 12:25:33 +0100
|
||||
Subject: [PATCH] pp_pack.c: Avoid some other potential overflows when
|
||||
calculating sizes
|
||||
|
||||
CVE: CVE-2026-57432
|
||||
Upstream-Status: Backport [https://github.com/Perl/perl5/commit/40754edc72dd3e513d758153c0e2f0215897740e]
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
pp_pack.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/pp_pack.c b/pp_pack.c
|
||||
index 6075e83aac..b2019902203a 100644
|
||||
--- a/pp_pack.c
|
||||
+++ b/pp_pack.c
|
||||
@@ -515,12 +515,12 @@ S_measure_struct(pTHX_ tempsym_t* symptr)
|
||||
break;
|
||||
case 'B':
|
||||
case 'b':
|
||||
- len = (len + 7)/8;
|
||||
+ len = (len / 8) + !!(len % 8);
|
||||
size = 1;
|
||||
break;
|
||||
case 'H':
|
||||
case 'h':
|
||||
- len = (len + 1)/2;
|
||||
+ len = (len / 2) + !!(len % 2);
|
||||
size = 1;
|
||||
break;
|
||||
|
||||
--
|
||||
2.43.0
|
||||
@@ -20,6 +20,10 @@ SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \
|
||||
file://0001-Fix-intermittent-failure-of-test-t-op-sigsystem.t.patch \
|
||||
file://CVE-2026-8376-01.patch \
|
||||
file://CVE-2026-8376-02.patch \
|
||||
file://CVE-2026-13221.patch \
|
||||
file://CVE-2026-57432-01.patch \
|
||||
file://CVE-2026-57432-02.patch \
|
||||
file://CVE-2025-40909.patch \
|
||||
"
|
||||
SRC_URI:append:class-native = " \
|
||||
file://perl-configpm-switch.patch \
|
||||
|
||||
@@ -19,6 +19,8 @@ inherit ptest
|
||||
SRC_URI += " \
|
||||
file://run-ptest \
|
||||
file://CVE-2026-23490.patch \
|
||||
file://CVE-2026-59886.patch \
|
||||
file://CVE-2026-59884.patch \
|
||||
"
|
||||
|
||||
RDEPENDS:${PN}-ptest += " \
|
||||
|
||||
@@ -7,6 +7,8 @@ SRC_URI[sha256sum] = "935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19
|
||||
|
||||
inherit pypi ptest python_hatchling
|
||||
|
||||
CVE_PRODUCT = "attrs_project:attrs"
|
||||
|
||||
SRC_URI += " \
|
||||
file://0001-test_funcs-skip-test_unknown-for-pytest-8.patch \
|
||||
file://0001-conftest.py-disable-deadline.patch \
|
||||
|
||||
@@ -9,6 +9,8 @@ PYPI_PACKAGE = "Babel"
|
||||
|
||||
inherit pypi setuptools3
|
||||
|
||||
CVE_PRODUCT = "pocoo:babel"
|
||||
|
||||
CLEANBROKEN = "1"
|
||||
|
||||
RDEPENDS:${PN} += " \
|
||||
|
||||
@@ -14,6 +14,8 @@ inherit pypi setuptools3 ptest
|
||||
|
||||
SRC_URI += "file://run-ptest"
|
||||
|
||||
CVE_PRODUCT = "palletsprojects:click"
|
||||
|
||||
RDEPENDS:${PN}-ptest += " \
|
||||
python3-pytest \
|
||||
python3-terminal \
|
||||
|
||||
@@ -11,6 +11,8 @@ PYPI_PACKAGE = "python-dbusmock"
|
||||
inherit pypi python_setuptools_build_meta
|
||||
DEPENDS += "python3-setuptools-scm-native"
|
||||
|
||||
CVE_PRODUCT = "python-dbusmock_project:python-dbusmock"
|
||||
|
||||
RDEPENDS:${PN} += "\
|
||||
python3-dbus \
|
||||
python3-unittest \
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From dc3885fd7b4cee9ce4bf04d120e63ea00d905431 Mon Sep 17 00:00:00 2001
|
||||
From: "GPT 5.4" <codex@openai.com>
|
||||
Date: Tue, 21 Apr 2026 09:30:29 +0800
|
||||
Subject: [PATCH] Make sure that multi-options are checked after splitting them
|
||||
with `shlex`
|
||||
|
||||
CVE: CVE-2026-42284
|
||||
Upstream-Status: Backport [https://github.com/gitpython-developers/GitPython/commit/c9a26789d88b18f8b4620f37307df2976292d2a0]
|
||||
|
||||
Backport Changes:
|
||||
- Omit regression tests because the Scarthgap PyPI source
|
||||
archive does not include the upstream test suite.
|
||||
|
||||
Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
|
||||
(cherry picked from commit c9a26789d88b18f8b4620f37307df2976292d2a0)
|
||||
Signed-off-by: Darsh Kelaiya <dkelaiya@cisco.com>
|
||||
---
|
||||
git/repo/base.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/git/repo/base.py b/git/repo/base.py
|
||||
index f5069dbf..92ace3a0 100644
|
||||
--- a/git/repo/base.py
|
||||
+++ b/git/repo/base.py
|
||||
@@ -1271,8 +1271,8 @@ class Repo:
|
||||
Git.check_unsafe_protocols(str(url))
|
||||
if not allow_unsafe_options:
|
||||
Git.check_unsafe_options(options=list(kwargs.keys()), unsafe_options=cls.unsafe_git_clone_options)
|
||||
- if not allow_unsafe_options and multi_options:
|
||||
- Git.check_unsafe_options(options=multi_options, unsafe_options=cls.unsafe_git_clone_options)
|
||||
+ if not allow_unsafe_options and multi:
|
||||
+ Git.check_unsafe_options(options=multi, unsafe_options=cls.unsafe_git_clone_options)
|
||||
|
||||
proc = git.clone(
|
||||
multi,
|
||||
--
|
||||
2.35.6
|
||||
136
meta/recipes-devtools/python/python3-git/CVE-2026-44243_p1.patch
Normal file
136
meta/recipes-devtools/python/python3-git/CVE-2026-44243_p1.patch
Normal file
@@ -0,0 +1,136 @@
|
||||
From fcd8d016816696780c0dc96dacbe48fc10df80f6 Mon Sep 17 00:00:00 2001
|
||||
From: "GPT 5.5" <codex@openai.com>
|
||||
Date: Tue, 28 Apr 2026 09:17:31 +0800
|
||||
Subject: [PATCH] prevent out-of-repo access when manipulating references.
|
||||
|
||||
This previously made it possible to create, modify and delete files outside outside
|
||||
of the repository, which is a problem if inputs aren't trusted.
|
||||
|
||||
CVE: CVE-2026-44243
|
||||
Upstream-Status: Backport [https://github.com/gitpython-developers/GitPython/commit/25ba54dd3fb374b8fade7de4be1ac2ac84722190]
|
||||
|
||||
Backport Changes:
|
||||
- Omit regression tests because the Scarthgap PyPI source
|
||||
archive does not include the upstream test suite.
|
||||
|
||||
Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
|
||||
(cherry picked from commit 25ba54dd3fb374b8fade7de4be1ac2ac84722190)
|
||||
Signed-off-by: Darsh Kelaiya <dkelaiya@cisco.com>
|
||||
---
|
||||
git/refs/log.py | 2 +-
|
||||
git/refs/remote.py | 5 +++--
|
||||
git/refs/symbolic.py | 37 +++++++++++++++++++++++++++++++------
|
||||
3 files changed, 35 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/git/refs/log.py b/git/refs/log.py
|
||||
index e45798d8..29293f4a 100644
|
||||
--- a/git/refs/log.py
|
||||
+++ b/git/refs/log.py
|
||||
@@ -204,7 +204,7 @@ class RefLog(List[RefLogEntry], Serializable):
|
||||
file though.
|
||||
:param ref: SymbolicReference instance
|
||||
"""
|
||||
- return osp.join(ref.repo.git_dir, "logs", to_native_path(ref.path))
|
||||
+ return to_native_path(ref._get_validated_reflog_path(ref.repo, ref.path))
|
||||
|
||||
@classmethod
|
||||
def iter_entries(cls, stream: Union[str, "BytesIO", mmap]) -> Iterator[RefLogEntry]:
|
||||
diff --git a/git/refs/remote.py b/git/refs/remote.py
|
||||
index 59d02a75..e50c54eb 100644
|
||||
--- a/git/refs/remote.py
|
||||
+++ b/git/refs/remote.py
|
||||
@@ -64,12 +64,13 @@ class RemoteReference(Head):
|
||||
# are generally ignored in the refs/ folder. We don't though
|
||||
# and delete remainders manually.
|
||||
for ref in refs:
|
||||
+ cls._check_ref_name_valid(ref.path)
|
||||
try:
|
||||
- os.remove(os.path.join(repo.common_dir, ref.path))
|
||||
+ os.remove(cls._get_validated_path(repo.common_dir, ref.path))
|
||||
except OSError:
|
||||
pass
|
||||
try:
|
||||
- os.remove(os.path.join(repo.git_dir, ref.path))
|
||||
+ os.remove(cls._get_validated_path(repo.git_dir, ref.path))
|
||||
except OSError:
|
||||
pass
|
||||
# END for each ref
|
||||
diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py
|
||||
index 31f959ac..d5c18290 100644
|
||||
--- a/git/refs/symbolic.py
|
||||
+++ b/git/refs/symbolic.py
|
||||
@@ -109,6 +109,32 @@ class SymbolicReference:
|
||||
def abspath(self) -> PathLike:
|
||||
return join_path_native(_git_dir(self.repo, self.path), self.path)
|
||||
|
||||
+ @staticmethod
|
||||
+ def _get_validated_path(base: PathLike, path: PathLike) -> str:
|
||||
+ path = os.fspath(path)
|
||||
+ base_path = os.path.realpath(os.fspath(base))
|
||||
+ abs_path = os.path.realpath(os.path.join(base_path, path))
|
||||
+ try:
|
||||
+ common_path = os.path.commonpath([base_path, abs_path])
|
||||
+ except ValueError as e:
|
||||
+ raise ValueError("Reference path %r escapes the repository" % path) from e
|
||||
+ if os.path.normcase(common_path) != os.path.normcase(base_path):
|
||||
+ raise ValueError("Reference path %r escapes the repository" % path)
|
||||
+ return abs_path
|
||||
+
|
||||
+ @classmethod
|
||||
+ def _get_validated_ref_path(cls, repo: "Repo", path: PathLike) -> str:
|
||||
+ """Return the absolute filesystem path for a ref after validating it."""
|
||||
+ cls._check_ref_name_valid(path)
|
||||
+ ref_path = os.fspath(path)
|
||||
+ return cls._get_validated_path(_git_dir(repo, ref_path), ref_path)
|
||||
+
|
||||
+ @classmethod
|
||||
+ def _get_validated_reflog_path(cls, repo: "Repo", path: PathLike) -> str:
|
||||
+ """Return the absolute filesystem path for a reflog after validating it."""
|
||||
+ cls._check_ref_name_valid(path)
|
||||
+ return cls._get_validated_path(os.path.join(repo.git_dir, "logs"), path)
|
||||
+
|
||||
@classmethod
|
||||
def _get_packed_refs_path(cls, repo: "Repo") -> str:
|
||||
return os.path.join(repo.common_dir, "packed-refs")
|
||||
@@ -442,7 +468,7 @@ class SymbolicReference:
|
||||
# END handle non-existing
|
||||
# END retrieve old hexsha
|
||||
|
||||
- fpath = self.abspath
|
||||
+ fpath = self._get_validated_ref_path(self.repo, self.path)
|
||||
assure_directory_exists(fpath, is_file=True)
|
||||
|
||||
lfd = LockedFD(fpath)
|
||||
@@ -571,7 +597,7 @@ class SymbolicReference:
|
||||
Alternatively the symbolic reference to be deleted.
|
||||
"""
|
||||
full_ref_path = cls.to_full_path(path)
|
||||
- abs_path = os.path.join(repo.common_dir, full_ref_path)
|
||||
+ abs_path = cls._get_validated_ref_path(repo, full_ref_path)
|
||||
if os.path.exists(abs_path):
|
||||
os.remove(abs_path)
|
||||
else:
|
||||
@@ -635,9 +661,8 @@ class SymbolicReference:
|
||||
corresponding object and a detached symbolic reference will be created
|
||||
instead.
|
||||
"""
|
||||
- git_dir = _git_dir(repo, path)
|
||||
full_ref_path = cls.to_full_path(path)
|
||||
- abs_ref_path = os.path.join(git_dir, full_ref_path)
|
||||
+ abs_ref_path = cls._get_validated_ref_path(repo, full_ref_path)
|
||||
|
||||
# Figure out target data.
|
||||
target = reference
|
||||
@@ -724,8 +749,8 @@ class SymbolicReference:
|
||||
if self.path == new_path:
|
||||
return self
|
||||
|
||||
- new_abs_path = os.path.join(_git_dir(self.repo, new_path), new_path)
|
||||
- cur_abs_path = os.path.join(_git_dir(self.repo, self.path), self.path)
|
||||
+ new_abs_path = self._get_validated_ref_path(self.repo, new_path)
|
||||
+ cur_abs_path = self._get_validated_ref_path(self.repo, self.path)
|
||||
if os.path.isfile(new_abs_path):
|
||||
if not force:
|
||||
# If they point to the same file, it's not an error.
|
||||
--
|
||||
2.35.6
|
||||
@@ -0,0 +1,86 @@
|
||||
From 2d1f681978b51ffff0db57cf89b0bcd6bffc7418 Mon Sep 17 00:00:00 2001
|
||||
From: "GPT 5.5" <codex@openai.com>
|
||||
Date: Tue, 28 Apr 2026 09:30:41 +0800
|
||||
Subject: [PATCH] address review feedback and CI failures
|
||||
|
||||
Consolidate follow-up fixes from review and CI:
|
||||
|
||||
- fix lint and mypy issues in reference log path handling
|
||||
- validate remote reference paths before invoking git branch deletion
|
||||
- add symlink escape coverage where realpath resolves symlinks
|
||||
- ensure temporary test repositories release git resources during cleanup
|
||||
|
||||
CVE: CVE-2026-44243
|
||||
Upstream-Status: Backport [https://github.com/gitpython-developers/GitPython/commit/4af8463cca31c2369312fcaa5309dfc30756c7b6]
|
||||
|
||||
Backport Changes:
|
||||
- Keep the 3.1.42 docstring layout and path coercion while
|
||||
applying upstream validation documentation and return type.
|
||||
- Omit regression test updates because the Scarthgap PyPI
|
||||
source archive does not include the upstream test suite.
|
||||
|
||||
Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
|
||||
(cherry picked from commit 4af8463cca31c2369312fcaa5309dfc30756c7b6)
|
||||
Signed-off-by: Darsh Kelaiya <dkelaiya@cisco.com>
|
||||
---
|
||||
git/refs/log.py | 3 ++-
|
||||
git/refs/remote.py | 4 +++-
|
||||
git/util.py | 2 +-
|
||||
3 files changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/git/refs/log.py b/git/refs/log.py
|
||||
index 29293f4a..eef525e7 100644
|
||||
--- a/git/refs/log.py
|
||||
+++ b/git/refs/log.py
|
||||
@@ -21,7 +21,6 @@ from git.util import (
|
||||
file_contents_ro_filepath,
|
||||
)
|
||||
|
||||
-import os.path as osp
|
||||
|
||||
|
||||
# typing ------------------------------------------------------------------
|
||||
@@ -203,6 +202,8 @@ class RefLog(List[RefLogEntry], Serializable):
|
||||
instance would be found. The path is not guaranteed to point to a valid
|
||||
file though.
|
||||
:param ref: SymbolicReference instance
|
||||
+ :raise ValueError:
|
||||
+ If `ref.path` is invalid or escapes the repository's reflog directory.
|
||||
"""
|
||||
return to_native_path(ref._get_validated_reflog_path(ref.repo, ref.path))
|
||||
|
||||
diff --git a/git/refs/remote.py b/git/refs/remote.py
|
||||
index e50c54eb..70eada81 100644
|
||||
--- a/git/refs/remote.py
|
||||
+++ b/git/refs/remote.py
|
||||
@@ -59,12 +59,14 @@ class RemoteReference(Head):
|
||||
kwargs are given for comparability with the base class method as we
|
||||
should not narrow the signature.
|
||||
"""
|
||||
+ for ref in refs:
|
||||
+ cls._check_ref_name_valid(ref.path)
|
||||
+
|
||||
repo.git.branch("-d", "-r", *refs)
|
||||
# The official deletion method will ignore remote symbolic refs - these
|
||||
# are generally ignored in the refs/ folder. We don't though
|
||||
# and delete remainders manually.
|
||||
for ref in refs:
|
||||
- cls._check_ref_name_valid(ref.path)
|
||||
try:
|
||||
os.remove(cls._get_validated_path(repo.common_dir, ref.path))
|
||||
except OSError:
|
||||
diff --git a/git/util.py b/git/util.py
|
||||
index 03d62ffc..5a136d18 100644
|
||||
--- a/git/util.py
|
||||
+++ b/git/util.py
|
||||
@@ -272,7 +272,7 @@ def join_path(a: PathLike, *p: PathLike) -> PathLike:
|
||||
|
||||
if os.name == "nt":
|
||||
|
||||
- def to_native_path_windows(path: PathLike) -> PathLike:
|
||||
+ def to_native_path_windows(path: PathLike) -> str:
|
||||
path = str(path)
|
||||
return path.replace("/", "\\")
|
||||
|
||||
--
|
||||
2.35.6
|
||||
104
meta/recipes-devtools/python/python3-git/CVE-2026-44244_p1.patch
Normal file
104
meta/recipes-devtools/python/python3-git/CVE-2026-44244_p1.patch
Normal file
@@ -0,0 +1,104 @@
|
||||
From 19e86eacc9471f2c3ef6f6a55dcaed40e5e139a0 Mon Sep 17 00:00:00 2001
|
||||
From: "GPT 5.5" <codex@openai.com>
|
||||
Date: Wed, 29 Apr 2026 05:47:57 +0800
|
||||
Subject: [PATCH] reject control chars in written values in configuration
|
||||
|
||||
Reject CR, LF, and NUL in GitConfigParser values before writing them
|
||||
to git config files (which also is a deviation from Git which escapes them).
|
||||
|
||||
GitConfigParser._write() serializes embedded newlines as indented
|
||||
continuation lines by replacing "\n" with "\n\t". Git itself skips
|
||||
leading whitespace before parsing config tokens, so an injected value
|
||||
such as:
|
||||
|
||||
foo
|
||||
[core]
|
||||
hooksPath=/tmp/hooks
|
||||
|
||||
is written in a form where the indented "[core]" line is still parsed by
|
||||
Git as a real section header. This lets attacker-controlled input passed
|
||||
to config_writer().set_value() poison repository config, including
|
||||
core.hooksPath, and redirect hook execution for later Git operations.
|
||||
|
||||
Fail closed instead of stripping or normalizing these characters. Silent
|
||||
normalization can hide unsanitized caller input, and GitPython does not
|
||||
currently round-trip Git-style escaped values such as "\n" as embedded
|
||||
newlines.
|
||||
|
||||
Apply the validation to set_value(), add_value(), and the public set()
|
||||
path so callers cannot bypass the safer helper API. Add regression tests
|
||||
for the advisory payload and for CR, LF, NUL, and bytes values.
|
||||
|
||||
This preserves existing read behavior for config files that already
|
||||
contain multiline values while preventing GitPython from writing new
|
||||
unsafe values.
|
||||
|
||||
CVE: CVE-2026-44244
|
||||
Upstream-Status: Backport [https://github.com/gitpython-developers/GitPython/commit/c417af469f9aa3da8dfef78f996c0fb8c5d1f4c2]
|
||||
|
||||
Backport Changes:
|
||||
- Omit regression tests because the Scarthgap PyPI source
|
||||
archive does not include the upstream test suite.
|
||||
|
||||
Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
|
||||
(cherry picked from commit c417af469f9aa3da8dfef78f996c0fb8c5d1f4c2)
|
||||
Signed-off-by: Darsh Kelaiya <dkelaiya@cisco.com>
|
||||
---
|
||||
git/config.py | 24 ++++++++++++++++++++++--
|
||||
1 file changed, 22 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/git/config.py b/git/config.py
|
||||
index 85f75419..ce307110 100644
|
||||
--- a/git/config.py
|
||||
+++ b/git/config.py
|
||||
@@ -841,6 +841,24 @@ class GitConfigParser(cp.RawConfigParser, metaclass=MetaParserBuilder):
|
||||
return str(value)
|
||||
return force_text(value)
|
||||
|
||||
+ def _value_to_string_safe(self, value: Union[str, bytes, int, float, bool]) -> str:
|
||||
+ value_str = self._value_to_string(value)
|
||||
+ if re.search(r"[\r\n\x00]", value_str):
|
||||
+ raise ValueError("Git config values must not contain CR, LF, or NUL")
|
||||
+ return value_str
|
||||
+
|
||||
+ @needs_values
|
||||
+ @set_dirty_and_flush_changes
|
||||
+ def set(
|
||||
+ self,
|
||||
+ section: str,
|
||||
+ option: str,
|
||||
+ value: Union[str, bytes, int, float, bool, None] = None,
|
||||
+ ) -> None:
|
||||
+ if value is not None:
|
||||
+ value = self._value_to_string_safe(value)
|
||||
+ return super().set(section, option, value)
|
||||
+
|
||||
@needs_values
|
||||
@set_dirty_and_flush_changes
|
||||
def set_value(self, section: str, option: str, value: Union[str, bytes, int, float, bool]) -> "GitConfigParser":
|
||||
@@ -855,9 +873,10 @@ class GitConfigParser(cp.RawConfigParser, metaclass=MetaParserBuilder):
|
||||
a string.
|
||||
:return: This instance
|
||||
"""
|
||||
+ value_str = self._value_to_string_safe(value)
|
||||
if not self.has_section(section):
|
||||
self.add_section(section)
|
||||
- self.set(section, option, self._value_to_string(value))
|
||||
+ self.set(section, option, value_str)
|
||||
return self
|
||||
|
||||
@needs_values
|
||||
@@ -875,9 +894,10 @@ class GitConfigParser(cp.RawConfigParser, metaclass=MetaParserBuilder):
|
||||
to a string
|
||||
:return: This instance
|
||||
"""
|
||||
+ value_str = self._value_to_string_safe(value)
|
||||
if not self.has_section(section):
|
||||
self.add_section(section)
|
||||
- self._sections[section].add(option, self._value_to_string(value))
|
||||
+ self._sections[section].add(option, value_str)
|
||||
return self
|
||||
|
||||
def rename_section(self, section: str, new_name: str) -> "GitConfigParser":
|
||||
--
|
||||
2.35.6
|
||||
@@ -0,0 +1,30 @@
|
||||
From cf273ba3958ad02afa361167a0d0f82e1f4b5f4d Mon Sep 17 00:00:00 2001
|
||||
From: "GPT 5.5" <codex@openai.com>
|
||||
Date: Wed, 29 Apr 2026 06:39:02 +0800
|
||||
Subject: [PATCH] avoid duplicate validation in set_value
|
||||
|
||||
CVE: CVE-2026-44244
|
||||
Upstream-Status: Backport [https://github.com/gitpython-developers/GitPython/commit/8e24503b42c1d63dd98e8b2e6a2f655bdd0821e3]
|
||||
|
||||
Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
|
||||
(cherry picked from commit 8e24503b42c1d63dd98e8b2e6a2f655bdd0821e3)
|
||||
Signed-off-by: Darsh Kelaiya <dkelaiya@cisco.com>
|
||||
---
|
||||
git/config.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/git/config.py b/git/config.py
|
||||
index ce307110..7988f5d9 100644
|
||||
--- a/git/config.py
|
||||
+++ b/git/config.py
|
||||
@@ -876,7 +876,7 @@ class GitConfigParser(cp.RawConfigParser, metaclass=MetaParserBuilder):
|
||||
value_str = self._value_to_string_safe(value)
|
||||
if not self.has_section(section):
|
||||
self.add_section(section)
|
||||
- self.set(section, option, value_str)
|
||||
+ super().set(section, option, value_str)
|
||||
return self
|
||||
|
||||
@needs_values
|
||||
--
|
||||
2.35.6
|
||||
@@ -10,8 +10,16 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=5279a7ab369ba336989dcf2a107e5c8e"
|
||||
|
||||
PYPI_PACKAGE = "GitPython"
|
||||
|
||||
CVE_PRODUCT = "gitpython_project:gitpython"
|
||||
|
||||
inherit pypi python_setuptools_build_meta
|
||||
|
||||
SRC_URI += "file://CVE-2026-42284.patch \
|
||||
file://CVE-2026-44243_p1.patch \
|
||||
file://CVE-2026-44243_p2.patch \
|
||||
file://CVE-2026-44244_p1.patch \
|
||||
file://CVE-2026-44244_p2.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "2d99869e0fef71a73cbd242528105af1d6c1b108c60dfabd994bf292f76c3ceb"
|
||||
|
||||
DEPENDS += " python3-gitdb"
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
From b34cd8399981324b361ae4f2b8e0eb77444ae0e3 Mon Sep 17 00:00:00 2001
|
||||
From: Kim Davies <kim@cynosure.com.au>
|
||||
Date: Sun, 10 May 2026 08:47:22 -0700
|
||||
Subject: [PATCH 1/3] Merge commit from fork
|
||||
|
||||
CVE: CVE-2026-45409
|
||||
Upstream-Status: Backport [https://github.com/kjd/idna/commit/c0dda4501df5d91c3181ce6f962dc5de74e82cc1]
|
||||
|
||||
Backport Changes:
|
||||
- Omit the HISTORY.rst hunk because it documents the upstream 3.14
|
||||
release and is not applicable to the Scarthgap 3.7 source.
|
||||
|
||||
(cherry picked from commit c0dda4501df5d91c3181ce6f962dc5de74e82cc1)
|
||||
Signed-off-by: Hetvi Thakar <hthakar@cisco.com>
|
||||
---
|
||||
idna/core.py | 14 ++++++++++++++
|
||||
tests/test_idna.py | 13 +++++++++++++
|
||||
2 files changed, 27 insertions(+)
|
||||
|
||||
diff --git a/idna/core.py b/idna/core.py
|
||||
index 0dae61a..a549326 100644
|
||||
--- a/idna/core.py
|
||||
+++ b/idna/core.py
|
||||
@@ -340,6 +340,15 @@ def encode(s: Union[str, bytes, bytearray], strict: bool = False, uts46: bool =
|
||||
raise IDNAError('should pass a unicode string to the function rather than a byte string.')
|
||||
if uts46:
|
||||
s = uts46_remap(s, std3_rules, transitional)
|
||||
+
|
||||
+ # Reject inputs that exceed the maximum DNS domain length up-front.
|
||||
+ # Each codepoint in a U-label contributes at least one octet to its
|
||||
+ # A-label form, so any input longer than the domain limit cannot
|
||||
+ # produce a valid A-domain. Short-circuiting here prevents per-label
|
||||
+ # validation from being driven into quadratic time
|
||||
+ if len(s) > 254:
|
||||
+ raise IDNAError("Domain too long")
|
||||
+
|
||||
trailing_dot = False
|
||||
result = []
|
||||
if strict:
|
||||
@@ -373,6 +382,11 @@ def decode(s: Union[str, bytes, bytearray], strict: bool = False, uts46: bool =
|
||||
raise IDNAError('Invalid ASCII in A-label')
|
||||
if uts46:
|
||||
s = uts46_remap(s, std3_rules, False)
|
||||
+ # See encode() for rationale; the same bound applies because every
|
||||
+ # legal A-domain is at most 254 octets and every codepoint of a
|
||||
+ # legal U-domain contributes at least one octet to its A-form.
|
||||
+ if len(s) > 254:
|
||||
+ raise IDNAError("Domain too long")
|
||||
trailing_dot = False
|
||||
result = []
|
||||
if not strict:
|
||||
diff --git a/tests/test_idna.py b/tests/test_idna.py
|
||||
index 81afb32..5001b48 100755
|
||||
--- a/tests/test_idna.py
|
||||
+++ b/tests/test_idna.py
|
||||
@@ -78,6 +78,19 @@ class IDNATests(unittest.TestCase):
|
||||
self.assertFalse(idna.valid_label_length('a' * 64))
|
||||
self.assertRaises(idna.IDNAError, idna.encode, 'a' * 64)
|
||||
|
||||
+ def test_oversized_input_rejected_promptly(self):
|
||||
+ # GHSA-65pc-fj4g-8rjx: encode/decode must reject inputs that
|
||||
+ # exceed the maximum DNS domain length before per-codepoint
|
||||
+ # validation runs, so labels dominated by CONTEXTO codepoints
|
||||
+ # cannot drive validation into quadratic time.
|
||||
+ import time
|
||||
+
|
||||
+ for payload in ("٠" * 8000, "・" * 8000 + "漢"):
|
||||
+ start = time.perf_counter()
|
||||
+ self.assertRaises(idna.IDNAError, idna.encode, payload)
|
||||
+ self.assertRaises(idna.IDNAError, idna.decode, payload)
|
||||
+ self.assertLess(time.perf_counter() - start, 1.0)
|
||||
+
|
||||
def test_check_bidi(self):
|
||||
|
||||
l = '\u0061'
|
||||
@@ -0,0 +1,48 @@
|
||||
From fabb538f1885a135e48a60de2e3c656d965e861d Mon Sep 17 00:00:00 2001
|
||||
From: Kim Davies <kim@cynosure.com.au>
|
||||
Date: Sun, 10 May 2026 12:44:47 -0700
|
||||
Subject: [PATCH 2/3] Use valid_string_length() for early oversized-input check
|
||||
|
||||
CVE: CVE-2026-45409
|
||||
Upstream-Status: Backport [https://github.com/kjd/idna/commit/628fef84d3eda59321c21127e73dcd873db23ead]
|
||||
|
||||
(cherry picked from commit 628fef84d3eda59321c21127e73dcd873db23ead)
|
||||
Signed-off-by: Hetvi Thakar <hthakar@cisco.com>
|
||||
---
|
||||
idna/core.py | 16 ++++++----------
|
||||
1 file changed, 6 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/idna/core.py b/idna/core.py
|
||||
index a549326..4a9fc75 100644
|
||||
--- a/idna/core.py
|
||||
+++ b/idna/core.py
|
||||
@@ -341,12 +341,9 @@ def encode(s: Union[str, bytes, bytearray], strict: bool = False, uts46: bool =
|
||||
if uts46:
|
||||
s = uts46_remap(s, std3_rules, transitional)
|
||||
|
||||
- # Reject inputs that exceed the maximum DNS domain length up-front.
|
||||
- # Each codepoint in a U-label contributes at least one octet to its
|
||||
- # A-label form, so any input longer than the domain limit cannot
|
||||
- # produce a valid A-domain. Short-circuiting here prevents per-label
|
||||
- # validation from being driven into quadratic time
|
||||
- if len(s) > 254:
|
||||
+ # Reject inputs that exceed the maximum DNS domain length up-front
|
||||
+ # to avoid expensive computation on long inputs.
|
||||
+ if not valid_string_length(s, trailing_dot=True):
|
||||
raise IDNAError("Domain too long")
|
||||
|
||||
trailing_dot = False
|
||||
@@ -382,10 +379,9 @@ def decode(s: Union[str, bytes, bytearray], strict: bool = False, uts46: bool =
|
||||
raise IDNAError('Invalid ASCII in A-label')
|
||||
if uts46:
|
||||
s = uts46_remap(s, std3_rules, False)
|
||||
- # See encode() for rationale; the same bound applies because every
|
||||
- # legal A-domain is at most 254 octets and every codepoint of a
|
||||
- # legal U-domain contributes at least one octet to its A-form.
|
||||
- if len(s) > 254:
|
||||
+ # Reject inputs that exceed the maximum DNS domain length up-front
|
||||
+ # to avoid expensive computation on long inputs.
|
||||
+ if not valid_string_length(s, trailing_dot=True):
|
||||
raise IDNAError("Domain too long")
|
||||
trailing_dot = False
|
||||
result = []
|
||||
@@ -0,0 +1,72 @@
|
||||
From 22acbaae97c3698005e69555eb4ebccc168b2fff Mon Sep 17 00:00:00 2001
|
||||
From: metsw24-max <metsw24@gmail.com>
|
||||
Date: Mon, 11 May 2026 20:59:30 +0530
|
||||
Subject: [PATCH 3/3] Enforce early length limits in check_label
|
||||
|
||||
CVE: CVE-2026-45409
|
||||
Upstream-Status: Backport [https://github.com/kjd/idna/commit/e1cb465b6376f33306a26f467d197edbcd01c4b9]
|
||||
|
||||
(cherry picked from commit e1cb465b6376f33306a26f467d197edbcd01c4b9)
|
||||
Signed-off-by: Hetvi Thakar <hthakar@cisco.com>
|
||||
---
|
||||
idna/core.py | 11 +++++++++++
|
||||
tests/test_idna.py | 24 ++++++++++++++++++++++++
|
||||
2 files changed, 35 insertions(+)
|
||||
|
||||
diff --git a/idna/core.py b/idna/core.py
|
||||
index 4a9fc75..26bb9fa 100644
|
||||
--- a/idna/core.py
|
||||
+++ b/idna/core.py
|
||||
@@ -230,6 +230,17 @@ def check_label(label: Union[str, bytes, bytearray]) -> None:
|
||||
label = label.decode('utf-8')
|
||||
if len(label) == 0:
|
||||
raise IDNAError('Empty Label')
|
||||
+ # Reject oversized labels before per-codepoint validation runs.
|
||||
+ # CONTEXTJ/CONTEXTO checks scan the whole label per codepoint, so an
|
||||
+ # uncapped label drives validation into quadratic time
|
||||
+ # (GHSA-65pc-fj4g-8rjx / CVE-2024-3651). encode()/decode() cap the
|
||||
+ # whole-domain length; this cap protects direct callers of
|
||||
+ # alabel/ulabel/check_label and the idna2008 incremental codec.
|
||||
+ # Use the whole-domain bound rather than the per-label DNS bound so
|
||||
+ # that UTS #46 lenient decoding of labels longer than 63 chars is
|
||||
+ # preserved.
|
||||
+ if not valid_string_length(label, trailing_dot=True):
|
||||
+ raise IDNAError("Label too long")
|
||||
|
||||
check_nfc(label)
|
||||
check_hyphen_ok(label)
|
||||
diff --git a/tests/test_idna.py b/tests/test_idna.py
|
||||
index 5001b48..2dc0892 100755
|
||||
--- a/tests/test_idna.py
|
||||
+++ b/tests/test_idna.py
|
||||
@@ -91,6 +91,30 @@ class IDNATests(unittest.TestCase):
|
||||
self.assertRaises(idna.IDNAError, idna.decode, payload)
|
||||
self.assertLess(time.perf_counter() - start, 1.0)
|
||||
|
||||
+ def test_oversized_label_rejected_promptly(self):
|
||||
+ # The whole-domain cap in encode()/decode() does not cover direct
|
||||
+ # callers of alabel/ulabel/check_label, nor the idna2008
|
||||
+ # incremental codec which calls alabel/ulabel per label. Without a
|
||||
+ # per-label cap, a single oversized CONTEXTO-heavy label still
|
||||
+ # drives validation into quadratic time.
|
||||
+ import codecs
|
||||
+ import time
|
||||
+
|
||||
+ import idna.codec # noqa: F401 (register the idna2008 codec)
|
||||
+
|
||||
+ payload = "・" * 8000 + "漢"
|
||||
+ start = time.perf_counter()
|
||||
+ self.assertRaises(idna.IDNAError, idna.check_label, payload)
|
||||
+ self.assertRaises(idna.IDNAError, idna.alabel, payload)
|
||||
+ self.assertRaises(idna.IDNAError, idna.ulabel, payload)
|
||||
+ self.assertRaises(
|
||||
+ idna.IDNAError,
|
||||
+ codecs.getincrementalencoder("idna2008")().encode,
|
||||
+ payload,
|
||||
+ True,
|
||||
+ )
|
||||
+ self.assertLess(time.perf_counter() - start, 1.0)
|
||||
+
|
||||
def test_check_bidi(self):
|
||||
|
||||
l = '\u0061'
|
||||
@@ -3,6 +3,11 @@ HOMEPAGE = "https://github.com/kjd/idna"
|
||||
LICENSE = "BSD-3-Clause & Python-2.0 & Unicode-TOU"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=204c0612e40a4dd46012a78d02c80fb1"
|
||||
|
||||
SRC_URI += " \
|
||||
file://CVE-2026-45409_p1.patch \
|
||||
file://CVE-2026-45409_p2.patch \
|
||||
file://CVE-2026-45409_p3.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"
|
||||
|
||||
CVE_PRODUCT = "kjd:idna kjd:internationalized_domain_names_in_applications"
|
||||
|
||||
110
meta/recipes-devtools/python/python3-mako/CVE-2026-41205.patch
Normal file
110
meta/recipes-devtools/python/python3-mako/CVE-2026-41205.patch
Normal file
@@ -0,0 +1,110 @@
|
||||
From e05ac61989a7fb9dd7dcde6cfd72dc48328719a3 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Bayer <mike_mp@zzzcomputing.com>
|
||||
Date: Tue, 14 Apr 2026 15:45:19 -0400
|
||||
Subject: [PATCH] Fix path traversal via double-slash URI prefix in
|
||||
TemplateLookup
|
||||
|
||||
The URI normalization in Template.__init__ stripped only a single
|
||||
leading slash, while TemplateLookup.get_template() stripped all
|
||||
leading slashes. A URI such as "//../../secret.txt" could bypass
|
||||
the directory traversal check. Changed to use lstrip("/") so
|
||||
both code paths handle leading slashes consistently.
|
||||
|
||||
Fixes: #434
|
||||
Change-Id: I400b9a40aed956cc2b5826a9c8736f104e84f1a4
|
||||
|
||||
CVE: CVE-2026-41205
|
||||
Upstream-Status: Backport [https://github.com/sqlalchemy/mako/commit/e05ac61989a7fb9dd7dcde6cfd72dc48328719a3]
|
||||
|
||||
(cherry picked from commit e05ac61989a7fb9dd7dcde6cfd72dc48328719a3)
|
||||
Signed-off-by: Hetvi Thakar <hthakar@cisco.com>
|
||||
---
|
||||
doc/build/unreleased/434.rst | 10 +++++++++
|
||||
mako/template.py | 4 +---
|
||||
test/test_lookup.py | 41 ++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 52 insertions(+), 3 deletions(-)
|
||||
create mode 100644 doc/build/unreleased/434.rst
|
||||
|
||||
diff --git a/doc/build/unreleased/434.rst b/doc/build/unreleased/434.rst
|
||||
new file mode 100644
|
||||
index 00000000..452265ad
|
||||
--- /dev/null
|
||||
+++ b/doc/build/unreleased/434.rst
|
||||
@@ -0,0 +1,10 @@
|
||||
+.. change::
|
||||
+ :tags: bug, template
|
||||
+ :tickets: 434
|
||||
+
|
||||
+ Fixed issue in :class:`.TemplateLookup` where a URI with a double-slash
|
||||
+ prefix (e.g. ``//../../``) could bypass the directory traversal check in
|
||||
+ :class:`.Template`, allowing reads of arbitrary files outside of the
|
||||
+ template directory. The issue was caused by an inconsistency in how leading
|
||||
+ slashes were stripped between :meth:`.TemplateLookup.get_template` and
|
||||
+ :class:`.Template` initialization.
|
||||
diff --git a/mako/template.py b/mako/template.py
|
||||
index 82c7cba8..d8ebc949 100644
|
||||
--- a/mako/template.py
|
||||
+++ b/mako/template.py
|
||||
@@ -259,9 +259,7 @@ def __init__(
|
||||
self.module_id = "memory:" + hex(id(self))
|
||||
self.uri = self.module_id
|
||||
|
||||
- u_norm = self.uri
|
||||
- if u_norm.startswith("/"):
|
||||
- u_norm = u_norm[1:]
|
||||
+ u_norm = self.uri.lstrip("/")
|
||||
u_norm = os.path.normpath(u_norm)
|
||||
if u_norm.startswith(".."):
|
||||
raise exceptions.TemplateLookupException(
|
||||
diff --git a/test/test_lookup.py b/test/test_lookup.py
|
||||
index 6a797d7a..2f7cdf0b 100644
|
||||
--- a/test/test_lookup.py
|
||||
+++ b/test/test_lookup.py
|
||||
@@ -127,6 +127,47 @@ def test_dont_accept_relative_outside_of_root(self):
|
||||
# this is OK since the .. cancels out
|
||||
runtime._lookup_template(ctx, "foo/../index.html", index.uri)
|
||||
|
||||
+ def test_dont_accept_relative_outside_of_root_via_double_slash(self):
|
||||
+ """test that double-slash URI prefix can't bypass the
|
||||
+ path traversal check"""
|
||||
+ with tempfile.TemporaryDirectory() as base:
|
||||
+ tmpl_dir = os.path.join(base, "app", "templates")
|
||||
+ os.makedirs(tmpl_dir)
|
||||
+ with open(os.path.join(tmpl_dir, "index.html"), "w") as f:
|
||||
+ f.write("Hello")
|
||||
+
|
||||
+ secret = os.path.join(base, "secrets", "creds.txt")
|
||||
+ os.makedirs(os.path.dirname(secret))
|
||||
+ with open(secret, "w") as f:
|
||||
+ f.write("SECRET_KEY=supersecret123")
|
||||
+
|
||||
+ tl = lookup.TemplateLookup(directories=[tmpl_dir])
|
||||
+ rel = os.path.relpath(secret, tmpl_dir)
|
||||
+
|
||||
+ # single-slash prefix should also be blocked
|
||||
+ assert_raises_message(
|
||||
+ exceptions.TemplateLookupException,
|
||||
+ "cannot be relative outside of the root path",
|
||||
+ tl.get_template,
|
||||
+ "/" + rel,
|
||||
+ )
|
||||
+
|
||||
+ # double-slash prefix must not bypass the check
|
||||
+ assert_raises_message(
|
||||
+ exceptions.TemplateLookupException,
|
||||
+ "cannot be relative outside of the root path",
|
||||
+ tl.get_template,
|
||||
+ "//" + rel,
|
||||
+ )
|
||||
+
|
||||
+ # triple-slash prefix must not bypass the check
|
||||
+ assert_raises_message(
|
||||
+ exceptions.TemplateLookupException,
|
||||
+ "cannot be relative outside of the root path",
|
||||
+ tl.get_template,
|
||||
+ "///" + rel,
|
||||
+ )
|
||||
+
|
||||
def test_checking_against_bad_filetype(self):
|
||||
with tempfile.TemporaryDirectory() as tempdir:
|
||||
tl = lookup.TemplateLookup(directories=[tempdir])
|
||||
@@ -8,6 +8,8 @@ PYPI_PACKAGE = "Mako"
|
||||
|
||||
inherit pypi python_setuptools_build_meta
|
||||
|
||||
SRC_URI += "file://CVE-2026-41205.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "2a0c8ad7f6274271b3bb7467dd37cf9cc6dab4bc19cb69a4ef10669402de698e"
|
||||
|
||||
RDEPENDS:${PN} = "python3-html \
|
||||
|
||||
@@ -18,6 +18,8 @@ SRC_URI[sha256sum] = "2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4
|
||||
GITHUB_BASE_URI = "https://github.com/numpy/numpy/releases"
|
||||
UPSTREAM_CHECK_REGEX = "releases/tag/v?(?P<pver>\d+(\.\d+)+)$"
|
||||
|
||||
CVE_PRODUCT = "numpy:numpy"
|
||||
|
||||
DEPENDS += "python3-cython-native"
|
||||
|
||||
inherit ptest setuptools3 github-releases
|
||||
|
||||
245
meta/recipes-devtools/python/python3-pyasn1/CVE-2026-59884.patch
Normal file
245
meta/recipes-devtools/python/python3-pyasn1/CVE-2026-59884.patch
Normal file
@@ -0,0 +1,245 @@
|
||||
From 38e8ae286160eb27620e7cb42108b3b28d1f299f Mon Sep 17 00:00:00 2001
|
||||
From: Simon Pichugin <simon.pichugin@gmail.com>
|
||||
Date: Wed, 8 Jul 2026 17:36:30 -0700
|
||||
Subject: [PATCH] Merge commit from fork
|
||||
|
||||
CVE: CVE-2026-59884
|
||||
Upstream-Status: Backport [https://github.com/pyasn1/pyasn1/commit/628e36ecbb5277a3f01572ce418ef54271b165a5]
|
||||
|
||||
(cherry picked from commit 628e36ecbb5277a3f01572ce418ef54271b165a5)
|
||||
Signed-off-by: Emily Vekariya <evekariy@cisco.com>
|
||||
---
|
||||
pyasn1/codec/ber/decoder.py | 13 +++++++++++--
|
||||
pyasn1/type/tag.py | 20 ++++++++++++++++----
|
||||
tests/codec/ber/test_decoder.py | 25 +++++++++++++++++++++++++
|
||||
tests/codec/cer/test_decoder.py | 15 +++++++++++++++
|
||||
tests/codec/der/test_decoder.py | 15 +++++++++++++++
|
||||
tests/type/test_tag.py | 20 ++++++++++++++++++++
|
||||
6 files changed, 102 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/pyasn1/codec/ber/decoder.py b/pyasn1/codec/ber/decoder.py
|
||||
index be8ba65..18865c2 100644
|
||||
--- a/pyasn1/codec/ber/decoder.py
|
||||
+++ b/pyasn1/codec/ber/decoder.py
|
||||
@@ -39,6 +39,10 @@ SubstrateUnderrunError = error.SubstrateUnderrunError
|
||||
# 20 octets allows up to 140-bit integers, supporting UUID-based OIDs
|
||||
MAX_OID_ARC_CONTINUATION_OCTETS = 20
|
||||
|
||||
+# Maximum number of octets in a long-form tag ID (20 octets = up to
|
||||
+# 140-bit tag IDs, matching the OID arc limit)
|
||||
+MAX_TAG_OCTETS = 20
|
||||
+
|
||||
|
||||
class AbstractPayloadDecoder(object):
|
||||
protoComponent = None
|
||||
@@ -1570,7 +1574,7 @@ class SingleItemDecoder(object):
|
||||
|
||||
if tagId == 0x1F:
|
||||
isShortTag = False
|
||||
- lengthOctetIdx = 0
|
||||
+ tagOctetCount = 0
|
||||
tagId = 0
|
||||
|
||||
while True:
|
||||
@@ -1584,7 +1588,12 @@ class SingleItemDecoder(object):
|
||||
)
|
||||
|
||||
integerTag = ord(integerByte)
|
||||
- lengthOctetIdx += 1
|
||||
+ tagOctetCount += 1
|
||||
+ if tagOctetCount > MAX_TAG_OCTETS:
|
||||
+ raise error.PyAsn1Error(
|
||||
+ 'Tag ID octet count exceeds limit (%d)' % (
|
||||
+ MAX_TAG_OCTETS,)
|
||||
+ )
|
||||
tagId <<= 7
|
||||
tagId |= (integerTag & 0x7F)
|
||||
|
||||
diff --git a/pyasn1/type/tag.py b/pyasn1/type/tag.py
|
||||
index a21a405..bbbdd85 100644
|
||||
--- a/pyasn1/type/tag.py
|
||||
+++ b/pyasn1/type/tag.py
|
||||
@@ -34,6 +34,16 @@ tagCategoryExplicit = 0x02
|
||||
tagCategoryUntagged = 0x04
|
||||
|
||||
|
||||
+def _tagIdToStr(tagId):
|
||||
+ # Decimal rendering of a huge tag ID can exceed the interpreter's
|
||||
+ # integer-to-string conversion limit (sys.get_int_max_str_digits(),
|
||||
+ # Python 3.11+) and raise ValueError; hexadecimal is not limited
|
||||
+ try:
|
||||
+ return str(tagId)
|
||||
+ except ValueError:
|
||||
+ return hex(tagId)
|
||||
+
|
||||
+
|
||||
class Tag(object):
|
||||
"""Create ASN.1 tag
|
||||
|
||||
@@ -56,7 +66,8 @@ class Tag(object):
|
||||
"""
|
||||
def __init__(self, tagClass, tagFormat, tagId):
|
||||
if tagId < 0:
|
||||
- raise error.PyAsn1Error('Negative tag ID (%s) not allowed' % tagId)
|
||||
+ raise error.PyAsn1Error(
|
||||
+ 'Negative tag ID (%s) not allowed' % _tagIdToStr(tagId))
|
||||
self.__tagClass = tagClass
|
||||
self.__tagFormat = tagFormat
|
||||
self.__tagId = tagId
|
||||
@@ -65,7 +76,7 @@ class Tag(object):
|
||||
|
||||
def __repr__(self):
|
||||
representation = '[%s:%s:%s]' % (
|
||||
- self.__tagClass, self.__tagFormat, self.__tagId)
|
||||
+ self.__tagClass, self.__tagFormat, _tagIdToStr(self.__tagId))
|
||||
return '<%s object, tag %s>' % (
|
||||
self.__class__.__name__, representation)
|
||||
|
||||
@@ -194,8 +205,9 @@ class TagSet(object):
|
||||
self.__hash = hash(self.__superTagsClassId)
|
||||
|
||||
def __repr__(self):
|
||||
- representation = '-'.join(['%s:%s:%s' % (x.tagClass, x.tagFormat, x.tagId)
|
||||
- for x in self.__superTags])
|
||||
+ representation = '-'.join(
|
||||
+ ['%s:%s:%s' % (x.tagClass, x.tagFormat, _tagIdToStr(x.tagId))
|
||||
+ for x in self.__superTags])
|
||||
if representation:
|
||||
representation = 'tags ' + representation
|
||||
else:
|
||||
diff --git a/tests/codec/ber/test_decoder.py b/tests/codec/ber/test_decoder.py
|
||||
index f6ff7b0..0152027 100644
|
||||
--- a/tests/codec/ber/test_decoder.py
|
||||
+++ b/tests/codec/ber/test_decoder.py
|
||||
@@ -34,6 +34,31 @@ class LargeTagDecoderTestCase(BaseTestCase):
|
||||
def testLongTag(self):
|
||||
assert decoder.decode(ints2octs((0x1f, 2, 1, 0)))[0].tagSet == univ.Integer.tagSet
|
||||
|
||||
+ def testVeryLongTagRoundTrip(self):
|
||||
+ # (1 << 140) - 1 is the largest tag ID fitting the 20 octet limit
|
||||
+ for tagId in (1 << 77, (1 << 140) - 1):
|
||||
+ largeTag = tag.Tag(tag.tagClassContext, tag.tagFormatSimple, tagId)
|
||||
+ asn1Spec = univ.Integer().subtype(implicitTag=largeTag)
|
||||
+ value = univ.Integer(1).subtype(implicitTag=largeTag)
|
||||
+
|
||||
+ decoded, rest = decoder.decode(encoder.encode(value), asn1Spec=asn1Spec)
|
||||
+
|
||||
+ assert rest == b''
|
||||
+ assert decoded == 1
|
||||
+
|
||||
+ def testExcessiveLongTag(self):
|
||||
+ # 1 << 140 is the smallest tag ID needing 21 octets, one over the limit
|
||||
+ excessiveTag = tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1 << 140)
|
||||
+ asn1Spec = univ.Integer().subtype(implicitTag=excessiveTag)
|
||||
+ substrate = encoder.encode(univ.Integer(1).subtype(implicitTag=excessiveTag))
|
||||
+
|
||||
+ try:
|
||||
+ decoder.decode(substrate, asn1Spec=asn1Spec)
|
||||
+ except error.PyAsn1Error:
|
||||
+ pass
|
||||
+ else:
|
||||
+ assert 0, 'excessive long tag tolerated'
|
||||
+
|
||||
def testTagsEquivalence(self):
|
||||
integer = univ.Integer(2).subtype(implicitTag=tag.Tag(tag.tagClassContext, 0, 0))
|
||||
assert decoder.decode(ints2octs((0x9f, 0x80, 0x00, 0x02, 0x01, 0x02)), asn1Spec=integer) == decoder.decode(
|
||||
diff --git a/tests/codec/cer/test_decoder.py b/tests/codec/cer/test_decoder.py
|
||||
index 3d27194..d759f76 100644
|
||||
--- a/tests/codec/cer/test_decoder.py
|
||||
+++ b/tests/codec/cer/test_decoder.py
|
||||
@@ -67,6 +67,21 @@ class OctetStringDecoderTestCase(BaseTestCase):
|
||||
# TODO: test failures on short chunked and long unchunked substrate samples
|
||||
|
||||
|
||||
+class LargeTagDecoderTestCase(BaseTestCase):
|
||||
+ def testExcessiveLongTag(self):
|
||||
+ # 1 << 140 is the smallest tag ID needing 21 octets, one over the limit
|
||||
+ excessiveTag = tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1 << 140)
|
||||
+ asn1Spec = univ.Integer().subtype(implicitTag=excessiveTag)
|
||||
+ substrate = encoder.encode(univ.Integer(1).subtype(implicitTag=excessiveTag))
|
||||
+
|
||||
+ try:
|
||||
+ decoder.decode(substrate, asn1Spec=asn1Spec)
|
||||
+ except PyAsn1Error:
|
||||
+ pass
|
||||
+ else:
|
||||
+ assert 0, 'excessive long tag tolerated'
|
||||
+
|
||||
+
|
||||
class RealDecoderTestCase(BaseTestCase):
|
||||
def testLargeBinaryRoundTrip(self):
|
||||
substrate = encoder.encode(univ.Real((-1, 2, 76354972)))
|
||||
diff --git a/tests/codec/der/test_decoder.py b/tests/codec/der/test_decoder.py
|
||||
index 553563c..726c999 100644
|
||||
--- a/tests/codec/der/test_decoder.py
|
||||
+++ b/tests/codec/der/test_decoder.py
|
||||
@@ -73,6 +73,21 @@ class OctetStringDecoderTestCase(BaseTestCase):
|
||||
assert 0, 'chunked encoding tolerated'
|
||||
|
||||
|
||||
+class LargeTagDecoderTestCase(BaseTestCase):
|
||||
+ def testExcessiveLongTag(self):
|
||||
+ # 1 << 140 is the smallest tag ID needing 21 octets, one over the limit
|
||||
+ excessiveTag = tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1 << 140)
|
||||
+ asn1Spec = univ.Integer().subtype(implicitTag=excessiveTag)
|
||||
+ substrate = encoder.encode(univ.Integer(1).subtype(implicitTag=excessiveTag))
|
||||
+
|
||||
+ try:
|
||||
+ decoder.decode(substrate, asn1Spec=asn1Spec)
|
||||
+ except PyAsn1Error:
|
||||
+ pass
|
||||
+ else:
|
||||
+ assert 0, 'excessive long tag tolerated'
|
||||
+
|
||||
+
|
||||
class RealDecoderTestCase(BaseTestCase):
|
||||
def testCanonicalLargeBinaryReal(self):
|
||||
substrate = encoder.encode(univ.Real((1, 2, 1000000)))
|
||||
diff --git a/tests/type/test_tag.py b/tests/type/test_tag.py
|
||||
index d0ffa07..ab9b8b1 100644
|
||||
--- a/tests/type/test_tag.py
|
||||
+++ b/tests/type/test_tag.py
|
||||
@@ -9,6 +9,7 @@ import unittest
|
||||
|
||||
from tests.base import BaseTestCase
|
||||
|
||||
+from pyasn1 import error
|
||||
from pyasn1.type import tag
|
||||
|
||||
|
||||
@@ -23,6 +24,19 @@ class TagReprTestCase(TagTestCaseBase):
|
||||
def testRepr(self):
|
||||
assert 'Tag' in repr(self.t1)
|
||||
|
||||
+ def testReprHugeTagId(self):
|
||||
+ # must not hit the interpreter's int-to-str conversion limit
|
||||
+ hugeTag = tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1 << 100000)
|
||||
+ assert 'Tag' in repr(hugeTag)
|
||||
+
|
||||
+ def testNegativeHugeTagId(self):
|
||||
+ try:
|
||||
+ tag.Tag(tag.tagClassContext, tag.tagFormatSimple, -(1 << 100000))
|
||||
+ except error.PyAsn1Error:
|
||||
+ pass
|
||||
+ else:
|
||||
+ assert 0, 'negative tag ID tolerated'
|
||||
+
|
||||
|
||||
class TagCmpTestCase(TagTestCaseBase):
|
||||
def testCmp(self):
|
||||
@@ -54,6 +68,12 @@ class TagSetReprTestCase(TagSetTestCaseBase):
|
||||
def testRepr(self):
|
||||
assert 'TagSet' in repr(self.ts1)
|
||||
|
||||
+ def testReprHugeTagId(self):
|
||||
+ # must not hit the interpreter's int-to-str conversion limit
|
||||
+ hugeTagSet = self.ts1.tagImplicitly(
|
||||
+ tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1 << 100000))
|
||||
+ assert 'TagSet' in repr(hugeTagSet)
|
||||
+
|
||||
|
||||
class TagSetCmpTestCase(TagSetTestCaseBase):
|
||||
def testCmp(self):
|
||||
--
|
||||
2.34.1
|
||||
|
||||
252
meta/recipes-devtools/python/python3-pyasn1/CVE-2026-59886.patch
Normal file
252
meta/recipes-devtools/python/python3-pyasn1/CVE-2026-59886.patch
Normal file
@@ -0,0 +1,252 @@
|
||||
From 9b89b511a7284f17ef3a2de6d05fbf6030133abb Mon Sep 17 00:00:00 2001
|
||||
From: Simon Pichugin <simon.pichugin@gmail.com>
|
||||
Date: Wed, 8 Jul 2026 17:32:09 -0700
|
||||
Subject: [PATCH] Merge commit from fork
|
||||
|
||||
CVE: CVE-2026-59886
|
||||
Upstream-Status: Backport [https://github.com/pyasn1/pyasn1/commit/e60c691cb91addb8fcefa2f537e85ede6fb1e886]
|
||||
|
||||
(cherry picked from commit e60c691cb91addb8fcefa2f537e85ede6fb1e886)
|
||||
Signed-off-by: Emily Vekariya <evekariy@cisco.com>
|
||||
---
|
||||
pyasn1/type/univ.py | 21 +++++++++----
|
||||
tests/codec/ber/test_decoder.py | 53 +++++++++++++++++++++++++++------
|
||||
tests/codec/cer/test_decoder.py | 10 +++++++
|
||||
tests/codec/der/test_decoder.py | 19 ++++++++++++
|
||||
tests/type/test_univ.py | 40 +++++++++++++++++++++++++
|
||||
5 files changed, 129 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py
|
||||
index c5d0778..adff2df 100644
|
||||
--- a/pyasn1/type/univ.py
|
||||
+++ b/pyasn1/type/univ.py
|
||||
@@ -1318,7 +1318,7 @@ class Real(base.SimpleAsn1Type):
|
||||
def __normalizeBase10(value):
|
||||
m, b, e = value
|
||||
while m and m % 10 == 0:
|
||||
- m /= 10
|
||||
+ m //= 10
|
||||
e += 1
|
||||
return m, b, e
|
||||
|
||||
@@ -1457,10 +1457,21 @@ class Real(base.SimpleAsn1Type):
|
||||
def __float__(self):
|
||||
if self._value in self._inf:
|
||||
return self._value
|
||||
- else:
|
||||
- return float(
|
||||
- self._value[0] * pow(self._value[1], self._value[2])
|
||||
- )
|
||||
+
|
||||
+ mantissa, base, exponent = self._value
|
||||
+
|
||||
+ if not mantissa:
|
||||
+ return 0.0
|
||||
+
|
||||
+ if base == 2:
|
||||
+ return math.ldexp(float(mantissa), exponent)
|
||||
+
|
||||
+ # base is 10 (prettyIn() rejects everything else); refuse to
|
||||
+ # materialize astronomically large integers via pow()
|
||||
+ if exponent > sys.float_info.max_10_exp:
|
||||
+ raise OverflowError('Real value too large to convert to float')
|
||||
+
|
||||
+ return float(mantissa * pow(base, exponent))
|
||||
|
||||
def __abs__(self):
|
||||
return self.clone(abs(float(self)))
|
||||
diff --git a/tests/codec/ber/test_decoder.py b/tests/codec/ber/test_decoder.py
|
||||
index f033dfd..f6ff7b0 100644
|
||||
--- a/tests/codec/ber/test_decoder.py
|
||||
+++ b/tests/codec/ber/test_decoder.py
|
||||
@@ -21,6 +21,7 @@ from pyasn1.type import univ
|
||||
from pyasn1.type import char
|
||||
from pyasn1.codec import streaming
|
||||
from pyasn1.codec.ber import decoder
|
||||
+from pyasn1.codec.ber import encoder
|
||||
from pyasn1.codec.ber import eoo
|
||||
from pyasn1.compat.octets import ints2octs, str2octs, null
|
||||
from pyasn1 import error
|
||||
@@ -547,17 +548,51 @@ class RealDecoderTestCase(BaseTestCase):
|
||||
ints2octs((9, 4, 161, 255, 1, 3))
|
||||
) == (univ.Real((3, 2, -1020)), null)
|
||||
|
||||
-# TODO: this requires Real type comparison fix
|
||||
+ def testBin6(self): # large exponent, base = 16
|
||||
+ value, rest = decoder.decode(
|
||||
+ bytes((9, 5, 162, 0, 255, 255, 1))
|
||||
+ )
|
||||
+
|
||||
+ assert tuple(value) == (1, 2, 262140)
|
||||
+ assert rest == b''
|
||||
+
|
||||
+ def testBin7(self): # large exponent in 4-octet form, base = 16
|
||||
+ value, rest = decoder.decode(
|
||||
+ bytes((9, 7, 227, 4, 1, 35, 69, 103, 1))
|
||||
+ )
|
||||
|
||||
-# def testBin6(self):
|
||||
-# assert decoder.decode(
|
||||
-# ints2octs((9, 5, 162, 0, 255, 255, 1))
|
||||
-# ) == (univ.Real((1, 2, 262140)), null)
|
||||
+ assert tuple(value) == (-1, 2, 76354972)
|
||||
+ assert rest == b''
|
||||
+
|
||||
+ def testLargeBinaryRoundTrip(self):
|
||||
+ substrate = encoder.encode(univ.Real((-1, 2, 76354972)))
|
||||
+ value, rest = decoder.decode(substrate)
|
||||
+
|
||||
+ assert tuple(value) == (-1, 2, 76354972)
|
||||
+ assert rest == b''
|
||||
+
|
||||
+ def testLongFormBinaryRealExponentLength(self):
|
||||
+ value, rest = decoder.decode(
|
||||
+ bytes((9, 6, 0x83, 3, 0x0f, 0x42, 0x40, 1))
|
||||
+ )
|
||||
|
||||
-# def testBin7(self):
|
||||
-# assert decoder.decode(
|
||||
-# ints2octs((9, 7, 227, 4, 1, 35, 69, 103, 1))
|
||||
-# ) == (univ.Real((-1, 2, 76354972)), null)
|
||||
+ assert tuple(value) == (1, 2, 1000000)
|
||||
+ assert rest == b''
|
||||
+
|
||||
+ def testLargeBinaryPrettyPrintOverflow(self):
|
||||
+ value, rest = decoder.decode(
|
||||
+ b'\t\t\xeb\x060662.666\xd0B\x00\x00\x00\x00\x00\x00\x00'
|
||||
+ )
|
||||
+
|
||||
+ assert value.prettyPrint() == '<overflow>'
|
||||
+ assert rest == b'6\xd0B\x00\x00\x00\x00\x00\x00\x00'
|
||||
+
|
||||
+ try:
|
||||
+ float(value)
|
||||
+ except OverflowError:
|
||||
+ pass
|
||||
+ else:
|
||||
+ assert 0, '__float__() tolerated overflow'
|
||||
|
||||
def testPlusInf(self):
|
||||
assert decoder.decode(
|
||||
diff --git a/tests/codec/cer/test_decoder.py b/tests/codec/cer/test_decoder.py
|
||||
index 133affd..3d27194 100644
|
||||
--- a/tests/codec/cer/test_decoder.py
|
||||
+++ b/tests/codec/cer/test_decoder.py
|
||||
@@ -15,6 +15,7 @@ from pyasn1.type import opentype
|
||||
from pyasn1.type import univ
|
||||
from pyasn1.codec.cer import decoder
|
||||
from pyasn1.compat.octets import ints2octs, str2octs, null
|
||||
+from pyasn1.codec.cer import encoder
|
||||
from pyasn1.error import PyAsn1Error
|
||||
|
||||
|
||||
@@ -66,6 +67,15 @@ class OctetStringDecoderTestCase(BaseTestCase):
|
||||
# TODO: test failures on short chunked and long unchunked substrate samples
|
||||
|
||||
|
||||
+class RealDecoderTestCase(BaseTestCase):
|
||||
+ def testLargeBinaryRoundTrip(self):
|
||||
+ substrate = encoder.encode(univ.Real((-1, 2, 76354972)))
|
||||
+ value, rest = decoder.decode(substrate)
|
||||
+
|
||||
+ assert tuple(value) == (-1, 2, 76354972)
|
||||
+ assert rest == b''
|
||||
+
|
||||
+
|
||||
class SequenceDecoderWithUntaggedOpenTypesTestCase(BaseTestCase):
|
||||
def setUp(self):
|
||||
openType = opentype.OpenType(
|
||||
diff --git a/tests/codec/der/test_decoder.py b/tests/codec/der/test_decoder.py
|
||||
index 5bc9deb..553563c 100644
|
||||
--- a/tests/codec/der/test_decoder.py
|
||||
+++ b/tests/codec/der/test_decoder.py
|
||||
@@ -15,6 +15,7 @@ from pyasn1.type import opentype
|
||||
from pyasn1.type import univ
|
||||
from pyasn1.codec.der import decoder
|
||||
from pyasn1.compat.octets import ints2octs, null
|
||||
+from pyasn1.codec.der import encoder
|
||||
from pyasn1.error import PyAsn1Error
|
||||
|
||||
|
||||
@@ -72,6 +73,24 @@ class OctetStringDecoderTestCase(BaseTestCase):
|
||||
assert 0, 'chunked encoding tolerated'
|
||||
|
||||
|
||||
+class RealDecoderTestCase(BaseTestCase):
|
||||
+ def testCanonicalLargeBinaryReal(self):
|
||||
+ substrate = encoder.encode(univ.Real((1, 2, 1000000)))
|
||||
+ assert substrate == bytes((9, 5, 0x82, 0x0f, 0x42, 0x40, 1))
|
||||
+
|
||||
+ value, rest = decoder.decode(substrate)
|
||||
+
|
||||
+ assert tuple(value) == (1, 2, 1000000)
|
||||
+ assert rest == b''
|
||||
+
|
||||
+ def testLargeBinaryRoundTrip(self):
|
||||
+ substrate = encoder.encode(univ.Real((-1, 2, 76354972)))
|
||||
+ value, rest = decoder.decode(substrate)
|
||||
+
|
||||
+ assert tuple(value) == (-1, 2, 76354972)
|
||||
+ assert rest == b''
|
||||
+
|
||||
+
|
||||
class SequenceDecoderWithUntaggedOpenTypesTestCase(BaseTestCase):
|
||||
def setUp(self):
|
||||
openType = opentype.OpenType(
|
||||
diff --git a/tests/type/test_univ.py b/tests/type/test_univ.py
|
||||
index 8aec183..bc21c37 100644
|
||||
--- a/tests/type/test_univ.py
|
||||
+++ b/tests/type/test_univ.py
|
||||
@@ -780,9 +780,49 @@ class RealTestCase(BaseTestCase):
|
||||
def testFloat(self):
|
||||
assert float(univ.Real(4.0)) == 4.0, '__float__() fails'
|
||||
|
||||
+ def testFloatBase10Precision(self):
|
||||
+ assert float(univ.Real((3, 10, 23))) == 3e23, '__float__() lost base-10 behavior'
|
||||
+
|
||||
+ def testFloatOverflow(self):
|
||||
+ try:
|
||||
+ float(univ.Real((1, 2, 1000000)))
|
||||
+ except OverflowError:
|
||||
+ pass
|
||||
+ else:
|
||||
+ assert 0, '__float__() tolerated overflow'
|
||||
+
|
||||
+ assert univ.Real((1, 2, 1000000)).prettyPrint() == '<overflow>'
|
||||
+
|
||||
+ def testFloatUnderflow(self):
|
||||
+ assert float(univ.Real((1, 2, -1000000))) == 0.0, '__float__() failed underflow'
|
||||
+
|
||||
+ def testFloatZeroMantissa(self):
|
||||
+ assert float(univ.Real((0, 10, 1000000000))) == 0.0, '__float__() failed zero mantissa'
|
||||
+ assert float(univ.Real((0, 2, 1000000000))) == 0.0, '__float__() failed zero mantissa'
|
||||
+
|
||||
+ def testFloatBase10Overflow(self):
|
||||
+ try:
|
||||
+ float(univ.Real((1, 10, sys.float_info.max_10_exp + 1)))
|
||||
+ except OverflowError:
|
||||
+ pass
|
||||
+ else:
|
||||
+ assert 0, '__float__() tolerated base-10 overflow'
|
||||
+
|
||||
+ def testFloatBase10NormalizedOverflow(self):
|
||||
+ try:
|
||||
+ float(univ.Real((10, 10, sys.float_info.max_10_exp)))
|
||||
+ except OverflowError:
|
||||
+ pass
|
||||
+ else:
|
||||
+ assert 0, '__float__() tolerated normalized base-10 overflow'
|
||||
+
|
||||
def testPrettyIn(self):
|
||||
assert univ.Real((3, 10, 0)) == 3, 'prettyIn() fails'
|
||||
|
||||
+ def testPrettyInBigBase10Mantissa(self):
|
||||
+ assert tuple(univ.Real((10 ** 400, 10, 0))) == (1, 10, 400), \
|
||||
+ 'prettyIn() big mantissa normalization fails'
|
||||
+
|
||||
# infinite float values
|
||||
def testStrInf(self):
|
||||
assert str(univ.Real('inf')) == 'inf', 'str() fails'
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -3,3 +3,4 @@ inherit python_setuptools_build_meta
|
||||
|
||||
SRC_URI[sha256sum] = "09609209ed7de61c2b560cc5c8c4fbf892f8b15b1faf7e4cbffac97db1fffda7"
|
||||
|
||||
CVE_PRODUCT = "pycryptodome:pycryptodome"
|
||||
|
||||
@@ -3,6 +3,8 @@ inherit python_setuptools_build_meta
|
||||
|
||||
SRC_URI[sha256sum] = "7a710b79baddd65b806402e14766c721aee8fb83381769c27920f26476276c1e"
|
||||
|
||||
CVE_PRODUCT = "pycryptodome:pycryptodomex"
|
||||
|
||||
FILES:${PN}-tests = " \
|
||||
${PYTHON_SITEPACKAGES_DIR}/Cryptodome/SelfTest/ \
|
||||
${PYTHON_SITEPACKAGES_DIR}/Cryptodome/SelfTest/__pycache__/ \
|
||||
|
||||
@@ -8,6 +8,8 @@ SRC_URI[sha256sum] = "c45be39f7882c9d34243236f2d63cbd58039e360f85d0913425fbd7cee
|
||||
|
||||
inherit python_flit_core pypi
|
||||
|
||||
CVE_PRODUCT = "wheel_project:wheel"
|
||||
|
||||
SRC_URI += "file://CVE-2026-24049.patch"
|
||||
|
||||
BBCLASSEXTEND = "native nativesdk"
|
||||
|
||||
@@ -19,7 +19,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in
|
||||
index 2d235d2..1ac2263 100644
|
||||
--- a/Makefile.pre.in
|
||||
+++ b/Makefile.pre.in
|
||||
@@ -2356,6 +2356,8 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
|
||||
@@ -2361,6 +2361,8 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
|
||||
@ # Substitution happens here, as the completely-expanded BINDIR
|
||||
@ # is not available in configure
|
||||
sed -e "s,@EXENAME@,$(EXENAME)," < $(srcdir)/Misc/python-config.in >python-config.py
|
||||
|
||||
@@ -13,7 +13,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in
|
||||
index 083f4c7..dce36a5 100644
|
||||
--- a/Makefile.pre.in
|
||||
+++ b/Makefile.pre.in
|
||||
@@ -660,8 +660,7 @@ profile-run-stamp:
|
||||
@@ -663,8 +663,7 @@ profile-run-stamp:
|
||||
# enabled.
|
||||
$(MAKE) profile-gen-stamp
|
||||
# Next, run the profile task to generate the profile information.
|
||||
|
||||
@@ -16,7 +16,7 @@ diff --git a/Lib/tarfile.py b/Lib/tarfile.py
|
||||
index 0a0f31e..4dfb67d 100755
|
||||
--- a/Lib/tarfile.py
|
||||
+++ b/Lib/tarfile.py
|
||||
@@ -2688,7 +2688,8 @@ class TarFile(object):
|
||||
@@ -2721,7 +2721,8 @@ class TarFile(object):
|
||||
os.lchown(targetpath, u, g)
|
||||
else:
|
||||
os.chown(targetpath, u, g)
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
From 14d7d2e8f51a17c23c98f13f33743253a0b7a18a Mon Sep 17 00:00:00 2001
|
||||
From: "Miss Islington (bot)"
|
||||
<31488909+miss-islington@users.noreply.github.com>
|
||||
Date: Mon, 18 May 2026 19:43:51 +0200
|
||||
Subject: [PATCH] [3.12] gh-141707: Skip TarInfo DIRTYPE normalization during
|
||||
GNU long name handling (#145817)
|
||||
|
||||
gh-141707: Skip TarInfo DIRTYPE normalization during GNU long name handling
|
||||
|
||||
CVE: CVE-2025-13462
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/d10950739a78f54d0718d88fb5a868374603c084]
|
||||
|
||||
Backport Changes:
|
||||
- This file is not present in the current version and is therefore omitted
|
||||
Misc/NEWS.d/next/Library/2025-11-18-06-35-53.gh-issue-141707.DBmQIy.rst
|
||||
|
||||
(cherry picked from commit 42d754e34c06e57ad6b8e7f92f32af679912d8ab)
|
||||
|
||||
Co-authored-by: Seth Michael Larson <seth@python.org>
|
||||
Co-authored-by: Eashwar Ranganathan <eashwar@eashwar.com>
|
||||
(cherry picked from commit d10950739a78f54d0718d88fb5a868374603c084)
|
||||
Signed-off-by: Sudhir Dumbhare <sudumbha@cisco.com>
|
||||
---
|
||||
Lib/tarfile.py | 29 +++++++++++++++++++++++++----
|
||||
Lib/test/test_tarfile.py | 19 +++++++++++++++++++
|
||||
Misc/ACKS | 1 +
|
||||
3 files changed, 45 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
|
||||
index 99451aa765..70fdbe85b0 100755
|
||||
--- a/Lib/tarfile.py
|
||||
+++ b/Lib/tarfile.py
|
||||
@@ -1246,6 +1246,20 @@ class TarInfo(object):
|
||||
@classmethod
|
||||
def frombuf(cls, buf, encoding, errors):
|
||||
"""Construct a TarInfo object from a 512 byte bytes object.
|
||||
+
|
||||
+ To support the old v7 tar format AREGTYPE headers are
|
||||
+ transformed to DIRTYPE headers if their name ends in '/'.
|
||||
+ """
|
||||
+ return cls._frombuf(buf, encoding, errors)
|
||||
+
|
||||
+ @classmethod
|
||||
+ def _frombuf(cls, buf, encoding, errors, *, dircheck=True):
|
||||
+ """Construct a TarInfo object from a 512 byte bytes object.
|
||||
+
|
||||
+ If ``dircheck`` is set to ``True`` then ``AREGTYPE`` headers will
|
||||
+ be normalized to ``DIRTYPE`` if the name ends in a trailing slash.
|
||||
+ ``dircheck`` must be set to ``False`` if this function is called
|
||||
+ on a follow-up header such as ``GNUTYPE_LONGNAME``.
|
||||
"""
|
||||
if len(buf) == 0:
|
||||
raise EmptyHeaderError("empty header")
|
||||
@@ -1276,7 +1290,7 @@ class TarInfo(object):
|
||||
|
||||
# Old V7 tar format represents a directory as a regular
|
||||
# file with a trailing slash.
|
||||
- if obj.type == AREGTYPE and obj.name.endswith("/"):
|
||||
+ if dircheck and obj.type == AREGTYPE and obj.name.endswith("/"):
|
||||
obj.type = DIRTYPE
|
||||
|
||||
# The old GNU sparse format occupies some of the unused
|
||||
@@ -1311,8 +1325,15 @@ class TarInfo(object):
|
||||
"""Return the next TarInfo object from TarFile object
|
||||
tarfile.
|
||||
"""
|
||||
+ return cls._fromtarfile(tarfile)
|
||||
+
|
||||
+ @classmethod
|
||||
+ def _fromtarfile(cls, tarfile, *, dircheck=True):
|
||||
+ """
|
||||
+ See dircheck documentation in _frombuf().
|
||||
+ """
|
||||
buf = tarfile.fileobj.read(BLOCKSIZE)
|
||||
- obj = cls.frombuf(buf, tarfile.encoding, tarfile.errors)
|
||||
+ obj = cls._frombuf(buf, tarfile.encoding, tarfile.errors, dircheck=dircheck)
|
||||
obj.offset = tarfile.fileobj.tell() - BLOCKSIZE
|
||||
return obj._proc_member(tarfile)
|
||||
|
||||
@@ -1370,7 +1391,7 @@ class TarInfo(object):
|
||||
|
||||
# Fetch the next header and process it.
|
||||
try:
|
||||
- next = self.fromtarfile(tarfile)
|
||||
+ next = self._fromtarfile(tarfile, dircheck=False)
|
||||
except HeaderError as e:
|
||||
raise SubsequentHeaderError(str(e)) from None
|
||||
|
||||
@@ -1505,7 +1526,7 @@ class TarInfo(object):
|
||||
|
||||
# Fetch the next header.
|
||||
try:
|
||||
- next = self.fromtarfile(tarfile)
|
||||
+ next = self._fromtarfile(tarfile, dircheck=False)
|
||||
except HeaderError as e:
|
||||
raise SubsequentHeaderError(str(e)) from None
|
||||
|
||||
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
|
||||
index 759fa03ead..82637841ed 100644
|
||||
--- a/Lib/test/test_tarfile.py
|
||||
+++ b/Lib/test/test_tarfile.py
|
||||
@@ -1134,6 +1134,25 @@ class LongnameTest:
|
||||
self.assertIsNotNone(tar.getmember(longdir))
|
||||
self.assertIsNotNone(tar.getmember(longdir.removesuffix('/')))
|
||||
|
||||
+ def test_longname_file_not_directory(self):
|
||||
+ # Test reading a longname file and ensure it is not handled as a directory
|
||||
+ # Issue #141707
|
||||
+ buf = io.BytesIO()
|
||||
+ with tarfile.open(mode='w', fileobj=buf, format=self.format) as tar:
|
||||
+ ti = tarfile.TarInfo()
|
||||
+ ti.type = tarfile.AREGTYPE
|
||||
+ ti.name = ('a' * 99) + '/' + ('b' * 3)
|
||||
+ tar.addfile(ti)
|
||||
+
|
||||
+ expected = {t.name: t.type for t in tar.getmembers()}
|
||||
+
|
||||
+ buf.seek(0)
|
||||
+ with tarfile.open(mode='r', fileobj=buf) as tar:
|
||||
+ actual = {t.name: t.type for t in tar.getmembers()}
|
||||
+
|
||||
+ self.assertEqual(expected, actual)
|
||||
+
|
||||
+
|
||||
class GNUReadTest(LongnameTest, ReadTest, unittest.TestCase):
|
||||
|
||||
subdir = "gnu"
|
||||
diff --git a/Misc/ACKS b/Misc/ACKS
|
||||
index a6e63a991f..30d5f99ebb 100644
|
||||
--- a/Misc/ACKS
|
||||
+++ b/Misc/ACKS
|
||||
@@ -1492,6 +1492,7 @@ Dhushyanth Ramasamy
|
||||
Ashwin Ramaswami
|
||||
Jeff Ramnani
|
||||
Bayard Randel
|
||||
+Eashwar Ranganathan
|
||||
Varpu Rantala
|
||||
Brodie Rao
|
||||
Rémi Rampin
|
||||
--
|
||||
2.35.6
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
From 91a9bd79cdbab8f8518c4a5e669b3f19680a2f31 Mon Sep 17 00:00:00 2001
|
||||
From: Stan Ulbrych <stan@python.org>
|
||||
Date: Tue, 23 Jun 2026 14:31:38 +0100
|
||||
Subject: [PATCH] gh-151558: Fix symlink escape via `tarfile`
|
||||
hardlink-extraction fallback (GH-151559)
|
||||
|
||||
CVE: CVE-2026-11940
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/27dd970bf6b17ebca7c8ed486a40ab043ed7af8f]
|
||||
|
||||
Signed-off-by: Benjamin Robin <benjamin.robin@bootlin.com>
|
||||
---
|
||||
Lib/tarfile.py | 3 +++
|
||||
Lib/test/test_tarfile.py | 24 ++++++++++++++++++++++++
|
||||
2 files changed, 27 insertions(+)
|
||||
|
||||
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
|
||||
index 59d3f6e5cce1..83226e907e4b 100755
|
||||
--- a/Lib/tarfile.py
|
||||
+++ b/Lib/tarfile.py
|
||||
@@ -2650,6 +2650,9 @@ def makelink_with_filter(self, tarinfo, targetpath,
|
||||
"makelink_with_filter: if filter_function is not None, "
|
||||
+ "extraction_root must also not be None")
|
||||
try:
|
||||
+ filter_function(
|
||||
+ unfiltered.replace(name=tarinfo.name, deep=False),
|
||||
+ extraction_root)
|
||||
filtered = filter_function(unfiltered, extraction_root)
|
||||
except _FILTER_ERRORS as cause:
|
||||
raise LinkFallbackError(tarinfo, unfiltered.name) from cause
|
||||
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
|
||||
index 759fa03ead70..29719d95b6c1 100644
|
||||
--- a/Lib/test/test_tarfile.py
|
||||
+++ b/Lib/test/test_tarfile.py
|
||||
@@ -4080,6 +4080,30 @@ def test_sneaky_hardlink_fallback(self):
|
||||
self.expect_file("boom", symlink_to='../../link_here')
|
||||
self.expect_file("c", symlink_to='b')
|
||||
|
||||
+ @symlink_test
|
||||
+ def test_sneaky_hardlink_fallback_deep(self):
|
||||
+ # (CVE-2026-11940)
|
||||
+ with ArchiveMaker() as arc:
|
||||
+ arc.add("a/b/s", symlink_to=os.path.join("..", "escape"))
|
||||
+ arc.add("s", hardlink_to=os.path.join("a", "b", "s"))
|
||||
+
|
||||
+ with self.check_context(arc.open(), 'data'):
|
||||
+ e = self.expect_exception(
|
||||
+ tarfile.LinkFallbackError,
|
||||
+ "link 's' would be extracted as a copy of "
|
||||
+ + "'a/b/s', which was rejected")
|
||||
+ self.assertIsInstance(e.__cause__,
|
||||
+ tarfile.LinkOutsideDestinationError)
|
||||
+
|
||||
+ for filter in 'tar', 'fully_trusted':
|
||||
+ with self.subTest(filter), self.check_context(arc.open(), filter):
|
||||
+ if not os_helper.can_symlink():
|
||||
+ self.expect_file("a/")
|
||||
+ self.expect_file("a/b/")
|
||||
+ else:
|
||||
+ self.expect_file("a/b/s", symlink_to=os.path.join('..', 'escape'))
|
||||
+ self.expect_file("s", symlink_to=os.path.join('..', 'escape'))
|
||||
+
|
||||
@symlink_test
|
||||
def test_exfiltration_via_symlink(self):
|
||||
# (CVE-2025-4138)
|
||||
--
|
||||
2.54.0
|
||||
@@ -1,60 +0,0 @@
|
||||
From a83ebdb495a9cbd28a03675acdeda235fade90b3 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Viktorin <encukou@gmail.com>
|
||||
Date: Tue, 23 Jun 2026 15:13:30 +0200
|
||||
Subject: [PATCH] gh-151981: Make tarfile._Stream.seek break at EOF (GH-151982)
|
||||
|
||||
Co-authored-by: Stan Ulbrych <stan@python.org>
|
||||
|
||||
CVE: CVE-2026-11972
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/f50bf13566189c8d0ce5a814f33eff3d89951896]
|
||||
|
||||
Signed-off-by: Benjamin Robin <benjamin.robin@bootlin.com>
|
||||
---
|
||||
Lib/tarfile.py | 4 +++-
|
||||
Lib/test/test_tarfile.py | 16 ++++++++++++++++
|
||||
2 files changed, 19 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
|
||||
index 83226e907e4b..c0007a78f700 100755
|
||||
--- a/Lib/tarfile.py
|
||||
+++ b/Lib/tarfile.py
|
||||
@@ -516,7 +516,9 @@ def seek(self, pos=0):
|
||||
if pos - self.pos >= 0:
|
||||
blocks, remainder = divmod(pos - self.pos, self.bufsize)
|
||||
for i in range(blocks):
|
||||
- self.read(self.bufsize)
|
||||
+ data = self.read(self.bufsize)
|
||||
+ if not data:
|
||||
+ break
|
||||
self.read(remainder)
|
||||
else:
|
||||
raise StreamError("seeking backwards is not allowed")
|
||||
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
|
||||
index 29719d95b6c1..8aeb2e1b1b9a 100644
|
||||
--- a/Lib/test/test_tarfile.py
|
||||
+++ b/Lib/test/test_tarfile.py
|
||||
@@ -4480,6 +4480,22 @@ def valueerror_filter(tarinfo, path):
|
||||
with self.check_context(arc.open(errorlevel='boo!'), filtererror_filter):
|
||||
self.expect_exception(TypeError) # errorlevel is not int
|
||||
|
||||
+ @support.subTests('format', [tarfile.GNU_FORMAT, tarfile.PAX_FORMAT])
|
||||
+ def test_getmembers_big_size(self, format):
|
||||
+ # gh-151981: A loop in seek() for streaming files tried to read the
|
||||
+ # declared number of blocks even at EOF
|
||||
+ tinfo = tarfile.TarInfo("huge-file")
|
||||
+ tinfo.size = 1 << 64
|
||||
+ bio = io.BytesIO()
|
||||
+ # Write header without data
|
||||
+ bio.write(tinfo.tobuf(format))
|
||||
+
|
||||
+ # Reset & try to get contents
|
||||
+ bio.seek(0)
|
||||
+ with tarfile.open(fileobj=bio, mode="r|") as tar:
|
||||
+ with self.assertRaises(tarfile.ReadError):
|
||||
+ tar.getmembers()
|
||||
+
|
||||
|
||||
class OverwriteTests(archiver_tests.OverwriteTests, unittest.TestCase):
|
||||
testdir = os.path.join(TEMPDIR, "testoverwrite")
|
||||
--
|
||||
2.54.0
|
||||
@@ -1,113 +0,0 @@
|
||||
From 05ed7ce7ae9e17c23a04085b2539fe6d6d3cef69 Mon Sep 17 00:00:00 2001
|
||||
From: Seth Larson <seth@python.org>
|
||||
Date: Fri, 10 Apr 2026 10:21:42 -0500
|
||||
Subject: [PATCH] gh-146211: Reject CR/LF in HTTP tunnel request headers
|
||||
(#146212)
|
||||
|
||||
Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
|
||||
|
||||
CVE: CVE-2026-1502
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/05ed7ce7ae9e17c23a04085b2539fe6d6d3cef69]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
Lib/http/client.py | 11 ++++-
|
||||
Lib/test/test_httplib.py | 45 +++++++++++++++++++
|
||||
...-03-20-09-29-42.gh-issue-146211.PQVbs7.rst | 2 +
|
||||
3 files changed, 57 insertions(+), 1 deletion(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Security/2026-03-20-09-29-42.gh-issue-146211.PQVbs7.rst
|
||||
|
||||
diff --git a/Lib/http/client.py b/Lib/http/client.py
|
||||
index 70451d6..7db4807 100644
|
||||
--- a/Lib/http/client.py
|
||||
+++ b/Lib/http/client.py
|
||||
@@ -972,13 +972,22 @@ class HTTPConnection:
|
||||
return ip
|
||||
|
||||
def _tunnel(self):
|
||||
+ if _contains_disallowed_url_pchar_re.search(self._tunnel_host):
|
||||
+ raise ValueError('Tunnel host can\'t contain control characters %r'
|
||||
+ % (self._tunnel_host,))
|
||||
connect = b"CONNECT %s:%d %s\r\n" % (
|
||||
self._wrap_ipv6(self._tunnel_host.encode("idna")),
|
||||
self._tunnel_port,
|
||||
self._http_vsn_str.encode("ascii"))
|
||||
headers = [connect]
|
||||
for header, value in self._tunnel_headers.items():
|
||||
- headers.append(f"{header}: {value}\r\n".encode("latin-1"))
|
||||
+ header_bytes = header.encode("latin-1")
|
||||
+ value_bytes = value.encode("latin-1")
|
||||
+ if not _is_legal_header_name(header_bytes):
|
||||
+ raise ValueError('Invalid header name %r' % (header_bytes,))
|
||||
+ if _is_illegal_header_value(value_bytes):
|
||||
+ raise ValueError('Invalid header value %r' % (value_bytes,))
|
||||
+ headers.append(b"%s: %s\r\n" % (header_bytes, value_bytes))
|
||||
headers.append(b"\r\n")
|
||||
# Making a single send() call instead of one per line encourages
|
||||
# the host OS to use a more optimal packet size instead of
|
||||
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
|
||||
index e46dac0..e027d93 100644
|
||||
--- a/Lib/test/test_httplib.py
|
||||
+++ b/Lib/test/test_httplib.py
|
||||
@@ -369,6 +369,51 @@ class HeaderTests(TestCase):
|
||||
with self.assertRaisesRegex(ValueError, 'Invalid header'):
|
||||
conn.putheader(name, value)
|
||||
|
||||
+ def test_invalid_tunnel_headers(self):
|
||||
+ cases = (
|
||||
+ ('Invalid\r\nName', 'ValidValue'),
|
||||
+ ('Invalid\rName', 'ValidValue'),
|
||||
+ ('Invalid\nName', 'ValidValue'),
|
||||
+ ('\r\nInvalidName', 'ValidValue'),
|
||||
+ ('\rInvalidName', 'ValidValue'),
|
||||
+ ('\nInvalidName', 'ValidValue'),
|
||||
+ (' InvalidName', 'ValidValue'),
|
||||
+ ('\tInvalidName', 'ValidValue'),
|
||||
+ ('Invalid:Name', 'ValidValue'),
|
||||
+ (':InvalidName', 'ValidValue'),
|
||||
+ ('ValidName', 'Invalid\r\nValue'),
|
||||
+ ('ValidName', 'Invalid\rValue'),
|
||||
+ ('ValidName', 'Invalid\nValue'),
|
||||
+ ('ValidName', 'InvalidValue\r\n'),
|
||||
+ ('ValidName', 'InvalidValue\r'),
|
||||
+ ('ValidName', 'InvalidValue\n'),
|
||||
+ )
|
||||
+ for name, value in cases:
|
||||
+ with self.subTest((name, value)):
|
||||
+ conn = client.HTTPConnection('example.com')
|
||||
+ conn.set_tunnel('tunnel', headers={
|
||||
+ name: value
|
||||
+ })
|
||||
+ conn.sock = FakeSocket('')
|
||||
+ with self.assertRaisesRegex(ValueError, 'Invalid header'):
|
||||
+ conn._tunnel() # Called in .connect()
|
||||
+
|
||||
+ def test_invalid_tunnel_host(self):
|
||||
+ cases = (
|
||||
+ 'invalid\r.host',
|
||||
+ '\ninvalid.host',
|
||||
+ 'invalid.host\r\n',
|
||||
+ 'invalid.host\x00',
|
||||
+ 'invalid host',
|
||||
+ )
|
||||
+ for tunnel_host in cases:
|
||||
+ with self.subTest(tunnel_host):
|
||||
+ conn = client.HTTPConnection('example.com')
|
||||
+ conn.set_tunnel(tunnel_host)
|
||||
+ conn.sock = FakeSocket('')
|
||||
+ with self.assertRaisesRegex(ValueError, 'Tunnel host can\'t contain control characters'):
|
||||
+ conn._tunnel() # Called in .connect()
|
||||
+
|
||||
def test_headers_debuglevel(self):
|
||||
body = (
|
||||
b'HTTP/1.1 200 OK\r\n'
|
||||
diff --git a/Misc/NEWS.d/next/Security/2026-03-20-09-29-42.gh-issue-146211.PQVbs7.rst b/Misc/NEWS.d/next/Security/2026-03-20-09-29-42.gh-issue-146211.PQVbs7.rst
|
||||
new file mode 100644
|
||||
index 0000000..4993633
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Security/2026-03-20-09-29-42.gh-issue-146211.PQVbs7.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Reject CR/LF characters in tunnel request headers for the
|
||||
+HTTPConnection.set_tunnel() method.
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -1,154 +0,0 @@
|
||||
From 6e291d2eba0b6820bc924e68f1db750328bf6c75 Mon Sep 17 00:00:00 2001
|
||||
From: "Miss Islington (bot)"
|
||||
<31488909+miss-islington@users.noreply.github.com>
|
||||
Date: Mon, 16 Mar 2026 15:05:13 +0100
|
||||
Subject: [PATCH] [3.13] gh-145599, CVE 2026-3644: Reject control
|
||||
characters in `http.cookies.Morsel.update()` (GH-145600) (#146024)
|
||||
|
||||
gh-145599, CVE 2026-3644: Reject control characters in `http.cookies.Morsel.update()` (GH-145600)
|
||||
|
||||
Reject control characters in `http.cookies.Morsel.update()` and `http.cookies.BaseCookie.js_output`.
|
||||
|
||||
CVE: CVE-2026-3644 CVE-2026-0672
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/d16ecc6c3626f0e2cc8f08c309c83934e8a979dd]
|
||||
|
||||
Backport Changes:
|
||||
- This file is not present in the current version and is therefore omitted
|
||||
Misc/NEWS.d/next/Security/2026-03-06-17-03-38.gh-issue-145599.kchwZV.rst
|
||||
|
||||
(cherry picked from commit 57e88c1cf95e1481b94ae57abe1010469d47a6b4)
|
||||
|
||||
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
|
||||
Co-authored-by: Victor Stinner <vstinner@python.org>
|
||||
Co-authored-by: Victor Stinner <victor.stinner@gmail.com>
|
||||
(cherry picked from commit d16ecc6c3626f0e2cc8f08c309c83934e8a979dd)
|
||||
Signed-off-by: Sudhir Dumbhare <sudumbha@cisco.com>
|
||||
---
|
||||
Lib/http/cookies.py | 24 ++++++++++++++++++----
|
||||
Lib/test/test_http_cookies.py | 38 +++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 58 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py
|
||||
index d0a69cbe191..63d119ad46c 100644
|
||||
--- a/Lib/http/cookies.py
|
||||
+++ b/Lib/http/cookies.py
|
||||
@@ -335,9 +335,16 @@ class Morsel(dict):
|
||||
key = key.lower()
|
||||
if key not in self._reserved:
|
||||
raise CookieError("Invalid attribute %r" % (key,))
|
||||
+ if _has_control_character(key, val):
|
||||
+ raise CookieError("Control characters are not allowed in "
|
||||
+ f"cookies {key!r} {val!r}")
|
||||
data[key] = val
|
||||
dict.update(self, data)
|
||||
|
||||
+ def __ior__(self, values):
|
||||
+ self.update(values)
|
||||
+ return self
|
||||
+
|
||||
def isReservedKey(self, K):
|
||||
return K.lower() in self._reserved
|
||||
|
||||
@@ -363,9 +370,15 @@ class Morsel(dict):
|
||||
}
|
||||
|
||||
def __setstate__(self, state):
|
||||
- self._key = state['key']
|
||||
- self._value = state['value']
|
||||
- self._coded_value = state['coded_value']
|
||||
+ key = state['key']
|
||||
+ value = state['value']
|
||||
+ coded_value = state['coded_value']
|
||||
+ if _has_control_character(key, value, coded_value):
|
||||
+ raise CookieError("Control characters are not allowed in cookies "
|
||||
+ f"{key!r} {value!r} {coded_value!r}")
|
||||
+ self._key = key
|
||||
+ self._value = value
|
||||
+ self._coded_value = coded_value
|
||||
|
||||
def output(self, attrs=None, header="Set-Cookie:"):
|
||||
return "%s %s" % (header, self.OutputString(attrs))
|
||||
@@ -377,13 +390,16 @@ class Morsel(dict):
|
||||
|
||||
def js_output(self, attrs=None):
|
||||
# Print javascript
|
||||
+ output_string = self.OutputString(attrs)
|
||||
+ if _has_control_character(output_string):
|
||||
+ raise CookieError("Control characters are not allowed in cookies")
|
||||
return """
|
||||
<script type="text/javascript">
|
||||
<!-- begin hiding
|
||||
document.cookie = \"%s\";
|
||||
// end hiding -->
|
||||
</script>
|
||||
- """ % (self.OutputString(attrs).replace('"', r'\"'))
|
||||
+ """ % (output_string.replace('"', r'\"'))
|
||||
|
||||
def OutputString(self, attrs=None):
|
||||
# Build up our result
|
||||
diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py
|
||||
index f196bcc48e3..2478a6c630f 100644
|
||||
--- a/Lib/test/test_http_cookies.py
|
||||
+++ b/Lib/test/test_http_cookies.py
|
||||
@@ -573,6 +573,14 @@ class MorselTests(unittest.TestCase):
|
||||
with self.assertRaises(cookies.CookieError):
|
||||
morsel["path"] = c0
|
||||
|
||||
+ # .__setstate__()
|
||||
+ with self.assertRaises(cookies.CookieError):
|
||||
+ morsel.__setstate__({'key': c0, 'value': 'val', 'coded_value': 'coded'})
|
||||
+ with self.assertRaises(cookies.CookieError):
|
||||
+ morsel.__setstate__({'key': 'key', 'value': c0, 'coded_value': 'coded'})
|
||||
+ with self.assertRaises(cookies.CookieError):
|
||||
+ morsel.__setstate__({'key': 'key', 'value': 'val', 'coded_value': c0})
|
||||
+
|
||||
# .setdefault()
|
||||
with self.assertRaises(cookies.CookieError):
|
||||
morsel.setdefault("path", c0)
|
||||
@@ -587,6 +595,18 @@ class MorselTests(unittest.TestCase):
|
||||
with self.assertRaises(cookies.CookieError):
|
||||
morsel.set("path", "val", c0)
|
||||
|
||||
+ # .update()
|
||||
+ with self.assertRaises(cookies.CookieError):
|
||||
+ morsel.update({"path": c0})
|
||||
+ with self.assertRaises(cookies.CookieError):
|
||||
+ morsel.update({c0: "val"})
|
||||
+
|
||||
+ # .__ior__()
|
||||
+ with self.assertRaises(cookies.CookieError):
|
||||
+ morsel |= {"path": c0}
|
||||
+ with self.assertRaises(cookies.CookieError):
|
||||
+ morsel |= {c0: "val"}
|
||||
+
|
||||
def test_control_characters_output(self):
|
||||
# Tests that even if the internals of Morsel are modified
|
||||
# that a call to .output() has control character safeguards.
|
||||
@@ -607,6 +627,24 @@ class MorselTests(unittest.TestCase):
|
||||
with self.assertRaises(cookies.CookieError):
|
||||
cookie.output()
|
||||
|
||||
+ # Tests that .js_output() also has control character safeguards.
|
||||
+ for c0 in support.control_characters_c0():
|
||||
+ morsel = cookies.Morsel()
|
||||
+ morsel.set("key", "value", "coded-value")
|
||||
+ morsel._key = c0 # Override private variable.
|
||||
+ cookie = cookies.SimpleCookie()
|
||||
+ cookie["cookie"] = morsel
|
||||
+ with self.assertRaises(cookies.CookieError):
|
||||
+ cookie.js_output()
|
||||
+
|
||||
+ morsel = cookies.Morsel()
|
||||
+ morsel.set("key", "value", "coded-value")
|
||||
+ morsel._coded_value = c0 # Override private variable.
|
||||
+ cookie = cookies.SimpleCookie()
|
||||
+ cookie["cookie"] = morsel
|
||||
+ with self.assertRaises(cookies.CookieError):
|
||||
+ cookie.js_output()
|
||||
+
|
||||
|
||||
def load_tests(loader, tests, pattern):
|
||||
tests.addTest(doctest.DocTestSuite(cookies))
|
||||
--
|
||||
2.35.6
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
From ca301e24e20d1d9d58bbd432ff103cab2cb87128 Mon Sep 17 00:00:00 2001
|
||||
From: Stan Ulbrych <stan@python.org>
|
||||
Date: Wed, 8 Apr 2026 11:27:39 +0100
|
||||
Subject: [PATCH] gh-145986: Avoid unbound C recursion in `conv_content_model`
|
||||
in `pyexpat.c` (CVE-2026-4224) (GH-145987) (#146000)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
* [3.11] gh-145986: Avoid unbound C recursion in `conv_content_model` in `pyexpat.c` (CVE-2026-4224) (GH-145987)
|
||||
|
||||
Fix C stack overflow (CVE-2026-4224) when an Expat parser
|
||||
with a registered `ElementDeclHandler` parses inline DTD
|
||||
containing deeply nested content model.
|
||||
|
||||
---------
|
||||
(cherry picked from commit eb0e8be3a7e11b87d198a2c3af1ed0eccf532768)
|
||||
(cherry picked from commit e5caf45faac74b0ed869e3336420cffd3510ce6e)
|
||||
|
||||
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
|
||||
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
||||
|
||||
* Update Misc/NEWS.d/next/Security/2026-03-14-17-31-39.gh-issue-145986.ifSSr8.rst
|
||||
|
||||
---------
|
||||
|
||||
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
||||
|
||||
CVE: CVE-2026-4224
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/642865ddf4b232da1f3b1f7abcfa3254c4bfe785]
|
||||
|
||||
Signed-off-by: Amaury Couderc <amaury.couderc@est.tech>
|
||||
---
|
||||
Lib/test/test_pyexpat.py | 18 ++++++++++++++++++
|
||||
...6-03-14-17-31-39.gh-issue-145986.ifSSr8.rst | 4 ++++
|
||||
Modules/pyexpat.c | 9 ++++++++-
|
||||
3 files changed, 30 insertions(+), 1 deletion(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Security/2026-03-14-17-31-39.gh-issue-145986.ifSSr8.rst
|
||||
|
||||
diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py
|
||||
index 38f951573f0..37d9086f40a 100644
|
||||
--- a/Lib/test/test_pyexpat.py
|
||||
+++ b/Lib/test/test_pyexpat.py
|
||||
@@ -675,6 +675,24 @@ class ChardataBufferTest(unittest.TestCase):
|
||||
parser.Parse(xml2, True)
|
||||
self.assertEqual(self.n, 4)
|
||||
|
||||
+class ElementDeclHandlerTest(unittest.TestCase):
|
||||
+ def test_deeply_nested_content_model(self):
|
||||
+ # This should raise a RecursionError and not crash.
|
||||
+ # See https://github.com/python/cpython/issues/145986.
|
||||
+ N = 500_000
|
||||
+ data = (
|
||||
+ b'<!DOCTYPE root [\n<!ELEMENT root '
|
||||
+ + b'(a, ' * N + b'a' + b')' * N
|
||||
+ + b'>\n]>\n<root/>\n'
|
||||
+ )
|
||||
+
|
||||
+ parser = expat.ParserCreate()
|
||||
+ parser.ElementDeclHandler = lambda _1, _2: None
|
||||
+ with support.infinite_recursion():
|
||||
+ with self.assertRaises(RecursionError):
|
||||
+ parser.Parse(data)
|
||||
+
|
||||
+
|
||||
class MalformedInputTest(unittest.TestCase):
|
||||
def test1(self):
|
||||
xml = b"\0\r\n"
|
||||
diff --git a/Misc/NEWS.d/next/Security/2026-03-14-17-31-39.gh-issue-145986.ifSSr8.rst b/Misc/NEWS.d/next/Security/2026-03-14-17-31-39.gh-issue-145986.ifSSr8.rst
|
||||
new file mode 100644
|
||||
index 00000000000..cb9dbadb72d
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Security/2026-03-14-17-31-39.gh-issue-145986.ifSSr8.rst
|
||||
@@ -0,0 +1,4 @@
|
||||
+:mod:`xml.parsers.expat`: Fixed a crash caused by unbounded C recursion when
|
||||
+converting deeply nested XML content models with
|
||||
+:meth:`~xml.parsers.expat.xmlparser.ElementDeclHandler`.
|
||||
+This addresses `CVE-2026-4224 <https://www.cve.org/CVERecord?id=CVE-2026-4224>`_.
|
||||
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
|
||||
index 79492ca5c4f..8673540f358 100644
|
||||
--- a/Modules/pyexpat.c
|
||||
+++ b/Modules/pyexpat.c
|
||||
@@ -3,6 +3,7 @@
|
||||
#endif
|
||||
|
||||
#include "Python.h"
|
||||
+#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
|
||||
#include "pycore_runtime.h" // _Py_ID()
|
||||
#include <ctype.h>
|
||||
|
||||
@@ -578,6 +579,10 @@ static PyObject *
|
||||
conv_content_model(XML_Content * const model,
|
||||
PyObject *(*conv_string)(const XML_Char *))
|
||||
{
|
||||
+ if (_Py_EnterRecursiveCall(" in conv_content_model")) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
PyObject *result = NULL;
|
||||
PyObject *children = PyTuple_New(model->numchildren);
|
||||
int i;
|
||||
@@ -589,7 +594,7 @@ conv_content_model(XML_Content * const model,
|
||||
conv_string);
|
||||
if (child == NULL) {
|
||||
Py_XDECREF(children);
|
||||
- return NULL;
|
||||
+ goto done;
|
||||
}
|
||||
PyTuple_SET_ITEM(children, i, child);
|
||||
}
|
||||
@@ -597,6 +602,8 @@ conv_content_model(XML_Content * const model,
|
||||
model->type, model->quant,
|
||||
conv_string,model->name, children);
|
||||
}
|
||||
+done:
|
||||
+ _Py_LeaveRecursiveCall();
|
||||
return result;
|
||||
}
|
||||
|
||||
--
|
||||
2.34.1
|
||||
@@ -1,66 +0,0 @@
|
||||
From b9af29b9f2f880cdcdc49a1460743680f59dcb4e Mon Sep 17 00:00:00 2001
|
||||
From: Stan Ulbrych <stan@python.org>
|
||||
Date: Mon, 13 Apr 2026 22:41:51 +0100
|
||||
Subject: [PATCH] [3.11] gh-148169: Fix webbrowser `%action` substitution
|
||||
bypass of dash-prefix check (GH-148170) (#148520)
|
||||
|
||||
CVE: CVE-2026-4519 CVE-2026-4786
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/f4654824ae0850ac87227fb270f9057477946769]
|
||||
|
||||
Backport Changes:
|
||||
- This file is not present in the current version and is therefore omitted.
|
||||
Misc/NEWS.d/next/Security/2026-03-31-09-15-51.gh-issue-148169.EZJzz2.rst
|
||||
|
||||
(cherry picked from commit d22922c8a7958353689dc4763dd72da2dea03fff)
|
||||
(cherry picked from commit f4654824ae0850ac87227fb270f9057477946769)
|
||||
Signed-off-by: Sudhir Dumbhare <sudumbha@cisco.com>
|
||||
---
|
||||
Lib/test/test_webbrowser.py | 8 ++++++++
|
||||
Lib/webbrowser.py | 5 +++--
|
||||
2 files changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Lib/test/test_webbrowser.py b/Lib/test/test_webbrowser.py
|
||||
index c9bf525360d..1d21f133725 100644
|
||||
--- a/Lib/test/test_webbrowser.py
|
||||
+++ b/Lib/test/test_webbrowser.py
|
||||
@@ -103,6 +103,14 @@ class ChromeCommandTest(CommandTestMixin, unittest.TestCase):
|
||||
options=[],
|
||||
arguments=[URL])
|
||||
|
||||
+ def test_reject_action_dash_prefixes(self):
|
||||
+ browser = self.browser_class(name=CMD_NAME)
|
||||
+ with self.assertRaises(ValueError):
|
||||
+ browser.open('%action--incognito')
|
||||
+ # new=1: action is "--new-window", so "%action" itself expands to
|
||||
+ # a dash-prefixed flag even with no dash in the original URL.
|
||||
+ with self.assertRaises(ValueError):
|
||||
+ browser.open('%action', new=1)
|
||||
|
||||
class EdgeCommandTest(CommandTestMixin, unittest.TestCase):
|
||||
|
||||
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
|
||||
index 000e89275b7..97c4eec9080 100755
|
||||
--- a/Lib/webbrowser.py
|
||||
+++ b/Lib/webbrowser.py
|
||||
@@ -268,7 +268,6 @@ class UnixBrowser(BaseBrowser):
|
||||
|
||||
def open(self, url, new=0, autoraise=True):
|
||||
sys.audit("webbrowser.open", url)
|
||||
- self._check_url(url)
|
||||
if new == 0:
|
||||
action = self.remote_action
|
||||
elif new == 1:
|
||||
@@ -282,7 +281,9 @@ class UnixBrowser(BaseBrowser):
|
||||
raise Error("Bad 'new' parameter to open(); " +
|
||||
"expected 0, 1, or 2, got %s" % new)
|
||||
|
||||
- args = [arg.replace("%s", url).replace("%action", action)
|
||||
+ self._check_url(url.replace("%action", action))
|
||||
+
|
||||
+ args = [arg.replace("%action", action).replace("%s", url)
|
||||
for arg in self.remote_args]
|
||||
args = [arg for arg in args if arg]
|
||||
success = self._invoke(args, True, autoraise, url)
|
||||
--
|
||||
2.35.6
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
From 7df48dd3c6330611a04d85a5159c0ea424dc1e62 Mon Sep 17 00:00:00 2001
|
||||
From: Pinky <pinky00ch@gmail.com>
|
||||
Date: Wed, 25 Mar 2026 01:02:37 +0530
|
||||
Subject: [PATCH] [3.12] gh-143930: Reject leading dashes in webbrowser
|
||||
URLs (GH-146360)
|
||||
|
||||
CVE: CVE-2026-4519
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/cbba6119391112aba9c5aebf7b94aea447922c48]
|
||||
|
||||
Backport Changes:
|
||||
- This file is not present in the current version and is therefore omitted
|
||||
Misc/NEWS.d/next/Security/2026-01-16-12-04-49.gh-issue-143930.zYC5x3.rst
|
||||
|
||||
(cherry picked from commit 82a24a4442312bdcfc4c799885e8b3e00990f02b)
|
||||
|
||||
Co-authored-by: Seth Michael Larson <seth@python.org>
|
||||
(cherry picked from commit cbba6119391112aba9c5aebf7b94aea447922c48)
|
||||
Signed-off-by: Sudhir Dumbhare <sudumbha@cisco.com>
|
||||
---
|
||||
Lib/test/test_webbrowser.py | 5 +++++
|
||||
Lib/webbrowser.py | 12 ++++++++++++
|
||||
2 files changed, 17 insertions(+)
|
||||
|
||||
diff --git a/Lib/test/test_webbrowser.py b/Lib/test/test_webbrowser.py
|
||||
index 2d695bc8831..60f094fd6a1 100644
|
||||
--- a/Lib/test/test_webbrowser.py
|
||||
+++ b/Lib/test/test_webbrowser.py
|
||||
@@ -59,6 +59,11 @@ class GenericBrowserCommandTest(CommandTestMixin, unittest.TestCase):
|
||||
options=[],
|
||||
arguments=[URL])
|
||||
|
||||
+ def test_reject_dash_prefixes(self):
|
||||
+ browser = self.browser_class(name=CMD_NAME)
|
||||
+ with self.assertRaises(ValueError):
|
||||
+ browser.open(f"--key=val {URL}")
|
||||
+
|
||||
|
||||
class BackgroundBrowserCommandTest(CommandTestMixin, unittest.TestCase):
|
||||
|
||||
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
|
||||
index 13b9e85f9e1..0bdb644d7db 100755
|
||||
--- a/Lib/webbrowser.py
|
||||
+++ b/Lib/webbrowser.py
|
||||
@@ -158,6 +158,12 @@ class BaseBrowser(object):
|
||||
def open_new_tab(self, url):
|
||||
return self.open(url, 2)
|
||||
|
||||
+ @staticmethod
|
||||
+ def _check_url(url):
|
||||
+ """Ensures that the URL is safe to pass to subprocesses as a parameter"""
|
||||
+ if url and url.lstrip().startswith("-"):
|
||||
+ raise ValueError(f"Invalid URL: {url}")
|
||||
+
|
||||
|
||||
class GenericBrowser(BaseBrowser):
|
||||
"""Class for all browsers started with a command
|
||||
@@ -175,6 +181,7 @@ class GenericBrowser(BaseBrowser):
|
||||
|
||||
def open(self, url, new=0, autoraise=True):
|
||||
sys.audit("webbrowser.open", url)
|
||||
+ self._check_url(url)
|
||||
cmdline = [self.name] + [arg.replace("%s", url)
|
||||
for arg in self.args]
|
||||
try:
|
||||
@@ -195,6 +202,7 @@ class BackgroundBrowser(GenericBrowser):
|
||||
cmdline = [self.name] + [arg.replace("%s", url)
|
||||
for arg in self.args]
|
||||
sys.audit("webbrowser.open", url)
|
||||
+ self._check_url(url)
|
||||
try:
|
||||
if sys.platform[:3] == 'win':
|
||||
p = subprocess.Popen(cmdline)
|
||||
@@ -260,6 +268,7 @@ class UnixBrowser(BaseBrowser):
|
||||
|
||||
def open(self, url, new=0, autoraise=True):
|
||||
sys.audit("webbrowser.open", url)
|
||||
+ self._check_url(url)
|
||||
if new == 0:
|
||||
action = self.remote_action
|
||||
elif new == 1:
|
||||
@@ -350,6 +359,7 @@ class Konqueror(BaseBrowser):
|
||||
|
||||
def open(self, url, new=0, autoraise=True):
|
||||
sys.audit("webbrowser.open", url)
|
||||
+ self._check_url(url)
|
||||
# XXX Currently I know no way to prevent KFM from opening a new win.
|
||||
if new == 2:
|
||||
action = "newTab"
|
||||
@@ -554,6 +564,7 @@ if sys.platform[:3] == "win":
|
||||
class WindowsDefault(BaseBrowser):
|
||||
def open(self, url, new=0, autoraise=True):
|
||||
sys.audit("webbrowser.open", url)
|
||||
+ self._check_url(url)
|
||||
try:
|
||||
os.startfile(url)
|
||||
except OSError:
|
||||
@@ -638,6 +649,7 @@ if sys.platform == 'darwin':
|
||||
|
||||
def open(self, url, new=0, autoraise=True):
|
||||
sys.audit("webbrowser.open", url)
|
||||
+ self._check_url(url)
|
||||
if self.name == 'default':
|
||||
script = 'open location "%s"' % url.replace('"', '%22') # opens in default browser
|
||||
else:
|
||||
--
|
||||
2.35.6
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
From 3ca64ff1722d2410a4e50e760de70f6279fa99fa Mon Sep 17 00:00:00 2001
|
||||
From: "Miss Islington (bot)"
|
||||
<31488909+miss-islington@users.noreply.github.com>
|
||||
Date: Sat, 4 Apr 2026 00:53:49 +0200
|
||||
Subject: [PATCH] [3.11] gh-143930: Tweak the exception message and
|
||||
increase test coverage (GH-146476) (GH-148045) (GH-148051) (GH-148052)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
CVE: CVE-2026-4519
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/96fc5048605863c7b6fd6289643feb0e97edd96c]
|
||||
|
||||
Backport Changes:
|
||||
- This file is not present in the current version and is therefore omitted.
|
||||
Misc/NEWS.d/next/Security/2026-01-16-12-04-49.gh-issue-143930.zYC5x3.rst
|
||||
- The file introduced in v3.12 by this commit;
|
||||
https://github.com/python/cpython/commit/cbba6119391112aba9c5aebf7b94aea447922c48
|
||||
|
||||
(cherry picked from commit cc023511238ad93ecc8796157c6f9139a2bb2932)
|
||||
(cherry picked from commit 89bfb8e5ed3c7caa241028f1a4eac5f6275a46a4)
|
||||
(cherry picked from commit 3681d47a440865aead912a054d4599087b4270dd)
|
||||
|
||||
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
||||
(cherry picked from commit 96fc5048605863c7b6fd6289643feb0e97edd96c)
|
||||
Signed-off-by: Sudhir Dumbhare <sudumbha@cisco.com>
|
||||
---
|
||||
Lib/test/test_webbrowser.py | 81 ++++++++++++++++++++++++++++++++++---
|
||||
Lib/webbrowser.py | 2 +-
|
||||
2 files changed, 76 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/Lib/test/test_webbrowser.py b/Lib/test/test_webbrowser.py
|
||||
index 60f094fd6a1..c9bf525360d 100644
|
||||
--- a/Lib/test/test_webbrowser.py
|
||||
+++ b/Lib/test/test_webbrowser.py
|
||||
@@ -1,6 +1,7 @@
|
||||
+import io
|
||||
+import os
|
||||
import webbrowser
|
||||
import unittest
|
||||
-import os
|
||||
import sys
|
||||
import subprocess
|
||||
from unittest import mock
|
||||
@@ -49,6 +50,14 @@ class CommandTestMixin:
|
||||
popen_args.pop(popen_args.index(option))
|
||||
self.assertEqual(popen_args, arguments)
|
||||
|
||||
+ def test_reject_dash_prefixes(self):
|
||||
+ browser = self.browser_class(name=CMD_NAME)
|
||||
+ with self.assertRaisesRegex(
|
||||
+ ValueError,
|
||||
+ r"^Invalid URL \(leading dash disallowed\): '--key=val http.*'$"
|
||||
+ ):
|
||||
+ browser.open(f"--key=val {URL}")
|
||||
+
|
||||
|
||||
class GenericBrowserCommandTest(CommandTestMixin, unittest.TestCase):
|
||||
|
||||
@@ -59,11 +68,6 @@ class GenericBrowserCommandTest(CommandTestMixin, unittest.TestCase):
|
||||
options=[],
|
||||
arguments=[URL])
|
||||
|
||||
- def test_reject_dash_prefixes(self):
|
||||
- browser = self.browser_class(name=CMD_NAME)
|
||||
- with self.assertRaises(ValueError):
|
||||
- browser.open(f"--key=val {URL}")
|
||||
-
|
||||
|
||||
class BackgroundBrowserCommandTest(CommandTestMixin, unittest.TestCase):
|
||||
|
||||
@@ -224,6 +228,71 @@ class ELinksCommandTest(CommandTestMixin, unittest.TestCase):
|
||||
arguments=['openURL({},new-tab)'.format(URL)])
|
||||
|
||||
|
||||
+class MockPopenPipe:
|
||||
+ def __init__(self, cmd, mode):
|
||||
+ self.cmd = cmd
|
||||
+ self.mode = mode
|
||||
+ self.pipe = io.StringIO()
|
||||
+ self._closed = False
|
||||
+
|
||||
+ def write(self, buf):
|
||||
+ self.pipe.write(buf)
|
||||
+
|
||||
+ def close(self):
|
||||
+ self._closed = True
|
||||
+ return None
|
||||
+
|
||||
+
|
||||
+@unittest.skipUnless(sys.platform == "darwin", "macOS specific test")
|
||||
+class MacOSXOSAScriptTest(unittest.TestCase):
|
||||
+ def setUp(self):
|
||||
+ # Ensure that 'BROWSER' is not set to 'open' or something else.
|
||||
+ # See: https://github.com/python/cpython/issues/131254.
|
||||
+ env = self.enterContext(os_helper.EnvironmentVarGuard())
|
||||
+ env.unset("BROWSER")
|
||||
+
|
||||
+ support.patch(self, os, "popen", self.mock_popen)
|
||||
+ self.browser = webbrowser.MacOSXOSAScript("default")
|
||||
+
|
||||
+ def mock_popen(self, cmd, mode):
|
||||
+ self.popen_pipe = MockPopenPipe(cmd, mode)
|
||||
+ return self.popen_pipe
|
||||
+
|
||||
+ def test_default(self):
|
||||
+ browser = webbrowser.get()
|
||||
+ assert isinstance(browser, webbrowser.MacOSXOSAScript)
|
||||
+ self.assertEqual(browser.name, "default")
|
||||
+
|
||||
+ def test_default_open(self):
|
||||
+ url = "https://python.org"
|
||||
+ self.browser.open(url)
|
||||
+ self.assertTrue(self.popen_pipe._closed)
|
||||
+ self.assertEqual(self.popen_pipe.cmd, "osascript")
|
||||
+ script = self.popen_pipe.pipe.getvalue()
|
||||
+ self.assertEqual(script.strip(), f'open location "{url}"')
|
||||
+
|
||||
+ def test_url_quote(self):
|
||||
+ self.browser.open('https://python.org/"quote"')
|
||||
+ script = self.popen_pipe.pipe.getvalue()
|
||||
+ self.assertEqual(
|
||||
+ script.strip(), 'open location "https://python.org/%22quote%22"'
|
||||
+ )
|
||||
+
|
||||
+ def test_explicit_browser(self):
|
||||
+ browser = webbrowser.MacOSXOSAScript("safari")
|
||||
+ browser.open("https://python.org")
|
||||
+ script = self.popen_pipe.pipe.getvalue()
|
||||
+ self.assertIn('tell application "safari"', script)
|
||||
+ self.assertIn('open location "https://python.org"', script)
|
||||
+
|
||||
+ def test_reject_dash_prefixes(self):
|
||||
+ with self.assertRaisesRegex(
|
||||
+ ValueError,
|
||||
+ r"^Invalid URL \(leading dash disallowed\): '--key=val http.*'$"
|
||||
+ ):
|
||||
+ self.browser.open(f"--key=val {URL}")
|
||||
+
|
||||
+
|
||||
class BrowserRegistrationTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
|
||||
index 0bdb644d7db..000e89275b7 100755
|
||||
--- a/Lib/webbrowser.py
|
||||
+++ b/Lib/webbrowser.py
|
||||
@@ -162,7 +162,7 @@ class BaseBrowser(object):
|
||||
def _check_url(url):
|
||||
"""Ensures that the URL is safe to pass to subprocesses as a parameter"""
|
||||
if url and url.lstrip().startswith("-"):
|
||||
- raise ValueError(f"Invalid URL: {url}")
|
||||
+ raise ValueError(f"Invalid URL (leading dash disallowed): {url!r}")
|
||||
|
||||
|
||||
class GenericBrowser(BaseBrowser):
|
||||
--
|
||||
2.35.6
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
From c3cf71c3366fe49acb776a639405c0eea6169c20 Mon Sep 17 00:00:00 2001
|
||||
From: "Miss Islington (bot)"
|
||||
<31488909+miss-islington@users.noreply.github.com>
|
||||
Date: Mon, 13 Apr 2026 03:35:24 +0200
|
||||
Subject: [PATCH] [3.13] gh-148395: Fix a possible UAF in
|
||||
`{LZMA,BZ2,_Zlib}Decompressor` (GH-148396) (#148479)
|
||||
|
||||
gh-148395: Fix a possible UAF in `{LZMA,BZ2,_Zlib}Decompressor` (GH-148396)
|
||||
|
||||
Fix dangling input pointer after `MemoryError` in _lzma/_bz2/_ZlibDecompressor.decompress
|
||||
(cherry picked from commit 8fc66aef6d7b3ae58f43f5c66f9366cc8cbbfcd2)
|
||||
|
||||
Co-authored-by: Stan Ulbrych <stan@python.org>
|
||||
|
||||
CVE: CVE-2026-6100
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/c3cf71c3366fe49acb776a639405c0eea6169c20]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
.../Security/2026-04-10-16-28-21.gh-issue-148395.kfzm0G.rst | 5 +++++
|
||||
Modules/_bz2module.c | 1 +
|
||||
Modules/_lzmamodule.c | 1 +
|
||||
Modules/zlibmodule.c | 1 +
|
||||
4 files changed, 8 insertions(+)
|
||||
create mode 100644 Misc/NEWS.d/next/Security/2026-04-10-16-28-21.gh-issue-148395.kfzm0G.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Security/2026-04-10-16-28-21.gh-issue-148395.kfzm0G.rst b/Misc/NEWS.d/next/Security/2026-04-10-16-28-21.gh-issue-148395.kfzm0G.rst
|
||||
new file mode 100644
|
||||
index 0000000..9502189
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Security/2026-04-10-16-28-21.gh-issue-148395.kfzm0G.rst
|
||||
@@ -0,0 +1,5 @@
|
||||
+Fix a dangling input pointer in :class:`lzma.LZMADecompressor`,
|
||||
+:class:`bz2.BZ2Decompressor`, and internal :class:`!zlib._ZlibDecompressor`
|
||||
+when memory allocation fails with :exc:`MemoryError`, which could let a
|
||||
+subsequent :meth:`!decompress` call read or write through a stale pointer to
|
||||
+the already-released caller buffer.
|
||||
diff --git a/Modules/_bz2module.c b/Modules/_bz2module.c
|
||||
index 97bd44b..a732e89 100644
|
||||
--- a/Modules/_bz2module.c
|
||||
+++ b/Modules/_bz2module.c
|
||||
@@ -587,6 +587,7 @@ decompress(BZ2Decompressor *d, char *data, size_t len, Py_ssize_t max_length)
|
||||
return result;
|
||||
|
||||
error:
|
||||
+ bzs->next_in = NULL;
|
||||
Py_XDECREF(result);
|
||||
return NULL;
|
||||
}
|
||||
diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c
|
||||
index 7bbd656..103a6ef 100644
|
||||
--- a/Modules/_lzmamodule.c
|
||||
+++ b/Modules/_lzmamodule.c
|
||||
@@ -1114,6 +1114,7 @@ decompress(Decompressor *d, uint8_t *data, size_t len, Py_ssize_t max_length)
|
||||
return result;
|
||||
|
||||
error:
|
||||
+ lzs->next_in = NULL;
|
||||
Py_XDECREF(result);
|
||||
return NULL;
|
||||
}
|
||||
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
|
||||
index f94c57e..9759593 100644
|
||||
--- a/Modules/zlibmodule.c
|
||||
+++ b/Modules/zlibmodule.c
|
||||
@@ -1645,6 +1645,7 @@ decompress(ZlibDecompressor *self, uint8_t *data,
|
||||
return result;
|
||||
|
||||
error:
|
||||
+ self->zst.next_in = NULL;
|
||||
Py_XDECREF(result);
|
||||
return NULL;
|
||||
}
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -1,148 +0,0 @@
|
||||
From 2ed6138dea0bc94c726f879501e4525712e885d1 Mon Sep 17 00:00:00 2001
|
||||
From: Stan Ulbrych <stan@python.org>
|
||||
Date: Sun, 10 May 2026 18:36:26 +0100
|
||||
Subject: [PATCH] gh-149018: Use `XML_SetHashSalt16Bytes` in
|
||||
`pyexpat`/`_elementtree` when possible (#149023)
|
||||
|
||||
|
||||
CVE: CVE-2026-7210
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/24b8f12544468e4cedf5bfbe25442fcd495391e4]
|
||||
|
||||
[yocto: Use weak symbol detection for XML_SetHashSalt16Bytes instead of
|
||||
XML_COMBINED_VERSION >= 20800, since our backported expat 2.6.4 provides
|
||||
the function but does not bump the version macros.]
|
||||
|
||||
Signed-off-by: Amaury Couderc <amaury.couderc@est.tech>
|
||||
---
|
||||
Include/pyexpat.h | 3 +++
|
||||
Include/pyhash.h | 8 +++++---
|
||||
.../2026-04-26-19-30-45.gh-issue-149018.a9SqWb.rst | 3 +++
|
||||
Modules/_elementtree.c | 8 ++++++--
|
||||
Modules/pyexpat.c | 22 ++++++++++++++++------
|
||||
5 files changed, 33 insertions(+), 11 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Security/2026-04-26-19-30-45.gh-issue-149018.a9SqWb.rst
|
||||
|
||||
diff --git a/Include/pyexpat.h b/Include/pyexpat.h
|
||||
index 04548b7684a..d28d6828975 100644
|
||||
--- a/Include/pyexpat.h
|
||||
+++ b/Include/pyexpat.h
|
||||
@@ -57,6 +57,9 @@ struct PyExpat_CAPI
|
||||
XML_Parser parser, unsigned long long activationThresholdBytes);
|
||||
XML_Bool (*SetAllocTrackerMaximumAmplification)(
|
||||
XML_Parser parser, float maxAmplificationFactor);
|
||||
+ /* might be NULL for expat < 2.8.0 */
|
||||
+ XML_Bool (*SetHashSalt16Bytes)(
|
||||
+ XML_Parser parser, const uint8_t entropy[16]);
|
||||
/* always add new stuff to the end! */
|
||||
};
|
||||
|
||||
diff --git a/Include/pyhash.h b/Include/pyhash.h
|
||||
index 182d223fab1..ec359bd2f35 100644
|
||||
--- a/Include/pyhash.h
|
||||
+++ b/Include/pyhash.h
|
||||
@@ -39,14 +39,14 @@ PyAPI_FUNC(Py_hash_t) _Py_HashBytes(const void*, Py_ssize_t);
|
||||
* pppppppp ssssssss ........ fnv -- two Py_hash_t
|
||||
* k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t
|
||||
* ........ ........ ssssssss djbx33a -- 16 bytes padding + one Py_hash_t
|
||||
- * ........ ........ eeeeeeee pyexpat XML hash salt
|
||||
+ * eeeeeeee eeeeeeee eeeeeeee pyexpat XML hash salt
|
||||
*
|
||||
* memory layout on 32 bit systems
|
||||
* cccccccc cccccccc cccccccc uc
|
||||
* ppppssss ........ ........ fnv -- two Py_hash_t
|
||||
* k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t (*)
|
||||
* ........ ........ ssss.... djbx33a -- 16 bytes padding + one Py_hash_t
|
||||
- * ........ ........ eeee.... pyexpat XML hash salt
|
||||
+ * eeeeeeee eeeeeeee eeee.... pyexpat XML hash salt
|
||||
*
|
||||
* (*) The siphash member may not be available on 32 bit platforms without
|
||||
* an unsigned int64 data type.
|
||||
@@ -71,7 +71,9 @@ typedef union {
|
||||
Py_hash_t suffix;
|
||||
} djbx33a;
|
||||
struct {
|
||||
- unsigned char padding[16];
|
||||
+ /* 16 bytes for XML_SetHashSalt16Bytes */
|
||||
+ uint8_t hashsalt16[16];
|
||||
+ /* 4/8 bytes for legacy XML_SetHashSalt */
|
||||
Py_hash_t hashsalt;
|
||||
} expat;
|
||||
} _Py_HashSecret_t;
|
||||
diff --git a/Misc/NEWS.d/next/Security/2026-04-26-19-30-45.gh-issue-149018.a9SqWb.rst b/Misc/NEWS.d/next/Security/2026-04-26-19-30-45.gh-issue-149018.a9SqWb.rst
|
||||
new file mode 100644
|
||||
index 00000000000..d1b5b368684
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Security/2026-04-26-19-30-45.gh-issue-149018.a9SqWb.rst
|
||||
@@ -0,0 +1,3 @@
|
||||
+Improved protection against XML hash-flooding attacks in
|
||||
+:mod:`xml.parsers.expat` and :mod:`xml.etree.ElementTree` when Python is
|
||||
+compiled with libExpat 2.8.0 or later.
|
||||
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
|
||||
index 56d1508af13..941376613b0 100644
|
||||
--- a/Modules/_elementtree.c
|
||||
+++ b/Modules/_elementtree.c
|
||||
@@ -3657,8 +3657,12 @@ _elementtree_XMLParser___init___impl(XMLParserObject *self, PyObject *target,
|
||||
PyErr_NoMemory();
|
||||
return -1;
|
||||
}
|
||||
- /* expat < 2.1.0 has no XML_SetHashSalt() */
|
||||
- if (EXPAT(st, SetHashSalt) != NULL) {
|
||||
+ // Prefer 16-byte entropy, only expat >= 2.8.0. See gh-149018
|
||||
+ if (EXPAT(st, SetHashSalt16Bytes) != NULL) {
|
||||
+ EXPAT(st, SetHashSalt16Bytes)(self->parser,
|
||||
+ _Py_HashSecret.expat.hashsalt16);
|
||||
+ }
|
||||
+ else if (EXPAT(st, SetHashSalt) != NULL) {
|
||||
EXPAT(st, SetHashSalt)(self->parser,
|
||||
(unsigned long)_Py_HashSecret.expat.hashsalt);
|
||||
}
|
||||
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
|
||||
index 79492ca5c4f..47e3a1b2c00 100644
|
||||
--- a/Modules/pyexpat.c
|
||||
+++ b/Modules/pyexpat.c
|
||||
@@ -14,6 +14,11 @@
|
||||
|
||||
#include "pyexpat.h"
|
||||
|
||||
+/* Use weak symbol to detect XML_SetHashSalt16Bytes at link time.
|
||||
+ This allows using the backported function from expat even when the
|
||||
+ version macros have not been bumped (e.g. expat 2.6.4 + CVE-2026-41080). */
|
||||
+#pragma weak XML_SetHashSalt16Bytes
|
||||
+
|
||||
/* Do not emit Clinic output to a file as that wreaks havoc with conditionally
|
||||
included methods. */
|
||||
/*[clinic input]
|
||||
@@ -1388,10 +1393,16 @@ newxmlparseobject(pyexpat_state *state, const char *encoding,
|
||||
Py_DECREF(self);
|
||||
return NULL;
|
||||
}
|
||||
-#if XML_COMBINED_VERSION >= 20100
|
||||
- /* This feature was added upstream in libexpat 2.1.0. */
|
||||
- XML_SetHashSalt(self->itself,
|
||||
- (unsigned long)_Py_HashSecret.expat.hashsalt);
|
||||
+ /* Prefer 16-byte entropy (expat >= 2.8.0 or backported). */
|
||||
+ if (XML_SetHashSalt16Bytes != NULL) {
|
||||
+ XML_SetHashSalt16Bytes(self->itself, _Py_HashSecret.expat.hashsalt16);
|
||||
+ }
|
||||
+#if XML_COMBINED_VERSION >= 20100
|
||||
+ else {
|
||||
+ /* This feature was added upstream in libexpat 2.1.0. */
|
||||
+ XML_SetHashSalt(self->itself,
|
||||
+ (unsigned long)_Py_HashSecret.expat.hashsalt);
|
||||
+ }
|
||||
#endif
|
||||
XML_SetUserData(self->itself, (void *)self);
|
||||
XML_SetUnknownEncodingHandler(self->itself,
|
||||
@@ -2257,6 +2267,12 @@ pyexpat_exec(PyObject *mod)
|
||||
#else
|
||||
capi->SetHashSalt = NULL;
|
||||
#endif
|
||||
+ /* Detect at runtime via weak symbol */
|
||||
+ if (XML_SetHashSalt16Bytes != NULL) {
|
||||
+ capi->SetHashSalt16Bytes = XML_SetHashSalt16Bytes;
|
||||
+ } else {
|
||||
+ capi->SetHashSalt16Bytes = NULL;
|
||||
+ }
|
||||
#if XML_COMBINED_VERSION >= 20600
|
||||
capi->SetReparseDeferralEnabled = XML_SetReparseDeferralEnabled;
|
||||
#else
|
||||
@@ -1,96 +0,0 @@
|
||||
From 5b412e1f7bdb3e0667b2bc8b216ad216d59d8373 Mon Sep 17 00:00:00 2001
|
||||
From: Stan Ulbrych <stan@python.org>
|
||||
Date: Mon, 8 Jun 2026 11:55:32 +0200
|
||||
Subject: [PATCH] gh-150599: Prevent bz2 decompressor reuse after errors
|
||||
(GH-150600)
|
||||
|
||||
CVE: CVE-2026-9669
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/5755d0f083949ff3c5bf3a37e673e24e306b036e]
|
||||
|
||||
Signed-off-by: Benjamin Robin <benjamin.robin@bootlin.com>
|
||||
---
|
||||
Lib/test/test_bz2.py | 15 +++++++++++++++
|
||||
Modules/_bz2module.c | 18 +++++++++++++++---
|
||||
2 files changed, 30 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
|
||||
index cb730a1a46e2..dcbf6a298264 100644
|
||||
--- a/Lib/test/test_bz2.py
|
||||
+++ b/Lib/test/test_bz2.py
|
||||
@@ -958,6 +958,21 @@ def test_failure(self):
|
||||
# Previously, a second call could crash due to internal inconsistency
|
||||
self.assertRaises(Exception, bzd.decompress, self.BAD_DATA * 30)
|
||||
|
||||
+ def test_decompress_after_data_error(self):
|
||||
+ data = bytes.fromhex(
|
||||
+ "425a6839314159265359000000000000007fffff000000000000000000000000"
|
||||
+ "00000000000000000000000000000000000000e0370000000000000000000000"
|
||||
+ "000000000000000000000000000000000000000000000000000083f3"
|
||||
+ )
|
||||
+ bzd = BZ2Decompressor()
|
||||
+ with self.assertRaisesRegex(OSError, "Invalid data stream"):
|
||||
+ bzd.decompress(data)
|
||||
+ # Previously, a second call could crash due to internal inconsistency
|
||||
+ self.assertFalse(bzd.needs_input)
|
||||
+ self.assertFalse(bzd.eof)
|
||||
+ with self.assertRaisesRegex(ValueError, "previous error"):
|
||||
+ bzd.decompress(b'\x00' * 18)
|
||||
+
|
||||
@support.refcount_test
|
||||
def test_refleaks_in___init__(self):
|
||||
gettotalrefcount = support.get_attribute(sys, 'gettotalrefcount')
|
||||
diff --git a/Modules/_bz2module.c b/Modules/_bz2module.c
|
||||
index 97bd44b4ac96..0b0916142f57 100644
|
||||
--- a/Modules/_bz2module.c
|
||||
+++ b/Modules/_bz2module.c
|
||||
@@ -114,6 +114,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
bz_stream bzs;
|
||||
+ int bzerror;
|
||||
char eof; /* T_BOOL expects a char */
|
||||
PyObject *unused_data;
|
||||
char needs_input;
|
||||
@@ -453,8 +454,11 @@ decompress_buf(BZ2Decompressor *d, Py_ssize_t max_length)
|
||||
|
||||
d->bzs_avail_in_real += bzs->avail_in;
|
||||
|
||||
- if (catch_bz2_error(bzret))
|
||||
+ if (catch_bz2_error(bzret)) {
|
||||
+ d->bzerror = bzret;
|
||||
+ d->needs_input = 0;
|
||||
goto error;
|
||||
+ }
|
||||
if (bzret == BZ_STREAM_END) {
|
||||
d->eof = 1;
|
||||
break;
|
||||
@@ -621,10 +625,17 @@ _bz2_BZ2Decompressor_decompress_impl(BZ2Decompressor *self, Py_buffer *data,
|
||||
PyObject *result = NULL;
|
||||
|
||||
ACQUIRE_LOCK(self);
|
||||
- if (self->eof)
|
||||
+ if (self->eof) {
|
||||
PyErr_SetString(PyExc_EOFError, "End of stream already reached");
|
||||
- else
|
||||
+ }
|
||||
+ else if (self->bzerror) {
|
||||
+ // Re-entering BZ2_bzDecompress() after an error can write out of bounds.
|
||||
+ PyErr_SetString(PyExc_ValueError,
|
||||
+ "Decompressor is unusable after a previous error");
|
||||
+ }
|
||||
+ else {
|
||||
result = decompress(self, data->buf, data->len, max_length);
|
||||
+ }
|
||||
RELEASE_LOCK(self);
|
||||
return result;
|
||||
}
|
||||
@@ -658,6 +669,7 @@ _bz2_BZ2Decompressor_impl(PyTypeObject *type)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+ self->bzerror = 0;
|
||||
self->needs_input = 1;
|
||||
self->bzs_avail_in_real = 0;
|
||||
self->input_buffer = NULL;
|
||||
--
|
||||
2.54.0
|
||||
@@ -20,7 +20,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in
|
||||
index dce36a5..2d235d2 100644
|
||||
--- a/Makefile.pre.in
|
||||
+++ b/Makefile.pre.in
|
||||
@@ -2267,7 +2267,7 @@ COMPILEALL_OPTS=-j0
|
||||
@@ -2272,7 +2272,7 @@ COMPILEALL_OPTS=-j0
|
||||
TEST_MODULES=@TEST_MODULES@
|
||||
|
||||
.PHONY: libinstall
|
||||
|
||||
@@ -31,30 +31,18 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
|
||||
file://0001-test_storlines-skip-due-to-load-variability.patch \
|
||||
file://0001-test_shutdown-skip-problematic-test.patch \
|
||||
file://0001-gh-107811-tarfile-treat-overflow-in-UID-GID-as-failu.patch \
|
||||
file://0001-test_deadlock-skip-problematic-test.patch \
|
||||
file://0001-test_active_children-skip-problematic-test.patch \
|
||||
file://0001-test_deadlock-skip-problematic-test.patch \
|
||||
file://0001-test_active_children-skip-problematic-test.patch \
|
||||
file://0001-test_readline-skip-limited-history-test.patch \
|
||||
file://CVE-2026-1502.patch \
|
||||
file://CVE-2026-6100.patch \
|
||||
file://CVE-2026-3644_CVE-2026-0672.patch \
|
||||
file://CVE-2026-4519_p1.patch \
|
||||
file://CVE-2026-4519_p2.patch \
|
||||
file://CVE-2026-4519_CVE-2026-4786.patch \
|
||||
file://CVE-2026-6019_p1.patch \
|
||||
file://CVE-2026-6019_p2.patch \
|
||||
file://CVE-2025-13462.patch \
|
||||
file://CVE-2026-4224.patch \
|
||||
file://CVE-2026-11940.patch \
|
||||
file://CVE-2026-11972.patch \
|
||||
file://CVE-2026-9669.patch \
|
||||
file://CVE-2026-7210.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:class-native = " \
|
||||
file://0001-Lib-sysconfig.py-use-prefix-value-from-build-configu.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684"
|
||||
SRC_URI[sha256sum] = "5c8462af5790baf43a321a1559dbe0db06d1be4300fb85fb53c40060668e548a"
|
||||
|
||||
# exclude pre-releases for both python 2.x and 3.x
|
||||
UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
|
||||
@@ -69,6 +57,12 @@ CVE_STATUS[CVE-2022-26488] = "not-applicable-platform: Issue only applies on Win
|
||||
CVE_STATUS[CVE-2015-20107] = "upstream-wontfix: The mailcap module is insecure by design, so this can't be fixed in a meaningful way"
|
||||
CVE_STATUS[CVE-2023-36632] = "disputed: Not an issue, in fact expected behaviour"
|
||||
CVE_STATUS[CVE-2026-3087] = "not-applicable-platform: Issue only applies on Windows"
|
||||
CVE_STATUS[CVE-2025-12084] = "cpe-stable-backport: Fixed in v3.12.13"
|
||||
CVE_STATUS[CVE-2025-13462] = "cpe-stable-backport: Fixed in v3.12.14"
|
||||
CVE_STATUS[CVE-2025-13837] = "cpe-stable-backport: Fixed in v3.12.13"
|
||||
CVE_STATUS[CVE-2026-3644] = "cpe-stable-backport: Fixed in v3.12.14"
|
||||
CVE_STATUS[CVE-2026-4519] = "cpe-stable-backport: Fixed in v3.12.14"
|
||||
CVE_STATUS[CVE-2026-7210] = "cpe-stable-backport: Fixed in v3.12.14"
|
||||
|
||||
PYTHON_MAJMIN = "3.12"
|
||||
|
||||
@@ -21,6 +21,7 @@ decompression path from executing.
|
||||
Found by fuzzing with ASAN/UBSAN.
|
||||
|
||||
CVE: CVE-2026-4426
|
||||
CVE: CVE-2026-5121
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/c3cb1c568ebf9e8f7f478cfc0356ae54e99712b0]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
1270
meta/recipes-extended/libarchive/libarchive/CVE-2026-5121-02.patch
Normal file
1270
meta/recipes-extended/libarchive/libarchive/CVE-2026-5121-02.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,39 @@
|
||||
From 5f7025543205106d64081cbafd8c345bf859b86f Mon Sep 17 00:00:00 2001
|
||||
From: Tim Kientzle <kientzle@acm.org>
|
||||
Date: Sat, 18 Apr 2026 21:04:59 -0700
|
||||
Subject: [PATCH] Merge pull request #2905 from Patsakas/Patsakas-fix-acl-bug
|
||||
|
||||
Fix NULL pointer increment in archive_acl_from_text_nl
|
||||
|
||||
(Not a security issue, and arguably not really even a bug, but easy to fix regardless.)
|
||||
|
||||
(cherry picked from commit 0b0b888f86b46e3b279f5f7c6eef0479f35978ee)
|
||||
|
||||
CVE: CVE-2026-5745
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/5f7025543205106d64081cbafd8c345bf859b86f]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
libarchive/archive_acl.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libarchive/archive_acl.c b/libarchive/archive_acl.c
|
||||
index ab601833..14a107a4 100644
|
||||
--- a/libarchive/archive_acl.c
|
||||
+++ b/libarchive/archive_acl.c
|
||||
@@ -1718,7 +1718,6 @@ archive_acl_from_text_nl(struct archive_acl *acl, const char *text,
|
||||
|
||||
tag = 0;
|
||||
s = field[n].start;
|
||||
- st = field[n].start + 1;
|
||||
len = field[n].end - field[n].start;
|
||||
|
||||
if (len == 0) {
|
||||
@@ -1726,6 +1725,8 @@ archive_acl_from_text_nl(struct archive_acl *acl, const char *text,
|
||||
continue;
|
||||
}
|
||||
|
||||
+ st = s + 1;
|
||||
+
|
||||
switch (*s) {
|
||||
case 'u':
|
||||
if (len == 1 || (len == 4
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user