mirror of
https://git.yoctoproject.org/poky
synced 2026-02-21 17:09:42 +01:00
Compare commits
61 Commits
yocto-4.0.
...
kirkstone-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c05660b21 | ||
|
|
cb1206dd84 | ||
|
|
33d90091be | ||
|
|
9f461395a8 | ||
|
|
0002d5d082 | ||
|
|
db73f23fc2 | ||
|
|
40701465df | ||
|
|
ba9338d810 | ||
|
|
46c836aefa | ||
|
|
5f8155aefa | ||
|
|
dd0a2c2470 | ||
|
|
c5794d82b0 | ||
|
|
169ca8debf | ||
|
|
5d27e8f05d | ||
|
|
d492537188 | ||
|
|
052e4214aa | ||
|
|
c76f44b1da | ||
|
|
088d1497d5 | ||
|
|
22f8da4818 | ||
|
|
4030876db9 | ||
|
|
c6234dce63 | ||
|
|
6639c7b295 | ||
|
|
7c4bd642e4 | ||
|
|
f58483837c | ||
|
|
cdc78fd36f | ||
|
|
36165cce68 | ||
|
|
9734a91472 | ||
|
|
42d2a2e8cd | ||
|
|
940e5e75b9 | ||
|
|
3d559d269a | ||
|
|
36037789d2 | ||
|
|
7dd51aea98 | ||
|
|
851a3f0c55 | ||
|
|
dacb67f70f | ||
|
|
232e8ebe3c | ||
|
|
41c16e82e9 | ||
|
|
cab0ee97d8 | ||
|
|
d54b15eba1 | ||
|
|
2943f88d88 | ||
|
|
9479971ef9 | ||
|
|
2cf2a95adb | ||
|
|
bababfb854 | ||
|
|
6f01aae51d | ||
|
|
33d61e50c1 | ||
|
|
9cc35e0f6d | ||
|
|
a916d3a38a | ||
|
|
b0c11efc8f | ||
|
|
478f5eaa61 | ||
|
|
748f958fd3 | ||
|
|
73e3da5d44 | ||
|
|
6b397fb207 | ||
|
|
6ab506f474 | ||
|
|
809b3e9113 | ||
|
|
e2d947b1cc | ||
|
|
1dd6d90744 | ||
|
|
8641f0fec9 | ||
|
|
484d31c23d | ||
|
|
aaf9219788 | ||
|
|
d152607f64 | ||
|
|
0de012f0f6 | ||
|
|
c4200e606c |
@@ -656,8 +656,8 @@ backported to a stable branch unless the bug in question does not affect the
|
||||
master branch or the fix on the master branch is unsuitable for backporting.
|
||||
|
||||
The list of stable branches along with the status and maintainer for each
|
||||
branch can be obtained from the
|
||||
:yocto_wiki:`Releases wiki page </Releases>`.
|
||||
branch can be obtained from the :yocto_home:`Releases </development/releases/>`
|
||||
page.
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@@ -111,17 +111,17 @@ occurred in your project. Perhaps an attempt to :ref:`modify a variable
|
||||
<bitbake-user-manual/bitbake-user-manual-metadata:modifying existing
|
||||
variables>` did not work out as expected.
|
||||
|
||||
BitBake's ``-e`` option is used to display variable values after
|
||||
parsing. The following command displays the variable values after the
|
||||
configuration files (i.e. ``local.conf``, ``bblayers.conf``,
|
||||
BitBake's ``bitbake-getvar`` command is used to display variable values after
|
||||
parsing. The following command displays the variable value for :term:`OVERRIDES`
|
||||
after the configuration files (i.e. ``local.conf``, ``bblayers.conf``,
|
||||
``bitbake.conf`` and so forth) have been parsed::
|
||||
|
||||
$ bitbake -e
|
||||
$ bitbake-getvar OVERRIDES
|
||||
|
||||
The following command displays variable values after a specific recipe has
|
||||
been parsed. The variables include those from the configuration as well::
|
||||
The following command displays the value of :term:`PV` after a specific recipe
|
||||
has been parsed::
|
||||
|
||||
$ bitbake -e recipename
|
||||
$ bitbake-getvar -r recipename PV
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -135,19 +135,25 @@ been parsed. The variables include those from the configuration as well::
|
||||
the recipe datastore, which means that variables set within one task
|
||||
will not be visible to other tasks.
|
||||
|
||||
In the output of ``bitbake -e``, each variable is preceded by a
|
||||
description of how the variable got its value, including temporary
|
||||
values that were later overridden. This description also includes
|
||||
variable flags (varflags) set on the variable. The output can be very
|
||||
In the output of ``bitbake-getvar``, the line containing the value of the
|
||||
variable is preceded by a description of how the variable got its value,
|
||||
including temporary values that were later overridden. This description also
|
||||
includes variable flags (varflags) set on the variable. The output can be very
|
||||
helpful during debugging.
|
||||
|
||||
Variables that are exported to the environment are preceded by
|
||||
``export`` in the output of ``bitbake -e``. See the following example::
|
||||
``export`` in the output of ``bitbake-getvar``. See the following example::
|
||||
|
||||
export CC="i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/ulf/poky/build/tmp/sysroots/qemux86"
|
||||
|
||||
In addition to variable values, the output of the ``bitbake -e`` and
|
||||
``bitbake -e`` recipe commands includes the following information:
|
||||
Shell functions and tasks can also be inspected with the same mechanism::
|
||||
|
||||
$ bitbake-getvar -r recipename do_install
|
||||
|
||||
For Python functions and tasks, ``bitbake -e recipename`` can be used instead.
|
||||
|
||||
Moreover, the output of the ``bitbake -e`` and ``bitbake -e`` recipe commands
|
||||
includes the following information:
|
||||
|
||||
- The output starts with a tree listing all configuration files and
|
||||
classes included globally, recursively listing the files they include
|
||||
|
||||
@@ -123,10 +123,9 @@ Follow these general steps to create your layer without using tools:
|
||||
Lists all layers on which this layer depends (if any).
|
||||
|
||||
- :term:`LAYERSERIES_COMPAT`:
|
||||
Lists the :yocto_wiki:`Yocto Project </Releases>`
|
||||
releases for which the current version is compatible. This
|
||||
variable is a good way to indicate if your particular layer is
|
||||
current.
|
||||
Lists the :yocto_home:`Yocto Project releases </development/releases/>`
|
||||
for which the current version is compatible. This variable is a good
|
||||
way to indicate if your particular layer is current.
|
||||
|
||||
|
||||
.. note::
|
||||
@@ -822,6 +821,8 @@ The following list describes the available commands:
|
||||
|
||||
- ``create-layer``: Creates a basic layer.
|
||||
|
||||
- ``show-machines``: Lists the machines available in the currently configured layers.
|
||||
|
||||
Creating a General Layer Using the ``bitbake-layers`` Script
|
||||
============================================================
|
||||
|
||||
|
||||
@@ -83,19 +83,20 @@ command::
|
||||
OpenEmbedded recipe tool
|
||||
|
||||
options:
|
||||
-d, --debug Enable debug output
|
||||
-q, --quiet Print only errors
|
||||
--color COLOR Colorize output (where COLOR is auto, always, never)
|
||||
-h, --help show this help message and exit
|
||||
-d, --debug Enable debug output
|
||||
-q, --quiet Print only errors
|
||||
--color COLOR Colorize output (where COLOR is auto, always, never)
|
||||
-h, --help show this help message and exit
|
||||
|
||||
subcommands:
|
||||
create Create a new recipe
|
||||
newappend Create a bbappend for the specified target in the specified
|
||||
layer
|
||||
setvar Set a variable within a recipe
|
||||
appendfile Create/update a bbappend to replace a target file
|
||||
appendsrcfiles Create/update a bbappend to add or replace source files
|
||||
appendsrcfile Create/update a bbappend to add or replace a source file
|
||||
newappend Create a bbappend for the specified target in the specified layer
|
||||
create Create a new recipe
|
||||
setvar Set a variable within a recipe
|
||||
appendfile Create/update a bbappend to replace a target file
|
||||
appendsrcfiles Create/update a bbappend to add or replace source files
|
||||
appendsrcfile Create/update a bbappend to add or replace a source file
|
||||
edit Edit the recipe and appends for the specified target. This obeys $VISUAL if set,
|
||||
otherwise $EDITOR, otherwise vi.
|
||||
Use recipetool <subcommand> --help to get help on a specific command
|
||||
|
||||
Running ``recipetool create -o OUTFILE`` creates the base recipe and
|
||||
@@ -218,9 +219,9 @@ compilation and packaging files, and so forth.
|
||||
|
||||
The path to the per-recipe temporary work directory depends on the
|
||||
context in which it is being built. The quickest way to find this path
|
||||
is to have BitBake return it by running the following::
|
||||
is to use the ``bitbake-getvar`` utility::
|
||||
|
||||
$ bitbake -e basename | grep ^WORKDIR=
|
||||
$ bitbake-getvar -r basename WORKDIR
|
||||
|
||||
As an example, assume a Source Directory
|
||||
top-level folder named ``poky``, a default :term:`Build Directory` at
|
||||
@@ -438,7 +439,7 @@ Licensing
|
||||
=========
|
||||
|
||||
Your recipe needs to define variables related to the license
|
||||
under whith the software is distributed. See the
|
||||
under which the software is distributed. See the
|
||||
:ref:`contributor-guide/recipe-style-guide:recipe license fields`
|
||||
section in the Contributor Guide for details.
|
||||
|
||||
|
||||
@@ -44,10 +44,10 @@ See the
|
||||
documentation for details regarding the policies and maintenance of stable
|
||||
branches.
|
||||
|
||||
The :yocto_wiki:`Releases page </Releases>` contains a list
|
||||
of all releases of the Yocto Project. Versions in gray are no longer actively
|
||||
maintained with security patches, but well-tested patches may still be accepted
|
||||
for them for significant issues.
|
||||
The :yocto_home:`Releases </development/releases/>` page contains a list of all
|
||||
releases of the Yocto Project, grouped into current and previous releases.
|
||||
Previous releases are no longer actively maintained with security patches, but
|
||||
well-tested patches may still be accepted for them for significant issues.
|
||||
|
||||
Security-related discussions at the Yocto Project
|
||||
-------------------------------------------------
|
||||
|
||||
@@ -676,7 +676,7 @@ described in the ":ref:`dev-manual/start:accessing index of releases`" section.
|
||||
.. note::
|
||||
|
||||
For a "map" of Yocto Project releases to version numbers, see the
|
||||
:yocto_wiki:`Releases </Releases>` wiki page.
|
||||
:yocto_home:`Releases </development/releases/>` page.
|
||||
|
||||
You can use the "RELEASE ARCHIVE" link to reveal a menu of all Yocto
|
||||
Project releases.
|
||||
|
||||
@@ -1272,10 +1272,12 @@ appear in the ``.config`` file, which is in the :term:`Build Directory`.
|
||||
|
||||
It is simple to create a configuration fragment. One method is to use
|
||||
shell commands. For example, issuing the following from the shell
|
||||
creates a configuration fragment file named ``my_smp.cfg`` that enables
|
||||
multi-processor support within the kernel::
|
||||
creates a configuration fragment file named ``my_changes.cfg`` that enables
|
||||
multi-processor support within the kernel and disables the FPGA
|
||||
Configuration Framework::
|
||||
|
||||
$ echo "CONFIG_SMP=y" >> my_smp.cfg
|
||||
$ echo "CONFIG_SMP=y" >> my_changes.cfg
|
||||
$ echo "# CONFIG_FPGA is not set" >> my_changes.cfg
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -1512,15 +1514,13 @@ Expanding Variables
|
||||
===================
|
||||
|
||||
Sometimes it is helpful to determine what a variable expands to during a
|
||||
build. You can examine the values of variables by examining the
|
||||
output of the ``bitbake -e`` command. The output is long and is more
|
||||
easily managed in a text file, which allows for easy searches::
|
||||
build. You can examine the value of a variable by running the ``bitbake-getvar``
|
||||
command::
|
||||
|
||||
$ bitbake -e virtual/kernel > some_text_file
|
||||
$ bitbake-getvar -r virtual/kernel VARIABLE
|
||||
|
||||
Within the text file, you can see
|
||||
exactly how each variable is expanded and used by the OpenEmbedded build
|
||||
system.
|
||||
The output of the command explains exactly how the variable is expanded and used
|
||||
by the :term:`OpenEmbedded Build System`.
|
||||
|
||||
Working with a "Dirty" Kernel Version String
|
||||
============================================
|
||||
|
||||
@@ -37,3 +37,4 @@ Release 4.0 (kirkstone)
|
||||
release-notes-4.0.28
|
||||
release-notes-4.0.29
|
||||
release-notes-4.0.30
|
||||
release-notes-4.0.31
|
||||
|
||||
210
documentation/migration-guides/release-notes-4.0.31.rst
Normal file
210
documentation/migration-guides/release-notes-4.0.31.rst
Normal file
@@ -0,0 +1,210 @@
|
||||
Release notes for Yocto-4.0.31 (Kirkstone)
|
||||
------------------------------------------
|
||||
|
||||
Security Fixes in Yocto-4.0.31
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- binutils: Fix :cve_nist:`2025-8225`, :cve_nist:`2025-11081`, :cve_nist:`2025-11082` and
|
||||
:cve_nist:`2025-11083`
|
||||
- busybox: Fix :cve_nist:`2025-46394`
|
||||
- cmake: Fix :cve_nist:`2025-9301`
|
||||
- curl: Fix :cve_nist:`2025-9086`
|
||||
- ffmpeg: Ignore :cve_nist:`2023-6603`
|
||||
- ffmpeg: mark :cve_nist:`2023-6601` as Fixed
|
||||
- ghostscript: Fix :cve_nist:`2025-59798`, :cve_nist:`2025-59799` and :cve_nist:`2025-59800`
|
||||
- git: Fix :cve_nist:`2025-48386`
|
||||
- glib-networking: Fix :cve_nist:`2025-60018` and :cve_nist:`2025-60019`
|
||||
- go: Fix :cve_nist:`2025-47906` and :cve_nist:`2025-47907`
|
||||
- grub2: Fix :cve_nist:`2024-56738`
|
||||
- grub: Ignore :cve_nist:`2024-2312`
|
||||
- gstreamer1.0-plugins-bad: Fix :cve_nist:`2025-3887`
|
||||
- gstreamer1.0: Ignore :cve_nist:`2025-2759`, :cve_nist:`2025-3887`, :cve_nist:`2025-47183`,
|
||||
:cve_nist:`2025-47219`, :cve_nist:`2025-47806`, :cve_nist:`2025-47807` and :cve_nist:`2025-47808`
|
||||
- python3-jinja2: Fix :cve_nist:`2024-56201`, :cve_nist:`2024-56326` and :cve_nist:`2025-27516`
|
||||
- libxml2: Fix :cve_nist:`2025-9714`
|
||||
- libxslt: Fix :cve_nist:`2025-7424`
|
||||
- lz4: Fix :cve_nist:`2025-62813`
|
||||
- openssl: Fix :cve_nist:`2025-9230` and :cve_nist:`2025-9232`
|
||||
- pulseaudio: Ignore :cve_nist:`2024-11586`
|
||||
- python3: Fix :cve_nist:`2024-6345`, :cve_nist:`2025-47273` and :cve_nist:`2025-59375`
|
||||
- qemu: Fix :cve_nist:`2024-8354`
|
||||
- tiff: Fix :cve_nist:`2025-8961`, :cve_nist:`2025-9165` and :cve_nist:`2025-9900`
|
||||
- vim: Fix :cve_nist:`2025-9389`
|
||||
|
||||
|
||||
Fixes in Yocto-4.0.31
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- build-appliance-image: Update to kirkstone head revision
|
||||
- poky.conf: bump version for 4.0.31
|
||||
- ref-manual/classes.rst: document the relative_symlinks class
|
||||
- ref-manual/classes.rst: gettext: extend the documentation of the class
|
||||
- ref-manual/variables.rst: document the CCACHE_DISABLE, UNINATIVE_CHECKSUM, UNINATIVE_URL, USE_NLS,
|
||||
REQUIRED_COMBINED_FEATURES, REQUIRED_IMAGE_FEATURES, :term:`REQUIRED_MACHINE_FEATURES` variable
|
||||
- ref-manual/variables.rst: fix :term:`LAYERDEPENDS` description
|
||||
- dev-manual, test-manual: Update autobuilder output links
|
||||
- ref-manual/classes.rst: extend the uninative class documentation
|
||||
- python3: upgrade to 3.10.19
|
||||
- linux-yocto/5.15: update to v5.15.194
|
||||
- glibc: : PTHREAD_COND_INITIALIZER compatibility with pre-2.41 versions (bug 32786)
|
||||
- glibc: nptl Use all of g1_start and g_signals
|
||||
- glibc: nptl rename __condvar_quiesce_and_switch_g1
|
||||
- glibc: nptl Fix indentation
|
||||
- glibc: nptl Use a single loop in pthread_cond_wait instaed of a nested loop
|
||||
- glibc: Remove g_refs from condition variables
|
||||
- glibc: nptl Remove unnecessary quadruple check in pthread_cond_wait
|
||||
- glibc: nptl Remove unnecessary catch-all-wake in condvar group switch
|
||||
- glibc: nptl Update comments and indentation for new condvar implementation
|
||||
- glibc: pthreads NPTL lost wakeup fix 2
|
||||
- glibc: Remove partial BZ#25847 backport patches
|
||||
- vulnerabilities: update nvdcve file name
|
||||
- migration-guides: add release notes for 4.0.30
|
||||
- oeqa/sdk/cases/buildcpio.py: use gnu mirror instead of main server
|
||||
- selftest/cases/meta_ide.py: use use gnu mirror instead of main server
|
||||
- conf/bitbake.conf: use gnu mirror instead of main server
|
||||
- p11-kit: backport fix for handle :term:`USE_NLS` from master
|
||||
- systemd: backport fix for handle :term:`USE_NLS` from master
|
||||
- glibc: stable 2.35 branch updates
|
||||
- openssl: upgrade to 3.0.18
|
||||
- scripts/install-buildtools: Update to 4.0.30
|
||||
- ref-manual/variables.rst: fix the description of :term:`STAGING_DIR`
|
||||
- ref-manual/structure: document the auto.conf file
|
||||
- dev-manual/building.rst: add note about externalsrc variables absolute paths
|
||||
- ref-manual/variables.rst: fix the description of :term:`KBUILD_DEFCONFIG`
|
||||
- kernel-dev/common.rst: fix the in-tree defconfig description
|
||||
- test-manual/yocto-project-compatible.rst: fix a typo
|
||||
- contributor-guide: submit-changes: make "Crediting contributors" part of "Commit your changes"
|
||||
- contributor-guide: submit-changes: number instruction list in commit your changes
|
||||
- contributor-guide: submit-changes: reword commit message instructions
|
||||
- contributor-guide: submit-changes: make the Cc tag follow kernel guidelines
|
||||
- contributor-guide: submit-changes: align :term:`CC` tag description
|
||||
- contributor-guide: submit-changes: clarify example with Yocto bug ID
|
||||
- contributor-guide: submit-changes: fix improper bold string
|
||||
- libhandy: update git branch name
|
||||
- python3-jinja2: upgrade to 3.1.6
|
||||
- vim: upgrade to 9.1.1683
|
||||
|
||||
|
||||
Known Issues in Yocto-4.0.31
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- N/A
|
||||
|
||||
|
||||
Contributors to Yocto-4.0.31
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Adam Blank
|
||||
- Aleksandar Nikolic
|
||||
- Antonin Godard
|
||||
- Archana Polampalli
|
||||
- AshishKumar Mishra
|
||||
- Bruce Ashfield
|
||||
- Deepesh Varatharajan
|
||||
- Divya Chellam
|
||||
- Gyorgy Sarvari
|
||||
- Hitendra Prajapati
|
||||
- João Marcos Costa
|
||||
- Lee Chee Yang
|
||||
- Paul Barker
|
||||
- Peter Marko
|
||||
- Praveen Kumar
|
||||
- Quentin Schulz
|
||||
- Rajeshkumar Ramasamy
|
||||
- Saravanan
|
||||
- Soumya Sambu
|
||||
- Steve Sakoman
|
||||
- Sunil Dora
|
||||
- Talel BELHAJ SALEM
|
||||
- Theo GAIGE
|
||||
- Vijay Anusuri
|
||||
- Yash Shinde
|
||||
- Yogita Urade
|
||||
|
||||
Repositories / Downloads for Yocto-4.0.31
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
yocto-docs
|
||||
|
||||
- Repository Location: :yocto_git:`/yocto-docs`
|
||||
- Branch: :yocto_git:`kirkstone </yocto-docs/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.31 </yocto-docs/log/?h=yocto-4.0.31>`
|
||||
- Git Revision: :yocto_git:`073f3bca4c374b03398317e7f445d2440a287741 </yocto-docs/commit/?id=073f3bca4c374b03398317e7f445d2440a287741>`
|
||||
- Release Artefact: yocto-docs-073f3bca4c374b03398317e7f445d2440a287741
|
||||
- sha: 3bfde9b6ad310dd42817509b67f61cd69552f74b2bc5011bd20788fe96d6823b
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.31/yocto-docs-073f3bca4c374b03398317e7f445d2440a287741.tar.bz2
|
||||
https://mirrors.edge.kernel.org/yocto/yocto/yocto-4.0.31/yocto-docs-073f3bca4c374b03398317e7f445d2440a287741.tar.bz2
|
||||
|
||||
poky
|
||||
|
||||
- Repository Location: :yocto_git:`/poky`
|
||||
- Branch: :yocto_git:`kirkstone </poky/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.31 </poky/log/?h=yocto-4.0.31>`
|
||||
- Git Revision: :yocto_git:`04b39e5b7eb19498215d85c88a5fffb460fea1eb </poky/commit/?id=04b39e5b7eb19498215d85c88a5fffb460fea1eb>`
|
||||
- Release Artefact: poky-04b39e5b7eb19498215d85c88a5fffb460fea1eb
|
||||
- sha: 0ca18ab1ed25c0d77412ba30dbb03d74811756c7c2fe2401940f848a5e734930
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.31/poky-04b39e5b7eb19498215d85c88a5fffb460fea1eb.tar.bz2
|
||||
https://mirrors.edge.kernel.org/yocto/yocto/yocto-4.0.31/poky-04b39e5b7eb19498215d85c88a5fffb460fea1eb.tar.bz2
|
||||
|
||||
openembedded-core
|
||||
|
||||
- Repository Location: :oe_git:`/openembedded-core`
|
||||
- Branch: :oe_git:`kirkstone </openembedded-core/log/?h=kirkstone>`
|
||||
- Tag: :oe_git:`yocto-4.0.31 </openembedded-core/log/?h=yocto-4.0.31>`
|
||||
- Git Revision: :oe_git:`99204008786f659ab03538cd2ae2fd23ed4164c5 </openembedded-core/commit/?id=99204008786f659ab03538cd2ae2fd23ed4164c5>`
|
||||
- Release Artefact: oecore-99204008786f659ab03538cd2ae2fd23ed4164c5
|
||||
- sha: aa97bf826ad217b3a5278b4ad60bef4d194f0f1ff617677cf2323d3cc4897687
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.31/oecore-99204008786f659ab03538cd2ae2fd23ed4164c5.tar.bz2
|
||||
https://mirrors.edge.kernel.org/yocto/yocto/yocto-4.0.31/oecore-99204008786f659ab03538cd2ae2fd23ed4164c5.tar.bz2
|
||||
|
||||
meta-yocto
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-yocto`
|
||||
- Branch: :yocto_git:`kirkstone </meta-yocto/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.31 </meta-yocto/log/?h=yocto-4.0.31>`
|
||||
- Git Revision: :yocto_git:`3b2df00345b46479237fe0218675a818249f891c </meta-yocto/commit/?id=3b2df00345b46479237fe0218675a818249f891c>`
|
||||
- Release Artefact: meta-yocto-3b2df00345b46479237fe0218675a818249f891c
|
||||
- sha: 630e99e0f515bab8a316b2e32aff1352b4404f15aa087e8821b84093596a08ce
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.31/meta-yocto-3b2df00345b46479237fe0218675a818249f891c.tar.bz2
|
||||
https://mirrors.edge.kernel.org/yocto/yocto/yocto-4.0.31/meta-yocto-3b2df00345b46479237fe0218675a818249f891c.tar.bz2
|
||||
|
||||
meta-mingw
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-mingw`
|
||||
- Branch: :yocto_git:`kirkstone </meta-mingw/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.31 </meta-mingw/log/?h=yocto-4.0.31>`
|
||||
- Git Revision: :yocto_git:`87c22abb1f11be430caf4372e6b833dc7d77564e </meta-mingw/commit/?id=87c22abb1f11be430caf4372e6b833dc7d77564e>`
|
||||
- Release Artefact: meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e
|
||||
- sha: f0bc4873e2e0319fb9d6d6ab9b98eb3f89664d4339a167d2db6a787dd12bc1a8
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.31/meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e.tar.bz2
|
||||
https://mirrors.edge.kernel.org/yocto/yocto/yocto-4.0.31/meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e.tar.bz2
|
||||
|
||||
meta-gplv2
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-gplv2`
|
||||
- Branch: :yocto_git:`kirkstone </meta-gplv2/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.31 </meta-gplv2/log/?h=yocto-4.0.31>`
|
||||
- Git Revision: :yocto_git:`d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a </meta-gplv2/commit/?id=d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a>`
|
||||
- Release Artefact: meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a
|
||||
- sha: c386f59f8a672747dc3d0be1d4234b6039273d0e57933eb87caa20f56b9cca6d
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.31/meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a.tar.bz2
|
||||
https://mirrors.edge.kernel.org/yocto/yocto/yocto-4.0.31/meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a.tar.bz2
|
||||
|
||||
bitbake
|
||||
|
||||
- Repository Location: :oe_git:`/bitbake`
|
||||
- Branch: :oe_git:`2.0 </bitbake/log/?h=2.0>`
|
||||
- Tag: :oe_git:`yocto-4.0.31 </bitbake/log/?h=yocto-4.0.31>`
|
||||
- Git Revision: :oe_git:`8e2d1f8de055549b2101614d85454fcd1d0f94b2 </bitbake/commit/?id=8e2d1f8de055549b2101614d85454fcd1d0f94b2>`
|
||||
- Release Artefact: bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2
|
||||
- sha: fad4e7699bae62082118e89785324b031b0af0743064caee87c91ba28549afb0
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.31/bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2.tar.bz2
|
||||
https://mirrors.edge.kernel.org/yocto/yocto/yocto-4.0.31/bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2.tar.bz2
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 20 KiB |
172
documentation/overview-manual/svg/key-dev-elements.svg
Normal file
172
documentation/overview-manual/svg/key-dev-elements.svg
Normal file
@@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="164.765mm"
|
||||
height="72.988113mm"
|
||||
viewBox="0 0 164.765 72.988114"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
xml:space="preserve"
|
||||
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
|
||||
sodipodi:docname="key-dev-elements.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="false"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="341.5"
|
||||
inkscape:cy="-31.5"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1440"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="layer2"
|
||||
showborder="false"
|
||||
borderlayer="false"
|
||||
inkscape:antialias-rendering="true"
|
||||
showguides="true" /><defs
|
||||
id="defs1" /><g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="Layer "
|
||||
style="display:inline"
|
||||
transform="translate(-20.664242,-129.6793)"><rect
|
||||
style="display:inline;fill:#f1e9cc;fill-opacity:1;stroke:#6d8eb4;stroke-width:0.653;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
id="rect1"
|
||||
width="164.112"
|
||||
height="54.273098"
|
||||
x="20.990742"
|
||||
y="130.0058"
|
||||
ry="0"
|
||||
inkscape:label="yp-rect" /><rect
|
||||
style="display:inline;fill:#f3d770;fill-opacity:1;stroke:#6d8eb4;stroke-width:0.653;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
id="rect2"
|
||||
width="101.45864"
|
||||
height="41.151588"
|
||||
x="28.1292"
|
||||
y="137.10953"
|
||||
inkscape:label="poky-rect" /><rect
|
||||
style="display:inline;fill:#c0ebf5;fill-opacity:1;stroke:#6d8eb4;stroke-width:0.653;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
id="rect3"
|
||||
width="50.652737"
|
||||
height="53.04562"
|
||||
x="35.516178"
|
||||
y="149.29529"
|
||||
inkscape:label="oe-rect" /><text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;white-space:pre;inline-size:46.7487;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
x="136.38763"
|
||||
y="137.69727"
|
||||
id="text3"
|
||||
inkscape:label="poky-title"
|
||||
transform="matrix(0.90889596,0,0,0.81399719,-26.072941,39.399474)"><tspan
|
||||
x="136.38763"
|
||||
y="137.69727"
|
||||
id="tspan2">Poky</tspan></text><text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;white-space:pre;inline-size:46.7487;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
x="136.38763"
|
||||
y="137.69727"
|
||||
id="text3-8"
|
||||
inkscape:label="oe-title"
|
||||
transform="matrix(0.90889596,0,0,0.81399719,-78.327995,83.175189)"><tspan
|
||||
x="136.38763"
|
||||
y="137.69727"
|
||||
id="tspan4">OpenEmbedded</tspan></text><text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;white-space:pre;inline-size:46.7487;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
x="136.38763"
|
||||
y="137.69727"
|
||||
id="text3-0"
|
||||
inkscape:label="yp-title"
|
||||
transform="matrix(0.8469291,0,0,0.81399719,21.497595,28.033837)"><tspan
|
||||
x="136.38763"
|
||||
y="137.69727"
|
||||
id="tspan5">YOCTO PROJECT (YP)</tspan></text><text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.98347px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
x="137.19444"
|
||||
y="150.50006"
|
||||
id="text4"
|
||||
transform="scale(1.0050579,0.9949676)"
|
||||
inkscape:label="yp-text"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.98347px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="137.19444"
|
||||
y="150.50006">Umbrella Open Source Project</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.98347px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="137.19444"
|
||||
y="154.2294"
|
||||
id="tspan6">that Builds and Maintains</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.98347px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="137.19444"
|
||||
y="157.95874"
|
||||
id="tspan7">Validated Open Source Tools and</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.98347px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="137.19444"
|
||||
y="161.68808"
|
||||
id="tspan8">Components Associated with</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.98347px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="137.19444"
|
||||
y="165.4174"
|
||||
id="tspan9">Embedded Linux</tspan></text><text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.97078px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
x="90.582634"
|
||||
y="159.10139"
|
||||
id="text10"
|
||||
transform="scale(1.0018079,0.9981954)"
|
||||
inkscape:label="poky-text"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan10"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.97078px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="90.582634"
|
||||
y="159.10139">Yocto Project Open</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.97078px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="90.582634"
|
||||
y="162.81487"
|
||||
id="tspan11">Source Reference</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.97078px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="90.582634"
|
||||
y="166.52835"
|
||||
id="tspan12">Embedded Distribution</tspan></text><text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.01677px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
x="40.36692"
|
||||
y="160.98824"
|
||||
id="text13"
|
||||
transform="scale(0.99784993,1.0021547)"
|
||||
inkscape:label="oe-text"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan13"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.01677px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="40.36692"
|
||||
y="160.98824">Open Source Build Engine</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.01677px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="40.36692"
|
||||
y="164.7592"
|
||||
id="tspan14">and YP-Compatible Metadata</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.01677px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="40.36692"
|
||||
y="168.53017"
|
||||
id="tspan15">for Embedded Linux</tspan></text></g></svg>
|
||||
|
After Width: | Height: | Size: 12 KiB |
@@ -23,8 +23,8 @@ comes to delivering embedded software stacks. The project allows
|
||||
software customizations and build interchange for multiple hardware
|
||||
platforms as well as software stacks that can be maintained and scaled.
|
||||
|
||||
.. image:: figures/key-dev-elements.png
|
||||
:align: center
|
||||
.. image:: svg/key-dev-elements.*
|
||||
:width: 100%
|
||||
|
||||
For further introductory information on the Yocto Project, you might be
|
||||
interested in this
|
||||
|
||||
@@ -62,7 +62,8 @@ codename are likely to be compatible and thus work together.
|
||||
|
||||
Releases are given a nominal release version as well but the codename is
|
||||
used in repositories for this reason. You can find information on Yocto
|
||||
Project releases and codenames at :yocto_wiki:`/Releases`.
|
||||
Project releases and codenames in the :yocto_home:`Releases page
|
||||
</development/releases/>`.
|
||||
|
||||
Our :doc:`/migration-guides/index` detail how to migrate from one release of
|
||||
the Yocto Project to the next.
|
||||
|
||||
@@ -5549,8 +5549,8 @@ system and gives an overview of their function and contents.
|
||||
|
||||
.. note::
|
||||
|
||||
An easy way to see what overrides apply is to search for :term:`OVERRIDES`
|
||||
in the output of the ``bitbake -e`` command. See the
|
||||
An easy way to see what overrides apply is to run the command
|
||||
``bitbake-getvar -r myrecipe OVERRIDES``. See the
|
||||
":ref:`dev-manual/debugging:viewing variable values`" section in the Yocto
|
||||
Project Development Tasks Manual for more information.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
#DISTRO_VERSION = "3.4+snapshot-${METADATA_REVISION}"
|
||||
DISTRO_VERSION = "4.0.31"
|
||||
DISTRO_VERSION = "4.0.32"
|
||||
DISTRO_CODENAME = "kirkstone"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${METADATA_REVISION}', 'snapshot')}"
|
||||
|
||||
@@ -18,6 +18,9 @@ TARGET_GOMIPS = "${@go_map_mips(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES
|
||||
TARGET_GOARM:class-native = "7"
|
||||
TARGET_GO386:class-native = "sse2"
|
||||
TARGET_GOMIPS:class-native = "hardfloat"
|
||||
TARGET_GOARM:class-crosssdk = "7"
|
||||
TARGET_GO386:class-crosssdk = "sse2"
|
||||
TARGET_GOMIPS:class-crosssdk = "hardfloat"
|
||||
TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}"
|
||||
GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE') == d.getVar('HOST_GOTUPLE')]}"
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ DEPENDS = "efivar popt"
|
||||
|
||||
COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
|
||||
|
||||
SRC_URI = "git://github.com/rhinstaller/efibootmgr.git;protocol=https;branch=master \
|
||||
SRC_URI = "git://github.com/rhinstaller/efibootmgr.git;protocol=https;branch=main \
|
||||
file://0001-remove-extra-decl.patch \
|
||||
file://97668ae0bce776a36ea2001dea63d376be8274ac.patch \
|
||||
file://0001-src-make-compatible-with-efivar-38.patch \
|
||||
|
||||
56
meta/recipes-bsp/u-boot/files/CVE-2024-42040.patch
Normal file
56
meta/recipes-bsp/u-boot/files/CVE-2024-42040.patch
Normal file
@@ -0,0 +1,56 @@
|
||||
From 1406fc918977bba4dac0af5e22e63a5553aa6aff Mon Sep 17 00:00:00 2001
|
||||
From: Paul HENRYS <paul.henrys_ext@softathome.com>
|
||||
Date: Thu, 9 Oct 2025 17:43:28 +0200
|
||||
Subject: [PATCH] net: bootp: Prevent buffer overflow to avoid leaking the RAM
|
||||
content
|
||||
|
||||
CVE-2024-42040 describes a possible buffer overflow when calling
|
||||
bootp_process_vendor() in bootp_handler() since the total length
|
||||
of the packet is passed to bootp_process_vendor() without being
|
||||
reduced to len-(offsetof(struct bootp_hdr,bp_vend)+4).
|
||||
|
||||
The packet length is also checked against its minimum size to avoid
|
||||
reading data from struct bootp_hdr outside of the packet length.
|
||||
|
||||
Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
|
||||
Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
|
||||
|
||||
CVE: CVE-2024-42040
|
||||
Upstream-Status: Backport [https://source.denx.de/u-boot/u-boot/-/commit/81e5708cc2c865df606e49aed5415adb2a662171]
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
---
|
||||
net/bootp.c | 11 ++++++++++-
|
||||
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/net/bootp.c b/net/bootp.c
|
||||
index 68002909634..843180d296c 100644
|
||||
--- a/net/bootp.c
|
||||
+++ b/net/bootp.c
|
||||
@@ -362,6 +362,14 @@ static void bootp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
|
||||
debug("got BOOTP packet (src=%d, dst=%d, len=%d want_len=%zu)\n",
|
||||
src, dest, len, sizeof(struct bootp_hdr));
|
||||
|
||||
+ /* Check the minimum size of a BOOTP packet is respected.
|
||||
+ * A BOOTP packet is between 300 bytes and 576 bytes big
|
||||
+ */
|
||||
+ if (len < offsetof(struct bootp_hdr, bp_vend) + 64) {
|
||||
+ printf("Error: got an invalid BOOTP packet (len=%u)\n", len);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
bp = (struct bootp_hdr *)pkt;
|
||||
|
||||
/* Filter out pkts we don't want */
|
||||
@@ -379,7 +387,8 @@ static void bootp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
|
||||
|
||||
/* Retrieve extended information (we must parse the vendor area) */
|
||||
if (net_read_u32((u32 *)&bp->bp_vend[0]) == htonl(BOOTP_VENDOR_MAGIC))
|
||||
- bootp_process_vendor((uchar *)&bp->bp_vend[4], len);
|
||||
+ bootp_process_vendor((uchar *)&bp->bp_vend[4], len -
|
||||
+ (offsetof(struct bootp_hdr, bp_vend) + 4));
|
||||
|
||||
net_set_timeout_handler(0, (thand_f *)0);
|
||||
bootstage_mark_name(BOOTSTAGE_ID_BOOTP_STOP, "bootp_stop");
|
||||
--
|
||||
2.49.0
|
||||
|
||||
@@ -14,7 +14,9 @@ PE = "1"
|
||||
# repo during parse
|
||||
SRCREV = "d637294e264adfeb29f390dfc393106fd4d41b17"
|
||||
|
||||
SRC_URI = "git://source.denx.de/u-boot/u-boot.git;protocol=https;branch=master"
|
||||
SRC_URI = "git://source.denx.de/u-boot/u-boot.git;protocol=https;branch=master \
|
||||
file://CVE-2024-42040.patch \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
B = "${WORKDIR}/build"
|
||||
|
||||
@@ -20,7 +20,7 @@ SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.xz \
|
||||
file://0001-avoid-start-failure-with-bind-user.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "fb373fac5ebbc41c645160afd5a9fb451918f6c0e69ab1d9474154e2b515de40"
|
||||
SRC_URI[sha256sum] = "6ddc1d981511c4da0b203b0513af131e5d15e5f1c261145736fe1f35dd1fe79d"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
|
||||
# follow the ESV versions divisible by 2
|
||||
@@ -0,0 +1,98 @@
|
||||
From 35d5917652106aede47621bb3f64044604164043 Mon Sep 17 00:00:00 2001
|
||||
From: "djm@openbsd.org" <djm@openbsd.org>
|
||||
Date: Thu, 4 Sep 2025 00:29:09 +0000
|
||||
Subject: [PATCH] upstream: Improve rules for %-expansion of username.
|
||||
|
||||
Usernames passed on the commandline will no longer be subject to
|
||||
% expansion. Some tools invoke ssh with connection information
|
||||
(i.e. usernames and host names) supplied from untrusted sources.
|
||||
These may contain % expansion sequences which could yield
|
||||
unexpected results.
|
||||
|
||||
Since openssh-9.6, all usernames have been subject to validity
|
||||
checking. This change tightens the validity checks by refusing
|
||||
usernames that include control characters (again, these can cause
|
||||
surprises when supplied adversarially).
|
||||
|
||||
This change also relaxes the validity checks in one small way:
|
||||
usernames supplied via the configuration file as literals (i.e.
|
||||
include no % expansion characters) are not subject to these
|
||||
validity checks. This allows usernames that contain arbitrary
|
||||
characters to be used, but only via configuration files. This
|
||||
is done on the basis that ssh's configuration is trusted.
|
||||
|
||||
Pointed out by David Leadbeater, ok deraadt@
|
||||
|
||||
OpenBSD-Commit-ID: e2f0c871fbe664aba30607321575e7c7fc798362
|
||||
|
||||
CVE: CVE-2025-61984
|
||||
Upstream-Status: Backport [https://github.com/openssh/openssh-portable/commit/35d5917652106aede47621bb3f64044604164043]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
ssh.c | 11 +++++++++++++++--
|
||||
1 file changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/ssh.c b/ssh.c
|
||||
index 82ed15f..d4e2040 100644
|
||||
--- a/ssh.c
|
||||
+++ b/ssh.c
|
||||
@@ -634,6 +634,8 @@ valid_ruser(const char *s)
|
||||
if (*s == '-')
|
||||
return 0;
|
||||
for (i = 0; s[i] != 0; i++) {
|
||||
+ if (iscntrl((u_char)s[i]))
|
||||
+ return 0;
|
||||
if (strchr("'`\";&<>|(){}", s[i]) != NULL)
|
||||
return 0;
|
||||
/* Disallow '-' after whitespace */
|
||||
@@ -655,6 +657,7 @@ main(int ac, char **av)
|
||||
struct ssh *ssh = NULL;
|
||||
int i, r, opt, exit_status, use_syslog, direct, timeout_ms;
|
||||
int was_addr, config_test = 0, opt_terminated = 0, want_final_pass = 0;
|
||||
+ int user_on_commandline = 0, user_was_default = 0, user_expanded = 0;
|
||||
char *p, *cp, *line, *argv0, *logfile, *host_arg;
|
||||
char cname[NI_MAXHOST], thishost[NI_MAXHOST];
|
||||
struct stat st;
|
||||
@@ -995,8 +998,10 @@ main(int ac, char **av)
|
||||
}
|
||||
break;
|
||||
case 'l':
|
||||
- if (options.user == NULL)
|
||||
+ if (options.user == NULL) {
|
||||
options.user = optarg;
|
||||
+ user_on_commandline = 1;
|
||||
+ }
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
@@ -1099,6 +1104,7 @@ main(int ac, char **av)
|
||||
if (options.user == NULL) {
|
||||
options.user = tuser;
|
||||
tuser = NULL;
|
||||
+ user_on_commandline = 1;
|
||||
}
|
||||
free(tuser);
|
||||
if (options.port == -1 && tport != -1)
|
||||
@@ -1113,6 +1119,7 @@ main(int ac, char **av)
|
||||
if (options.user == NULL) {
|
||||
options.user = p;
|
||||
p = NULL;
|
||||
+ user_on_commandline = 1;
|
||||
}
|
||||
*cp++ = '\0';
|
||||
host = xstrdup(cp);
|
||||
@@ -1265,8 +1272,10 @@ main(int ac, char **av)
|
||||
if (fill_default_options(&options) != 0)
|
||||
cleanup_exit(255);
|
||||
|
||||
- if (options.user == NULL)
|
||||
+ if (options.user == NULL) {
|
||||
+ user_was_default = 1;
|
||||
options.user = xstrdup(pw->pw_name);
|
||||
+ }
|
||||
|
||||
/*
|
||||
* If ProxyJump option specified, then construct a ProxyCommand now.
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 54928cb9eaa7143ff17f463efa7ed3109afdbf30 Mon Sep 17 00:00:00 2001
|
||||
From: "djm@openbsd.org" <djm@openbsd.org>
|
||||
Date: Thu, 4 Sep 2025 00:30:06 +0000
|
||||
Subject: [PATCH] upstream: don't allow \0 characters in url-encoded strings.
|
||||
Suggested by David Leadbeater, ok deraadt@
|
||||
|
||||
OpenBSD-Commit-ID: c92196cef0f970ceabc1e8007a80b01e9b7cd49c
|
||||
|
||||
CVE: CVE-2025-61985
|
||||
|
||||
Upstream-Status: Backport [https://github.com/openssh/openssh-portable/commit/43b3bff47bb029f2299bacb6a36057981b39fdb0]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
misc.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/misc.c b/misc.c
|
||||
index 6135b15..3d133b5 100644
|
||||
--- a/misc.c
|
||||
+++ b/misc.c
|
||||
@@ -934,9 +934,10 @@ urldecode(const char *src)
|
||||
*dst++ = ' ';
|
||||
break;
|
||||
case '%':
|
||||
+ /* note: don't allow \0 characters */
|
||||
if (!isxdigit((unsigned char)src[1]) ||
|
||||
!isxdigit((unsigned char)src[2]) ||
|
||||
- (ch = hexchar(src + 1)) == -1) {
|
||||
+ (ch = hexchar(src + 1)) == -1 || ch == 0) {
|
||||
free(ret);
|
||||
return NULL;
|
||||
}
|
||||
--
|
||||
2.40.0
|
||||
@@ -39,6 +39,8 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
|
||||
file://CVE-2024-6387.patch \
|
||||
file://CVE-2025-26465.patch \
|
||||
file://CVE-2025-32728.patch \
|
||||
file://CVE-2025-61985.patch \
|
||||
file://CVE-2025-61984.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "fd497654b7ab1686dac672fb83dfb4ba4096e8b5ffcdaccd262380ae58bec5e7"
|
||||
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
From 726432d7622cc0088ac353d073b59628b590ea44 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Sat, 25 Jan 2025 11:21:16 +0200
|
||||
Subject: [PATCH] RADIUS: Drop pending request only when accepting the response
|
||||
|
||||
The case of an invalid authenticator in a RADIUS response could imply
|
||||
that the response is not from the correct RADIUS server and as such,
|
||||
such a response should be discarded without changing internal state for
|
||||
the pending request. The case of an unknown response (RADIUS_RX_UNKNOWN)
|
||||
is somewhat more complex since it could have been indicated before
|
||||
validating the authenticator. In any case, it seems better to change the
|
||||
state for the pending request only when we have fully accepted the
|
||||
response.
|
||||
|
||||
Allowing the internal state of pending RADIUS request to change based on
|
||||
responses that are not fully validation could have allow at least a
|
||||
theoretical DoS attack if an attacker were to have means for injecting
|
||||
RADIUS messages to the network using the IP address of the real RADIUS
|
||||
server and being able to do so more quickly than the real server and
|
||||
with the matching identifier from the request header (i.e., either by
|
||||
flooding 256 responses quickly or by having means to capture the RADIUS
|
||||
request). These should not really be realistic options in a properly
|
||||
protected deployment, but nevertheless it is good to be more careful in
|
||||
processing RADIUS responses.
|
||||
|
||||
Remove a pending RADIUS request from the internal list only when having
|
||||
fully accepted a matching RADIUS response, i.e., after one of the
|
||||
registered handlers has confirmed that the authenticator is valid and
|
||||
processing of the response has succeeded.
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
|
||||
CVE: CVE-2025-24912
|
||||
Upstream-Status: Backport [https://w1.fi/cgit/hostap/commit/?id=726432d7622cc0088ac353d073b59628b590ea44]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
src/radius/radius_client.c | 15 +++++++--------
|
||||
1 file changed, 7 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c
|
||||
index 2a7f36170..7909b29a7 100644
|
||||
--- a/src/radius/radius_client.c
|
||||
+++ b/src/radius/radius_client.c
|
||||
@@ -922,13 +922,6 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
roundtrip / 100, roundtrip % 100);
|
||||
rconf->round_trip_time = roundtrip;
|
||||
|
||||
- /* Remove ACKed RADIUS packet from retransmit list */
|
||||
- if (prev_req)
|
||||
- prev_req->next = req->next;
|
||||
- else
|
||||
- radius->msgs = req->next;
|
||||
- radius->num_msgs--;
|
||||
-
|
||||
for (i = 0; i < num_handlers; i++) {
|
||||
RadiusRxResult res;
|
||||
res = handlers[i].handler(msg, req->msg, req->shared_secret,
|
||||
@@ -939,6 +932,13 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
radius_msg_free(msg);
|
||||
/* fall through */
|
||||
case RADIUS_RX_QUEUED:
|
||||
+ /* Remove ACKed RADIUS packet from retransmit list */
|
||||
+ if (prev_req)
|
||||
+ prev_req->next = req->next;
|
||||
+ else
|
||||
+ radius->msgs = req->next;
|
||||
+ radius->num_msgs--;
|
||||
+
|
||||
radius_client_msg_free(req);
|
||||
return;
|
||||
case RADIUS_RX_INVALID_AUTHENTICATOR:
|
||||
@@ -960,7 +960,6 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
msg_type, hdr->code, hdr->identifier,
|
||||
invalid_authenticator ? " [INVALID AUTHENTICATOR]" :
|
||||
"");
|
||||
- radius_client_msg_free(req);
|
||||
|
||||
fail:
|
||||
radius_msg_free(msg);
|
||||
@@ -0,0 +1,70 @@
|
||||
From 339a334551ca911187cc870f4f97ef08e11db109 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
Date: Wed, 5 Feb 2025 19:23:39 +0200
|
||||
Subject: [PATCH] RADIUS: Fix pending request dropping
|
||||
|
||||
A recent change to this moved the place where the processed RADIUS
|
||||
request was removed from the pending list to happen after the message
|
||||
handler had been called. This did not take into account possibility of
|
||||
the handler adding a new pending request in the list and the prev_req
|
||||
pointer not necessarily pointing to the correct entry anymore. As such,
|
||||
some of the pending requests could have been lost and that would result
|
||||
in not being able to process responses to those requests and also, to a
|
||||
memory leak.
|
||||
|
||||
Fix this by determining prev_req at the point when the pending request
|
||||
is being removed, i.e., after the handler function has already added a
|
||||
new entry.
|
||||
|
||||
Fixes: 726432d7622c ("RADIUS: Drop pending request only when accepting the response")
|
||||
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
|
||||
CVE: CVE-2025-24912
|
||||
Upstream-Status: Backport [https://w1.fi/cgit/hostap/commit/?id=339a334551ca911187cc870f4f97ef08e11db109]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
src/radius/radius_client.c | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c
|
||||
index 7909b29a7..d4faa7936 100644
|
||||
--- a/src/radius/radius_client.c
|
||||
+++ b/src/radius/radius_client.c
|
||||
@@ -824,7 +824,7 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
struct radius_hdr *hdr;
|
||||
struct radius_rx_handler *handlers;
|
||||
size_t num_handlers, i;
|
||||
- struct radius_msg_list *req, *prev_req;
|
||||
+ struct radius_msg_list *req, *prev_req, *r;
|
||||
struct os_reltime now;
|
||||
struct hostapd_radius_server *rconf;
|
||||
int invalid_authenticator = 0;
|
||||
@@ -887,7 +887,6 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
break;
|
||||
}
|
||||
|
||||
- prev_req = NULL;
|
||||
req = radius->msgs;
|
||||
while (req) {
|
||||
/* TODO: also match by src addr:port of the packet when using
|
||||
@@ -899,7 +898,6 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
hdr->identifier)
|
||||
break;
|
||||
|
||||
- prev_req = req;
|
||||
req = req->next;
|
||||
}
|
||||
|
||||
@@ -933,6 +931,12 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
/* fall through */
|
||||
case RADIUS_RX_QUEUED:
|
||||
/* Remove ACKed RADIUS packet from retransmit list */
|
||||
+ prev_req = NULL;
|
||||
+ for (r = radius->msgs; r; r = r->next) {
|
||||
+ if (r == req)
|
||||
+ break;
|
||||
+ prev_req = r;
|
||||
+ }
|
||||
if (prev_req)
|
||||
prev_req->next = req->next;
|
||||
else
|
||||
@@ -43,6 +43,8 @@ SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \
|
||||
file://CVE-2022-37660-0003.patch \
|
||||
file://CVE-2022-37660-0004.patch \
|
||||
file://CVE-2022-37660-0005.patch \
|
||||
file://CVE-2025-24912-01.patch \
|
||||
file://CVE-2025-24912-02.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "20df7ae5154b3830355f8ab4269123a87affdea59fe74fe9292a91d0d7e17b2f"
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ IMAGE_FSTYPES = "wic.vmdk wic.vhd wic.vhdx"
|
||||
|
||||
inherit core-image setuptools3
|
||||
|
||||
SRCREV ?= "8d5cd4a310e1807e841b25aaa46261dc24cea1eb"
|
||||
SRCREV ?= "cb1206dd8460f2701df03b1e9224825bad23a90e"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=kirkstone \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
|
||||
802
meta/recipes-core/libxml/libxml2/CVE-2025-7425.patch
Normal file
802
meta/recipes-core/libxml/libxml2/CVE-2025-7425.patch
Normal file
@@ -0,0 +1,802 @@
|
||||
From 87786d6200ae1f5ac98d21f04d451e17ff25a216 Mon Sep 17 00:00:00 2001
|
||||
From: David Kilzer <ddkilzer@apple.com>
|
||||
Reviewed-By: Aron Xu <aron@debian.org>
|
||||
Date: Mon, 23 Jun 2025 14:41:56 -0700
|
||||
Subject: [PATCH] libxslt: heap-use-after-free in xmlFreeID caused by `atype`
|
||||
corruption
|
||||
|
||||
* include/libxml/tree.h:
|
||||
(XML_ATTR_CLEAR_ATYPE): Add.
|
||||
(XML_ATTR_GET_ATYPE): Add.
|
||||
(XML_ATTR_SET_ATYPE): Add.
|
||||
(XML_NODE_ADD_EXTRA): Add.
|
||||
(XML_NODE_CLEAR_EXTRA): Add.
|
||||
(XML_NODE_GET_EXTRA): Add.
|
||||
(XML_NODE_SET_EXTRA): Add.
|
||||
(XML_DOC_ADD_PROPERTIES): Add.
|
||||
(XML_DOC_CLEAR_PROPERTIES): Add.
|
||||
(XML_DOC_GET_PROPERTIES): Add.
|
||||
(XML_DOC_SET_PROPERTIES): Add.
|
||||
- Add macros for accessing fields with upper bits that may be set by
|
||||
libxslt.
|
||||
|
||||
* HTMLparser.c:
|
||||
(htmlNewDocNoDtD):
|
||||
* SAX2.c:
|
||||
(xmlSAX2StartDocument):
|
||||
(xmlSAX2EndDocument):
|
||||
* parser.c:
|
||||
(xmlParseEntityDecl):
|
||||
(xmlParseExternalSubset):
|
||||
(xmlParseReference):
|
||||
(xmlCtxtParseDtd):
|
||||
* runxmlconf.c:
|
||||
(xmlconfTestInvalid):
|
||||
(xmlconfTestValid):
|
||||
* tree.c:
|
||||
(xmlNewDoc):
|
||||
(xmlFreeProp):
|
||||
(xmlNodeSetDoc):
|
||||
(xmlSetNsProp):
|
||||
(xmlDOMWrapAdoptBranch):
|
||||
* valid.c:
|
||||
(xmlFreeID):
|
||||
(xmlAddIDInternal):
|
||||
(xmlValidateAttributeValueInternal):
|
||||
(xmlValidateOneAttribute):
|
||||
(xmlValidateRef):
|
||||
* xmlreader.c:
|
||||
(xmlTextReaderStartElement):
|
||||
(xmlTextReaderStartElementNs):
|
||||
(xmlTextReaderValidateEntity):
|
||||
(xmlTextReaderRead):
|
||||
(xmlTextReaderNext):
|
||||
(xmlTextReaderIsEmptyElement):
|
||||
(xmlTextReaderPreserve):
|
||||
* xmlschemas.c:
|
||||
(xmlSchemaPValAttrNodeID):
|
||||
* xmlschemastypes.c:
|
||||
(xmlSchemaValAtomicType):
|
||||
- Adopt macros by renaming the struct fields, recompiling and fixing
|
||||
compiler failures, then changing the struct field names back.
|
||||
Origin: https://launchpad.net/ubuntu/+source/libxml2/2.9.14+dfsg-1.3ubuntu3.6
|
||||
Ref : https://security-tracker.debian.org/tracker/CVE-2025-7425
|
||||
|
||||
CVE: CVE-2025-7425
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxslt/-/issues/140]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
HTMLparser.c | 1 +
|
||||
SAX2.c | 6 ++--
|
||||
include/libxml/tree.h | 14 ++++++++-
|
||||
parser.c | 8 ++---
|
||||
runxmlconf.c | 4 +--
|
||||
tree.c | 20 ++++++-------
|
||||
valid.c | 68 +++++++++++++++++++++----------------------
|
||||
xmlreader.c | 30 +++++++++----------
|
||||
xmlschemas.c | 4 +--
|
||||
xmlschemastypes.c | 12 ++++----
|
||||
10 files changed, 90 insertions(+), 77 deletions(-)
|
||||
|
||||
diff --git a/HTMLparser.c b/HTMLparser.c
|
||||
index e720bb2..1307f71 100644
|
||||
--- a/HTMLparser.c
|
||||
+++ b/HTMLparser.c
|
||||
@@ -2514,6 +2514,7 @@ htmlNewDocNoDtD(const xmlChar *URI, const xmlChar *ExternalID) {
|
||||
cur->refs = NULL;
|
||||
cur->_private = NULL;
|
||||
cur->charset = XML_CHAR_ENCODING_UTF8;
|
||||
+ XML_DOC_SET_PROPERTIES(cur, XML_DOC_HTML | XML_DOC_USERBUILT);
|
||||
cur->properties = XML_DOC_HTML | XML_DOC_USERBUILT;
|
||||
if ((ExternalID != NULL) ||
|
||||
(URI != NULL))
|
||||
diff --git a/SAX2.c b/SAX2.c
|
||||
index f7c77c2..0d8e84a 100644
|
||||
--- a/SAX2.c
|
||||
+++ b/SAX2.c
|
||||
@@ -970,7 +970,7 @@ xmlSAX2StartDocument(void *ctx)
|
||||
xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument");
|
||||
return;
|
||||
}
|
||||
- ctxt->myDoc->properties = XML_DOC_HTML;
|
||||
+ XML_DOC_SET_PROPERTIES(ctxt->myDoc, XML_DOC_HTML);
|
||||
ctxt->myDoc->parseFlags = ctxt->options;
|
||||
#else
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
@@ -983,9 +983,9 @@ xmlSAX2StartDocument(void *ctx)
|
||||
} else {
|
||||
doc = ctxt->myDoc = xmlNewDoc(ctxt->version);
|
||||
if (doc != NULL) {
|
||||
- doc->properties = 0;
|
||||
+ XML_DOC_CLEAR_PROPERTIES(doc);
|
||||
if (ctxt->options & XML_PARSE_OLD10)
|
||||
- doc->properties |= XML_DOC_OLD10;
|
||||
+ XML_DOC_ADD_PROPERTIES(doc, XML_DOC_OLD10);
|
||||
doc->parseFlags = ctxt->options;
|
||||
if (ctxt->encoding != NULL)
|
||||
doc->encoding = xmlStrdup(ctxt->encoding);
|
||||
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
|
||||
index 1e79be9..61178b2 100644
|
||||
--- a/include/libxml/tree.h
|
||||
+++ b/include/libxml/tree.h
|
||||
@@ -365,7 +365,6 @@ struct _xmlElement {
|
||||
#endif
|
||||
};
|
||||
|
||||
-
|
||||
/**
|
||||
* XML_LOCAL_NAMESPACE:
|
||||
*
|
||||
@@ -446,6 +445,10 @@ struct _xmlAttr {
|
||||
void *psvi; /* for type/PSVI information */
|
||||
};
|
||||
|
||||
+#define XML_ATTR_CLEAR_ATYPE(attr) (((attr)->atype) = 0)
|
||||
+#define XML_ATTR_GET_ATYPE(attr) (((attr)->atype) & ~(15U << 27))
|
||||
+#define XML_ATTR_SET_ATYPE(attr, type) ((attr)->atype = ((((attr)->atype) & (15U << 27)) | ((type) & ~(15U << 27))))
|
||||
+
|
||||
/**
|
||||
* xmlID:
|
||||
*
|
||||
@@ -507,6 +510,11 @@ struct _xmlNode {
|
||||
unsigned short extra; /* extra data for XPath/XSLT */
|
||||
};
|
||||
|
||||
+#define XML_NODE_ADD_EXTRA(node, type) ((node)->extra |= ((type) & ~(15U << 12)))
|
||||
+#define XML_NODE_CLEAR_EXTRA(node) (((node)->extra) = 0)
|
||||
+#define XML_NODE_GET_EXTRA(node) (((node)->extra) & ~(15U << 12))
|
||||
+#define XML_NODE_SET_EXTRA(node, type) ((node)->extra = ((((node)->extra) & (15U << 12)) | ((type) & ~(15U << 12))))
|
||||
+
|
||||
/**
|
||||
* XML_GET_CONTENT:
|
||||
*
|
||||
@@ -585,6 +593,10 @@ struct _xmlDoc {
|
||||
set at the end of parsing */
|
||||
};
|
||||
|
||||
+#define XML_DOC_ADD_PROPERTIES(doc, type) ((doc)->properties |= ((type) & ~(15U << 27)))
|
||||
+#define XML_DOC_CLEAR_PROPERTIES(doc) (((doc)->properties) = 0)
|
||||
+#define XML_DOC_GET_PROPERTIES(doc) (((doc)->properties) & ~(15U << 27))
|
||||
+#define XML_DOC_SET_PROPERTIES(doc, type) ((doc)->properties = ((((doc)->properties) & (15U << 27)) | ((type) & ~(15U << 27))))
|
||||
|
||||
typedef struct _xmlDOMWrapCtxt xmlDOMWrapCtxt;
|
||||
typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr;
|
||||
diff --git a/parser.c b/parser.c
|
||||
index 738dbee..772d883 100644
|
||||
--- a/parser.c
|
||||
+++ b/parser.c
|
||||
@@ -5523,7 +5523,7 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
|
||||
xmlErrMemory(ctxt, "New Doc failed");
|
||||
return;
|
||||
}
|
||||
- ctxt->myDoc->properties = XML_DOC_INTERNAL;
|
||||
+ XML_DOC_SET_PROPERTIES(ctxt->myDoc, XML_DOC_INTERNAL);
|
||||
}
|
||||
if (ctxt->myDoc->intSubset == NULL)
|
||||
ctxt->myDoc->intSubset = xmlNewDtd(ctxt->myDoc,
|
||||
@@ -5594,7 +5594,7 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
|
||||
xmlErrMemory(ctxt, "New Doc failed");
|
||||
return;
|
||||
}
|
||||
- ctxt->myDoc->properties = XML_DOC_INTERNAL;
|
||||
+ XML_DOC_SET_PROPERTIES(ctxt->myDoc, XML_DOC_INTERNAL);
|
||||
}
|
||||
|
||||
if (ctxt->myDoc->intSubset == NULL)
|
||||
@@ -7035,7 +7035,7 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID,
|
||||
xmlErrMemory(ctxt, "New Doc failed");
|
||||
return;
|
||||
}
|
||||
- ctxt->myDoc->properties = XML_DOC_INTERNAL;
|
||||
+ XML_DOC_SET_PROPERTIES(ctxt->myDoc, XML_DOC_INTERNAL);
|
||||
}
|
||||
if ((ctxt->myDoc != NULL) && (ctxt->myDoc->intSubset == NULL))
|
||||
xmlCreateIntSubset(ctxt->myDoc, NULL, ExternalID, SystemID);
|
||||
@@ -7419,7 +7419,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
|
||||
(nw != NULL) &&
|
||||
(nw->type == XML_ELEMENT_NODE) &&
|
||||
(nw->children == NULL))
|
||||
- nw->extra = 1;
|
||||
+ XML_NODE_SET_EXTRA(nw, 1);
|
||||
|
||||
break;
|
||||
}
|
||||
diff --git a/runxmlconf.c b/runxmlconf.c
|
||||
index f43fdd3..82b7241 100644
|
||||
--- a/runxmlconf.c
|
||||
+++ b/runxmlconf.c
|
||||
@@ -197,7 +197,7 @@ xmlconfTestInvalid(const char *id, const char *filename, int options) {
|
||||
id, filename);
|
||||
} else {
|
||||
/* invalidity should be reported both in the context and in the document */
|
||||
- if ((ctxt->valid != 0) || (doc->properties & XML_DOC_DTDVALID)) {
|
||||
+ if ((ctxt->valid != 0) || (XML_DOC_GET_PROPERTIES(doc) & XML_DOC_DTDVALID)) {
|
||||
test_log("test %s : %s failed to detect invalid document\n",
|
||||
id, filename);
|
||||
nb_errors++;
|
||||
@@ -229,7 +229,7 @@ xmlconfTestValid(const char *id, const char *filename, int options) {
|
||||
ret = 0;
|
||||
} else {
|
||||
/* validity should be reported both in the context and in the document */
|
||||
- if ((ctxt->valid == 0) || ((doc->properties & XML_DOC_DTDVALID) == 0)) {
|
||||
+ if ((ctxt->valid == 0) || ((XML_DOC_GET_PROPERTIES(doc) & XML_DOC_DTDVALID) == 0)) {
|
||||
test_log("test %s : %s failed to validate a valid document\n",
|
||||
id, filename);
|
||||
nb_errors++;
|
||||
diff --git a/tree.c b/tree.c
|
||||
index cdf863c..3bac0b8 100644
|
||||
--- a/tree.c
|
||||
+++ b/tree.c
|
||||
@@ -1192,7 +1192,7 @@ xmlNewDoc(const xmlChar *version) {
|
||||
cur->compression = -1; /* not initialized */
|
||||
cur->doc = cur;
|
||||
cur->parseFlags = 0;
|
||||
- cur->properties = XML_DOC_USERBUILT;
|
||||
+ XML_DOC_SET_PROPERTIES(cur, XML_DOC_USERBUILT);
|
||||
/*
|
||||
* The in memory encoding is always UTF8
|
||||
* This field will never change and would
|
||||
@@ -2119,7 +2119,7 @@ xmlFreeProp(xmlAttrPtr cur) {
|
||||
xmlDeregisterNodeDefaultValue((xmlNodePtr)cur);
|
||||
|
||||
/* Check for ID removal -> leading to invalid references ! */
|
||||
- if ((cur->doc != NULL) && (cur->atype == XML_ATTRIBUTE_ID)) {
|
||||
+ if ((cur->doc != NULL) && (XML_ATTR_GET_ATYPE(cur) == XML_ATTRIBUTE_ID)) {
|
||||
xmlRemoveID(cur->doc, cur);
|
||||
}
|
||||
if (cur->children != NULL) xmlFreeNodeList(cur->children);
|
||||
@@ -2838,7 +2838,7 @@ xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) {
|
||||
if(tree->type == XML_ELEMENT_NODE) {
|
||||
prop = tree->properties;
|
||||
while (prop != NULL) {
|
||||
- if (prop->atype == XML_ATTRIBUTE_ID) {
|
||||
+ if (XML_ATTR_GET_ATYPE(prop) == XML_ATTRIBUTE_ID) {
|
||||
xmlRemoveID(tree->doc, prop);
|
||||
}
|
||||
|
||||
@@ -6953,9 +6953,9 @@ xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name,
|
||||
/*
|
||||
* Modify the attribute's value.
|
||||
*/
|
||||
- if (prop->atype == XML_ATTRIBUTE_ID) {
|
||||
+ if (XML_ATTR_GET_ATYPE(prop) == XML_ATTRIBUTE_ID) {
|
||||
xmlRemoveID(node->doc, prop);
|
||||
- prop->atype = XML_ATTRIBUTE_ID;
|
||||
+ XML_ATTR_SET_ATYPE(prop, XML_ATTRIBUTE_ID);
|
||||
}
|
||||
if (prop->children != NULL)
|
||||
xmlFreeNodeList(prop->children);
|
||||
@@ -6975,7 +6975,7 @@ xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name,
|
||||
tmp = tmp->next;
|
||||
}
|
||||
}
|
||||
- if (prop->atype == XML_ATTRIBUTE_ID)
|
||||
+ if (XML_ATTR_GET_ATYPE(prop) == XML_ATTRIBUTE_ID)
|
||||
xmlAddID(NULL, node->doc, value, prop);
|
||||
return(prop);
|
||||
}
|
||||
@@ -9252,7 +9252,7 @@ ns_end:
|
||||
if (cur->type == XML_ELEMENT_NODE) {
|
||||
cur->psvi = NULL;
|
||||
cur->line = 0;
|
||||
- cur->extra = 0;
|
||||
+ XML_NODE_CLEAR_EXTRA(cur);
|
||||
/*
|
||||
* Walk attributes.
|
||||
*/
|
||||
@@ -9268,11 +9268,11 @@ ns_end:
|
||||
* Attributes.
|
||||
*/
|
||||
if ((sourceDoc != NULL) &&
|
||||
- (((xmlAttrPtr) cur)->atype == XML_ATTRIBUTE_ID))
|
||||
+ (XML_ATTR_GET_ATYPE((xmlAttrPtr) cur) == XML_ATTRIBUTE_ID))
|
||||
{
|
||||
xmlRemoveID(sourceDoc, (xmlAttrPtr) cur);
|
||||
}
|
||||
- ((xmlAttrPtr) cur)->atype = 0;
|
||||
+ XML_ATTR_CLEAR_ATYPE((xmlAttrPtr) cur);
|
||||
((xmlAttrPtr) cur)->psvi = NULL;
|
||||
}
|
||||
break;
|
||||
@@ -9992,7 +9992,7 @@ xmlDOMWrapAdoptAttr(xmlDOMWrapCtxtPtr ctxt,
|
||||
}
|
||||
|
||||
XML_TREE_ADOPT_STR(attr->name);
|
||||
- attr->atype = 0;
|
||||
+ XML_ATTR_CLEAR_ATYPE(attr);
|
||||
attr->psvi = NULL;
|
||||
/*
|
||||
* Walk content.
|
||||
diff --git a/valid.c b/valid.c
|
||||
index 36a0435..8e76cfa 100644
|
||||
--- a/valid.c
|
||||
+++ b/valid.c
|
||||
@@ -1906,7 +1906,7 @@ xmlScanIDAttributeDecl(xmlValidCtxtPtr ctxt, xmlElementPtr elem, int err) {
|
||||
if (elem == NULL) return(0);
|
||||
cur = elem->attributes;
|
||||
while (cur != NULL) {
|
||||
- if (cur->atype == XML_ATTRIBUTE_ID) {
|
||||
+ if (XML_ATTR_GET_ATYPE(cur) == XML_ATTRIBUTE_ID) {
|
||||
ret ++;
|
||||
if ((ret > 1) && (err))
|
||||
xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_MULTIPLE_ID,
|
||||
@@ -2279,7 +2279,7 @@ xmlDumpAttributeDecl(xmlBufferPtr buf, xmlAttributePtr attr) {
|
||||
xmlBufferWriteChar(buf, ":");
|
||||
}
|
||||
xmlBufferWriteCHAR(buf, attr->name);
|
||||
- switch (attr->atype) {
|
||||
+ switch (XML_ATTR_GET_ATYPE(attr)) {
|
||||
case XML_ATTRIBUTE_CDATA:
|
||||
xmlBufferWriteChar(buf, " CDATA");
|
||||
break;
|
||||
@@ -2758,7 +2758,7 @@ xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value,
|
||||
return(NULL);
|
||||
}
|
||||
if (attr != NULL)
|
||||
- attr->atype = XML_ATTRIBUTE_ID;
|
||||
+ XML_ATTR_SET_ATYPE(attr, XML_ATTRIBUTE_ID);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@@ -2837,7 +2837,7 @@ xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) {
|
||||
if ((fullelemname != felem) && (fullelemname != elem->name))
|
||||
xmlFree(fullelemname);
|
||||
|
||||
- if ((attrDecl != NULL) && (attrDecl->atype == XML_ATTRIBUTE_ID))
|
||||
+ if ((attrDecl != NULL) && (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_ID))
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
@@ -2878,7 +2878,7 @@ xmlRemoveID(xmlDocPtr doc, xmlAttrPtr attr) {
|
||||
|
||||
xmlHashRemoveEntry(table, ID, xmlFreeIDTableEntry);
|
||||
xmlFree(ID);
|
||||
- attr->atype = 0;
|
||||
+ XML_ATTR_CLEAR_ATYPE(attr);
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -3157,8 +3157,8 @@ xmlIsRef(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) {
|
||||
elem->name, attr->name);
|
||||
|
||||
if ((attrDecl != NULL) &&
|
||||
- (attrDecl->atype == XML_ATTRIBUTE_IDREF ||
|
||||
- attrDecl->atype == XML_ATTRIBUTE_IDREFS))
|
||||
+ (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_IDREF ||
|
||||
+ XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_IDREFS))
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
@@ -3532,7 +3532,7 @@ xmlIsMixedElement(xmlDocPtr doc, const xmlChar *name) {
|
||||
|
||||
static int
|
||||
xmlIsDocNameStartChar(xmlDocPtr doc, int c) {
|
||||
- if ((doc == NULL) || (doc->properties & XML_DOC_OLD10) == 0) {
|
||||
+ if ((doc == NULL) || (XML_DOC_GET_PROPERTIES(doc) & XML_DOC_OLD10) == 0) {
|
||||
/*
|
||||
* Use the new checks of production [4] [4a] amd [5] of the
|
||||
* Update 5 of XML-1.0
|
||||
@@ -3562,7 +3562,7 @@ xmlIsDocNameStartChar(xmlDocPtr doc, int c) {
|
||||
|
||||
static int
|
||||
xmlIsDocNameChar(xmlDocPtr doc, int c) {
|
||||
- if ((doc == NULL) || (doc->properties & XML_DOC_OLD10) == 0) {
|
||||
+ if ((doc == NULL) || (XML_DOC_GET_PROPERTIES(doc) & XML_DOC_OLD10) == 0) {
|
||||
/*
|
||||
* Use the new checks of production [4] [4a] amd [5] of the
|
||||
* Update 5 of XML-1.0
|
||||
@@ -4112,7 +4112,7 @@ xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
|
||||
if (attrDecl == NULL)
|
||||
return(NULL);
|
||||
- if (attrDecl->atype == XML_ATTRIBUTE_CDATA)
|
||||
+ if (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_CDATA)
|
||||
return(NULL);
|
||||
|
||||
ret = xmlStrdup(value);
|
||||
@@ -4174,7 +4174,7 @@ xmlValidNormalizeAttributeValue(xmlDocPtr doc, xmlNodePtr elem,
|
||||
|
||||
if (attrDecl == NULL)
|
||||
return(NULL);
|
||||
- if (attrDecl->atype == XML_ATTRIBUTE_CDATA)
|
||||
+ if (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_CDATA)
|
||||
return(NULL);
|
||||
|
||||
ret = xmlStrdup(value);
|
||||
@@ -4189,7 +4189,7 @@ xmlValidateAttributeIdCallback(void *payload, void *data,
|
||||
const xmlChar *name ATTRIBUTE_UNUSED) {
|
||||
xmlAttributePtr attr = (xmlAttributePtr) payload;
|
||||
int *count = (int *) data;
|
||||
- if (attr->atype == XML_ATTRIBUTE_ID) (*count)++;
|
||||
+ if (XML_ATTR_GET_ATYPE(attr) == XML_ATTRIBUTE_ID) (*count)++;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4221,7 +4221,7 @@ xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
/* Attribute Default Legal */
|
||||
/* Enumeration */
|
||||
if (attr->defaultValue != NULL) {
|
||||
- val = xmlValidateAttributeValueInternal(doc, attr->atype,
|
||||
+ val = xmlValidateAttributeValueInternal(doc, XML_ATTR_GET_ATYPE(attr),
|
||||
attr->defaultValue);
|
||||
if (val == 0) {
|
||||
xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ATTRIBUTE_DEFAULT,
|
||||
@@ -4232,7 +4232,7 @@ xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
}
|
||||
|
||||
/* ID Attribute Default */
|
||||
- if ((attr->atype == XML_ATTRIBUTE_ID)&&
|
||||
+ if ((XML_ATTR_GET_ATYPE(attr) == XML_ATTRIBUTE_ID)&&
|
||||
(attr->def != XML_ATTRIBUTE_IMPLIED) &&
|
||||
(attr->def != XML_ATTRIBUTE_REQUIRED)) {
|
||||
xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ID_FIXED,
|
||||
@@ -4242,7 +4242,7 @@ xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
}
|
||||
|
||||
/* One ID per Element Type */
|
||||
- if (attr->atype == XML_ATTRIBUTE_ID) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attr) == XML_ATTRIBUTE_ID) {
|
||||
int nbId;
|
||||
|
||||
/* the trick is that we parse DtD as their own internal subset */
|
||||
@@ -4501,9 +4501,9 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
attr->name, elem->name, NULL);
|
||||
return(0);
|
||||
}
|
||||
- attr->atype = attrDecl->atype;
|
||||
+ XML_ATTR_SET_ATYPE(attr, attrDecl->atype);
|
||||
|
||||
- val = xmlValidateAttributeValueInternal(doc, attrDecl->atype, value);
|
||||
+ val = xmlValidateAttributeValueInternal(doc, XML_ATTR_GET_ATYPE(attrDecl), value);
|
||||
if (val == 0) {
|
||||
xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
|
||||
"Syntax of value for attribute %s of %s is not valid\n",
|
||||
@@ -4522,19 +4522,19 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
}
|
||||
|
||||
/* Validity Constraint: ID uniqueness */
|
||||
- if (attrDecl->atype == XML_ATTRIBUTE_ID) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_ID) {
|
||||
if (xmlAddID(ctxt, doc, value, attr) == NULL)
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
- if ((attrDecl->atype == XML_ATTRIBUTE_IDREF) ||
|
||||
- (attrDecl->atype == XML_ATTRIBUTE_IDREFS)) {
|
||||
+ if ((XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_IDREF) ||
|
||||
+ (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_IDREFS)) {
|
||||
if (xmlAddRef(ctxt, doc, value, attr) == NULL)
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
/* Validity Constraint: Notation Attributes */
|
||||
- if (attrDecl->atype == XML_ATTRIBUTE_NOTATION) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_NOTATION) {
|
||||
xmlEnumerationPtr tree = attrDecl->tree;
|
||||
xmlNotationPtr nota;
|
||||
|
||||
@@ -4564,7 +4564,7 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
}
|
||||
|
||||
/* Validity Constraint: Enumeration */
|
||||
- if (attrDecl->atype == XML_ATTRIBUTE_ENUMERATION) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_ENUMERATION) {
|
||||
xmlEnumerationPtr tree = attrDecl->tree;
|
||||
while (tree != NULL) {
|
||||
if (xmlStrEqual(tree->name, value)) break;
|
||||
@@ -4589,7 +4589,7 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
|
||||
/* Extra check for the attribute value */
|
||||
ret &= xmlValidateAttributeValue2(ctxt, doc, attr->name,
|
||||
- attrDecl->atype, value);
|
||||
+ XML_ATTR_GET_ATYPE(attrDecl), value);
|
||||
|
||||
return(ret);
|
||||
}
|
||||
@@ -4688,7 +4688,7 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
- val = xmlValidateAttributeValueInternal(doc, attrDecl->atype, value);
|
||||
+ val = xmlValidateAttributeValueInternal(doc, XML_ATTR_GET_ATYPE(attrDecl), value);
|
||||
if (val == 0) {
|
||||
if (ns->prefix != NULL) {
|
||||
xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_DEFAULT,
|
||||
@@ -4738,7 +4738,7 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) {
|
||||
#endif
|
||||
|
||||
/* Validity Constraint: Notation Attributes */
|
||||
- if (attrDecl->atype == XML_ATTRIBUTE_NOTATION) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_NOTATION) {
|
||||
xmlEnumerationPtr tree = attrDecl->tree;
|
||||
xmlNotationPtr nota;
|
||||
|
||||
@@ -4780,7 +4780,7 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) {
|
||||
}
|
||||
|
||||
/* Validity Constraint: Enumeration */
|
||||
- if (attrDecl->atype == XML_ATTRIBUTE_ENUMERATION) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_ENUMERATION) {
|
||||
xmlEnumerationPtr tree = attrDecl->tree;
|
||||
while (tree != NULL) {
|
||||
if (xmlStrEqual(tree->name, value)) break;
|
||||
@@ -4818,10 +4818,10 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) {
|
||||
/* Extra check for the attribute value */
|
||||
if (ns->prefix != NULL) {
|
||||
ret &= xmlValidateAttributeValue2(ctxt, doc, ns->prefix,
|
||||
- attrDecl->atype, value);
|
||||
+ XML_ATTR_GET_ATYPE(attrDecl), value);
|
||||
} else {
|
||||
ret &= xmlValidateAttributeValue2(ctxt, doc, BAD_CAST "xmlns",
|
||||
- attrDecl->atype, value);
|
||||
+ XML_ATTR_GET_ATYPE(attrDecl), value);
|
||||
}
|
||||
|
||||
return(ret);
|
||||
@@ -6574,7 +6574,7 @@ xmlValidateRef(xmlRefPtr ref, xmlValidCtxtPtr ctxt,
|
||||
while (IS_BLANK_CH(*cur)) cur++;
|
||||
}
|
||||
xmlFree(dup);
|
||||
- } else if (attr->atype == XML_ATTRIBUTE_IDREF) {
|
||||
+ } else if (XML_ATTR_GET_ATYPE(attr) == XML_ATTRIBUTE_IDREF) {
|
||||
id = xmlGetID(ctxt->doc, name);
|
||||
if (id == NULL) {
|
||||
xmlErrValidNode(ctxt, attr->parent, XML_DTD_UNKNOWN_ID,
|
||||
@@ -6582,7 +6582,7 @@ xmlValidateRef(xmlRefPtr ref, xmlValidCtxtPtr ctxt,
|
||||
attr->name, name, NULL);
|
||||
ctxt->valid = 0;
|
||||
}
|
||||
- } else if (attr->atype == XML_ATTRIBUTE_IDREFS) {
|
||||
+ } else if (XML_ATTR_GET_ATYPE(attr) == XML_ATTRIBUTE_IDREFS) {
|
||||
xmlChar *dup, *str = NULL, *cur, save;
|
||||
|
||||
dup = xmlStrdup(name);
|
||||
@@ -6782,7 +6782,7 @@ xmlValidateAttributeCallback(void *payload, void *data,
|
||||
|
||||
if (cur == NULL)
|
||||
return;
|
||||
- switch (cur->atype) {
|
||||
+ switch (XML_ATTR_GET_ATYPE(cur)) {
|
||||
case XML_ATTRIBUTE_CDATA:
|
||||
case XML_ATTRIBUTE_ID:
|
||||
case XML_ATTRIBUTE_IDREF :
|
||||
@@ -6797,7 +6797,7 @@ xmlValidateAttributeCallback(void *payload, void *data,
|
||||
if (cur->defaultValue != NULL) {
|
||||
|
||||
ret = xmlValidateAttributeValue2(ctxt, ctxt->doc, cur->name,
|
||||
- cur->atype, cur->defaultValue);
|
||||
+ XML_ATTR_GET_ATYPE(cur), cur->defaultValue);
|
||||
if ((ret == 0) && (ctxt->valid == 1))
|
||||
ctxt->valid = 0;
|
||||
}
|
||||
@@ -6805,14 +6805,14 @@ xmlValidateAttributeCallback(void *payload, void *data,
|
||||
xmlEnumerationPtr tree = cur->tree;
|
||||
while (tree != NULL) {
|
||||
ret = xmlValidateAttributeValue2(ctxt, ctxt->doc,
|
||||
- cur->name, cur->atype, tree->name);
|
||||
+ cur->name, XML_ATTR_GET_ATYPE(cur), tree->name);
|
||||
if ((ret == 0) && (ctxt->valid == 1))
|
||||
ctxt->valid = 0;
|
||||
tree = tree->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
- if (cur->atype == XML_ATTRIBUTE_NOTATION) {
|
||||
+ if (XML_ATTR_GET_ATYPE(cur) == XML_ATTRIBUTE_NOTATION) {
|
||||
doc = cur->doc;
|
||||
if (cur->elem == NULL) {
|
||||
xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR,
|
||||
diff --git a/xmlreader.c b/xmlreader.c
|
||||
index 67ff2cd..2a1a66a 100644
|
||||
--- a/xmlreader.c
|
||||
+++ b/xmlreader.c
|
||||
@@ -753,7 +753,7 @@ xmlTextReaderStartElement(void *ctx, const xmlChar *fullname,
|
||||
if ((ctxt->node != NULL) && (ctxt->input != NULL) &&
|
||||
(ctxt->input->cur != NULL) && (ctxt->input->cur[0] == '/') &&
|
||||
(ctxt->input->cur[1] == '>'))
|
||||
- ctxt->node->extra = NODE_IS_EMPTY;
|
||||
+ XML_NODE_SET_EXTRA(ctxt->node, NODE_IS_EMPTY);
|
||||
}
|
||||
if (reader != NULL)
|
||||
reader->state = XML_TEXTREADER_ELEMENT;
|
||||
@@ -818,7 +818,7 @@ xmlTextReaderStartElementNs(void *ctx,
|
||||
if ((ctxt->node != NULL) && (ctxt->input != NULL) &&
|
||||
(ctxt->input->cur != NULL) && (ctxt->input->cur[0] == '/') &&
|
||||
(ctxt->input->cur[1] == '>'))
|
||||
- ctxt->node->extra = NODE_IS_EMPTY;
|
||||
+ XML_NODE_SET_EXTRA(ctxt->node, NODE_IS_EMPTY);
|
||||
}
|
||||
if (reader != NULL)
|
||||
reader->state = XML_TEXTREADER_ELEMENT;
|
||||
@@ -1216,7 +1216,7 @@ skip_children:
|
||||
xmlNodePtr tmp;
|
||||
if (reader->entNr == 0) {
|
||||
while ((tmp = node->last) != NULL) {
|
||||
- if ((tmp->extra & NODE_IS_PRESERVED) == 0) {
|
||||
+ if ((XML_NODE_GET_EXTRA(tmp) & NODE_IS_PRESERVED) == 0) {
|
||||
xmlUnlinkNode(tmp);
|
||||
xmlTextReaderFreeNode(reader, tmp);
|
||||
} else
|
||||
@@ -1467,7 +1467,7 @@ get_next_node:
|
||||
if ((oldstate == XML_TEXTREADER_ELEMENT) &&
|
||||
(reader->node->type == XML_ELEMENT_NODE) &&
|
||||
(reader->node->children == NULL) &&
|
||||
- ((reader->node->extra & NODE_IS_EMPTY) == 0)
|
||||
+ ((XML_NODE_GET_EXTRA(reader->node) & NODE_IS_EMPTY) == 0)
|
||||
#ifdef LIBXML_XINCLUDE_ENABLED
|
||||
&& (reader->in_xinclude <= 0)
|
||||
#endif
|
||||
@@ -1481,7 +1481,7 @@ get_next_node:
|
||||
xmlTextReaderValidatePop(reader);
|
||||
#endif /* LIBXML_REGEXP_ENABLED */
|
||||
if ((reader->preserves > 0) &&
|
||||
- (reader->node->extra & NODE_IS_SPRESERVED))
|
||||
+ (XML_NODE_GET_EXTRA(reader->node) & NODE_IS_SPRESERVED))
|
||||
reader->preserves--;
|
||||
reader->node = reader->node->next;
|
||||
reader->state = XML_TEXTREADER_ELEMENT;
|
||||
@@ -1497,7 +1497,7 @@ get_next_node:
|
||||
(reader->node->prev != NULL) &&
|
||||
(reader->node->prev->type != XML_DTD_NODE)) {
|
||||
xmlNodePtr tmp = reader->node->prev;
|
||||
- if ((tmp->extra & NODE_IS_PRESERVED) == 0) {
|
||||
+ if ((XML_NODE_GET_EXTRA(tmp) & NODE_IS_PRESERVED) == 0) {
|
||||
if (oldnode == tmp)
|
||||
oldnode = NULL;
|
||||
xmlUnlinkNode(tmp);
|
||||
@@ -1510,7 +1510,7 @@ get_next_node:
|
||||
if ((oldstate == XML_TEXTREADER_ELEMENT) &&
|
||||
(reader->node->type == XML_ELEMENT_NODE) &&
|
||||
(reader->node->children == NULL) &&
|
||||
- ((reader->node->extra & NODE_IS_EMPTY) == 0)) {;
|
||||
+ ((XML_NODE_GET_EXTRA(reader->node) & NODE_IS_EMPTY) == 0)) {;
|
||||
reader->state = XML_TEXTREADER_END;
|
||||
goto node_found;
|
||||
}
|
||||
@@ -1519,7 +1519,7 @@ get_next_node:
|
||||
xmlTextReaderValidatePop(reader);
|
||||
#endif /* LIBXML_REGEXP_ENABLED */
|
||||
if ((reader->preserves > 0) &&
|
||||
- (reader->node->extra & NODE_IS_SPRESERVED))
|
||||
+ (XML_NODE_GET_EXTRA(reader->node) & NODE_IS_SPRESERVED))
|
||||
reader->preserves--;
|
||||
reader->node = reader->node->parent;
|
||||
if ((reader->node == NULL) ||
|
||||
@@ -1546,7 +1546,7 @@ get_next_node:
|
||||
#endif
|
||||
(reader->entNr == 0) &&
|
||||
(oldnode->type != XML_DTD_NODE) &&
|
||||
- ((oldnode->extra & NODE_IS_PRESERVED) == 0)) {
|
||||
+ ((XML_NODE_GET_EXTRA(oldnode) & NODE_IS_PRESERVED) == 0)) {
|
||||
xmlUnlinkNode(oldnode);
|
||||
xmlTextReaderFreeNode(reader, oldnode);
|
||||
}
|
||||
@@ -1559,7 +1559,7 @@ get_next_node:
|
||||
#endif
|
||||
(reader->entNr == 0) &&
|
||||
(reader->node->last != NULL) &&
|
||||
- ((reader->node->last->extra & NODE_IS_PRESERVED) == 0)) {
|
||||
+ ((XML_NODE_GET_EXTRA(reader->node->last) & NODE_IS_PRESERVED) == 0)) {
|
||||
xmlNodePtr tmp = reader->node->last;
|
||||
xmlUnlinkNode(tmp);
|
||||
xmlTextReaderFreeNode(reader, tmp);
|
||||
@@ -1741,7 +1741,7 @@ xmlTextReaderNext(xmlTextReaderPtr reader) {
|
||||
return(xmlTextReaderRead(reader));
|
||||
if (reader->state == XML_TEXTREADER_END || reader->state == XML_TEXTREADER_BACKTRACK)
|
||||
return(xmlTextReaderRead(reader));
|
||||
- if (cur->extra & NODE_IS_EMPTY)
|
||||
+ if (XML_NODE_GET_EXTRA(cur) & NODE_IS_EMPTY)
|
||||
return(xmlTextReaderRead(reader));
|
||||
do {
|
||||
ret = xmlTextReaderRead(reader);
|
||||
@@ -3167,7 +3167,7 @@ xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader) {
|
||||
if (reader->in_xinclude > 0)
|
||||
return(1);
|
||||
#endif
|
||||
- return((reader->node->extra & NODE_IS_EMPTY) != 0);
|
||||
+ return((XML_NODE_GET_EXTRA(reader->node) & NODE_IS_EMPTY) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4035,15 +4035,15 @@ xmlTextReaderPreserve(xmlTextReaderPtr reader) {
|
||||
return(NULL);
|
||||
|
||||
if ((cur->type != XML_DOCUMENT_NODE) && (cur->type != XML_DTD_NODE)) {
|
||||
- cur->extra |= NODE_IS_PRESERVED;
|
||||
- cur->extra |= NODE_IS_SPRESERVED;
|
||||
+ XML_NODE_ADD_EXTRA(cur, NODE_IS_PRESERVED);
|
||||
+ XML_NODE_ADD_EXTRA(cur, NODE_IS_SPRESERVED);
|
||||
}
|
||||
reader->preserves++;
|
||||
|
||||
parent = cur->parent;;
|
||||
while (parent != NULL) {
|
||||
if (parent->type == XML_ELEMENT_NODE)
|
||||
- parent->extra |= NODE_IS_PRESERVED;
|
||||
+ XML_NODE_ADD_EXTRA(parent, NODE_IS_PRESERVED);
|
||||
parent = parent->parent;
|
||||
}
|
||||
return(cur);
|
||||
diff --git a/xmlschemas.c b/xmlschemas.c
|
||||
index a2dd6cf..2e6c349 100644
|
||||
--- a/xmlschemas.c
|
||||
+++ b/xmlschemas.c
|
||||
@@ -6024,7 +6024,7 @@ xmlSchemaPValAttrNodeID(xmlSchemaParserCtxtPtr ctxt, xmlAttrPtr attr)
|
||||
/*
|
||||
* NOTE: the IDness might have already be declared in the DTD
|
||||
*/
|
||||
- if (attr->atype != XML_ATTRIBUTE_ID) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attr) != XML_ATTRIBUTE_ID) {
|
||||
xmlIDPtr res;
|
||||
xmlChar *strip;
|
||||
|
||||
@@ -6047,7 +6047,7 @@ xmlSchemaPValAttrNodeID(xmlSchemaParserCtxtPtr ctxt, xmlAttrPtr attr)
|
||||
NULL, NULL, "Duplicate value '%s' of simple "
|
||||
"type 'xs:ID'", value, NULL);
|
||||
} else
|
||||
- attr->atype = XML_ATTRIBUTE_ID;
|
||||
+ XML_ATTR_SET_ATYPE(attr, XML_ATTRIBUTE_ID);
|
||||
}
|
||||
} else if (ret > 0) {
|
||||
ret = XML_SCHEMAP_S4S_ATTR_INVALID_VALUE;
|
||||
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
|
||||
index af31be5..d40da49 100644
|
||||
--- a/xmlschemastypes.c
|
||||
+++ b/xmlschemastypes.c
|
||||
@@ -2867,7 +2867,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
/*
|
||||
* NOTE: the IDness might have already be declared in the DTD
|
||||
*/
|
||||
- if (attr->atype != XML_ATTRIBUTE_ID) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attr) != XML_ATTRIBUTE_ID) {
|
||||
xmlIDPtr res;
|
||||
xmlChar *strip;
|
||||
|
||||
@@ -2880,7 +2880,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
if (res == NULL) {
|
||||
ret = 2;
|
||||
} else {
|
||||
- attr->atype = XML_ATTRIBUTE_ID;
|
||||
+ XML_ATTR_SET_ATYPE(attr, XML_ATTRIBUTE_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2905,7 +2905,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
xmlFree(strip);
|
||||
} else
|
||||
xmlAddRef(NULL, node->doc, value, attr);
|
||||
- attr->atype = XML_ATTRIBUTE_IDREF;
|
||||
+ XML_ATTR_SET_ATYPE(attr, XML_ATTRIBUTE_IDREF);
|
||||
}
|
||||
goto done;
|
||||
case XML_SCHEMAS_IDREFS:
|
||||
@@ -2919,7 +2919,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
(node->type == XML_ATTRIBUTE_NODE)) {
|
||||
xmlAttrPtr attr = (xmlAttrPtr) node;
|
||||
|
||||
- attr->atype = XML_ATTRIBUTE_IDREFS;
|
||||
+ XML_ATTR_SET_ATYPE(attr, XML_ATTRIBUTE_IDREFS);
|
||||
}
|
||||
goto done;
|
||||
case XML_SCHEMAS_ENTITY:{
|
||||
@@ -2950,7 +2950,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
(node->type == XML_ATTRIBUTE_NODE)) {
|
||||
xmlAttrPtr attr = (xmlAttrPtr) node;
|
||||
|
||||
- attr->atype = XML_ATTRIBUTE_ENTITY;
|
||||
+ XML_ATTR_SET_ATYPE(attr, XML_ATTRIBUTE_ENTITY);
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
@@ -2967,7 +2967,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
(node->type == XML_ATTRIBUTE_NODE)) {
|
||||
xmlAttrPtr attr = (xmlAttrPtr) node;
|
||||
|
||||
- attr->atype = XML_ATTRIBUTE_ENTITIES;
|
||||
+ XML_ATTR_SET_ATYPE(attr, XML_ATTRIBUTE_ENTITIES);
|
||||
}
|
||||
goto done;
|
||||
case XML_SCHEMAS_NOTATION:{
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -43,6 +43,7 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar;subdir=${BP};name=testt
|
||||
file://CVE-2025-49794-CVE-2025-49796.patch \
|
||||
file://CVE-2025-6170.patch \
|
||||
file://CVE-2025-9714.patch \
|
||||
file://CVE-2025-7425.patch \
|
||||
"
|
||||
|
||||
SRC_URI[archive.sha256sum] = "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee"
|
||||
|
||||
39
meta/recipes-core/musl/musl/CVE-2025-26519-1.patch
Normal file
39
meta/recipes-core/musl/musl/CVE-2025-26519-1.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
From 345d2a053c32f3443dbfdd313f49346ce30b92f8 Mon Sep 17 00:00:00 2001
|
||||
From: Rich Felker <dalias@aerifal.cx>
|
||||
Date: Wed, 19 Nov 2025 13:23:38 +0100
|
||||
Subject: [PATCH] iconv: fix erroneous input validation in EUC-KR decoder
|
||||
|
||||
as a result of incorrect bounds checking on the lead byte being
|
||||
decoded, certain invalid inputs which should produce an encoding
|
||||
error, such as "\xc8\x41", instead produced out-of-bounds loads from
|
||||
the ksc table.
|
||||
|
||||
in a worst case, the loaded value may not be a valid unicode scalar
|
||||
value, in which case, if the output encoding was UTF-8, wctomb would
|
||||
return (size_t)-1, causing an overflow in the output pointer and
|
||||
remaining buffer size which could clobber memory outside of the output
|
||||
buffer.
|
||||
|
||||
bug report was submitted in private by Nick Wellnhofer on account of
|
||||
potential security implications.
|
||||
|
||||
CVE: CVE-2025-26519
|
||||
Upstream-Status: Backport [https://git.musl-libc.org/cgit/musl/commit/?id=e5adcd97b5196e29991b524237381a0202a60659]
|
||||
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
|
||||
---
|
||||
src/locale/iconv.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/locale/iconv.c b/src/locale/iconv.c
|
||||
index 3047c27b..1fb66bc8 100644
|
||||
--- a/src/locale/iconv.c
|
||||
+++ b/src/locale/iconv.c
|
||||
@@ -495,7 +495,7 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
|
||||
if (c >= 93 || d >= 94) {
|
||||
c += (0xa1-0x81);
|
||||
d += 0xa1;
|
||||
- if (c >= 93 || c>=0xc6-0x81 && d>0x52)
|
||||
+ if (c > 0xc6-0x81 || c==0xc6-0x81 && d>0x52)
|
||||
goto ilseq;
|
||||
if (d-'A'<26) d = d-'A';
|
||||
else if (d-'a'<26) d = d-'a'+26;
|
||||
38
meta/recipes-core/musl/musl/CVE-2025-26519-2.patch
Normal file
38
meta/recipes-core/musl/musl/CVE-2025-26519-2.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From b81230050f6c3348038fe470d260028824b9a9e5 Mon Sep 17 00:00:00 2001
|
||||
From: Rich Felker <dalias@aerifal.cx>
|
||||
Date: Wed, 19 Nov 2025 13:27:15 +0100
|
||||
Subject: [PATCH] iconv: harden UTF-8 output code path against input decoder
|
||||
bugs
|
||||
|
||||
the UTF-8 output code was written assuming an invariant that iconv's
|
||||
decoders only emit valid Unicode Scalar Values which wctomb can encode
|
||||
successfully, thereby always returning a value between 1 and 4.
|
||||
|
||||
if this invariant is not satisfied, wctomb returns (size_t)-1, and the
|
||||
subsequent adjustments to the output buffer pointer and remaining
|
||||
output byte count overflow, moving the output position backwards,
|
||||
potentially past the beginning of the buffer, without storing any
|
||||
bytes.
|
||||
|
||||
CVE: CVE-2025-26519
|
||||
Upstream-Status: Backport [https://git.musl-libc.org/cgit/musl/commit/?id=c47ad25ea3b484e10326f933e927c0bc8cded3da]
|
||||
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
|
||||
---
|
||||
src/locale/iconv.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/locale/iconv.c b/src/locale/iconv.c
|
||||
index 1fb66bc8..fb1d3217 100644
|
||||
--- a/src/locale/iconv.c
|
||||
+++ b/src/locale/iconv.c
|
||||
@@ -538,6 +538,10 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
|
||||
if (*outb < k) goto toobig;
|
||||
memcpy(*out, tmp, k);
|
||||
} else k = wctomb_utf8(*out, c);
|
||||
+ /* This failure condition should be unreachable, but
|
||||
+ * is included to prevent decoder bugs from translating
|
||||
+ * into advancement outside the output buffer range. */
|
||||
+ if (k>4) goto ilseq;
|
||||
*out += k;
|
||||
*outb -= k;
|
||||
break;
|
||||
@@ -15,7 +15,9 @@ PV = "${BASEVER}+git${SRCPV}"
|
||||
SRC_URI = "git://git.musl-libc.org/musl;branch=master \
|
||||
file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \
|
||||
file://0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch \
|
||||
"
|
||||
file://CVE-2025-26519-1.patch \
|
||||
file://CVE-2025-26519-2.patch \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
|
||||
@@ -84,5 +84,7 @@ SRC_URI = "\
|
||||
file://0045-CVE-2025-11083.patch \
|
||||
file://0046-CVE-2025-11081.patch \
|
||||
file://0047-CVE-2025-8225.patch \
|
||||
file://CVE-2025-11412.patch \
|
||||
file://CVE-2025-11413.patch \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
35
meta/recipes-devtools/binutils/binutils/CVE-2025-11412.patch
Normal file
35
meta/recipes-devtools/binutils/binutils/CVE-2025-11412.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
From 047435dd988a3975d40c6626a8f739a0b2e154bc Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Thu, 25 Sep 2025 08:22:24 +0930
|
||||
Subject: [PATCH] PR 33452 SEGV in bfd_elf_gc_record_vtentry
|
||||
|
||||
Limit addends on vtentry relocs, otherwise ld might attempt to
|
||||
allocate a stupidly large array. This also fixes the expression
|
||||
overflow leading to pr33452. A vtable of 33M entries on a 64-bit
|
||||
host is surely large enough, especially considering that VTINHERIT
|
||||
and VTENTRY relocations are to support -fvtable-gc that disappeared
|
||||
from gcc over 20 years ago.
|
||||
|
||||
PR ld/33452
|
||||
* elflink.c (bfd_elf_gc_record_vtentry): Sanity check addend.
|
||||
|
||||
CVE: CVE-2025-11412
|
||||
Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=047435dd988a3975d40c6626a8f739a0b2e154bc]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
bfd/elflink.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/bfd/elflink.c b/bfd/elflink.c
|
||||
index 54f0d6e957e..0a0456177c2 100644
|
||||
--- a/bfd/elflink.c
|
||||
+++ b/bfd/elflink.c
|
||||
@@ -14407,7 +14407,7 @@ bfd_elf_gc_record_vtentry (bfd *abfd, asection *sec,
|
||||
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
|
||||
unsigned int log_file_align = bed->s->log_file_align;
|
||||
|
||||
- if (!h)
|
||||
+ if (!h || addend > 1u << 28)
|
||||
{
|
||||
/* xgettext:c-format */
|
||||
_bfd_error_handler (_("%pB: section '%pA': corrupt VTENTRY entry"),
|
||||
38
meta/recipes-devtools/binutils/binutils/CVE-2025-11413.patch
Normal file
38
meta/recipes-devtools/binutils/binutils/CVE-2025-11413.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From 72efdf166aa0ed72ecc69fc2349af6591a7a19c0 Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Thu, 25 Sep 2025 10:41:32 +0930
|
||||
Subject: [PATCH] Re: elf: Disallow the empty global symbol name
|
||||
|
||||
sparc64-linux-gnu +FAIL: selective2
|
||||
sparc64-linux-gnu +FAIL: selective3
|
||||
|
||||
PR ld/33456
|
||||
* elflink.c (elf_link_add_object_symbols): Move new check later
|
||||
to give the backend add_symbol_hook a chance to remove symbols
|
||||
with empty names.
|
||||
|
||||
CVE: CVE-2025-11413
|
||||
Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=72efdf166aa0ed72ecc69fc2349af6591a7a19c0]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
bfd/elflink.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/bfd/elflink.c b/bfd/elflink.c
|
||||
index 0a0456177c2..5c8b822e36a 100644
|
||||
--- a/bfd/elflink.c
|
||||
+++ b/bfd/elflink.c
|
||||
@@ -4931,6 +4931,13 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
continue;
|
||||
}
|
||||
|
||||
+ if (name[0] == '\0')
|
||||
+ {
|
||||
+ _bfd_error_handler (_("%pB: corrupt symbol table"), abfd);
|
||||
+ bfd_set_error (bfd_error_bad_value);
|
||||
+ goto error_free_vers;
|
||||
+ }
|
||||
+
|
||||
/* Sanity check that all possibilities were handled. */
|
||||
if (sec == NULL)
|
||||
abort ();
|
||||
@@ -25,6 +25,8 @@ SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
|
||||
file://0001-debuginfod-debuginfod-client.c-use-long-for-cache-ti.patch \
|
||||
file://CVE-2025-1352.patch \
|
||||
file://CVE-2025-1372.patch \
|
||||
file://CVE-2025-1376.patch \
|
||||
file://CVE-2025-1377.patch \
|
||||
"
|
||||
SRC_URI:append:libc-musl = " \
|
||||
file://0003-musl-utils.patch \
|
||||
|
||||
58
meta/recipes-devtools/elfutils/files/CVE-2025-1376.patch
Normal file
58
meta/recipes-devtools/elfutils/files/CVE-2025-1376.patch
Normal file
@@ -0,0 +1,58 @@
|
||||
From b16f441cca0a4841050e3215a9f120a6d8aea918 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Thu, 13 Feb 2025 00:02:32 +0100
|
||||
Subject: [PATCH] libelf: Handle elf_strptr on section without any data
|
||||
|
||||
In the unlikely situation that elf_strptr was called on a section with
|
||||
sh_size already set, but that doesn't have any data yet we could crash
|
||||
trying to verify the string to return.
|
||||
|
||||
This could happen for example when a new section was created with
|
||||
elf_newscn, but no data having been added yet.
|
||||
|
||||
* libelf/elf_strptr.c (elf_strptr): Check strscn->rawdata_base
|
||||
is not NULL.
|
||||
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=32672
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
|
||||
CVE: CVE-2025-1376
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=b16f441cca0a4841050e3215a9f120a6d8aea918]
|
||||
|
||||
Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com>
|
||||
---
|
||||
libelf/elf_strptr.c | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/libelf/elf_strptr.c b/libelf/elf_strptr.c
|
||||
index c5a94f8..7be7f5e 100644
|
||||
--- a/libelf/elf_strptr.c
|
||||
+++ b/libelf/elf_strptr.c
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Return string pointer from string section.
|
||||
Copyright (C) 1998-2002, 2004, 2008, 2009, 2015 Red Hat, Inc.
|
||||
+ Copyright (C) 2025 Mark J. Wielaard <mark@klomp.org>
|
||||
This file is part of elfutils.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 1998.
|
||||
|
||||
@@ -183,9 +184,12 @@ elf_strptr (Elf *elf, size_t idx, size_t offset)
|
||||
// initialized yet (when data_read is zero). So we cannot just
|
||||
// look at the rawdata.d.d_size.
|
||||
|
||||
- /* Make sure the string is NUL terminated. Start from the end,
|
||||
- which very likely is a NUL char. */
|
||||
- if (likely (validate_str (strscn->rawdata_base, offset, sh_size)))
|
||||
+ /* First check there actually is any data. This could be a new
|
||||
+ section which hasn't had any data set yet. Then make sure
|
||||
+ the string is at a valid offset and NUL terminated. */
|
||||
+ if (unlikely (strscn->rawdata_base == NULL))
|
||||
+ __libelf_seterrno (ELF_E_INVALID_SECTION);
|
||||
+ else if (likely (validate_str (strscn->rawdata_base, offset, sh_size)))
|
||||
result = &strscn->rawdata_base[offset];
|
||||
else
|
||||
__libelf_seterrno (ELF_E_INVALID_INDEX);
|
||||
--
|
||||
2.40.0
|
||||
|
||||
68
meta/recipes-devtools/elfutils/files/CVE-2025-1377.patch
Normal file
68
meta/recipes-devtools/elfutils/files/CVE-2025-1377.patch
Normal file
@@ -0,0 +1,68 @@
|
||||
From fbf1df9ca286de3323ae541973b08449f8d03aba Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Thu, 13 Feb 2025 14:59:34 +0100
|
||||
Subject: [PATCH] strip: Verify symbol table is a real symbol table
|
||||
|
||||
We didn't check the symbol table referenced from the relocation table
|
||||
was a real symbol table. This could cause a crash if that section
|
||||
happened to be an SHT_NOBITS section without any data. Fix this by
|
||||
adding an explicit check.
|
||||
|
||||
* src/strip.c (INTERNAL_ERROR_MSG): New macro that takes a
|
||||
message string to display.
|
||||
(INTERNAL_ERROR): Use INTERNAL_ERROR_MSG with elf_errmsg (-1).
|
||||
(remove_debug_relocations): Check the sh_link referenced
|
||||
section is real and isn't a SHT_NOBITS section.
|
||||
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=32673
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
|
||||
CVE: CVE-2025-1377
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=fbf1df9ca286de3323ae541973b08449f8d03aba]
|
||||
|
||||
Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com>
|
||||
---
|
||||
src/strip.c | 13 ++++++++++---
|
||||
1 file changed, 10 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/strip.c b/src/strip.c
|
||||
index d5b753d..0cfd8c8 100644
|
||||
--- a/src/strip.c
|
||||
+++ b/src/strip.c
|
||||
@@ -127,13 +127,14 @@ static char *tmp_debug_fname = NULL;
|
||||
/* Close debug file descriptor, if opened. And remove temporary debug file. */
|
||||
static void cleanup_debug (void);
|
||||
|
||||
-#define INTERNAL_ERROR(fname) \
|
||||
+#define INTERNAL_ERROR_MSG(fname, msg) \
|
||||
do { \
|
||||
cleanup_debug (); \
|
||||
error (EXIT_FAILURE, 0, _("%s: INTERNAL ERROR %d (%s): %s"), \
|
||||
- fname, __LINE__, PACKAGE_VERSION, elf_errmsg (-1)); \
|
||||
+ fname, __LINE__, PACKAGE_VERSION, msg); \
|
||||
} while (0)
|
||||
|
||||
+#define INTERNAL_ERROR(fname) INTERNAL_ERROR_MSG(fname, elf_errmsg (-1))
|
||||
|
||||
/* Name of the output file. */
|
||||
static const char *output_fname;
|
||||
@@ -632,7 +633,13 @@ remove_debug_relocations (Ebl *ebl, Elf *elf, GElf_Ehdr *ehdr,
|
||||
resolve relocation symbol indexes. */
|
||||
Elf64_Word symt = shdr->sh_link;
|
||||
Elf_Data *symdata, *xndxdata;
|
||||
- Elf_Scn * symscn = elf_getscn (elf, symt);
|
||||
+ Elf_Scn *symscn = elf_getscn (elf, symt);GElf_Shdr symshdr_mem;
|
||||
+ GElf_Shdr *symshdr = gelf_getshdr (symscn, &symshdr_mem);
|
||||
+ if (symshdr == NULL)
|
||||
+ INTERNAL_ERROR (fname);
|
||||
+ if (symshdr->sh_type == SHT_NOBITS)
|
||||
+ INTERNAL_ERROR_MSG (fname, "NOBITS section");
|
||||
+
|
||||
symdata = elf_getdata (symscn, NULL);
|
||||
xndxdata = get_xndxdata (elf, symscn);
|
||||
if (symdata == NULL)
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -68,6 +68,11 @@ SRC_URI = "https://golang.org/dl/go${PV}.src.tar.gz;name=main \
|
||||
file://CVE-2025-47907-pre-0002.patch \
|
||||
file://CVE-2025-47907.patch \
|
||||
file://CVE-2025-47906.patch \
|
||||
file://CVE-2024-24783.patch \
|
||||
file://CVE-2025-58187.patch \
|
||||
file://CVE-2025-58189.patch \
|
||||
file://CVE-2025-61723.patch \
|
||||
file://CVE-2025-61724.patch \
|
||||
"
|
||||
SRC_URI[main.sha256sum] = "a1a48b23afb206f95e7bbaa9b898d965f90826f6f1d1fc0c1d784ada0cd300fd"
|
||||
|
||||
|
||||
349
meta/recipes-devtools/go/go-1.18/CVE-2025-58187.patch
Normal file
349
meta/recipes-devtools/go/go-1.18/CVE-2025-58187.patch
Normal file
@@ -0,0 +1,349 @@
|
||||
From f334417e71f8b078ad64035bddb6df7f8910da6c Mon Sep 17 00:00:00 2001
|
||||
From: Neal Patel <nealpatel@google.com>
|
||||
Date: Mon, 15 Sep 2025 16:31:22 -0400
|
||||
Subject: [PATCH] crypto/x509: improve domain name verification
|
||||
|
||||
Don't use domainToReverseLabels to check if domain names are valid,
|
||||
since it is not particularly performant, and can contribute to DoS
|
||||
vectors. Instead just iterate over the name and enforce the properties
|
||||
we care about.
|
||||
|
||||
This also enforces that DNS names, both in SANs and name constraints,
|
||||
are valid. We previously allowed invalid SANs, because some
|
||||
intermediates had these weird names (see #23995), but there are
|
||||
currently no trusted intermediates that have this property, and since we
|
||||
target the web PKI, supporting this particular case is not a high
|
||||
priority.
|
||||
|
||||
Thank you to Jakub Ciolek for reporting this issue.
|
||||
|
||||
Fixes CVE-2025-58187
|
||||
For #75681
|
||||
Fixes #75714
|
||||
|
||||
Change-Id: I6ebce847dcbe5fc63ef2f9a74f53f11c4c56d3d1
|
||||
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/2820
|
||||
Reviewed-by: Damien Neil <dneil@google.com>
|
||||
Reviewed-by: Roland Shoemaker <bracewell@google.com>
|
||||
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/2982
|
||||
Reviewed-by: Nicholas Husin <husin@google.com>
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/709839
|
||||
Auto-Submit: Michael Pratt <mpratt@google.com>
|
||||
Reviewed-by: Carlos Amedee <carlos@golang.org>
|
||||
TryBot-Bypass: Michael Pratt <mpratt@google.com>
|
||||
|
||||
CVE: CVE-2025-58187
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/f334417e71f8b078ad64035bddb6df7f8910da6c]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
src/crypto/x509/name_constraints_test.go | 66 ++------------------
|
||||
src/crypto/x509/parser.go | 77 ++++++++++++++----------
|
||||
src/crypto/x509/parser_test.go | 43 +++++++++++++
|
||||
src/crypto/x509/verify.go | 1 +
|
||||
4 files changed, 95 insertions(+), 92 deletions(-)
|
||||
|
||||
diff --git a/src/crypto/x509/name_constraints_test.go b/src/crypto/x509/name_constraints_test.go
|
||||
index c59a7dc..d4f7d41 100644
|
||||
--- a/src/crypto/x509/name_constraints_test.go
|
||||
+++ b/src/crypto/x509/name_constraints_test.go
|
||||
@@ -1452,63 +1452,7 @@ var nameConstraintsTests = []nameConstraintsTest{
|
||||
requestedEKUs: []ExtKeyUsage{ExtKeyUsageServerAuth},
|
||||
},
|
||||
|
||||
- // An invalid DNS SAN should be detected only at validation time so
|
||||
- // that we can process CA certificates in the wild that have invalid SANs.
|
||||
- // See https://github.com/golang/go/issues/23995
|
||||
-
|
||||
- // #77: an invalid DNS or mail SAN will not be detected if name constraint
|
||||
- // checking is not triggered.
|
||||
- {
|
||||
- roots: make([]constraintsSpec, 1),
|
||||
- intermediates: [][]constraintsSpec{
|
||||
- {
|
||||
- {},
|
||||
- },
|
||||
- },
|
||||
- leaf: leafSpec{
|
||||
- sans: []string{"dns:this is invalid", "email:this @ is invalid"},
|
||||
- },
|
||||
- },
|
||||
-
|
||||
- // #78: an invalid DNS SAN will be detected if any name constraint checking
|
||||
- // is triggered.
|
||||
- {
|
||||
- roots: []constraintsSpec{
|
||||
- {
|
||||
- bad: []string{"uri:"},
|
||||
- },
|
||||
- },
|
||||
- intermediates: [][]constraintsSpec{
|
||||
- {
|
||||
- {},
|
||||
- },
|
||||
- },
|
||||
- leaf: leafSpec{
|
||||
- sans: []string{"dns:this is invalid"},
|
||||
- },
|
||||
- expectedError: "cannot parse dnsName",
|
||||
- },
|
||||
-
|
||||
- // #79: an invalid email SAN will be detected if any name constraint
|
||||
- // checking is triggered.
|
||||
- {
|
||||
- roots: []constraintsSpec{
|
||||
- {
|
||||
- bad: []string{"uri:"},
|
||||
- },
|
||||
- },
|
||||
- intermediates: [][]constraintsSpec{
|
||||
- {
|
||||
- {},
|
||||
- },
|
||||
- },
|
||||
- leaf: leafSpec{
|
||||
- sans: []string{"email:this @ is invalid"},
|
||||
- },
|
||||
- expectedError: "cannot parse rfc822Name",
|
||||
- },
|
||||
-
|
||||
- // #80: if several EKUs are requested, satisfying any of them is sufficient.
|
||||
+ // #77: if several EKUs are requested, satisfying any of them is sufficient.
|
||||
{
|
||||
roots: make([]constraintsSpec, 1),
|
||||
intermediates: [][]constraintsSpec{
|
||||
@@ -1523,7 +1467,7 @@ var nameConstraintsTests = []nameConstraintsTest{
|
||||
requestedEKUs: []ExtKeyUsage{ExtKeyUsageClientAuth, ExtKeyUsageEmailProtection},
|
||||
},
|
||||
|
||||
- // #81: EKUs that are not asserted in VerifyOpts are not required to be
|
||||
+ // #78: EKUs that are not asserted in VerifyOpts are not required to be
|
||||
// nested.
|
||||
{
|
||||
roots: make([]constraintsSpec, 1),
|
||||
@@ -1542,7 +1486,7 @@ var nameConstraintsTests = []nameConstraintsTest{
|
||||
},
|
||||
},
|
||||
|
||||
- // #82: a certificate without SANs and CN is accepted in a constrained chain.
|
||||
+ // #79: a certificate without SANs and CN is accepted in a constrained chain.
|
||||
{
|
||||
roots: []constraintsSpec{
|
||||
{
|
||||
@@ -1559,7 +1503,7 @@ var nameConstraintsTests = []nameConstraintsTest{
|
||||
},
|
||||
},
|
||||
|
||||
- // #83: a certificate without SANs and with a CN that does not parse as a
|
||||
+ // #80: a certificate without SANs and with a CN that does not parse as a
|
||||
// hostname is accepted in a constrained chain.
|
||||
{
|
||||
roots: []constraintsSpec{
|
||||
@@ -1578,7 +1522,7 @@ var nameConstraintsTests = []nameConstraintsTest{
|
||||
},
|
||||
},
|
||||
|
||||
- // #84: a certificate with SANs and CN is accepted in a constrained chain.
|
||||
+ // #81: a certificate with SANs and CN is accepted in a constrained chain.
|
||||
{
|
||||
roots: []constraintsSpec{
|
||||
{
|
||||
diff --git a/src/crypto/x509/parser.go b/src/crypto/x509/parser.go
|
||||
index 635e74b..0788210 100644
|
||||
--- a/src/crypto/x509/parser.go
|
||||
+++ b/src/crypto/x509/parser.go
|
||||
@@ -391,10 +391,14 @@ func parseSANExtension(der cryptobyte.String) (dnsNames, emailAddresses []string
|
||||
if err := isIA5String(email); err != nil {
|
||||
return errors.New("x509: SAN rfc822Name is malformed")
|
||||
}
|
||||
+ parsed, ok := parseRFC2821Mailbox(email)
|
||||
+ if !ok || (ok && !domainNameValid(parsed.domain, false)) {
|
||||
+ return errors.New("x509: SAN rfc822Name is malformed")
|
||||
+ }
|
||||
emailAddresses = append(emailAddresses, email)
|
||||
case nameTypeDNS:
|
||||
name := string(data)
|
||||
- if err := isIA5String(name); err != nil {
|
||||
+ if err := isIA5String(name); err != nil || (err == nil && !domainNameValid(name, false)) {
|
||||
return errors.New("x509: SAN dNSName is malformed")
|
||||
}
|
||||
dnsNames = append(dnsNames, string(name))
|
||||
@@ -404,14 +408,9 @@ func parseSANExtension(der cryptobyte.String) (dnsNames, emailAddresses []string
|
||||
return errors.New("x509: SAN uniformResourceIdentifier is malformed")
|
||||
}
|
||||
uri, err := url.Parse(uriStr)
|
||||
- if err != nil {
|
||||
+ if err != nil || (err == nil && uri.Host != "" && !domainNameValid(uri.Host, false)) {
|
||||
return fmt.Errorf("x509: cannot parse URI %q: %s", uriStr, err)
|
||||
}
|
||||
- if len(uri.Host) > 0 {
|
||||
- if _, ok := domainToReverseLabels(uri.Host); !ok {
|
||||
- return fmt.Errorf("x509: cannot parse URI %q: invalid domain", uriStr)
|
||||
- }
|
||||
- }
|
||||
uris = append(uris, uri)
|
||||
case nameTypeIP:
|
||||
switch len(data) {
|
||||
@@ -551,15 +550,7 @@ func parseNameConstraintsExtension(out *Certificate, e pkix.Extension) (unhandle
|
||||
return nil, nil, nil, nil, errors.New("x509: invalid constraint value: " + err.Error())
|
||||
}
|
||||
|
||||
- trimmedDomain := domain
|
||||
- if len(trimmedDomain) > 0 && trimmedDomain[0] == '.' {
|
||||
- // constraints can have a leading
|
||||
- // period to exclude the domain
|
||||
- // itself, but that's not valid in a
|
||||
- // normal domain name.
|
||||
- trimmedDomain = trimmedDomain[1:]
|
||||
- }
|
||||
- if _, ok := domainToReverseLabels(trimmedDomain); !ok {
|
||||
+ if !domainNameValid(domain, true) {
|
||||
return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse dnsName constraint %q", domain)
|
||||
}
|
||||
dnsNames = append(dnsNames, domain)
|
||||
@@ -600,12 +591,7 @@ func parseNameConstraintsExtension(out *Certificate, e pkix.Extension) (unhandle
|
||||
return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse rfc822Name constraint %q", constraint)
|
||||
}
|
||||
} else {
|
||||
- // Otherwise it's a domain name.
|
||||
- domain := constraint
|
||||
- if len(domain) > 0 && domain[0] == '.' {
|
||||
- domain = domain[1:]
|
||||
- }
|
||||
- if _, ok := domainToReverseLabels(domain); !ok {
|
||||
+ if !domainNameValid(constraint, true) {
|
||||
return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse rfc822Name constraint %q", constraint)
|
||||
}
|
||||
}
|
||||
@@ -621,15 +607,7 @@ func parseNameConstraintsExtension(out *Certificate, e pkix.Extension) (unhandle
|
||||
return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse URI constraint %q: cannot be IP address", domain)
|
||||
}
|
||||
|
||||
- trimmedDomain := domain
|
||||
- if len(trimmedDomain) > 0 && trimmedDomain[0] == '.' {
|
||||
- // constraints can have a leading
|
||||
- // period to exclude the domain itself,
|
||||
- // but that's not valid in a normal
|
||||
- // domain name.
|
||||
- trimmedDomain = trimmedDomain[1:]
|
||||
- }
|
||||
- if _, ok := domainToReverseLabels(trimmedDomain); !ok {
|
||||
+ if !domainNameValid(domain, true) {
|
||||
return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse URI constraint %q", domain)
|
||||
}
|
||||
uriDomains = append(uriDomains, domain)
|
||||
@@ -1011,3 +989,40 @@ func ParseCertificates(der []byte) ([]*Certificate, error) {
|
||||
}
|
||||
return certs, nil
|
||||
}
|
||||
+
|
||||
+// domainNameValid does minimal domain name validity checking. In particular it
|
||||
+// enforces the following properties:
|
||||
+// - names cannot have the trailing period
|
||||
+// - names can only have a leading period if constraint is true
|
||||
+// - names must be <= 253 characters
|
||||
+// - names cannot have empty labels
|
||||
+// - names cannot labels that are longer than 63 characters
|
||||
+//
|
||||
+// Note that this does not enforce the LDH requirements for domain names.
|
||||
+func domainNameValid(s string, constraint bool) bool {
|
||||
+ if len(s) == 0 && constraint {
|
||||
+ return true
|
||||
+ }
|
||||
+ if len(s) == 0 || (!constraint && s[0] == '.') || s[len(s)-1] == '.' || len(s) > 253 {
|
||||
+ return false
|
||||
+ }
|
||||
+ lastDot := -1
|
||||
+ if constraint && s[0] == '.' {
|
||||
+ s = s[1:]
|
||||
+ }
|
||||
+
|
||||
+ for i := 0; i <= len(s); i++ {
|
||||
+ if i == len(s) || s[i] == '.' {
|
||||
+ labelLen := i
|
||||
+ if lastDot >= 0 {
|
||||
+ labelLen -= lastDot + 1
|
||||
+ }
|
||||
+ if labelLen == 0 || labelLen > 63 {
|
||||
+ return false
|
||||
+ }
|
||||
+ lastDot = i
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return true
|
||||
+}
|
||||
diff --git a/src/crypto/x509/parser_test.go b/src/crypto/x509/parser_test.go
|
||||
index d7cf7ea..95ed116 100644
|
||||
--- a/src/crypto/x509/parser_test.go
|
||||
+++ b/src/crypto/x509/parser_test.go
|
||||
@@ -5,6 +5,7 @@ package x509
|
||||
|
||||
import (
|
||||
"encoding/asn1"
|
||||
+ "strings"
|
||||
"testing"
|
||||
|
||||
cryptobyte_asn1 "golang.org/x/crypto/cryptobyte/asn1"
|
||||
@@ -100,3 +101,45 @@ func TestParseASN1String(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
+
|
||||
+func TestDomainNameValid(t *testing.T) {
|
||||
+ for _, tc := range []struct {
|
||||
+ name string
|
||||
+ dnsName string
|
||||
+ constraint bool
|
||||
+ valid bool
|
||||
+ }{
|
||||
+ {"empty name, name", "", false, false},
|
||||
+ {"empty name, constraint", "", true, true},
|
||||
+ {"empty label, name", "a..a", false, false},
|
||||
+ {"empty label, constraint", "a..a", true, false},
|
||||
+ {"period, name", ".", false, false},
|
||||
+ {"period, constraint", ".", true, false}, // TODO(roland): not entirely clear if this is a valid constraint (require at least one label?)
|
||||
+ {"valid, name", "a.b.c", false, true},
|
||||
+ {"valid, constraint", "a.b.c", true, true},
|
||||
+ {"leading period, name", ".a.b.c", false, false},
|
||||
+ {"leading period, constraint", ".a.b.c", true, true},
|
||||
+ {"trailing period, name", "a.", false, false},
|
||||
+ {"trailing period, constraint", "a.", true, false},
|
||||
+ {"bare label, name", "a", false, true},
|
||||
+ {"bare label, constraint", "a", true, true},
|
||||
+ {"254 char label, name", strings.Repeat("a.a", 84) + "aaa", false, false},
|
||||
+ {"254 char label, constraint", strings.Repeat("a.a", 84) + "aaa", true, false},
|
||||
+ {"253 char label, name", strings.Repeat("a.a", 84) + "aa", false, false},
|
||||
+ {"253 char label, constraint", strings.Repeat("a.a", 84) + "aa", true, false},
|
||||
+ {"64 char single label, name", strings.Repeat("a", 64), false, false},
|
||||
+ {"64 char single label, constraint", strings.Repeat("a", 64), true, false},
|
||||
+ {"63 char single label, name", strings.Repeat("a", 63), false, true},
|
||||
+ {"63 char single label, constraint", strings.Repeat("a", 63), true, true},
|
||||
+ {"64 char label, name", "a." + strings.Repeat("a", 64), false, false},
|
||||
+ {"64 char label, constraint", "a." + strings.Repeat("a", 64), true, false},
|
||||
+ {"63 char label, name", "a." + strings.Repeat("a", 63), false, true},
|
||||
+ {"63 char label, constraint", "a." + strings.Repeat("a", 63), true, true},
|
||||
+ } {
|
||||
+ t.Run(tc.name, func(t *testing.T) {
|
||||
+ if tc.valid != domainNameValid(tc.dnsName, tc.constraint) {
|
||||
+ t.Errorf("domainNameValid(%q, %t) = %v; want %v", tc.dnsName, tc.constraint, !tc.valid, tc.valid)
|
||||
+ }
|
||||
+ })
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/crypto/x509/verify.go b/src/crypto/x509/verify.go
|
||||
index 3e95808..fb2f4b2 100644
|
||||
--- a/src/crypto/x509/verify.go
|
||||
+++ b/src/crypto/x509/verify.go
|
||||
@@ -357,6 +357,7 @@ func parseRFC2821Mailbox(in string) (mailbox rfc2821Mailbox, ok bool) {
|
||||
// domainToReverseLabels converts a textual domain name like foo.example.com to
|
||||
// the list of labels in reverse order, e.g. ["com", "example", "foo"].
|
||||
func domainToReverseLabels(domain string) (reverseLabels []string, ok bool) {
|
||||
+ reverseLabels = make([]string, 0, strings.Count(domain, ".")+1)
|
||||
for len(domain) > 0 {
|
||||
if i := strings.LastIndexByte(domain, '.'); i == -1 {
|
||||
reverseLabels = append(reverseLabels, domain)
|
||||
--
|
||||
2.40.0
|
||||
|
||||
51
meta/recipes-devtools/go/go-1.18/CVE-2025-58189.patch
Normal file
51
meta/recipes-devtools/go/go-1.18/CVE-2025-58189.patch
Normal file
@@ -0,0 +1,51 @@
|
||||
From 2e1e356e33b9c792a9643749a7626a1789197bb9 Mon Sep 17 00:00:00 2001
|
||||
From: Roland Shoemaker <roland@golang.org>
|
||||
Date: Mon, 29 Sep 2025 10:11:56 -0700
|
||||
Subject: [PATCH] crypto/tls: quote protocols in ALPN error message
|
||||
|
||||
Quote the protocols sent by the client when returning the ALPN
|
||||
negotiation error message.
|
||||
|
||||
Fixes CVE-2025-58189
|
||||
Updates #75652
|
||||
Fixes #75660
|
||||
|
||||
Change-Id: Ie7b3a1ed0b6efcc1705b71f0f1e8417126661330
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/707776
|
||||
Auto-Submit: Roland Shoemaker <roland@golang.org>
|
||||
Reviewed-by: Neal Patel <nealpatel@google.com>
|
||||
Reviewed-by: Nicholas Husin <nsh@golang.org>
|
||||
Auto-Submit: Nicholas Husin <nsh@golang.org>
|
||||
Reviewed-by: Nicholas Husin <husin@google.com>
|
||||
TryBot-Bypass: Roland Shoemaker <roland@golang.org>
|
||||
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
|
||||
(cherry picked from commit 4e9006a716533fe1c7ee08df02dfc73078f7dc19)
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/708096
|
||||
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
|
||||
Reviewed-by: Carlos Amedee <carlos@golang.org>
|
||||
|
||||
CVE: CVE-2025-58189
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/2e1e356e33b9c792a9643749a7626a1789197bb9]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
src/crypto/tls/handshake_server.go | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/crypto/tls/handshake_server.go b/src/crypto/tls/handshake_server.go
|
||||
index 4e84aa9..17b6891 100644
|
||||
--- a/src/crypto/tls/handshake_server.go
|
||||
+++ b/src/crypto/tls/handshake_server.go
|
||||
@@ -312,7 +312,7 @@ func negotiateALPN(serverProtos, clientProtos []string, quic bool) (string, erro
|
||||
if http11fallback {
|
||||
return "", nil
|
||||
}
|
||||
- return "", fmt.Errorf("tls: client requested unsupported application protocols (%s)", clientProtos)
|
||||
+ return "", fmt.Errorf("tls: client requested unsupported application protocols (%q)", clientProtos)
|
||||
}
|
||||
|
||||
// supportsECDHE returns whether ECDHE key exchanges can be used with this
|
||||
--
|
||||
2.40.0
|
||||
|
||||
221
meta/recipes-devtools/go/go-1.18/CVE-2025-61723.patch
Normal file
221
meta/recipes-devtools/go/go-1.18/CVE-2025-61723.patch
Normal file
@@ -0,0 +1,221 @@
|
||||
From 74d4d836b91318a8764b94bc2b4b66ff599eb5f2 Mon Sep 17 00:00:00 2001
|
||||
From: Roland Shoemaker <bracewell@google.com>
|
||||
Date: Tue, 30 Sep 2025 11:16:56 -0700
|
||||
Subject: [PATCH] encoding/pem: make Decode complexity linear Because Decode
|
||||
scanned the input first for the first BEGIN line, and then the first END
|
||||
line, the complexity of Decode is quadratic. If the input contained a large
|
||||
number of BEGINs and then a single END right at the end of the input, we
|
||||
would find the first BEGIN, and then scan the entire input for the END, and
|
||||
fail to parse the block, so move onto the next BEGIN, scan the entire input
|
||||
for the END, etc.
|
||||
|
||||
Instead, look for the first END in the input, and then the first BEGIN
|
||||
that precedes the found END. We then process the bytes between the BEGIN
|
||||
and END, and move onto the bytes after the END for further processing.
|
||||
This gives us linear complexity.
|
||||
|
||||
Fixes CVE-2025-61723
|
||||
For #75676
|
||||
Fixes #75708
|
||||
|
||||
Change-Id: I813c4f63e78bca4054226c53e13865c781564ccf
|
||||
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/2921
|
||||
Reviewed-by: Nicholas Husin <husin@google.com>
|
||||
Reviewed-by: Damien Neil <dneil@google.com>
|
||||
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/2986
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/709842
|
||||
TryBot-Bypass: Michael Pratt <mpratt@google.com>
|
||||
Auto-Submit: Michael Pratt <mpratt@google.com>
|
||||
Reviewed-by: Carlos Amedee <carlos@golang.org>
|
||||
|
||||
CVE: CVE-2025-61723
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/74d4d836b91318a8764b94bc2b4b66ff599eb5f2]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
src/encoding/pem/pem.go | 67 +++++++++++++++++++-----------------
|
||||
src/encoding/pem/pem_test.go | 13 +++----
|
||||
2 files changed, 43 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/src/encoding/pem/pem.go b/src/encoding/pem/pem.go
|
||||
index 1bee1c1..01bed75 100644
|
||||
--- a/src/encoding/pem/pem.go
|
||||
+++ b/src/encoding/pem/pem.go
|
||||
@@ -35,7 +35,7 @@ type Block struct {
|
||||
// line bytes. The remainder of the byte array (also not including the new line
|
||||
// bytes) is also returned and this will always be smaller than the original
|
||||
// argument.
|
||||
-func getLine(data []byte) (line, rest []byte) {
|
||||
+func getLine(data []byte) (line, rest []byte, consumed int) {
|
||||
i := bytes.IndexByte(data, '\n')
|
||||
var j int
|
||||
if i < 0 {
|
||||
@@ -47,7 +47,7 @@ func getLine(data []byte) (line, rest []byte) {
|
||||
i--
|
||||
}
|
||||
}
|
||||
- return bytes.TrimRight(data[0:i], " \t"), data[j:]
|
||||
+ return bytes.TrimRight(data[0:i], " \t"), data[j:], j
|
||||
}
|
||||
|
||||
// removeSpacesAndTabs returns a copy of its input with all spaces and tabs
|
||||
@@ -88,19 +88,29 @@ func Decode(data []byte) (p *Block, rest []byte) {
|
||||
// the byte array, we'll accept the start string without it.
|
||||
rest = data
|
||||
for {
|
||||
- if bytes.HasPrefix(rest, pemStart[1:]) {
|
||||
- rest = rest[len(pemStart)-1:]
|
||||
- } else if i := bytes.Index(rest, pemStart); i >= 0 {
|
||||
- rest = rest[i+len(pemStart) : len(rest)]
|
||||
- } else {
|
||||
+ // Find the first END line, and then find the last BEGIN line before
|
||||
+ // the end line. This lets us skip any repeated BEGIN lines that don't
|
||||
+ // have a matching END.
|
||||
+ endIndex := bytes.Index(rest, pemEnd)
|
||||
+ if endIndex < 0 {
|
||||
return nil, data
|
||||
}
|
||||
-
|
||||
+ endTrailerIndex := endIndex + len(pemEnd)
|
||||
+ beginIndex := bytes.LastIndex(rest[:endIndex], pemStart[1:])
|
||||
+ if beginIndex < 0 || beginIndex > 0 && rest[beginIndex-1] != '\n' {
|
||||
+ return nil, data
|
||||
+ }
|
||||
+ rest = rest[beginIndex+len(pemStart)-1:]
|
||||
+ endIndex -= beginIndex + len(pemStart) - 1
|
||||
+ endTrailerIndex -= beginIndex + len(pemStart) - 1
|
||||
var typeLine []byte
|
||||
- typeLine, rest = getLine(rest)
|
||||
+ var consumed int
|
||||
+ typeLine, rest, consumed = getLine(rest)
|
||||
if !bytes.HasSuffix(typeLine, pemEndOfLine) {
|
||||
continue
|
||||
}
|
||||
+ endIndex -= consumed
|
||||
+ endTrailerIndex -= consumed
|
||||
typeLine = typeLine[0 : len(typeLine)-len(pemEndOfLine)]
|
||||
|
||||
p = &Block{
|
||||
@@ -114,7 +124,7 @@ func Decode(data []byte) (p *Block, rest []byte) {
|
||||
if len(rest) == 0 {
|
||||
return nil, data
|
||||
}
|
||||
- line, next := getLine(rest)
|
||||
+ line, next, consumed := getLine(rest)
|
||||
|
||||
i := bytes.IndexByte(line, ':')
|
||||
if i == -1 {
|
||||
@@ -127,21 +137,13 @@ func Decode(data []byte) (p *Block, rest []byte) {
|
||||
val = bytes.TrimSpace(val)
|
||||
p.Headers[string(key)] = string(val)
|
||||
rest = next
|
||||
+ endIndex -= consumed
|
||||
+ endTrailerIndex -= consumed
|
||||
}
|
||||
|
||||
- var endIndex, endTrailerIndex int
|
||||
-
|
||||
- // If there were no headers, the END line might occur
|
||||
- // immediately, without a leading newline.
|
||||
- if len(p.Headers) == 0 && bytes.HasPrefix(rest, pemEnd[1:]) {
|
||||
- endIndex = 0
|
||||
- endTrailerIndex = len(pemEnd) - 1
|
||||
- } else {
|
||||
- endIndex = bytes.Index(rest, pemEnd)
|
||||
- endTrailerIndex = endIndex + len(pemEnd)
|
||||
- }
|
||||
-
|
||||
- if endIndex < 0 {
|
||||
+ // If there were headers, there must be a newline between the headers
|
||||
+ // and the END line, so endIndex should be >= 0.
|
||||
+ if len(p.Headers) > 0 && endIndex < 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -161,21 +163,24 @@ func Decode(data []byte) (p *Block, rest []byte) {
|
||||
}
|
||||
|
||||
// The line must end with only whitespace.
|
||||
- if s, _ := getLine(restOfEndLine); len(s) != 0 {
|
||||
+ if s, _, _ := getLine(restOfEndLine); len(s) != 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
- base64Data := removeSpacesAndTabs(rest[:endIndex])
|
||||
- p.Bytes = make([]byte, base64.StdEncoding.DecodedLen(len(base64Data)))
|
||||
- n, err := base64.StdEncoding.Decode(p.Bytes, base64Data)
|
||||
- if err != nil {
|
||||
- continue
|
||||
+ p.Bytes = []byte{}
|
||||
+ if endIndex > 0 {
|
||||
+ base64Data := removeSpacesAndTabs(rest[:endIndex])
|
||||
+ p.Bytes = make([]byte, base64.StdEncoding.DecodedLen(len(base64Data)))
|
||||
+ n, err := base64.StdEncoding.Decode(p.Bytes, base64Data)
|
||||
+ if err != nil {
|
||||
+ continue
|
||||
+ }
|
||||
+ p.Bytes = p.Bytes[:n]
|
||||
}
|
||||
- p.Bytes = p.Bytes[:n]
|
||||
|
||||
// the -1 is because we might have only matched pemEnd without the
|
||||
// leading newline if the PEM block was empty.
|
||||
- _, rest = getLine(rest[endIndex+len(pemEnd)-1:])
|
||||
+ _, rest, _ = getLine(rest[endIndex+len(pemEnd)-1:])
|
||||
return p, rest
|
||||
}
|
||||
}
|
||||
diff --git a/src/encoding/pem/pem_test.go b/src/encoding/pem/pem_test.go
|
||||
index c94b5ca..a326f9b 100644
|
||||
--- a/src/encoding/pem/pem_test.go
|
||||
+++ b/src/encoding/pem/pem_test.go
|
||||
@@ -34,7 +34,7 @@ var getLineTests = []GetLineTest{
|
||||
|
||||
func TestGetLine(t *testing.T) {
|
||||
for i, test := range getLineTests {
|
||||
- x, y := getLine([]byte(test.in))
|
||||
+ x, y, _ := getLine([]byte(test.in))
|
||||
if string(x) != test.out1 || string(y) != test.out2 {
|
||||
t.Errorf("#%d got:%+v,%+v want:%s,%s", i, x, y, test.out1, test.out2)
|
||||
}
|
||||
@@ -46,6 +46,7 @@ func TestDecode(t *testing.T) {
|
||||
if !reflect.DeepEqual(result, certificate) {
|
||||
t.Errorf("#0 got:%#v want:%#v", result, certificate)
|
||||
}
|
||||
+
|
||||
result, remainder = Decode(remainder)
|
||||
if !reflect.DeepEqual(result, privateKey) {
|
||||
t.Errorf("#1 got:%#v want:%#v", result, privateKey)
|
||||
@@ -68,7 +69,7 @@ func TestDecode(t *testing.T) {
|
||||
}
|
||||
|
||||
result, remainder = Decode(remainder)
|
||||
- if result == nil || result.Type != "HEADERS" || len(result.Headers) != 1 {
|
||||
+ if result == nil || result.Type != "VALID HEADERS" || len(result.Headers) != 1 {
|
||||
t.Errorf("#5 expected single header block but got :%v", result)
|
||||
}
|
||||
|
||||
@@ -381,15 +382,15 @@ ZWAaUoVtWIQ52aKS0p19G99hhb+IVANC4akkdHV4SP8i7MVNZhfUmg==
|
||||
|
||||
# This shouldn't be recognised because of the missing newline after the
|
||||
headers.
|
||||
------BEGIN HEADERS-----
|
||||
+-----BEGIN INVALID HEADERS-----
|
||||
Header: 1
|
||||
------END HEADERS-----
|
||||
+-----END INVALID HEADERS-----
|
||||
|
||||
# This should be valid, however.
|
||||
------BEGIN HEADERS-----
|
||||
+-----BEGIN VALID HEADERS-----
|
||||
Header: 1
|
||||
|
||||
------END HEADERS-----`)
|
||||
+-----END VALID HEADERS-----`)
|
||||
|
||||
var certificate = &Block{Type: "CERTIFICATE",
|
||||
Headers: map[string]string{},
|
||||
--
|
||||
2.40.0
|
||||
|
||||
74
meta/recipes-devtools/go/go-1.18/CVE-2025-61724.patch
Normal file
74
meta/recipes-devtools/go/go-1.18/CVE-2025-61724.patch
Normal file
@@ -0,0 +1,74 @@
|
||||
From a402f4ad285514f5f3db90516d72047d591b307a Mon Sep 17 00:00:00 2001
|
||||
From: Damien Neil <dneil@google.com>
|
||||
Date: Tue, 30 Sep 2025 15:11:16 -0700
|
||||
Subject: [PATCH] net/textproto: avoid quadratic complexity in
|
||||
Reader.ReadResponse Reader.ReadResponse constructed a response string from
|
||||
repeated string concatenation, permitting a malicious sender to cause
|
||||
excessive memory allocation and CPU consumption by sending a response
|
||||
consisting of many short lines.
|
||||
|
||||
Use a strings.Builder to construct the string instead.
|
||||
|
||||
Thanks to Jakub Ciolek for reporting this issue.
|
||||
|
||||
Fixes CVE-2025-61724
|
||||
For #75716
|
||||
Fixes #75717
|
||||
|
||||
Change-Id: I1a98ce85a21b830cb25799f9ac9333a67400d736
|
||||
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/2940
|
||||
Reviewed-by: Roland Shoemaker <bracewell@google.com>
|
||||
Reviewed-by: Nicholas Husin <husin@google.com>
|
||||
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/2980
|
||||
Reviewed-by: Damien Neil <dneil@google.com>
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/709837
|
||||
Reviewed-by: Carlos Amedee <carlos@golang.org>
|
||||
TryBot-Bypass: Michael Pratt <mpratt@google.com>
|
||||
Auto-Submit: Michael Pratt <mpratt@google.com>
|
||||
|
||||
CVE: CVE-2025-61724
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/a402f4ad285514f5f3db90516d72047d591b307a]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
src/net/textproto/reader.go | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/net/textproto/reader.go b/src/net/textproto/reader.go
|
||||
index 3ac4d4d..a996257 100644
|
||||
--- a/src/net/textproto/reader.go
|
||||
+++ b/src/net/textproto/reader.go
|
||||
@@ -288,8 +288,10 @@ func (r *Reader) ReadCodeLine(expectCode int) (code int, message string, err err
|
||||
// An expectCode <= 0 disables the check of the status code.
|
||||
//
|
||||
func (r *Reader) ReadResponse(expectCode int) (code int, message string, err error) {
|
||||
- code, continued, message, err := r.readCodeLine(expectCode)
|
||||
+ code, continued, first, err := r.readCodeLine(expectCode)
|
||||
multi := continued
|
||||
+ var messageBuilder strings.Builder
|
||||
+ messageBuilder.WriteString(first)
|
||||
for continued {
|
||||
line, err := r.ReadLine()
|
||||
if err != nil {
|
||||
@@ -300,12 +302,15 @@ func (r *Reader) ReadResponse(expectCode int) (code int, message string, err err
|
||||
var moreMessage string
|
||||
code2, continued, moreMessage, err = parseCodeLine(line, 0)
|
||||
if err != nil || code2 != code {
|
||||
- message += "\n" + strings.TrimRight(line, "\r\n")
|
||||
+ messageBuilder.WriteByte('\n')
|
||||
+ messageBuilder.WriteString(strings.TrimRight(line, "\r\n"))
|
||||
continued = true
|
||||
continue
|
||||
}
|
||||
- message += "\n" + moreMessage
|
||||
+ messageBuilder.WriteByte('\n')
|
||||
+ messageBuilder.WriteString(moreMessage)
|
||||
}
|
||||
+ message = messageBuilder.String()
|
||||
if err != nil && multi && message != "" {
|
||||
// replace one line error message with all lines (full message)
|
||||
err = &Error{code, message}
|
||||
--
|
||||
2.40.0
|
||||
|
||||
83
meta/recipes-devtools/go/go-1.21/CVE-2024-24783.patch
Normal file
83
meta/recipes-devtools/go/go-1.21/CVE-2024-24783.patch
Normal file
@@ -0,0 +1,83 @@
|
||||
From be5b52bea674190ef7de272664be6c7ae93ec5a0 Mon Sep 17 00:00:00 2001
|
||||
From: Roland Shoemaker <bracewell@google.com>
|
||||
Date: Thu, 18 Jan 2024 12:51:13 -0800
|
||||
Subject: [PATCH] [release-branch.go1.21] crypto/x509: make sure pub key is
|
||||
non-nil before interface conversion
|
||||
|
||||
alreadyInChain assumes all keys fit a interface which contains the
|
||||
Equal method (which they do), but this ignores that certificates may
|
||||
have a nil key when PublicKeyAlgorithm is UnknownPublicKeyAlgorithm. In
|
||||
this case alreadyInChain panics.
|
||||
|
||||
Check that the key is non-nil as part of considerCandidate (we are never
|
||||
going to build a chain containing UnknownPublicKeyAlgorithm anyway).
|
||||
|
||||
For #65390
|
||||
Fixes #65392
|
||||
Fixes CVE-2024-24783
|
||||
|
||||
Change-Id: Ibdccc0a487e3368b6812be35daad2512220243f3
|
||||
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/2137282
|
||||
Reviewed-by: Damien Neil <dneil@google.com>
|
||||
Run-TryBot: Roland Shoemaker <bracewell@google.com>
|
||||
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
|
||||
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/2173774
|
||||
Reviewed-by: Roland Shoemaker <bracewell@google.com>
|
||||
Reviewed-by: Carlos Amedee <amedee@google.com>
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/569238
|
||||
Auto-Submit: Michael Knyszek <mknyszek@google.com>
|
||||
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
|
||||
Reviewed-by: Carlos Amedee <carlos@golang.org>
|
||||
|
||||
CVE: CVE-2024-24783
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/be5b52bea674190ef7de272664be6c7ae93ec5a0]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
src/crypto/x509/verify.go | 3 +++
|
||||
src/crypto/x509/verify_test.go | 19 +++++++++++++++++++
|
||||
2 files changed, 22 insertions(+)
|
||||
|
||||
diff --git a/src/crypto/x509/verify.go b/src/crypto/x509/verify.go
|
||||
index 9ef1146..3e95808 100644
|
||||
--- a/src/crypto/x509/verify.go
|
||||
+++ b/src/crypto/x509/verify.go
|
||||
@@ -819,6 +819,9 @@ func (c *Certificate) buildChains(cache map[*Certificate][][]*Certificate, curre
|
||||
)
|
||||
|
||||
considerCandidate := func(certType int, candidate *Certificate) {
|
||||
+ if candidate.PublicKey == nil {
|
||||
+ return
|
||||
+ }
|
||||
for _, cert := range currentChain {
|
||||
if cert.Equal(candidate) {
|
||||
return
|
||||
diff --git a/src/crypto/x509/verify_test.go b/src/crypto/x509/verify_test.go
|
||||
index 9954a67..9da39ca 100644
|
||||
--- a/src/crypto/x509/verify_test.go
|
||||
+++ b/src/crypto/x509/verify_test.go
|
||||
@@ -1968,3 +1968,22 @@ func TestSystemRootsErrorUnwrap(t *testing.T) {
|
||||
t.Error("errors.Is failed, wanted success")
|
||||
}
|
||||
}
|
||||
+
|
||||
+func TestVerifyNilPubKey(t *testing.T) {
|
||||
+ c := &Certificate{
|
||||
+ RawIssuer: []byte{1, 2, 3},
|
||||
+ AuthorityKeyId: []byte{1, 2, 3},
|
||||
+ }
|
||||
+ opts := &VerifyOptions{}
|
||||
+ opts.Roots = NewCertPool()
|
||||
+ r := &Certificate{
|
||||
+ RawSubject: []byte{1, 2, 3},
|
||||
+ SubjectKeyId: []byte{1, 2, 3},
|
||||
+ }
|
||||
+ opts.Roots.AddCert(r)
|
||||
+
|
||||
+ _, err := c.buildChains(nil, []*Certificate{r}, nil, opts)
|
||||
+ if _, ok := err.(UnknownAuthorityError); !ok {
|
||||
+ t.Fatalf("buildChains returned unexpected error, got: %v, want %v", err, UnknownAuthorityError{})
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.50.1
|
||||
|
||||
2484
meta/recipes-devtools/python/python3-idna/CVE-2024-3651.patch
Normal file
2484
meta/recipes-devtools/python/python3-idna/CVE-2024-3651.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE.md;md5=239668a7c6066d9e0c5382e9c8c6c0e1"
|
||||
|
||||
SRC_URI[sha256sum] = "9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"
|
||||
|
||||
SRC_URI += " file://CVE-2024-3651.patch"
|
||||
|
||||
inherit pypi setuptools3
|
||||
|
||||
# Remove bundled egg-info
|
||||
|
||||
@@ -15,7 +15,7 @@ DEPENDS += "python3 glib-2.0"
|
||||
SRCNAME="pygobject"
|
||||
|
||||
SRC_URI = " \
|
||||
http://ftp.gnome.org/pub/GNOME/sources/${SRCNAME}/${@gnome_verdir("${PV}")}/${SRCNAME}-${PV}.tar.xz \
|
||||
${GNOME_MIRROR}/${SRCNAME}/${@gnome_verdir("${PV}")}/${SRCNAME}-${PV}.tar.xz \
|
||||
file://0001-Do-not-build-tests.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "9b12616e32cfc792f9dc841d9c472a41a35b85ba67d3a6eb427e307a6fe4367b"
|
||||
|
||||
@@ -3,7 +3,7 @@ HOMEPAGE = "https://github.com/shazow/urllib3"
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=c2823cb995439c984fd62a973d79815c"
|
||||
|
||||
SRC_URI[sha256sum] = "f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0"
|
||||
SRC_URI[sha256sum] = "40c2dc0c681e47eb8f90e7e27bf6ff7df2e677421fd46756da1161c39ca70d32"
|
||||
|
||||
inherit pypi setuptools3
|
||||
|
||||
364
meta/recipes-devtools/python/python3/CVE-2025-6075.patch
Normal file
364
meta/recipes-devtools/python/python3/CVE-2025-6075.patch
Normal file
@@ -0,0 +1,364 @@
|
||||
From 892747b4cf0f95ba8beb51c0d0658bfaa381ebca Mon Sep 17 00:00:00 2001
|
||||
From: Łukasz Langa <lukasz@langa.pl>
|
||||
Date: Fri, 31 Oct 2025 17:51:32 +0100
|
||||
Subject: [PATCH] gh-136065: Fix quadratic complexity in os.path.expandvars()
|
||||
(GH-134952) (GH-140851)
|
||||
|
||||
(cherry picked from commit f029e8db626ddc6e3a3beea4eff511a71aaceb5c)
|
||||
|
||||
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
||||
|
||||
CVE: CVE-2025-6075
|
||||
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/892747b4cf0f95ba8beb51c0d0658bfaa381ebca]
|
||||
|
||||
Signed-off-by: Praveen Kumar <praveen.kumar@windriver.com>
|
||||
---
|
||||
Lib/ntpath.py | 126 ++++++------------
|
||||
Lib/posixpath.py | 43 +++---
|
||||
Lib/test/test_genericpath.py | 14 ++
|
||||
Lib/test/test_ntpath.py | 20 ++-
|
||||
...-05-30-22-33-27.gh-issue-136065.bu337o.rst | 1 +
|
||||
5 files changed, 93 insertions(+), 111 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Security/2025-05-30-22-33-27.gh-issue-136065.bu337o.rst
|
||||
|
||||
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
|
||||
index 9b0cca4..bd2b4e2 100644
|
||||
--- a/Lib/ntpath.py
|
||||
+++ b/Lib/ntpath.py
|
||||
@@ -374,17 +374,23 @@ def expanduser(path):
|
||||
# XXX With COMMAND.COM you can use any characters in a variable name,
|
||||
# XXX except '^|<>='.
|
||||
|
||||
+_varpattern = r"'[^']*'?|%(%|[^%]*%?)|\$(\$|[-\w]+|\{[^}]*\}?)"
|
||||
+_varsub = None
|
||||
+_varsubb = None
|
||||
+
|
||||
def expandvars(path):
|
||||
"""Expand shell variables of the forms $var, ${var} and %var%.
|
||||
|
||||
Unknown variables are left unchanged."""
|
||||
path = os.fspath(path)
|
||||
+ global _varsub, _varsubb
|
||||
if isinstance(path, bytes):
|
||||
if b'$' not in path and b'%' not in path:
|
||||
return path
|
||||
- import string
|
||||
- varchars = bytes(string.ascii_letters + string.digits + '_-', 'ascii')
|
||||
- quote = b'\''
|
||||
+ if not _varsubb:
|
||||
+ import re
|
||||
+ _varsubb = re.compile(_varpattern.encode(), re.ASCII).sub
|
||||
+ sub = _varsubb
|
||||
percent = b'%'
|
||||
brace = b'{'
|
||||
rbrace = b'}'
|
||||
@@ -393,94 +399,44 @@ def expandvars(path):
|
||||
else:
|
||||
if '$' not in path and '%' not in path:
|
||||
return path
|
||||
- import string
|
||||
- varchars = string.ascii_letters + string.digits + '_-'
|
||||
- quote = '\''
|
||||
+ if not _varsub:
|
||||
+ import re
|
||||
+ _varsub = re.compile(_varpattern, re.ASCII).sub
|
||||
+ sub = _varsub
|
||||
percent = '%'
|
||||
brace = '{'
|
||||
rbrace = '}'
|
||||
dollar = '$'
|
||||
environ = os.environ
|
||||
- res = path[:0]
|
||||
- index = 0
|
||||
- pathlen = len(path)
|
||||
- while index < pathlen:
|
||||
- c = path[index:index+1]
|
||||
- if c == quote: # no expansion within single quotes
|
||||
- path = path[index + 1:]
|
||||
- pathlen = len(path)
|
||||
- try:
|
||||
- index = path.index(c)
|
||||
- res += c + path[:index + 1]
|
||||
- except ValueError:
|
||||
- res += c + path
|
||||
- index = pathlen - 1
|
||||
- elif c == percent: # variable or '%'
|
||||
- if path[index + 1:index + 2] == percent:
|
||||
- res += c
|
||||
- index += 1
|
||||
- else:
|
||||
- path = path[index+1:]
|
||||
- pathlen = len(path)
|
||||
- try:
|
||||
- index = path.index(percent)
|
||||
- except ValueError:
|
||||
- res += percent + path
|
||||
- index = pathlen - 1
|
||||
- else:
|
||||
- var = path[:index]
|
||||
- try:
|
||||
- if environ is None:
|
||||
- value = os.fsencode(os.environ[os.fsdecode(var)])
|
||||
- else:
|
||||
- value = environ[var]
|
||||
- except KeyError:
|
||||
- value = percent + var + percent
|
||||
- res += value
|
||||
- elif c == dollar: # variable or '$$'
|
||||
- if path[index + 1:index + 2] == dollar:
|
||||
- res += c
|
||||
- index += 1
|
||||
- elif path[index + 1:index + 2] == brace:
|
||||
- path = path[index+2:]
|
||||
- pathlen = len(path)
|
||||
- try:
|
||||
- index = path.index(rbrace)
|
||||
- except ValueError:
|
||||
- res += dollar + brace + path
|
||||
- index = pathlen - 1
|
||||
- else:
|
||||
- var = path[:index]
|
||||
- try:
|
||||
- if environ is None:
|
||||
- value = os.fsencode(os.environ[os.fsdecode(var)])
|
||||
- else:
|
||||
- value = environ[var]
|
||||
- except KeyError:
|
||||
- value = dollar + brace + var + rbrace
|
||||
- res += value
|
||||
- else:
|
||||
- var = path[:0]
|
||||
- index += 1
|
||||
- c = path[index:index + 1]
|
||||
- while c and c in varchars:
|
||||
- var += c
|
||||
- index += 1
|
||||
- c = path[index:index + 1]
|
||||
- try:
|
||||
- if environ is None:
|
||||
- value = os.fsencode(os.environ[os.fsdecode(var)])
|
||||
- else:
|
||||
- value = environ[var]
|
||||
- except KeyError:
|
||||
- value = dollar + var
|
||||
- res += value
|
||||
- if c:
|
||||
- index -= 1
|
||||
+
|
||||
+ def repl(m):
|
||||
+ lastindex = m.lastindex
|
||||
+ if lastindex is None:
|
||||
+ return m[0]
|
||||
+ name = m[lastindex]
|
||||
+ if lastindex == 1:
|
||||
+ if name == percent:
|
||||
+ return name
|
||||
+ if not name.endswith(percent):
|
||||
+ return m[0]
|
||||
+ name = name[:-1]
|
||||
else:
|
||||
- res += c
|
||||
- index += 1
|
||||
- return res
|
||||
+ if name == dollar:
|
||||
+ return name
|
||||
+ if name.startswith(brace):
|
||||
+ if not name.endswith(rbrace):
|
||||
+ return m[0]
|
||||
+ name = name[1:-1]
|
||||
+
|
||||
+ try:
|
||||
+ if environ is None:
|
||||
+ return os.fsencode(os.environ[os.fsdecode(name)])
|
||||
+ else:
|
||||
+ return environ[name]
|
||||
+ except KeyError:
|
||||
+ return m[0]
|
||||
+
|
||||
+ return sub(repl, path)
|
||||
|
||||
|
||||
# Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A\B.
|
||||
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
|
||||
index b8dd563..75020ee 100644
|
||||
--- a/Lib/posixpath.py
|
||||
+++ b/Lib/posixpath.py
|
||||
@@ -279,42 +279,41 @@ def expanduser(path):
|
||||
# This expands the forms $variable and ${variable} only.
|
||||
# Non-existent variables are left unchanged.
|
||||
|
||||
-_varprog = None
|
||||
-_varprogb = None
|
||||
+_varpattern = r'\$(\w+|\{[^}]*\}?)'
|
||||
+_varsub = None
|
||||
+_varsubb = None
|
||||
|
||||
def expandvars(path):
|
||||
"""Expand shell variables of form $var and ${var}. Unknown variables
|
||||
are left unchanged."""
|
||||
path = os.fspath(path)
|
||||
- global _varprog, _varprogb
|
||||
+ global _varsub, _varsubb
|
||||
if isinstance(path, bytes):
|
||||
if b'$' not in path:
|
||||
return path
|
||||
- if not _varprogb:
|
||||
+ if not _varsubb:
|
||||
import re
|
||||
- _varprogb = re.compile(br'\$(\w+|\{[^}]*\})', re.ASCII)
|
||||
- search = _varprogb.search
|
||||
+ _varsubb = re.compile(_varpattern.encode(), re.ASCII).sub
|
||||
+ sub = _varsubb
|
||||
start = b'{'
|
||||
end = b'}'
|
||||
environ = getattr(os, 'environb', None)
|
||||
else:
|
||||
if '$' not in path:
|
||||
return path
|
||||
- if not _varprog:
|
||||
+ if not _varsub:
|
||||
import re
|
||||
- _varprog = re.compile(r'\$(\w+|\{[^}]*\})', re.ASCII)
|
||||
- search = _varprog.search
|
||||
+ _varsub = re.compile(_varpattern, re.ASCII).sub
|
||||
+ sub = _varsub
|
||||
start = '{'
|
||||
end = '}'
|
||||
environ = os.environ
|
||||
- i = 0
|
||||
- while True:
|
||||
- m = search(path, i)
|
||||
- if not m:
|
||||
- break
|
||||
- i, j = m.span(0)
|
||||
- name = m.group(1)
|
||||
- if name.startswith(start) and name.endswith(end):
|
||||
+
|
||||
+ def repl(m):
|
||||
+ name = m[1]
|
||||
+ if name.startswith(start):
|
||||
+ if not name.endswith(end):
|
||||
+ return m[0]
|
||||
name = name[1:-1]
|
||||
try:
|
||||
if environ is None:
|
||||
@@ -322,13 +321,11 @@ def expandvars(path):
|
||||
else:
|
||||
value = environ[name]
|
||||
except KeyError:
|
||||
- i = j
|
||||
+ return m[0]
|
||||
else:
|
||||
- tail = path[j:]
|
||||
- path = path[:i] + value
|
||||
- i = len(path)
|
||||
- path += tail
|
||||
- return path
|
||||
+ return value
|
||||
+
|
||||
+ return sub(repl, path)
|
||||
|
||||
|
||||
# Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B.
|
||||
diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py
|
||||
index 1ff7f75..b0a1326 100644
|
||||
--- a/Lib/test/test_genericpath.py
|
||||
+++ b/Lib/test/test_genericpath.py
|
||||
@@ -7,6 +7,7 @@ import os
|
||||
import sys
|
||||
import unittest
|
||||
import warnings
|
||||
+from test import support
|
||||
from test.support import os_helper
|
||||
from test.support import warnings_helper
|
||||
from test.support.script_helper import assert_python_ok
|
||||
@@ -430,6 +431,19 @@ class CommonTest(GenericTest):
|
||||
os.fsencode('$bar%s bar' % nonascii))
|
||||
check(b'$spam}bar', os.fsencode('%s}bar' % nonascii))
|
||||
|
||||
+ @support.requires_resource('cpu')
|
||||
+ def test_expandvars_large(self):
|
||||
+ expandvars = self.pathmodule.expandvars
|
||||
+ with os_helper.EnvironmentVarGuard() as env:
|
||||
+ env.clear()
|
||||
+ env["A"] = "B"
|
||||
+ n = 100_000
|
||||
+ self.assertEqual(expandvars('$A'*n), 'B'*n)
|
||||
+ self.assertEqual(expandvars('${A}'*n), 'B'*n)
|
||||
+ self.assertEqual(expandvars('$A!'*n), 'B!'*n)
|
||||
+ self.assertEqual(expandvars('${A}A'*n), 'BA'*n)
|
||||
+ self.assertEqual(expandvars('${'*10*n), '${'*10*n)
|
||||
+
|
||||
def test_abspath(self):
|
||||
self.assertIn("foo", self.pathmodule.abspath("foo"))
|
||||
with warnings.catch_warnings():
|
||||
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
|
||||
index f790f77..161e57d 100644
|
||||
--- a/Lib/test/test_ntpath.py
|
||||
+++ b/Lib/test/test_ntpath.py
|
||||
@@ -5,8 +5,8 @@ import sys
|
||||
import unittest
|
||||
import warnings
|
||||
from ntpath import ALLOW_MISSING
|
||||
+from test import support
|
||||
from test.support import os_helper
|
||||
-from test.support import TestFailed
|
||||
from test.support.os_helper import FakePath
|
||||
from test import test_genericpath
|
||||
from tempfile import TemporaryFile
|
||||
@@ -56,7 +56,7 @@ def tester(fn, wantResult):
|
||||
fn = fn.replace("\\", "\\\\")
|
||||
gotResult = eval(fn)
|
||||
if wantResult != gotResult and _norm(wantResult) != _norm(gotResult):
|
||||
- raise TestFailed("%s should return: %s but returned: %s" \
|
||||
+ raise support.TestFailed("%s should return: %s but returned: %s" \
|
||||
%(str(fn), str(wantResult), str(gotResult)))
|
||||
|
||||
# then with bytes
|
||||
@@ -72,7 +72,7 @@ def tester(fn, wantResult):
|
||||
warnings.simplefilter("ignore", DeprecationWarning)
|
||||
gotResult = eval(fn)
|
||||
if _norm(wantResult) != _norm(gotResult):
|
||||
- raise TestFailed("%s should return: %s but returned: %s" \
|
||||
+ raise support.TestFailed("%s should return: %s but returned: %s" \
|
||||
%(str(fn), str(wantResult), repr(gotResult)))
|
||||
|
||||
|
||||
@@ -689,6 +689,19 @@ class TestNtpath(NtpathTestCase):
|
||||
check('%spam%bar', '%sbar' % nonascii)
|
||||
check('%{}%bar'.format(nonascii), 'ham%sbar' % nonascii)
|
||||
|
||||
+ @support.requires_resource('cpu')
|
||||
+ def test_expandvars_large(self):
|
||||
+ expandvars = ntpath.expandvars
|
||||
+ with os_helper.EnvironmentVarGuard() as env:
|
||||
+ env.clear()
|
||||
+ env["A"] = "B"
|
||||
+ n = 100_000
|
||||
+ self.assertEqual(expandvars('%A%'*n), 'B'*n)
|
||||
+ self.assertEqual(expandvars('%A%A'*n), 'BA'*n)
|
||||
+ self.assertEqual(expandvars("''"*n + '%%'), "''"*n + '%')
|
||||
+ self.assertEqual(expandvars("%%"*n), "%"*n)
|
||||
+ self.assertEqual(expandvars("$$"*n), "$"*n)
|
||||
+
|
||||
def test_expanduser(self):
|
||||
tester('ntpath.expanduser("test")', 'test')
|
||||
|
||||
@@ -923,6 +936,7 @@ class TestNtpath(NtpathTestCase):
|
||||
self.assertIsInstance(b_final_path, bytes)
|
||||
self.assertGreater(len(b_final_path), 0)
|
||||
|
||||
+
|
||||
class NtCommonTest(test_genericpath.CommonTest, unittest.TestCase):
|
||||
pathmodule = ntpath
|
||||
attributes = ['relpath']
|
||||
diff --git a/Misc/NEWS.d/next/Security/2025-05-30-22-33-27.gh-issue-136065.bu337o.rst b/Misc/NEWS.d/next/Security/2025-05-30-22-33-27.gh-issue-136065.bu337o.rst
|
||||
new file mode 100644
|
||||
index 0000000..1d152bb
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Security/2025-05-30-22-33-27.gh-issue-136065.bu337o.rst
|
||||
@@ -0,0 +1 @@
|
||||
+Fix quadratic complexity in :func:`os.path.expandvars`.
|
||||
--
|
||||
2.40.0
|
||||
@@ -37,6 +37,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
|
||||
file://0001-Avoid-shebang-overflow-on-python-config.py.patch \
|
||||
file://0001-test_storlines-skip-due-to-load-variability.patch \
|
||||
file://0001-gh-107811-tarfile-treat-overflow-in-UID-GID-as-failu.patch \
|
||||
file://CVE-2025-6075.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:class-native = " \
|
||||
|
||||
112
meta/recipes-devtools/ruby/ruby/CVE-2024-35176.patch
Normal file
112
meta/recipes-devtools/ruby/ruby/CVE-2024-35176.patch
Normal file
@@ -0,0 +1,112 @@
|
||||
From 4325835f92f3f142ebd91a3fdba4e1f1ab7f1cfb Mon Sep 17 00:00:00 2001
|
||||
From: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Date: Thu, 16 May 2024 11:26:51 +0900
|
||||
Subject: [PATCH] Read quoted attributes in chunks (#126)
|
||||
|
||||
CVE: CVE-2024-35176
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/4325835f92f3f142ebd91a3fdba4e1f1ab7f1cfb]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.../lib/rexml/parsers/baseparser.rb | 20 ++++++-------
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/source.rb | 29 +++++++++++++++----
|
||||
2 files changed, 34 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index b97beb3..eab942d 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -675,17 +675,17 @@ module REXML
|
||||
message = "Missing attribute equal: <#{name}>"
|
||||
raise REXML::ParseException.new(message, @source)
|
||||
end
|
||||
- unless match = @source.match(/(['"])(.*?)\1\s*/um, true)
|
||||
- if match = @source.match(/(['"])/, true)
|
||||
- message =
|
||||
- "Missing attribute value end quote: <#{name}>: <#{match[1]}>"
|
||||
- raise REXML::ParseException.new(message, @source)
|
||||
- else
|
||||
- message = "Missing attribute value start quote: <#{name}>"
|
||||
- raise REXML::ParseException.new(message, @source)
|
||||
- end
|
||||
+ unless match = @source.match(/(['"])/, true)
|
||||
+ message = "Missing attribute value start quote: <#{name}>"
|
||||
+ raise REXML::ParseException.new(message, @source)
|
||||
+ end
|
||||
+ quote = match[1]
|
||||
+ value = @source.read_until(quote)
|
||||
+ unless value.chomp!(quote)
|
||||
+ message = "Missing attribute value end quote: <#{name}>: <#{quote}>"
|
||||
+ raise REXML::ParseException.new(message, @source)
|
||||
end
|
||||
- value = match[2]
|
||||
+ @source.match(/\s*/um, true)
|
||||
if prefix == "xmlns"
|
||||
if local_part == "xml"
|
||||
if value != "http://www.w3.org/XML/1998/namespace"
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
index 4111d1d..7132147 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
@@ -65,7 +65,11 @@ module REXML
|
||||
encoding_updated
|
||||
end
|
||||
|
||||
- def read
|
||||
+ def read(term = nil)
|
||||
+ end
|
||||
+
|
||||
+ def read_until(term)
|
||||
+ @scanner.scan_until(Regexp.union(term)) or @scanner.rest
|
||||
end
|
||||
|
||||
def match(pattern, cons=false)
|
||||
@@ -151,9 +155,9 @@ module REXML
|
||||
end
|
||||
end
|
||||
|
||||
- def read
|
||||
+ def read(term = nil)
|
||||
begin
|
||||
- @scanner << readline
|
||||
+ @scanner << readline(term)
|
||||
true
|
||||
rescue Exception, NameError
|
||||
@source = nil
|
||||
@@ -161,6 +165,21 @@ module REXML
|
||||
end
|
||||
end
|
||||
|
||||
+ def read_until(term)
|
||||
+ pattern = Regexp.union(term)
|
||||
+ data = []
|
||||
+ begin
|
||||
+ until str = @scanner.scan_until(pattern)
|
||||
+ @scanner << readline(term)
|
||||
+ end
|
||||
+ rescue EOFError
|
||||
+ @scanner.rest
|
||||
+ else
|
||||
+ read if @scanner.eos? and !@source.eof?
|
||||
+ str
|
||||
+ end
|
||||
+ end
|
||||
+
|
||||
def match( pattern, cons=false )
|
||||
read if @scanner.eos? && @source
|
||||
while true
|
||||
@@ -205,8 +224,8 @@ module REXML
|
||||
end
|
||||
|
||||
private
|
||||
- def readline
|
||||
- str = @source.readline(@line_break)
|
||||
+ def readline(term = nil)
|
||||
+ str = @source.readline(term || @line_break)
|
||||
if @pending_buffer
|
||||
if str.nil?
|
||||
str = @pending_buffer
|
||||
--
|
||||
2.40.0
|
||||
|
||||
46
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0001.patch
Normal file
46
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0001.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
From f1df7d13b3e57a5e059273d2f0870163c08d7420 Mon Sep 17 00:00:00 2001
|
||||
From: Sutou Kouhei <kou@clear-code.com>
|
||||
Date: Mon, 20 May 2024 12:17:27 +0900
|
||||
Subject: [PATCH] Add support for old strscan
|
||||
|
||||
Fix GH-132
|
||||
|
||||
If we support old strscan, users can also use strscan installed as a
|
||||
default gem.
|
||||
|
||||
Reported by Adam. Thanks!!!
|
||||
|
||||
CVE: CVE-2024-39908
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/f1df7d13b3e57a5e059273d2f0870163c08d7420]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.../gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index eab942d..8ea8b43 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -7,6 +7,17 @@ require "strscan"
|
||||
|
||||
module REXML
|
||||
module Parsers
|
||||
+ if StringScanner::Version < "3.0.8"
|
||||
+ module StringScannerCaptures
|
||||
+ refine StringScanner do
|
||||
+ def captures
|
||||
+ values_at(*(1...size))
|
||||
+ end
|
||||
+ end
|
||||
+ end
|
||||
+ using StringScannerCaptures
|
||||
+ end
|
||||
+
|
||||
# = Using the Pull Parser
|
||||
# <em>This API is experimental, and subject to change.</em>
|
||||
# parser = PullParser.new( "<a>text<b att='val'/>txet</a>" )
|
||||
--
|
||||
2.40.0
|
||||
|
||||
130
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0002.patch
Normal file
130
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0002.patch
Normal file
@@ -0,0 +1,130 @@
|
||||
From d146162e9a61574499d10428bc0065754cd26601 Mon Sep 17 00:00:00 2001
|
||||
From: NAITOH Jun <naitoh@gmail.com>
|
||||
Date: Mon, 4 Mar 2024 05:24:53 +0900
|
||||
Subject: [PATCH] Remove `Source#string=` method (#117)
|
||||
|
||||
We want to just change scan pointer.
|
||||
|
||||
https://github.com/ruby/rexml/pull/114#discussion_r1501773803
|
||||
> I want to just change scan pointer (`StringScanner#pos=`) instead of
|
||||
changing `@scanner.string`.
|
||||
|
||||
CVE: CVE-2024-39908
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/d146162e9a61574499d10428bc0065754cd26601]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.../lib/rexml/parsers/baseparser.rb | 19 +++++++++++--------
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/source.rb | 8 ++++++--
|
||||
2 files changed, 17 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index 8ea8b43..81415a8 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -231,8 +231,9 @@ module REXML
|
||||
#STDERR.puts @source.encoding
|
||||
#STDERR.puts "BUFFER = #{@source.buffer.inspect}"
|
||||
if @document_status == nil
|
||||
+ start_position = @source.position
|
||||
if @source.match("<?", true)
|
||||
- return process_instruction
|
||||
+ return process_instruction(start_position)
|
||||
elsif @source.match("<!", true)
|
||||
if @source.match("--", true)
|
||||
return [ :comment, @source.match(/(.*?)-->/um, true)[1] ]
|
||||
@@ -244,7 +245,7 @@ module REXML
|
||||
else
|
||||
message = "#{base_error_message}: invalid name"
|
||||
end
|
||||
- @source.string = "<!DOCTYPE" + @source.buffer
|
||||
+ @source.position = start_position
|
||||
raise REXML::ParseException.new(message, @source)
|
||||
end
|
||||
name = parse_name(base_error_message)
|
||||
@@ -285,6 +286,7 @@ module REXML
|
||||
end
|
||||
if @document_status == :in_doctype
|
||||
@source.match(/\s*/um, true) # skip spaces
|
||||
+ start_position = @source.position
|
||||
if @source.match("<!", true)
|
||||
if @source.match("ELEMENT", true)
|
||||
md = @source.match(/(.*?)>/um, true)
|
||||
@@ -344,7 +346,7 @@ module REXML
|
||||
else
|
||||
message = "#{base_error_message}: invalid name"
|
||||
end
|
||||
- @source.string = " <!NOTATION" + @source.buffer
|
||||
+ @source.position = start_position
|
||||
raise REXML::ParseException.new(message, @source)
|
||||
end
|
||||
name = parse_name(base_error_message)
|
||||
@@ -374,6 +376,7 @@ module REXML
|
||||
@source.match(/\s*/um, true)
|
||||
end
|
||||
begin
|
||||
+ start_position = @source.position
|
||||
if @source.match("<", true)
|
||||
if @source.match("/", true)
|
||||
@namespaces_restore_stack.pop
|
||||
@@ -386,7 +389,7 @@ module REXML
|
||||
if md.nil? or last_tag != md[1]
|
||||
message = "Missing end tag for '#{last_tag}'"
|
||||
message += " (got '#{md[1]}')" if md
|
||||
- @source.string = "</" + @source.buffer if md.nil?
|
||||
+ @source.position = start_position if md.nil?
|
||||
raise REXML::ParseException.new(message, @source)
|
||||
end
|
||||
return [ :end_element, last_tag ]
|
||||
@@ -410,12 +413,12 @@ module REXML
|
||||
raise REXML::ParseException.new( "Declarations can only occur "+
|
||||
"in the doctype declaration.", @source)
|
||||
elsif @source.match("?", true)
|
||||
- return process_instruction
|
||||
+ return process_instruction(start_position)
|
||||
else
|
||||
# Get the next tag
|
||||
md = @source.match(TAG_PATTERN, true)
|
||||
unless md
|
||||
- @source.string = "<" + @source.buffer
|
||||
+ @source.position = start_position
|
||||
raise REXML::ParseException.new("malformed XML: missing tag start", @source)
|
||||
end
|
||||
tag = md[1]
|
||||
@@ -641,11 +644,11 @@ module REXML
|
||||
end
|
||||
end
|
||||
|
||||
- def process_instruction
|
||||
+ def process_instruction(start_position)
|
||||
match_data = @source.match(INSTRUCTION_END, true)
|
||||
unless match_data
|
||||
message = "Invalid processing instruction node"
|
||||
- @source.string = "<?" + @source.buffer
|
||||
+ @source.position = start_position
|
||||
raise REXML::ParseException.new(message, @source)
|
||||
end
|
||||
if @document_status.nil? and match_data[1] == "xml"
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
index 7132147..b20cc4f 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
@@ -80,8 +80,12 @@ module REXML
|
||||
end
|
||||
end
|
||||
|
||||
- def string=(string)
|
||||
- @scanner.string = string
|
||||
+ def position
|
||||
+ @scanner.pos
|
||||
+ end
|
||||
+
|
||||
+ def position=(pos)
|
||||
+ @scanner.pos = pos
|
||||
end
|
||||
|
||||
# @return true if the Source is exhausted
|
||||
--
|
||||
2.40.0
|
||||
|
||||
46
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0003.patch
Normal file
46
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0003.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
From b5bf109a599ea733663150e99c09eb44046b41dd Mon Sep 17 00:00:00 2001
|
||||
From: Hiroya Fujinami <make.just.on@gmail.com>
|
||||
Date: Thu, 13 Jun 2024 15:12:32 +0900
|
||||
Subject: [PATCH] Add a "malformed comment" check for top-level comments (#145)
|
||||
|
||||
This check was missing. Therefore, `REXML::Document.new("<!--")` raised
|
||||
the ``undefined method `[]' for nil`` error, for example.
|
||||
|
||||
This PR also adds tests for "malformed comment" checks.
|
||||
|
||||
---------
|
||||
|
||||
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
|
||||
|
||||
CVE: CVE-2024-39908
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/b5bf109a599ea733663150e99c09eb44046b41dd]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index 81415a8..49c313c 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -236,7 +236,14 @@ module REXML
|
||||
return process_instruction(start_position)
|
||||
elsif @source.match("<!", true)
|
||||
if @source.match("--", true)
|
||||
- return [ :comment, @source.match(/(.*?)-->/um, true)[1] ]
|
||||
+ md = @source.match(/(.*?)-->/um, true)
|
||||
+ if md.nil?
|
||||
+ raise REXML::ParseException.new("Unclosed comment", @source)
|
||||
+ end
|
||||
+ if /--|-\z/.match?(md[1])
|
||||
+ raise REXML::ParseException.new("Malformed comment", @source)
|
||||
+ end
|
||||
+ return [ :comment, md[1] ]
|
||||
elsif @source.match("DOCTYPE", true)
|
||||
base_error_message = "Malformed DOCTYPE"
|
||||
unless @source.match(/\s+/um, true)
|
||||
--
|
||||
2.40.0
|
||||
|
||||
76
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0004.patch
Normal file
76
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0004.patch
Normal file
@@ -0,0 +1,76 @@
|
||||
From b8a5f4cd5c8fe29c65d7a00e67170223d9d2b50e Mon Sep 17 00:00:00 2001
|
||||
From: Watson <watson1978@gmail.com>
|
||||
Date: Tue, 16 Jul 2024 10:48:53 +0900
|
||||
Subject: [PATCH] Fix performance issue caused by using repeated `>` characters
|
||||
inside `<?xml` (#170)
|
||||
|
||||
A `<` is treated as a string delimiter.
|
||||
In certain cases, if `<` is used in succession, read and match are
|
||||
repeated, which slows down the process. Therefore, the following is used
|
||||
to read ahead to a specific part of the string in advance.
|
||||
|
||||
CVE: CVE-2024-39908
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/b8a5f4cd5c8fe29c65d7a00e67170223d9d2b50e]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb | 3 ++-
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/source.rb | 6 +++---
|
||||
2 files changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index 49c313c..767e134 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -125,6 +125,7 @@ module REXML
|
||||
|
||||
module Private
|
||||
INSTRUCTION_END = /#{NAME}(\s+.*?)?\?>/um
|
||||
+ INSTRUCTION_TERM = "?>"
|
||||
TAG_PATTERN = /((?>#{QNAME_STR}))\s*/um
|
||||
CLOSE_PATTERN = /(#{QNAME_STR})\s*>/um
|
||||
ATTLISTDECL_END = /\s+#{NAME}(?:#{ATTDEF})*\s*>/um
|
||||
@@ -652,7 +653,7 @@ module REXML
|
||||
end
|
||||
|
||||
def process_instruction(start_position)
|
||||
- match_data = @source.match(INSTRUCTION_END, true)
|
||||
+ match_data = @source.match(Private::INSTRUCTION_END, true, term: Private::INSTRUCTION_TERM)
|
||||
unless match_data
|
||||
message = "Invalid processing instruction node"
|
||||
@source.position = start_position
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
index b20cc4f..08a035c 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
@@ -72,7 +72,7 @@ module REXML
|
||||
@scanner.scan_until(Regexp.union(term)) or @scanner.rest
|
||||
end
|
||||
|
||||
- def match(pattern, cons=false)
|
||||
+ def match(pattern, cons=false, term: nil)
|
||||
if cons
|
||||
@scanner.scan(pattern).nil? ? nil : @scanner
|
||||
else
|
||||
@@ -184,7 +184,7 @@ module REXML
|
||||
end
|
||||
end
|
||||
|
||||
- def match( pattern, cons=false )
|
||||
+ def match( pattern, cons=false, term: nil )
|
||||
read if @scanner.eos? && @source
|
||||
while true
|
||||
if cons
|
||||
@@ -195,7 +195,7 @@ module REXML
|
||||
break if md
|
||||
return nil if pattern.is_a?(String) && pattern.bytesize <= @scanner.rest_size
|
||||
return nil if @source.nil?
|
||||
- return nil unless read
|
||||
+ return nil unless read(term)
|
||||
end
|
||||
|
||||
md.nil? ? nil : @scanner
|
||||
--
|
||||
2.40.0
|
||||
|
||||
87
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0005.patch
Normal file
87
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0005.patch
Normal file
@@ -0,0 +1,87 @@
|
||||
From 0af55fa49d4c9369f90f239a9571edab800ed36e Mon Sep 17 00:00:00 2001
|
||||
From: Watson <watson1978@gmail.com>
|
||||
Date: Tue, 16 Jul 2024 10:57:39 +0900
|
||||
Subject: [PATCH] Fix ReDoS caused by very large character references using
|
||||
repeated 0s (#169)
|
||||
|
||||
This patch will fix the ReDoS that is caused by large string of 0s on a
|
||||
character reference (like `�...`).
|
||||
|
||||
This is occurred in Ruby 3.1 or earlier.
|
||||
|
||||
CVE: CVE-2024-39908
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/0af55fa49d4c9369f90f239a9571edab800ed36e]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/text.rb | 48 +++++++++++++++-------
|
||||
1 file changed, 34 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/text.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/text.rb
|
||||
index 050b09c..0957d70 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/text.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/text.rb
|
||||
@@ -151,25 +151,45 @@ module REXML
|
||||
end
|
||||
end
|
||||
|
||||
- # context sensitive
|
||||
- string.scan(pattern) do
|
||||
- if $1[-1] != ?;
|
||||
- raise "Illegal character #{$1.inspect} in raw string #{string.inspect}"
|
||||
- elsif $1[0] == ?&
|
||||
- if $5 and $5[0] == ?#
|
||||
- case ($5[1] == ?x ? $5[2..-1].to_i(16) : $5[1..-1].to_i)
|
||||
- when *VALID_CHAR
|
||||
+ pos = 0
|
||||
+ while (index = string.index(/<|&/, pos))
|
||||
+ if string[index] == "<"
|
||||
+ raise "Illegal character \"#{string[index]}\" in raw string #{string.inspect}"
|
||||
+ end
|
||||
+
|
||||
+ unless (end_index = string.index(/[^\s];/, index + 1))
|
||||
+ raise "Illegal character \"#{string[index]}\" in raw string #{string.inspect}"
|
||||
+ end
|
||||
+
|
||||
+ value = string[(index + 1)..end_index]
|
||||
+ if /\s/.match?(value)
|
||||
+ raise "Illegal character \"#{string[index]}\" in raw string #{string.inspect}"
|
||||
+ end
|
||||
+
|
||||
+ if value[0] == "#"
|
||||
+ character_reference = value[1..-1]
|
||||
+
|
||||
+ unless (/\A(\d+|x[0-9a-fA-F]+)\z/.match?(character_reference))
|
||||
+ if character_reference[0] == "x" || character_reference[-1] == "x"
|
||||
+ raise "Illegal character \"#{string[index]}\" in raw string #{string.inspect}"
|
||||
else
|
||||
- raise "Illegal character #{$1.inspect} in raw string #{string.inspect}"
|
||||
+ raise "Illegal character #{string.inspect} in raw string #{string.inspect}"
|
||||
end
|
||||
- # FIXME: below can't work but this needs API change.
|
||||
- # elsif @parent and $3 and !SUBSTITUTES.include?($1)
|
||||
- # if !doctype or !doctype.entities.has_key?($3)
|
||||
- # raise "Undeclared entity '#{$1}' in raw string \"#{string}\""
|
||||
- # end
|
||||
end
|
||||
+
|
||||
+ case (character_reference[0] == "x" ? character_reference[1..-1].to_i(16) : character_reference[0..-1].to_i)
|
||||
+ when *VALID_CHAR
|
||||
+ else
|
||||
+ raise "Illegal character #{string.inspect} in raw string #{string.inspect}"
|
||||
+ end
|
||||
+ elsif !(/\A#{Entity::NAME}\z/um.match?(value))
|
||||
+ raise "Illegal character \"#{string[index]}\" in raw string #{string.inspect}"
|
||||
end
|
||||
+
|
||||
+ pos = end_index + 1
|
||||
end
|
||||
+
|
||||
+ string
|
||||
end
|
||||
|
||||
def node_type
|
||||
--
|
||||
2.40.0
|
||||
|
||||
44
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0006.patch
Normal file
44
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0006.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
From c1b64c174ec2e8ca2174c51332670e3be30c865f Mon Sep 17 00:00:00 2001
|
||||
From: Watson <watson1978@gmail.com>
|
||||
Date: Tue, 16 Jul 2024 10:57:50 +0900
|
||||
Subject: [PATCH] Fix performance issue caused by using repeated `>` characters
|
||||
inside comments (#171)
|
||||
|
||||
A `<` is treated as a string delimiter.
|
||||
In certain cases, if `<` is used in succession, read and match are
|
||||
repeated, which slows down the process. Therefore, the following is used
|
||||
to read ahead to a specific part of the string in advance.
|
||||
|
||||
CVE: CVE-2024-39908
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/c1b64c174ec2e8ca2174c51332670e3be30c865f]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index 767e134..81753ad 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -126,6 +126,7 @@ module REXML
|
||||
module Private
|
||||
INSTRUCTION_END = /#{NAME}(\s+.*?)?\?>/um
|
||||
INSTRUCTION_TERM = "?>"
|
||||
+ COMMENT_TERM = "-->"
|
||||
TAG_PATTERN = /((?>#{QNAME_STR}))\s*/um
|
||||
CLOSE_PATTERN = /(#{QNAME_STR})\s*>/um
|
||||
ATTLISTDECL_END = /\s+#{NAME}(?:#{ATTDEF})*\s*>/um
|
||||
@@ -237,7 +238,7 @@ module REXML
|
||||
return process_instruction(start_position)
|
||||
elsif @source.match("<!", true)
|
||||
if @source.match("--", true)
|
||||
- md = @source.match(/(.*?)-->/um, true)
|
||||
+ md = @source.match(/(.*?)-->/um, true, term: Private::COMMENT_TERM)
|
||||
if md.nil?
|
||||
raise REXML::ParseException.new("Unclosed comment", @source)
|
||||
end
|
||||
--
|
||||
2.40.0
|
||||
|
||||
44
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0007.patch
Normal file
44
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0007.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
From 9f1415a2616c77cad44a176eee90e8457b4774b6 Mon Sep 17 00:00:00 2001
|
||||
From: Watson <watson1978@gmail.com>
|
||||
Date: Tue, 16 Jul 2024 11:04:40 +0900
|
||||
Subject: [PATCH] Fix performance issue caused by using repeated `>` characters
|
||||
inside `CDATA [ PAYLOAD ]` (#172)
|
||||
|
||||
A `<` is treated as a string delimiter.
|
||||
In certain cases, if `<` is used in succession, read and match are
|
||||
repeated, which slows down the process. Therefore, the following is used
|
||||
to read ahead to a specific part of the string in advance.
|
||||
|
||||
CVE: CVE-2024-39908
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/9f1415a2616c77cad44a176eee90e8457b4774b6]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index 81753ad..c907f8c 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -127,6 +127,7 @@ module REXML
|
||||
INSTRUCTION_END = /#{NAME}(\s+.*?)?\?>/um
|
||||
INSTRUCTION_TERM = "?>"
|
||||
COMMENT_TERM = "-->"
|
||||
+ CDATA_TERM = "]]>"
|
||||
TAG_PATTERN = /((?>#{QNAME_STR}))\s*/um
|
||||
CLOSE_PATTERN = /(#{QNAME_STR})\s*>/um
|
||||
ATTLISTDECL_END = /\s+#{NAME}(?:#{ATTDEF})*\s*>/um
|
||||
@@ -416,7 +417,7 @@ module REXML
|
||||
|
||||
return [ :comment, md[1] ] if md
|
||||
else
|
||||
- md = @source.match(/\[CDATA\[(.*?)\]\]>/um, true)
|
||||
+ md = @source.match(/\[CDATA\[(.*?)\]\]>/um, true, term: Private::CDATA_TERM)
|
||||
return [ :cdata, md[1] ] if md
|
||||
end
|
||||
raise REXML::ParseException.new( "Declarations can only occur "+
|
||||
--
|
||||
2.40.0
|
||||
|
||||
44
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0008.patch
Normal file
44
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0008.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
From c33ea498102be65082940e8b7d6d31cb2c6e6ee2 Mon Sep 17 00:00:00 2001
|
||||
From: Watson <watson1978@gmail.com>
|
||||
Date: Tue, 16 Jul 2024 11:11:17 +0900
|
||||
Subject: [PATCH] Fix performance issue caused by using repeated `>` characters
|
||||
after ` <!DOCTYPE name` (#173)
|
||||
|
||||
A `<` is treated as a string delimiter.
|
||||
In certain cases, if `<` is used in succession, read and match are
|
||||
repeated, which slows down the process. Therefore, the following is used
|
||||
to read ahead to a specific part of the string in advance.
|
||||
|
||||
CVE: CVE-2024-39908
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/c33ea498102be65082940e8b7d6d31cb2c6e6ee2]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index c907f8c..5391e0a 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -128,6 +128,7 @@ module REXML
|
||||
INSTRUCTION_TERM = "?>"
|
||||
COMMENT_TERM = "-->"
|
||||
CDATA_TERM = "]]>"
|
||||
+ DOCTYPE_TERM = "]>"
|
||||
TAG_PATTERN = /((?>#{QNAME_STR}))\s*/um
|
||||
CLOSE_PATTERN = /(#{QNAME_STR})\s*>/um
|
||||
ATTLISTDECL_END = /\s+#{NAME}(?:#{ATTDEF})*\s*>/um
|
||||
@@ -375,7 +376,7 @@ module REXML
|
||||
end
|
||||
return [ :comment, md[1] ] if md
|
||||
end
|
||||
- elsif match = @source.match(/(%.*?;)\s*/um, true)
|
||||
+ elsif match = @source.match(/(%.*?;)\s*/um, true, term: Private::DOCTYPE_TERM)
|
||||
return [ :externalentity, match[1] ]
|
||||
elsif @source.match(/\]\s*>/um, true)
|
||||
@document_status = :after_doctype
|
||||
--
|
||||
2.40.0
|
||||
|
||||
36
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0009.patch
Normal file
36
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0009.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
From a79ac8b4b42a9efabe33a0be31bd82d33fd50347 Mon Sep 17 00:00:00 2001
|
||||
From: Watson <watson1978@gmail.com>
|
||||
Date: Tue, 16 Jul 2024 11:18:11 +0900
|
||||
Subject: [PATCH] Fix performance issue caused by using repeated `>` characters
|
||||
inside `<!DOCTYPE root [<!-- PAYLOAD -->]>` (#174)
|
||||
|
||||
A `<` is treated as a string delimiter.
|
||||
In certain cases, if `<` is used in succession, read and match are
|
||||
repeated, which slows down the process. Therefore, the following is used
|
||||
to read ahead to a specific part of the string in advance.
|
||||
|
||||
CVE: CVE-2024-39908
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/a79ac8b4b42a9efabe33a0be31bd82d33fd50347]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index 5391e0a..c22b632 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -369,7 +369,7 @@ module REXML
|
||||
raise REXML::ParseException.new(message, @source)
|
||||
end
|
||||
return [:notationdecl, name, *id]
|
||||
- elsif md = @source.match(/--(.*?)-->/um, true)
|
||||
+ elsif md = @source.match(/--(.*?)-->/um, true, term: Private::COMMENT_TERM)
|
||||
case md[1]
|
||||
when /--/, /-\z/
|
||||
raise REXML::ParseException.new("Malformed comment", @source)
|
||||
--
|
||||
2.40.0
|
||||
|
||||
53
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0010.patch
Normal file
53
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0010.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
From 67efb5951ed09dbb575c375b130a1e469f437d1f Mon Sep 17 00:00:00 2001
|
||||
From: Watson <watson1978@gmail.com>
|
||||
Date: Tue, 16 Jul 2024 11:26:57 +0900
|
||||
Subject: [PATCH] Fix performance issue caused by using repeated `>` characters
|
||||
inside `<!DOCTYPE name [<!ENTITY>]>` (#175)
|
||||
|
||||
A `<` is treated as a string delimiter.
|
||||
In certain cases, if `<` is used in succession, read and match are
|
||||
repeated, which slows down the process. Therefore, the following is used
|
||||
to read ahead to a specific part of the string in advance.
|
||||
|
||||
CVE: CVE-2024-39908
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/67efb5951ed09dbb575c375b130a1e469f437d1f]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index c22b632..c4de254 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -124,11 +124,15 @@ module REXML
|
||||
}
|
||||
|
||||
module Private
|
||||
- INSTRUCTION_END = /#{NAME}(\s+.*?)?\?>/um
|
||||
+ # Terminal requires two or more letters.
|
||||
INSTRUCTION_TERM = "?>"
|
||||
COMMENT_TERM = "-->"
|
||||
CDATA_TERM = "]]>"
|
||||
DOCTYPE_TERM = "]>"
|
||||
+ # Read to the end of DOCTYPE because there is no proper ENTITY termination
|
||||
+ ENTITY_TERM = DOCTYPE_TERM
|
||||
+
|
||||
+ INSTRUCTION_END = /#{NAME}(\s+.*?)?\?>/um
|
||||
TAG_PATTERN = /((?>#{QNAME_STR}))\s*/um
|
||||
CLOSE_PATTERN = /(#{QNAME_STR})\s*>/um
|
||||
ATTLISTDECL_END = /\s+#{NAME}(?:#{ATTDEF})*\s*>/um
|
||||
@@ -304,7 +308,7 @@ module REXML
|
||||
raise REXML::ParseException.new( "Bad ELEMENT declaration!", @source ) if md.nil?
|
||||
return [ :elementdecl, "<!ELEMENT" + md[1] ]
|
||||
elsif @source.match("ENTITY", true)
|
||||
- match = [:entitydecl, *@source.match(ENTITYDECL_PATTERN, true).captures.compact]
|
||||
+ match = [:entitydecl, *@source.match(Private::ENTITYDECL_PATTERN, true, term: Private::ENTITY_TERM).captures.compact]
|
||||
ref = false
|
||||
if match[1] == '%'
|
||||
ref = true
|
||||
--
|
||||
2.40.0
|
||||
|
||||
35
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0011.patch
Normal file
35
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0011.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
From 1f1e6e9b40bf339894e843dfd679c2fb1a5ddbf2 Mon Sep 17 00:00:00 2001
|
||||
From: Watson <watson1978@gmail.com>
|
||||
Date: Tue, 16 Jul 2024 11:35:41 +0900
|
||||
Subject: [PATCH] Fix ReDoS by using repeated space characters inside
|
||||
`<!DOCTYPE name [<!ATTLIST>]>` (#176)
|
||||
|
||||
Fix performance by removing unnecessary spaces.
|
||||
|
||||
This is occurred in Ruby 3.1 or earlier.
|
||||
|
||||
CVE: CVE-2024-39908
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/1f1e6e9b40bf339894e843dfd679c2fb1a5ddbf2]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index c4de254..a9b1b44 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -340,7 +340,7 @@ module REXML
|
||||
contents = md[0]
|
||||
|
||||
pairs = {}
|
||||
- values = md[0].scan( ATTDEF_RE )
|
||||
+ values = md[0].strip.scan( ATTDEF_RE )
|
||||
values.each do |attdef|
|
||||
unless attdef[3] == "#IMPLIED"
|
||||
attdef.compact!
|
||||
--
|
||||
2.40.0
|
||||
|
||||
36
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0012.patch
Normal file
36
meta/recipes-devtools/ruby/ruby/CVE-2024-39908-0012.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
From 910e5a2b487cb5a30989884a39f9cad2cc499cfc Mon Sep 17 00:00:00 2001
|
||||
From: Watson <watson1978@gmail.com>
|
||||
Date: Tue, 16 Jul 2024 11:36:05 +0900
|
||||
Subject: [PATCH] Fix performance issue caused by using repeated `>` characters
|
||||
inside `<xml><!-- --></xml>` (#177)
|
||||
|
||||
A `<` is treated as a string delimiter.
|
||||
In certain cases, if `<` is used in succession, read and match are
|
||||
repeated, which slows down the process. Therefore, the following is used
|
||||
to read ahead to a specific part of the string in advance.
|
||||
|
||||
CVE: CVE-2024-39908
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/910e5a2b487cb5a30989884a39f9cad2cc499cfc]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index a9b1b44..4864ba1 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -413,7 +413,7 @@ module REXML
|
||||
#STDERR.puts "SOURCE BUFFER = #{source.buffer}, #{source.buffer.size}"
|
||||
raise REXML::ParseException.new("Malformed node", @source) unless md
|
||||
if md[0][0] == ?-
|
||||
- md = @source.match(/--(.*?)-->/um, true)
|
||||
+ md = @source.match(/--(.*?)-->/um, true, term: Private::COMMENT_TERM)
|
||||
|
||||
case md[1]
|
||||
when /--/, /-\z/
|
||||
--
|
||||
2.40.0
|
||||
|
||||
44
meta/recipes-devtools/ruby/ruby/CVE-2024-41123-0001.patch
Normal file
44
meta/recipes-devtools/ruby/ruby/CVE-2024-41123-0001.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
From 2c39c91a65d69357cfbc35dd8079b3606d86bb70 Mon Sep 17 00:00:00 2001
|
||||
From: Watson <watson1978@gmail.com>
|
||||
Date: Fri, 19 Jul 2024 17:15:15 +0900
|
||||
Subject: [PATCH] Fix method scope in test in order to invoke the tests
|
||||
properly and fix exception message (#182)
|
||||
|
||||
This PR includes following two fixes.
|
||||
|
||||
1. The `test_empty` and `test_linear_performance_gt` were defined as
|
||||
private method. Seems that test-unit runner does not invoke private
|
||||
methods even if the methods have `test_` prefix.
|
||||
2. When parse malformed entity declaration, the exception might have the
|
||||
message about `NoMethodError`. The proper exception message will be
|
||||
contained by this fix.
|
||||
|
||||
CVE: CVE-2024-41123
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/2c39c91a65d69357cfbc35dd8079b3606d86bb70]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index 4864ba1..451fbf8 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -308,7 +308,11 @@ module REXML
|
||||
raise REXML::ParseException.new( "Bad ELEMENT declaration!", @source ) if md.nil?
|
||||
return [ :elementdecl, "<!ELEMENT" + md[1] ]
|
||||
elsif @source.match("ENTITY", true)
|
||||
- match = [:entitydecl, *@source.match(Private::ENTITYDECL_PATTERN, true, term: Private::ENTITY_TERM).captures.compact]
|
||||
+ match_data = @source.match(Private::ENTITYDECL_PATTERN, true, term: Private::ENTITY_TERM)
|
||||
+ unless match_data
|
||||
+ raise REXML::ParseException.new("Malformed entity declaration", @source)
|
||||
+ end
|
||||
+ match = [:entitydecl, *match_data.captures.compact]
|
||||
ref = false
|
||||
if match[1] == '%'
|
||||
ref = true
|
||||
--
|
||||
2.40.0
|
||||
|
||||
37
meta/recipes-devtools/ruby/ruby/CVE-2024-41123-0002.patch
Normal file
37
meta/recipes-devtools/ruby/ruby/CVE-2024-41123-0002.patch
Normal file
@@ -0,0 +1,37 @@
|
||||
From 4444a04ece4c02a7bd51e8c75623f22dc12d882b Mon Sep 17 00:00:00 2001
|
||||
From: Sutou Kouhei <kou@clear-code.com>
|
||||
Date: Sun, 2 Jun 2024 16:59:16 +0900
|
||||
Subject: [PATCH] Add missing encode for custom term
|
||||
|
||||
CVE: CVE-2024-41123
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/4444a04ece4c02a7bd51e8c75623f22dc12d882b]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/source.rb | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
index 08a035c..7be430a 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
@@ -160,6 +160,7 @@ module REXML
|
||||
end
|
||||
|
||||
def read(term = nil)
|
||||
+ term = encode(term) if term
|
||||
begin
|
||||
@scanner << readline(term)
|
||||
true
|
||||
@@ -171,6 +172,7 @@ module REXML
|
||||
|
||||
def read_until(term)
|
||||
pattern = Regexp.union(term)
|
||||
+ term = encode(term)
|
||||
data = []
|
||||
begin
|
||||
until str = @scanner.scan_until(pattern)
|
||||
--
|
||||
2.40.0
|
||||
|
||||
55
meta/recipes-devtools/ruby/ruby/CVE-2024-41123-0003.patch
Normal file
55
meta/recipes-devtools/ruby/ruby/CVE-2024-41123-0003.patch
Normal file
@@ -0,0 +1,55 @@
|
||||
From ebc3e85bfa2796fb4922c1932760bec8390ff87c Mon Sep 17 00:00:00 2001
|
||||
From: NAITOH Jun <naitoh@gmail.com>
|
||||
Date: Mon, 8 Jul 2024 05:54:06 +0900
|
||||
Subject: [PATCH] Add position check for XML declaration (#162)
|
||||
|
||||
XML declaration must be the first item.
|
||||
|
||||
https://www.w3.org/TR/2006/REC-xml11-20060816/#document
|
||||
|
||||
```
|
||||
[1] document ::= ( prolog element Misc* ) - ( Char* RestrictedChar Char* )
|
||||
```
|
||||
|
||||
https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-prolog
|
||||
|
||||
```
|
||||
[22] prolog ::= XMLDecl Misc* (doctypedecl Misc*)?
|
||||
```
|
||||
|
||||
https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-XMLDecl
|
||||
|
||||
```
|
||||
[23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
|
||||
```
|
||||
|
||||
See: https://github.com/ruby/rexml/pull/161#discussion_r1666118193
|
||||
|
||||
CVE: CVE-2024-41123
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/ebc3e85bfa2796fb4922c1932760bec8390ff87c]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index 451fbf8..71fce99 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -670,7 +670,10 @@ module REXML
|
||||
@source.position = start_position
|
||||
raise REXML::ParseException.new(message, @source)
|
||||
end
|
||||
- if @document_status.nil? and match_data[1] == "xml"
|
||||
+ if match_data[1] == "xml"
|
||||
+ if @document_status
|
||||
+ raise ParseException.new("Malformed XML: XML declaration is not at the start", @source)
|
||||
+ end
|
||||
content = match_data[2]
|
||||
version = VERSION.match(content)
|
||||
version = version[1] unless version.nil?
|
||||
--
|
||||
2.40.0
|
||||
|
||||
163
meta/recipes-devtools/ruby/ruby/CVE-2024-41123-0004.patch
Normal file
163
meta/recipes-devtools/ruby/ruby/CVE-2024-41123-0004.patch
Normal file
@@ -0,0 +1,163 @@
|
||||
From 6cac15d45864c8d70904baa5cbfcc97181000960 Mon Sep 17 00:00:00 2001
|
||||
From: tomoya ishida <tomoyapenguin@gmail.com>
|
||||
Date: Thu, 1 Aug 2024 09:21:19 +0900
|
||||
Subject: [PATCH] Fix source.match performance without specifying term string
|
||||
(#186)
|
||||
|
||||
Performance problem of `source.match(regexp)` was recently fixed by
|
||||
specifying terminator string. However, I think maintaining appropriate
|
||||
terminator string for a regexp is hard.
|
||||
I propose solving this performance issue by increasing bytes to read in
|
||||
each iteration.
|
||||
|
||||
CVE: CVE-2024-41123
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/6cac15d45864c8d70904baa5cbfcc97181000960]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.../lib/rexml/parsers/baseparser.rb | 22 ++++++------------
|
||||
.bundle/gems/rexml-3.2.5/lib/rexml/source.rb | 23 +++++++++++++++----
|
||||
2 files changed, 25 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index 71fce99..c1a22b8 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -124,14 +124,6 @@ module REXML
|
||||
}
|
||||
|
||||
module Private
|
||||
- # Terminal requires two or more letters.
|
||||
- INSTRUCTION_TERM = "?>"
|
||||
- COMMENT_TERM = "-->"
|
||||
- CDATA_TERM = "]]>"
|
||||
- DOCTYPE_TERM = "]>"
|
||||
- # Read to the end of DOCTYPE because there is no proper ENTITY termination
|
||||
- ENTITY_TERM = DOCTYPE_TERM
|
||||
-
|
||||
INSTRUCTION_END = /#{NAME}(\s+.*?)?\?>/um
|
||||
TAG_PATTERN = /((?>#{QNAME_STR}))\s*/um
|
||||
CLOSE_PATTERN = /(#{QNAME_STR})\s*>/um
|
||||
@@ -244,7 +236,7 @@ module REXML
|
||||
return process_instruction(start_position)
|
||||
elsif @source.match("<!", true)
|
||||
if @source.match("--", true)
|
||||
- md = @source.match(/(.*?)-->/um, true, term: Private::COMMENT_TERM)
|
||||
+ md = @source.match(/(.*?)-->/um, true)
|
||||
if md.nil?
|
||||
raise REXML::ParseException.new("Unclosed comment", @source)
|
||||
end
|
||||
@@ -308,7 +300,7 @@ module REXML
|
||||
raise REXML::ParseException.new( "Bad ELEMENT declaration!", @source ) if md.nil?
|
||||
return [ :elementdecl, "<!ELEMENT" + md[1] ]
|
||||
elsif @source.match("ENTITY", true)
|
||||
- match_data = @source.match(Private::ENTITYDECL_PATTERN, true, term: Private::ENTITY_TERM)
|
||||
+ match_data = @source.match(Private::ENTITYDECL_PATTERN, true)
|
||||
unless match_data
|
||||
raise REXML::ParseException.new("Malformed entity declaration", @source)
|
||||
end
|
||||
@@ -377,14 +369,14 @@ module REXML
|
||||
raise REXML::ParseException.new(message, @source)
|
||||
end
|
||||
return [:notationdecl, name, *id]
|
||||
- elsif md = @source.match(/--(.*?)-->/um, true, term: Private::COMMENT_TERM)
|
||||
+ elsif md = @source.match(/--(.*?)-->/um, true)
|
||||
case md[1]
|
||||
when /--/, /-\z/
|
||||
raise REXML::ParseException.new("Malformed comment", @source)
|
||||
end
|
||||
return [ :comment, md[1] ] if md
|
||||
end
|
||||
- elsif match = @source.match(/(%.*?;)\s*/um, true, term: Private::DOCTYPE_TERM)
|
||||
+ elsif match = @source.match(/(%.*?;)\s*/um, true)
|
||||
return [ :externalentity, match[1] ]
|
||||
elsif @source.match(/\]\s*>/um, true)
|
||||
@document_status = :after_doctype
|
||||
@@ -417,7 +409,7 @@ module REXML
|
||||
#STDERR.puts "SOURCE BUFFER = #{source.buffer}, #{source.buffer.size}"
|
||||
raise REXML::ParseException.new("Malformed node", @source) unless md
|
||||
if md[0][0] == ?-
|
||||
- md = @source.match(/--(.*?)-->/um, true, term: Private::COMMENT_TERM)
|
||||
+ md = @source.match(/--(.*?)-->/um, true)
|
||||
|
||||
case md[1]
|
||||
when /--/, /-\z/
|
||||
@@ -426,7 +418,7 @@ module REXML
|
||||
|
||||
return [ :comment, md[1] ] if md
|
||||
else
|
||||
- md = @source.match(/\[CDATA\[(.*?)\]\]>/um, true, term: Private::CDATA_TERM)
|
||||
+ md = @source.match(/\[CDATA\[(.*?)\]\]>/um, true)
|
||||
return [ :cdata, md[1] ] if md
|
||||
end
|
||||
raise REXML::ParseException.new( "Declarations can only occur "+
|
||||
@@ -664,7 +656,7 @@ module REXML
|
||||
end
|
||||
|
||||
def process_instruction(start_position)
|
||||
- match_data = @source.match(Private::INSTRUCTION_END, true, term: Private::INSTRUCTION_TERM)
|
||||
+ match_data = @source.match(Private::INSTRUCTION_END, true)
|
||||
unless match_data
|
||||
message = "Invalid processing instruction node"
|
||||
@source.position = start_position
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
index 7be430a..7c05cb5 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/source.rb
|
||||
@@ -72,7 +72,7 @@ module REXML
|
||||
@scanner.scan_until(Regexp.union(term)) or @scanner.rest
|
||||
end
|
||||
|
||||
- def match(pattern, cons=false, term: nil)
|
||||
+ def match(pattern, cons=false)
|
||||
if cons
|
||||
@scanner.scan(pattern).nil? ? nil : @scanner
|
||||
else
|
||||
@@ -159,10 +159,20 @@ module REXML
|
||||
end
|
||||
end
|
||||
|
||||
- def read(term = nil)
|
||||
+ def read(term = nil, min_bytes = 1)
|
||||
term = encode(term) if term
|
||||
begin
|
||||
- @scanner << readline(term)
|
||||
+ str = readline(term)
|
||||
+ @scanner << str
|
||||
+ read_bytes = str.bytesize
|
||||
+ begin
|
||||
+ while read_bytes < min_bytes
|
||||
+ str = readline(term)
|
||||
+ @scanner << str
|
||||
+ read_bytes += str.bytesize
|
||||
+ end
|
||||
+ rescue IOError
|
||||
+ end
|
||||
true
|
||||
rescue Exception, NameError
|
||||
@source = nil
|
||||
@@ -186,7 +196,9 @@ module REXML
|
||||
end
|
||||
end
|
||||
|
||||
- def match( pattern, cons=false, term: nil )
|
||||
+ def match( pattern, cons=false )
|
||||
+ # To avoid performance issue, we need to increase bytes to read per scan
|
||||
+ min_bytes = 1
|
||||
read if @scanner.eos? && @source
|
||||
while true
|
||||
if cons
|
||||
@@ -197,7 +209,8 @@ module REXML
|
||||
break if md
|
||||
return nil if pattern.is_a?(String) && pattern.bytesize <= @scanner.rest_size
|
||||
return nil if @source.nil?
|
||||
- return nil unless read(term)
|
||||
+ return nil unless read(nil, min_bytes)
|
||||
+ min_bytes *= 2
|
||||
end
|
||||
|
||||
md.nil? ? nil : @scanner
|
||||
--
|
||||
2.40.0
|
||||
|
||||
111
meta/recipes-devtools/ruby/ruby/CVE-2024-41123-0005.patch
Normal file
111
meta/recipes-devtools/ruby/ruby/CVE-2024-41123-0005.patch
Normal file
@@ -0,0 +1,111 @@
|
||||
From e2546e6ecade16b04c9ee528e5be8509fe16c2d6 Mon Sep 17 00:00:00 2001
|
||||
From: Sutou Kouhei <kou@clear-code.com>
|
||||
Date: Thu, 1 Aug 2024 11:23:43 +0900
|
||||
Subject: [PATCH] parse pi: improve invalid case detection
|
||||
|
||||
CVE: CVE-2024-41123
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/e2546e6ecade16b04c9ee528e5be8509fe16c2d6]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
.../lib/rexml/parsers/baseparser.rb | 35 +++++++++++--------
|
||||
1 file changed, 20 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
index c1a22b8..0ece9b5 100644
|
||||
--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -124,11 +124,10 @@ module REXML
|
||||
}
|
||||
|
||||
module Private
|
||||
- INSTRUCTION_END = /#{NAME}(\s+.*?)?\?>/um
|
||||
TAG_PATTERN = /((?>#{QNAME_STR}))\s*/um
|
||||
CLOSE_PATTERN = /(#{QNAME_STR})\s*>/um
|
||||
ATTLISTDECL_END = /\s+#{NAME}(?:#{ATTDEF})*\s*>/um
|
||||
- NAME_PATTERN = /\s*#{NAME}/um
|
||||
+ NAME_PATTERN = /#{NAME}/um
|
||||
GEDECL_PATTERN = "\\s+#{NAME}\\s+#{ENTITYDEF}\\s*>"
|
||||
PEDECL_PATTERN = "\\s+(%)\\s+#{NAME}\\s+#{PEDEF}\\s*>"
|
||||
ENTITYDECL_PATTERN = /(?:#{GEDECL_PATTERN})|(?:#{PEDECL_PATTERN})/um
|
||||
@@ -233,7 +232,7 @@ module REXML
|
||||
if @document_status == nil
|
||||
start_position = @source.position
|
||||
if @source.match("<?", true)
|
||||
- return process_instruction(start_position)
|
||||
+ return process_instruction
|
||||
elsif @source.match("<!", true)
|
||||
if @source.match("--", true)
|
||||
md = @source.match(/(.*?)-->/um, true)
|
||||
@@ -424,7 +423,7 @@ module REXML
|
||||
raise REXML::ParseException.new( "Declarations can only occur "+
|
||||
"in the doctype declaration.", @source)
|
||||
elsif @source.match("?", true)
|
||||
- return process_instruction(start_position)
|
||||
+ return process_instruction
|
||||
else
|
||||
# Get the next tag
|
||||
md = @source.match(TAG_PATTERN, true)
|
||||
@@ -579,14 +578,14 @@ module REXML
|
||||
def parse_name(base_error_message)
|
||||
md = @source.match(NAME_PATTERN, true)
|
||||
unless md
|
||||
- if @source.match(/\s*\S/um)
|
||||
+ if @source.match(/\S/um)
|
||||
message = "#{base_error_message}: invalid name"
|
||||
else
|
||||
message = "#{base_error_message}: name is missing"
|
||||
end
|
||||
raise REXML::ParseException.new(message, @source)
|
||||
end
|
||||
- md[1]
|
||||
+ md[0]
|
||||
end
|
||||
|
||||
def parse_id(base_error_message,
|
||||
@@ -655,18 +654,24 @@ module REXML
|
||||
end
|
||||
end
|
||||
|
||||
- def process_instruction(start_position)
|
||||
- match_data = @source.match(Private::INSTRUCTION_END, true)
|
||||
- unless match_data
|
||||
- message = "Invalid processing instruction node"
|
||||
- @source.position = start_position
|
||||
- raise REXML::ParseException.new(message, @source)
|
||||
+ def process_instruction
|
||||
+ name = parse_name("Malformed XML: Invalid processing instruction node")
|
||||
+ if @source.match(/\s+/um, true)
|
||||
+ match_data = @source.match(/(.*?)\?>/um, true)
|
||||
+ unless match_data
|
||||
+ raise ParseException.new("Malformed XML: Unclosed processing instruction", @source)
|
||||
+ end
|
||||
+ content = match_data[1]
|
||||
+ else
|
||||
+ content = nil
|
||||
+ unless @source.match("?>", true)
|
||||
+ raise ParseException.new("Malformed XML: Unclosed processing instruction", @source)
|
||||
+ end
|
||||
end
|
||||
- if match_data[1] == "xml"
|
||||
+ if name == "xml"
|
||||
if @document_status
|
||||
raise ParseException.new("Malformed XML: XML declaration is not at the start", @source)
|
||||
end
|
||||
- content = match_data[2]
|
||||
version = VERSION.match(content)
|
||||
version = version[1] unless version.nil?
|
||||
encoding = ENCODING.match(content)
|
||||
@@ -681,7 +686,7 @@ module REXML
|
||||
standalone = standalone[1] unless standalone.nil?
|
||||
return [ :xmldecl, version, encoding, standalone ]
|
||||
end
|
||||
- [:processing_instruction, match_data[1], match_data[2]]
|
||||
+ [:processing_instruction, name, content]
|
||||
end
|
||||
|
||||
def parse_attributes(prefixes)
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -53,6 +53,24 @@ SRC_URI = "http://cache.ruby-lang.org/pub/ruby/${SHRT_VER}/ruby-${PV}.tar.gz \
|
||||
file://CVE-2024-43398-0003.patch \
|
||||
file://CVE-2025-27221-0001.patch \
|
||||
file://CVE-2025-27221-0002.patch \
|
||||
file://CVE-2024-35176.patch \
|
||||
file://CVE-2024-39908-0001.patch \
|
||||
file://CVE-2024-39908-0002.patch \
|
||||
file://CVE-2024-39908-0003.patch \
|
||||
file://CVE-2024-39908-0004.patch \
|
||||
file://CVE-2024-39908-0005.patch \
|
||||
file://CVE-2024-39908-0006.patch \
|
||||
file://CVE-2024-39908-0007.patch \
|
||||
file://CVE-2024-39908-0008.patch \
|
||||
file://CVE-2024-39908-0009.patch \
|
||||
file://CVE-2024-39908-0010.patch \
|
||||
file://CVE-2024-39908-0011.patch \
|
||||
file://CVE-2024-39908-0012.patch \
|
||||
file://CVE-2024-41123-0001.patch \
|
||||
file://CVE-2024-41123-0002.patch \
|
||||
file://CVE-2024-41123-0003.patch \
|
||||
file://CVE-2024-41123-0004.patch \
|
||||
file://CVE-2024-41123-0005.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_URI = "https://www.ruby-lang.org/en/downloads/"
|
||||
|
||||
|
||||
@@ -76,3 +76,5 @@ SUMMARY:${RUSTLIB_HOST_PN} = "Rust cross canadian libaries for ${HOST_SYS}"
|
||||
SUMMARY:${RUSTLIB_SRC_PN} = "Rust standard library sources for cross canadian toolchain"
|
||||
SUMMARY:${PN} = "Rust crost canadian compiler"
|
||||
|
||||
# These CVEs are specific to Microsoft Windows
|
||||
CVE_CHECK_IGNORE += "CVE-2024-43402"
|
||||
|
||||
@@ -8,7 +8,7 @@ LICENSE = "LGPL-2.1-only & GPL-2.0-only"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \
|
||||
file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe"
|
||||
|
||||
SRC_URI = "git://github.com/systemd/systemd-bootchart.git;protocol=https;branch=master \
|
||||
SRC_URI = "git://github.com/systemd/systemd-bootchart.git;protocol=https;branch=main \
|
||||
file://0001-architecture-Recognise-RISCV-32-RISCV-64.patch \
|
||||
file://mips64.patch \
|
||||
file://no_lto.patch \
|
||||
|
||||
@@ -18,7 +18,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
|
||||
|
||||
SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
|
||||
|
||||
SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz"
|
||||
SRC_URI = "${GNOME_MIRROR}/${BPN}/${SHRT_VER}/${BP}.tar.xz"
|
||||
inherit autotools pkgconfig upstream-version-is-even
|
||||
|
||||
FILES:${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From 2e73ea3a7db1c3c743c28a0d2dd0456a43e96b96 Mon Sep 17 00:00:00 2001
|
||||
From: Sam Bingner <sam@bingner.com>
|
||||
Date: Fri, 5 Jul 2024 09:34:43 -1000
|
||||
Subject: [PATCH] Fix max path-length metadata writing (#2243)
|
||||
|
||||
Previous code added `.XXXXXX` to the end of the filename to write the
|
||||
mac metadata. This is a problem if the filename is at or near the
|
||||
filesystem max path length. This reuses the same code used by
|
||||
create_tempdatafork to ensure that the filename is not too long.
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/2e73ea3a7db1c3c743c28a0d2dd0456a43e96b96]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
libarchive/archive_write_disk_posix.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
|
||||
index bac906d2..098a8fe4 100644
|
||||
--- a/libarchive/archive_write_disk_posix.c
|
||||
+++ b/libarchive/archive_write_disk_posix.c
|
||||
@@ -4331,8 +4331,7 @@ set_mac_metadata(struct archive_write_disk *a, const char *pathname,
|
||||
* silly dance of writing the data to disk just so that
|
||||
* copyfile() can read it back in again. */
|
||||
archive_string_init(&tmp);
|
||||
- archive_strcpy(&tmp, pathname);
|
||||
- archive_strcat(&tmp, ".XXXXXX");
|
||||
+ archive_strcpy(&tmp, "tar.mmd.XXXXXX");
|
||||
fd = mkstemp(tmp.s);
|
||||
|
||||
if (fd < 0) {
|
||||
@@ -0,0 +1,28 @@
|
||||
From 53d2bc4f89fcbd7414b92bd242f6cdc901941f55 Mon Sep 17 00:00:00 2001
|
||||
From: Tim Kientzle <kientzle@acm.org>
|
||||
Date: Sat, 16 Aug 2025 10:27:11 -0600
|
||||
Subject: [PATCH] Merge pull request #2696 from al3xtjames/mkstemp
|
||||
|
||||
Fix mkstemp path in setup_mac_metadata
|
||||
|
||||
(cherry picked from commit 892f33145093d1c9b962b6521a6480dfea66ae00)
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/53d2bc4f89fcbd7414b92bd242f6cdc901941f55]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
libarchive/archive_read_disk_entry_from_file.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c
|
||||
index 19d04977..87389642 100644
|
||||
--- a/libarchive/archive_read_disk_entry_from_file.c
|
||||
+++ b/libarchive/archive_read_disk_entry_from_file.c
|
||||
@@ -365,7 +365,7 @@ setup_mac_metadata(struct archive_read_disk *a,
|
||||
tempdir = _PATH_TMP;
|
||||
archive_string_init(&tempfile);
|
||||
archive_strcpy(&tempfile, tempdir);
|
||||
- archive_strcat(&tempfile, "tar.md.XXXXXX");
|
||||
+ archive_strcat(&tempfile, "/tar.md.XXXXXX");
|
||||
tempfd = mkstemp(tempfile.s);
|
||||
if (tempfd < 0) {
|
||||
archive_set_error(&a->archive, errno,
|
||||
@@ -0,0 +1,183 @@
|
||||
From 82e31ba4a9afcce0c7c19e591ccd8653196d84a0 Mon Sep 17 00:00:00 2001
|
||||
From: Tim Kientzle <kientzle@acm.org>
|
||||
Date: Mon, 13 Oct 2025 10:57:18 -0700
|
||||
Subject: [PATCH] Merge pull request #2749 from KlaraSystems/des/tempdir
|
||||
|
||||
Unify temporary directory handling
|
||||
|
||||
(cherry picked from commit d207d816d065c79dc2cb992008c3ba9721c6a276)
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/82e31ba4a9afcce0c7c19e591ccd8653196d84a0]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
CMakeLists.txt | 6 ++-
|
||||
configure.ac | 4 +-
|
||||
libarchive/archive_private.h | 1 +
|
||||
.../archive_read_disk_entry_from_file.c | 14 +++----
|
||||
libarchive/archive_read_disk_posix.c | 3 --
|
||||
libarchive/archive_util.c | 38 ++++++++++++++++---
|
||||
6 files changed, 48 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index f44adc77..fc9aca4e 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1357,14 +1357,18 @@ CHECK_FUNCTION_EXISTS_GLIBC(ftruncate HAVE_FTRUNCATE)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(futimens HAVE_FUTIMENS)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(futimes HAVE_FUTIMES)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(futimesat HAVE_FUTIMESAT)
|
||||
+CHECK_FUNCTION_EXISTS_GLIBC(getegid HAVE_GETEGID)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(geteuid HAVE_GETEUID)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getgrgid_r HAVE_GETGRGID_R)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getgrnam_r HAVE_GETGRNAM_R)
|
||||
+CHECK_FUNCTION_EXISTS_GLIBC(getpid HAVE_GETPID)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getpwnam_r HAVE_GETPWNAM_R)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getpwuid_r HAVE_GETPWUID_R)
|
||||
-CHECK_FUNCTION_EXISTS_GLIBC(getpid HAVE_GETPID)
|
||||
+CHECK_FUNCTION_EXISTS_GLIBC(getresgid HAVE_GETRESGID)
|
||||
+CHECK_FUNCTION_EXISTS_GLIBC(getresuid HAVE_GETRESUID)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getvfsbyname HAVE_GETVFSBYNAME)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(gmtime_r HAVE_GMTIME_R)
|
||||
+CHECK_FUNCTION_EXISTS_GLIBC(issetugid HAVE_ISSETUGID)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(lchflags HAVE_LCHFLAGS)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(lchmod HAVE_LCHMOD)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(lchown HAVE_LCHOWN)
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index aae0f381..a1a8f380 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -677,7 +677,9 @@ AC_CHECK_FUNCS([fchdir fchflags fchmod fchown fcntl fdopendir fork])
|
||||
AC_CHECK_FUNCS([fstat fstatat fstatfs fstatvfs ftruncate])
|
||||
AC_CHECK_FUNCS([futimens futimes futimesat])
|
||||
AC_CHECK_FUNCS([geteuid getpid getgrgid_r getgrnam_r])
|
||||
-AC_CHECK_FUNCS([getpwnam_r getpwuid_r getvfsbyname gmtime_r])
|
||||
+AC_CHECK_FUNCS([getgrgid_r getgrnam_r getpwnam_r getpwuid_r])
|
||||
+AC_CHECK_FUNCS([getvfsbyname gmtime_r])
|
||||
+AC_CHECK_FUNCS([issetugid])
|
||||
AC_CHECK_FUNCS([lchflags lchmod lchown link linkat localtime_r lstat lutimes])
|
||||
AC_CHECK_FUNCS([mbrtowc memmove memset])
|
||||
AC_CHECK_FUNCS([mkdir mkfifo mknod mkstemp])
|
||||
diff --git a/libarchive/archive_private.h b/libarchive/archive_private.h
|
||||
index 050fc63c..3a926c68 100644
|
||||
--- a/libarchive/archive_private.h
|
||||
+++ b/libarchive/archive_private.h
|
||||
@@ -156,6 +156,7 @@ int __archive_check_magic(struct archive *, unsigned int magic,
|
||||
void __archive_errx(int retvalue, const char *msg) __LA_DEAD;
|
||||
|
||||
void __archive_ensure_cloexec_flag(int fd);
|
||||
+int __archive_get_tempdir(struct archive_string *);
|
||||
int __archive_mktemp(const char *tmpdir);
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
int __archive_mkstemp(wchar_t *template);
|
||||
diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c
|
||||
index 87389642..42af4034 100644
|
||||
--- a/libarchive/archive_read_disk_entry_from_file.c
|
||||
+++ b/libarchive/archive_read_disk_entry_from_file.c
|
||||
@@ -339,7 +339,7 @@ setup_mac_metadata(struct archive_read_disk *a,
|
||||
int ret = ARCHIVE_OK;
|
||||
void *buff = NULL;
|
||||
int have_attrs;
|
||||
- const char *name, *tempdir;
|
||||
+ const char *name;
|
||||
struct archive_string tempfile;
|
||||
|
||||
(void)fd; /* UNUSED */
|
||||
@@ -358,14 +358,12 @@ setup_mac_metadata(struct archive_read_disk *a,
|
||||
if (have_attrs == 0)
|
||||
return (ARCHIVE_OK);
|
||||
|
||||
- tempdir = NULL;
|
||||
- if (issetugid() == 0)
|
||||
- tempdir = getenv("TMPDIR");
|
||||
- if (tempdir == NULL)
|
||||
- tempdir = _PATH_TMP;
|
||||
archive_string_init(&tempfile);
|
||||
- archive_strcpy(&tempfile, tempdir);
|
||||
- archive_strcat(&tempfile, "/tar.md.XXXXXX");
|
||||
+ if (__archive_get_tempdir(&tempfile) != ARCHIVE_OK) {
|
||||
+ ret = ARCHIVE_WARN;
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+ archive_strcat(&tempfile, "tar.md.XXXXXX");
|
||||
tempfd = mkstemp(tempfile.s);
|
||||
if (tempfd < 0) {
|
||||
archive_set_error(&a->archive, errno,
|
||||
diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c
|
||||
index ba0046d7..54a8e661 100644
|
||||
--- a/libarchive/archive_read_disk_posix.c
|
||||
+++ b/libarchive/archive_read_disk_posix.c
|
||||
@@ -1579,9 +1579,6 @@ setup_current_filesystem(struct archive_read_disk *a)
|
||||
# endif
|
||||
#endif
|
||||
int r, xr = 0;
|
||||
-#if !defined(HAVE_STRUCT_STATFS_F_NAMEMAX)
|
||||
- long nm;
|
||||
-#endif
|
||||
|
||||
t->current_filesystem->synthetic = -1;
|
||||
t->current_filesystem->remote = -1;
|
||||
diff --git a/libarchive/archive_util.c b/libarchive/archive_util.c
|
||||
index 900abd0c..d048bbc9 100644
|
||||
--- a/libarchive/archive_util.c
|
||||
+++ b/libarchive/archive_util.c
|
||||
@@ -395,11 +395,39 @@ __archive_mkstemp(wchar_t *template)
|
||||
#else
|
||||
|
||||
static int
|
||||
-get_tempdir(struct archive_string *temppath)
|
||||
+__archive_issetugid(void)
|
||||
{
|
||||
- const char *tmp;
|
||||
+#ifdef HAVE_ISSETUGID
|
||||
+ return (issetugid());
|
||||
+#elif HAVE_GETRESUID
|
||||
+ uid_t ruid, euid, suid;
|
||||
+ gid_t rgid, egid, sgid;
|
||||
+ if (getresuid(&ruid, &euid, &suid) != 0)
|
||||
+ return (-1);
|
||||
+ if (ruid != euid || ruid != suid)
|
||||
+ return (1);
|
||||
+ if (getresgid(&ruid, &egid, &sgid) != 0)
|
||||
+ return (-1);
|
||||
+ if (rgid != egid || rgid != sgid)
|
||||
+ return (1);
|
||||
+#elif HAVE_GETEUID
|
||||
+ if (geteuid() != getuid())
|
||||
+ return (1);
|
||||
+#if HAVE_GETEGID
|
||||
+ if (getegid() != getgid())
|
||||
+ return (1);
|
||||
+#endif
|
||||
+#endif
|
||||
+ return (0);
|
||||
+}
|
||||
|
||||
- tmp = getenv("TMPDIR");
|
||||
+int
|
||||
+__archive_get_tempdir(struct archive_string *temppath)
|
||||
+{
|
||||
+ const char *tmp = NULL;
|
||||
+
|
||||
+ if (__archive_issetugid() == 0)
|
||||
+ tmp = getenv("TMPDIR");
|
||||
if (tmp == NULL)
|
||||
#ifdef _PATH_TMP
|
||||
tmp = _PATH_TMP;
|
||||
@@ -426,7 +454,7 @@ __archive_mktemp(const char *tmpdir)
|
||||
|
||||
archive_string_init(&temp_name);
|
||||
if (tmpdir == NULL) {
|
||||
- if (get_tempdir(&temp_name) != ARCHIVE_OK)
|
||||
+ if (__archive_get_tempdir(&temp_name) != ARCHIVE_OK)
|
||||
goto exit_tmpfile;
|
||||
} else {
|
||||
archive_strcpy(&temp_name, tmpdir);
|
||||
@@ -487,7 +515,7 @@ __archive_mktempx(const char *tmpdir, char *template)
|
||||
if (template == NULL) {
|
||||
archive_string_init(&temp_name);
|
||||
if (tmpdir == NULL) {
|
||||
- if (get_tempdir(&temp_name) != ARCHIVE_OK)
|
||||
+ if (__archive_get_tempdir(&temp_name) != ARCHIVE_OK)
|
||||
goto exit_tmpfile;
|
||||
} else
|
||||
archive_strcpy(&temp_name, tmpdir);
|
||||
@@ -0,0 +1,190 @@
|
||||
From c3593848067cea3b41bc11eec15f391318675cb4 Mon Sep 17 00:00:00 2001
|
||||
From: Tim Kientzle <kientzle@acm.org>
|
||||
Date: Tue, 28 Oct 2025 17:13:18 -0700
|
||||
Subject: [PATCH] Merge pull request #2753 from KlaraSystems/des/temp-files
|
||||
|
||||
Create temporary files in the target directory
|
||||
|
||||
(cherry picked from commit d2e861769c25470427656b36a14b535f17d47d03)
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/c3593848067cea3b41bc11eec15f391318675cb4]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
.../archive_read_disk_entry_from_file.c | 10 ++---
|
||||
libarchive/archive_string.c | 20 ++++++++++
|
||||
libarchive/archive_string.h | 4 ++
|
||||
libarchive/archive_write_disk_posix.c | 20 ++++++----
|
||||
libarchive/test/test_archive_string.c | 38 +++++++++++++++++++
|
||||
5 files changed, 79 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c
|
||||
index 42af4034..121af198 100644
|
||||
--- a/libarchive/archive_read_disk_entry_from_file.c
|
||||
+++ b/libarchive/archive_read_disk_entry_from_file.c
|
||||
@@ -359,12 +359,10 @@ setup_mac_metadata(struct archive_read_disk *a,
|
||||
return (ARCHIVE_OK);
|
||||
|
||||
archive_string_init(&tempfile);
|
||||
- if (__archive_get_tempdir(&tempfile) != ARCHIVE_OK) {
|
||||
- ret = ARCHIVE_WARN;
|
||||
- goto cleanup;
|
||||
- }
|
||||
- archive_strcat(&tempfile, "tar.md.XXXXXX");
|
||||
- tempfd = mkstemp(tempfile.s);
|
||||
+ archive_strcpy(&tempfile, name);
|
||||
+ archive_string_dirname(&tempfile);
|
||||
+ archive_strcat(&tempfile, "/tar.XXXXXXXX");
|
||||
+ tempfd = __archive_mkstemp(tempfile.s);
|
||||
if (tempfd < 0) {
|
||||
archive_set_error(&a->archive, errno,
|
||||
"Could not open extended attribute file");
|
||||
diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c
|
||||
index 3bb97833..740308b6 100644
|
||||
--- a/libarchive/archive_string.c
|
||||
+++ b/libarchive/archive_string.c
|
||||
@@ -2012,6 +2012,26 @@ archive_strncat_l(struct archive_string *as, const void *_p, size_t n,
|
||||
return (r);
|
||||
}
|
||||
|
||||
+struct archive_string *
|
||||
+archive_string_dirname(struct archive_string *as)
|
||||
+{
|
||||
+ /* strip trailing separators */
|
||||
+ while (as->length > 1 && as->s[as->length - 1] == '/')
|
||||
+ as->length--;
|
||||
+ /* strip final component */
|
||||
+ while (as->length > 0 && as->s[as->length - 1] != '/')
|
||||
+ as->length--;
|
||||
+ /* empty path -> cwd */
|
||||
+ if (as->length == 0)
|
||||
+ return (archive_strcat(as, "."));
|
||||
+ /* strip separator(s) */
|
||||
+ while (as->length > 1 && as->s[as->length - 1] == '/')
|
||||
+ as->length--;
|
||||
+ /* terminate */
|
||||
+ as->s[as->length] = '\0';
|
||||
+ return (as);
|
||||
+}
|
||||
+
|
||||
#if HAVE_ICONV
|
||||
|
||||
/*
|
||||
diff --git a/libarchive/archive_string.h b/libarchive/archive_string.h
|
||||
index e8987867..d5f5c03a 100644
|
||||
--- a/libarchive/archive_string.h
|
||||
+++ b/libarchive/archive_string.h
|
||||
@@ -195,6 +195,10 @@ void archive_string_vsprintf(struct archive_string *, const char *,
|
||||
void archive_string_sprintf(struct archive_string *, const char *, ...)
|
||||
__LA_PRINTF(2, 3);
|
||||
|
||||
+/* Equivalent to dirname(3) */
|
||||
+struct archive_string *
|
||||
+archive_string_dirname(struct archive_string *);
|
||||
+
|
||||
/* Translates from MBS to Unicode. */
|
||||
/* Returns non-zero if conversion failed in any way. */
|
||||
int archive_wstring_append_from_mbs(struct archive_wstring *dest,
|
||||
diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
|
||||
index 6fcf3929..cd256203 100644
|
||||
--- a/libarchive/archive_write_disk_posix.c
|
||||
+++ b/libarchive/archive_write_disk_posix.c
|
||||
@@ -412,12 +412,14 @@ static ssize_t _archive_write_disk_data_block(struct archive *, const void *,
|
||||
static int
|
||||
la_mktemp(struct archive_write_disk *a)
|
||||
{
|
||||
+ struct archive_string *tmp = &a->_tmpname_data;
|
||||
int oerrno, fd;
|
||||
mode_t mode;
|
||||
|
||||
- archive_string_empty(&a->_tmpname_data);
|
||||
- archive_string_sprintf(&a->_tmpname_data, "%s.XXXXXX", a->name);
|
||||
- a->tmpname = a->_tmpname_data.s;
|
||||
+ archive_strcpy(tmp, a->name);
|
||||
+ archive_string_dirname(tmp);
|
||||
+ archive_strcat(tmp, "/tar.XXXXXXXX");
|
||||
+ a->tmpname = tmp->s;
|
||||
|
||||
fd = __archive_mkstemp(a->tmpname);
|
||||
if (fd == -1)
|
||||
@@ -4251,8 +4253,10 @@ create_tempdatafork(struct archive_write_disk *a, const char *pathname)
|
||||
int tmpfd;
|
||||
|
||||
archive_string_init(&tmpdatafork);
|
||||
- archive_strcpy(&tmpdatafork, "tar.md.XXXXXX");
|
||||
- tmpfd = mkstemp(tmpdatafork.s);
|
||||
+ archive_strcpy(&tmpdatafork, pathname);
|
||||
+ archive_string_dirname(&tmpdatafork);
|
||||
+ archive_strcat(&tmpdatafork, "/tar.XXXXXXXX");
|
||||
+ tmpfd = __archive_mkstemp(tmpdatafork.s);
|
||||
if (tmpfd < 0) {
|
||||
archive_set_error(&a->archive, errno,
|
||||
"Failed to mkstemp");
|
||||
@@ -4331,8 +4335,10 @@ set_mac_metadata(struct archive_write_disk *a, const char *pathname,
|
||||
* silly dance of writing the data to disk just so that
|
||||
* copyfile() can read it back in again. */
|
||||
archive_string_init(&tmp);
|
||||
- archive_strcpy(&tmp, "tar.mmd.XXXXXX");
|
||||
- fd = mkstemp(tmp.s);
|
||||
+ archive_strcpy(&tmp, pathname);
|
||||
+ archive_string_dirname(&tmp);
|
||||
+ archive_strcat(&tmp, "/tar.XXXXXXXX");
|
||||
+ fd = __archive_mkstemp(tmp.s);
|
||||
|
||||
if (fd < 0) {
|
||||
archive_set_error(&a->archive, errno,
|
||||
diff --git a/libarchive/test/test_archive_string.c b/libarchive/test/test_archive_string.c
|
||||
index 30f7a800..bf822c0d 100644
|
||||
--- a/libarchive/test/test_archive_string.c
|
||||
+++ b/libarchive/test/test_archive_string.c
|
||||
@@ -354,6 +354,43 @@ test_archive_string_sprintf(void)
|
||||
archive_string_free(&s);
|
||||
}
|
||||
|
||||
+static void
|
||||
+test_archive_string_dirname(void)
|
||||
+{
|
||||
+ static struct pair { const char *str, *exp; } pairs[] = {
|
||||
+ { "", "." },
|
||||
+ { "/", "/" },
|
||||
+ { "//", "/" },
|
||||
+ { "///", "/" },
|
||||
+ { "./", "." },
|
||||
+ { ".", "." },
|
||||
+ { "..", "." },
|
||||
+ { "foo", "." },
|
||||
+ { "foo/", "." },
|
||||
+ { "foo//", "." },
|
||||
+ { "foo/bar", "foo" },
|
||||
+ { "foo/bar/", "foo" },
|
||||
+ { "foo/bar//", "foo" },
|
||||
+ { "foo//bar", "foo" },
|
||||
+ { "foo//bar/", "foo" },
|
||||
+ { "foo//bar//", "foo" },
|
||||
+ { "/foo", "/" },
|
||||
+ { "//foo", "/" },
|
||||
+ { "//foo/", "/" },
|
||||
+ { "//foo//", "/" },
|
||||
+ { 0 },
|
||||
+ };
|
||||
+ struct pair *pair;
|
||||
+ struct archive_string s;
|
||||
+
|
||||
+ archive_string_init(&s);
|
||||
+ for (pair = pairs; pair->str; pair++) {
|
||||
+ archive_strcpy(&s, pair->str);
|
||||
+ archive_string_dirname(&s);
|
||||
+ assertEqualString(pair->exp, s.s);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
DEFINE_TEST(test_archive_string)
|
||||
{
|
||||
test_archive_string_ensure();
|
||||
@@ -365,6 +402,7 @@ DEFINE_TEST(test_archive_string)
|
||||
test_archive_string_concat();
|
||||
test_archive_string_copy();
|
||||
test_archive_string_sprintf();
|
||||
+ test_archive_string_dirname();
|
||||
}
|
||||
|
||||
static const char *strings[] =
|
||||
@@ -0,0 +1,28 @@
|
||||
From 82b57a9740aa6d084edcf4592a3b8e49f63dec98 Mon Sep 17 00:00:00 2001
|
||||
From: Tim Kientzle <kientzle@acm.org>
|
||||
Date: Fri, 31 Oct 2025 22:07:19 -0700
|
||||
Subject: [PATCH] Merge pull request #2768 from Commandoss/master
|
||||
|
||||
Fix for an out-of-bounds buffer overrun when using p[H_LEVEL_OFFSET]
|
||||
|
||||
(cherry picked from commit ce614c65246158bcb0dc1f9c1dce5a5af65f9827)
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/82b57a9740aa6d084edcf4592a3b8e49f63dec98]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
libarchive/archive_read_support_format_lha.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c
|
||||
index 2a84ad9d..abf8b879 100644
|
||||
--- a/libarchive/archive_read_support_format_lha.c
|
||||
+++ b/libarchive/archive_read_support_format_lha.c
|
||||
@@ -690,7 +690,7 @@ archive_read_format_lha_read_header(struct archive_read *a,
|
||||
* a pathname and a symlink has '\' character, a directory
|
||||
* separator in DOS/Windows. So we should convert it to '/'.
|
||||
*/
|
||||
- if (p[H_LEVEL_OFFSET] == 0)
|
||||
+ if (lha->level == 0)
|
||||
lha_replace_path_separator(lha, entry);
|
||||
|
||||
archive_entry_set_mode(entry, lha->mode);
|
||||
@@ -0,0 +1,76 @@
|
||||
From 3150539edb18690c2c5f81c37fd2d3a35c69ace5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?ARJANEN=20Lo=C3=AFc=20Jean=20David?= <ljd@luigiscorner.mu>
|
||||
Date: Fri, 14 Nov 2025 20:34:48 +0100
|
||||
Subject: [PATCH] Fix bsdtar zero-length pattern issue.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Uses the sed-like way (and Java-like, and .Net-like, and Javascript-like…) to fix this issue of advancing the string to be processed by one if the match is zero-length.
|
||||
|
||||
Fixes libarchive/libarchive#2725 and solves libarchive/libarchive#2438.
|
||||
|
||||
CVE: CVE-2025-60753
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/3150539edb18690c2c5f81c37fd2d3a35c69ace5]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
tar/subst.c | 19 ++++++++++++-------
|
||||
tar/test/test_option_s.c | 8 +++++++-
|
||||
2 files changed, 19 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/tar/subst.c b/tar/subst.c
|
||||
index 9747abb9..902a4d64 100644
|
||||
--- a/tar/subst.c
|
||||
+++ b/tar/subst.c
|
||||
@@ -237,7 +237,9 @@ apply_substitution(struct bsdtar *bsdtar, const char *name, char **result,
|
||||
continue;
|
||||
}
|
||||
|
||||
- while (1) {
|
||||
+ char isEnd = 0;
|
||||
+ do {
|
||||
+ isEnd = *name == '\0';
|
||||
if (regexec(&rule->re, name, 10, matches, 0))
|
||||
break;
|
||||
|
||||
@@ -291,12 +293,15 @@ apply_substitution(struct bsdtar *bsdtar, const char *name, char **result,
|
||||
}
|
||||
|
||||
realloc_strcat(result, rule->result + j);
|
||||
-
|
||||
- name += matches[0].rm_eo;
|
||||
-
|
||||
- if (!rule->global)
|
||||
- break;
|
||||
- }
|
||||
+ if (matches[0].rm_eo > 0) {
|
||||
+ name += matches[0].rm_eo;
|
||||
+ } else {
|
||||
+ // We skip a character because the match is 0-length
|
||||
+ // so we need to add it to the output
|
||||
+ realloc_strncat(result, name, 1);
|
||||
+ name += 1;
|
||||
+ }
|
||||
+ } while (rule->global && !isEnd); // Testing one step after because sed et al. run 0-length patterns a last time on the empty string at the end
|
||||
}
|
||||
|
||||
if (got_match)
|
||||
diff --git a/tar/test/test_option_s.c b/tar/test/test_option_s.c
|
||||
index 564793b9..90b4c471 100644
|
||||
--- a/tar/test/test_option_s.c
|
||||
+++ b/tar/test/test_option_s.c
|
||||
@@ -61,7 +61,13 @@ DEFINE_TEST(test_option_s)
|
||||
systemf("%s -cf test1_2.tar -s /d1/d2/ in/d1/foo", testprog);
|
||||
systemf("%s -xf test1_2.tar -C test1", testprog);
|
||||
assertFileContents("foo", 3, "test1/in/d2/foo");
|
||||
-
|
||||
+ systemf("%s -cf test1_3.tar -s /o/#/g in/d1/foo", testprog);
|
||||
+ systemf("%s -xf test1_3.tar -C test1", testprog);
|
||||
+ assertFileContents("foo", 3, "test1/in/d1/f##");
|
||||
+ // For the 0-length pattern check, remember that "test1/" isn't part of the string affected by the regexp
|
||||
+ systemf("%s -cf test1_4.tar -s /f*/\\<~\\>/g in/d1/foo", testprog);
|
||||
+ systemf("%s -xf test1_4.tar -C test1", testprog);
|
||||
+ assertFileContents("foo", 3, "test1/<>i<>n<>/<>d<>1<>/<f><>o<>o<>");
|
||||
/*
|
||||
* Test 2: Basic substitution when extracting archive.
|
||||
*/
|
||||
@@ -43,6 +43,12 @@ SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
|
||||
file://0001-Improve-lseek-handling-2564.patch \
|
||||
file://CVE-2025-5918-01.patch \
|
||||
file://CVE-2025-5918-02.patch \
|
||||
file://0001-Fix-max-path-length-metadata-writing-2243.patch \
|
||||
file://0001-Merge-pull-request-2696-from-al3xtjames-mkstemp.patch \
|
||||
file://0001-Merge-pull-request-2749-from-KlaraSystems-des-tempdi.patch \
|
||||
file://0001-Merge-pull-request-2753-from-KlaraSystems-des-temp-f.patch \
|
||||
file://0001-Merge-pull-request-2768-from-Commandoss-master.patch \
|
||||
file://CVE-2025-60753.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_URI = "http://libarchive.org/"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ require gtk+3.inc
|
||||
|
||||
MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
|
||||
|
||||
SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar.xz \
|
||||
SRC_URI = "${GNOME_MIRROR}/gtk+/${MAJ_VER}/gtk+-${PV}.tar.xz \
|
||||
file://0002-Do-not-try-to-initialize-GL-without-libGL.patch \
|
||||
file://0003-Add-disable-opengl-configure-option.patch \
|
||||
file://link_fribidi.patch \
|
||||
|
||||
@@ -22,7 +22,7 @@ GIR_MESON_DISABLE_FLAG = 'disabled'
|
||||
|
||||
GTKDOC_MESON_OPTION = "gtk_doc"
|
||||
|
||||
UPSTREAM_CHECK_URI = "http://ftp.gnome.org/pub/GNOME/sources/libgudev/"
|
||||
UPSTREAM_CHECK_URI = "${GNOME_MIRROR}/libgudev/"
|
||||
UPSTREAM_CHECK_REGEX = "(?P<pver>(\d+))"
|
||||
|
||||
# This isn't a GNOME-style version do gnome_verdir fails. Just return the
|
||||
|
||||
@@ -13,8 +13,7 @@ SRCREV = "31486f40f8e8f8923ca0799aea84b58799754564"
|
||||
PV = "2.99.917+git${SRCPV}"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
SRC_URI = "git://anongit.freedesktop.org/xorg/driver/xf86-video-intel;branch=master \
|
||||
"
|
||||
SRC_URI = "git://gitlab.freedesktop.org/xorg/driver/xf86-video-intel.git;protocol=https;branch=master"
|
||||
|
||||
UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
From 5a4286b13f631b66c20f5bc8db7b68211dcbd1d0 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Wed, 2 Jul 2025 09:46:22 +0200
|
||||
Subject: [PATCH] present: Fix use-after-free in present_create_notifies()
|
||||
|
||||
Using the Present extension, if an error occurs while processing and
|
||||
adding the notifications after presenting a pixmap, the function
|
||||
present_create_notifies() will clean up and remove the notifications
|
||||
it added.
|
||||
|
||||
However, there are two different code paths that can lead to an error
|
||||
creating the notify, one being before the notify is being added to the
|
||||
list, and another one after the notify is added.
|
||||
|
||||
When the error occurs before it's been added, it removes the elements up
|
||||
to the last added element, instead of the actual number of elements
|
||||
which were added.
|
||||
|
||||
As a result, in case of error, as with an invalid window for example, it
|
||||
leaves a dangling pointer to the last element, leading to a use after
|
||||
free case later:
|
||||
|
||||
| Invalid write of size 8
|
||||
| at 0x5361D5: present_clear_window_notifies (present_notify.c:42)
|
||||
| by 0x534A56: present_destroy_window (present_screen.c:107)
|
||||
| by 0x41E441: xwl_destroy_window (xwayland-window.c:1959)
|
||||
| by 0x4F9EC9: compDestroyWindow (compwindow.c:622)
|
||||
| by 0x51EAC4: damageDestroyWindow (damage.c:1592)
|
||||
| by 0x4FDC29: DbeDestroyWindow (dbe.c:1291)
|
||||
| by 0x4EAC55: FreeWindowResources (window.c:1023)
|
||||
| by 0x4EAF59: DeleteWindow (window.c:1091)
|
||||
| by 0x4DE59A: doFreeResource (resource.c:890)
|
||||
| by 0x4DEFB2: FreeClientResources (resource.c:1156)
|
||||
| by 0x4A9AFB: CloseDownClient (dispatch.c:3567)
|
||||
| by 0x5DCC78: ClientReady (connection.c:603)
|
||||
| Address 0x16126200 is 16 bytes inside a block of size 2,048 free'd
|
||||
| at 0x4841E43: free (vg_replace_malloc.c:989)
|
||||
| by 0x5363DD: present_destroy_notifies (present_notify.c:111)
|
||||
| by 0x53638D: present_create_notifies (present_notify.c:100)
|
||||
| by 0x5368E9: proc_present_pixmap_common (present_request.c:164)
|
||||
| by 0x536A7D: proc_present_pixmap (present_request.c:189)
|
||||
| by 0x536FA9: proc_present_dispatch (present_request.c:337)
|
||||
| by 0x4A1E4E: Dispatch (dispatch.c:561)
|
||||
| by 0x4B00F1: dix_main (main.c:284)
|
||||
| by 0x42879D: main (stubmain.c:34)
|
||||
| Block was alloc'd at
|
||||
| at 0x48463F3: calloc (vg_replace_malloc.c:1675)
|
||||
| by 0x5362A1: present_create_notifies (present_notify.c:81)
|
||||
| by 0x5368E9: proc_present_pixmap_common (present_request.c:164)
|
||||
| by 0x536A7D: proc_present_pixmap (present_request.c:189)
|
||||
| by 0x536FA9: proc_present_dispatch (present_request.c:337)
|
||||
| by 0x4A1E4E: Dispatch (dispatch.c:561)
|
||||
| by 0x4B00F1: dix_main (main.c:284)
|
||||
| by 0x42879D: main (stubmain.c:34)
|
||||
|
||||
To fix the issue, count and remove the actual number of notify elements
|
||||
added in case of error.
|
||||
|
||||
CVE-2025-62229, ZDI-CAN-27238
|
||||
|
||||
This vulnerability was discovered by:
|
||||
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2086>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/5a4286b13f631b66c20f5bc8db7b68211dcbd1d0]
|
||||
CVE: CVE-2025-62229
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
present/present_notify.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/present/present_notify.c b/present/present_notify.c
|
||||
index 7d19d9cfe1..fe84d1f070 100644
|
||||
--- a/present/present_notify.c
|
||||
+++ b/present/present_notify.c
|
||||
@@ -92,7 +92,7 @@ present_create_notifies(ClientPtr client, int num_notifies, xPresentNotify *x_no
|
||||
if (status != Success)
|
||||
goto bail;
|
||||
|
||||
- added = i;
|
||||
+ added++;
|
||||
}
|
||||
return Success;
|
||||
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
From 865089ca70840c0f13a61df135f7b44a9782a175 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Wed, 10 Sep 2025 15:55:06 +0200
|
||||
Subject: [PATCH] xkb: Make the RT_XKBCLIENT resource private
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Currently, the resource in only available to the xkb.c source file.
|
||||
|
||||
In preparation for the next commit, to be able to free the resources
|
||||
from XkbRemoveResourceClient(), make that variable private instead.
|
||||
|
||||
This is related to:
|
||||
|
||||
CVE-2025-62230, ZDI-CAN-27545
|
||||
|
||||
This vulnerability was discovered by:
|
||||
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
||||
(cherry picked from commit 99790a2c9205a52fbbec01f21a92c9b7f4ed1d8f)
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2087>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/865089ca70840c0f13a61df135f7b44a9782a175]
|
||||
CVE: CVE-2025-62230
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
include/xkbsrv.h | 2 ++
|
||||
xkb/xkb.c | 2 +-
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/xkbsrv.h b/include/xkbsrv.h
|
||||
index fbb5427e1c..b2766277cf 100644
|
||||
--- a/include/xkbsrv.h
|
||||
+++ b/include/xkbsrv.h
|
||||
@@ -58,6 +58,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#include "inputstr.h"
|
||||
#include "events.h"
|
||||
|
||||
+extern RESTYPE RT_XKBCLIENT;
|
||||
+
|
||||
typedef struct _XkbInterest {
|
||||
DeviceIntPtr dev;
|
||||
ClientPtr client;
|
||||
diff --git a/xkb/xkb.c b/xkb/xkb.c
|
||||
index 5131bfcdf7..26d965d482 100644
|
||||
--- a/xkb/xkb.c
|
||||
+++ b/xkb/xkb.c
|
||||
@@ -51,7 +51,7 @@ int XkbKeyboardErrorCode;
|
||||
CARD32 xkbDebugFlags = 0;
|
||||
static CARD32 xkbDebugCtrls = 0;
|
||||
|
||||
-static RESTYPE RT_XKBCLIENT;
|
||||
+RESTYPE RT_XKBCLIENT = 0;
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
From 87fe2553937a99fd914ad0cde999376a3adc3839 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Wed, 10 Sep 2025 15:58:57 +0200
|
||||
Subject: [PATCH] xkb: Free the XKB resource when freeing XkbInterest
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
XkbRemoveResourceClient() would free the XkbInterest data associated
|
||||
with the device, but not the resource associated with it.
|
||||
|
||||
As a result, when the client terminates, the resource delete function
|
||||
gets called and accesses already freed memory:
|
||||
|
||||
| Invalid read of size 8
|
||||
| at 0x5BC0C0: XkbRemoveResourceClient (xkbEvents.c:1047)
|
||||
| by 0x5B3391: XkbClientGone (xkb.c:7094)
|
||||
| by 0x4DF138: doFreeResource (resource.c:890)
|
||||
| by 0x4DFB50: FreeClientResources (resource.c:1156)
|
||||
| by 0x4A9A59: CloseDownClient (dispatch.c:3550)
|
||||
| by 0x5E0A53: ClientReady (connection.c:601)
|
||||
| by 0x5E4FEF: ospoll_wait (ospoll.c:657)
|
||||
| by 0x5DC834: WaitForSomething (WaitFor.c:206)
|
||||
| by 0x4A1BA5: Dispatch (dispatch.c:491)
|
||||
| by 0x4B0070: dix_main (main.c:277)
|
||||
| by 0x4285E7: main (stubmain.c:34)
|
||||
| Address 0x1893e278 is 184 bytes inside a block of size 928 free'd
|
||||
| at 0x4842E43: free (vg_replace_malloc.c:989)
|
||||
| by 0x49C1A6: CloseDevice (devices.c:1067)
|
||||
| by 0x49C522: CloseOneDevice (devices.c:1193)
|
||||
| by 0x49C6E4: RemoveDevice (devices.c:1244)
|
||||
| by 0x5873D4: remove_master (xichangehierarchy.c:348)
|
||||
| by 0x587921: ProcXIChangeHierarchy (xichangehierarchy.c:504)
|
||||
| by 0x579BF1: ProcIDispatch (extinit.c:390)
|
||||
| by 0x4A1D85: Dispatch (dispatch.c:551)
|
||||
| by 0x4B0070: dix_main (main.c:277)
|
||||
| by 0x4285E7: main (stubmain.c:34)
|
||||
| Block was alloc'd at
|
||||
| at 0x48473F3: calloc (vg_replace_malloc.c:1675)
|
||||
| by 0x49A118: AddInputDevice (devices.c:262)
|
||||
| by 0x4A0E58: AllocDevicePair (devices.c:2846)
|
||||
| by 0x5866EE: add_master (xichangehierarchy.c:153)
|
||||
| by 0x5878C2: ProcXIChangeHierarchy (xichangehierarchy.c:493)
|
||||
| by 0x579BF1: ProcIDispatch (extinit.c:390)
|
||||
| by 0x4A1D85: Dispatch (dispatch.c:551)
|
||||
| by 0x4B0070: dix_main (main.c:277)
|
||||
| by 0x4285E7: main (stubmain.c:34)
|
||||
|
||||
To avoid that issue, make sure to free the resources when freeing the
|
||||
device XkbInterest data.
|
||||
|
||||
CVE-2025-62230, ZDI-CAN-27545
|
||||
|
||||
This vulnerability was discovered by:
|
||||
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
||||
(cherry picked from commit 10c94238bdad17c11707e0bdaaa3a9cd54c504be)
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2087>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/87fe2553937a99fd914ad0cde999376a3adc3839]
|
||||
CVE: CVE-2025-62230
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
xkb/xkbEvents.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
|
||||
index 0bbd661867..3d04ecf0c4 100644
|
||||
--- a/xkb/xkbEvents.c
|
||||
+++ b/xkb/xkbEvents.c
|
||||
@@ -1056,6 +1056,7 @@ XkbRemoveResourceClient(DevicePtr inDev, XID id)
|
||||
autoCtrls = interest->autoCtrls;
|
||||
autoValues = interest->autoCtrlValues;
|
||||
client = interest->client;
|
||||
+ FreeResource(interest->resource, RT_XKBCLIENT);
|
||||
free(interest);
|
||||
found = TRUE;
|
||||
}
|
||||
@@ -1067,6 +1068,7 @@ XkbRemoveResourceClient(DevicePtr inDev, XID id)
|
||||
autoCtrls = victim->autoCtrls;
|
||||
autoValues = victim->autoCtrlValues;
|
||||
client = victim->client;
|
||||
+ FreeResource(victim->resource, RT_XKBCLIENT);
|
||||
free(victim);
|
||||
found = TRUE;
|
||||
}
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
From 3baad99f9c15028ed8c3e3d8408e5ec35db155aa Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Wed, 10 Sep 2025 16:30:29 +0200
|
||||
Subject: [PATCH] xkb: Prevent overflow in XkbSetCompatMap()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The XkbCompatMap structure stores its "num_si" and "size_si" fields
|
||||
using an unsigned short.
|
||||
|
||||
However, the function _XkbSetCompatMap() will store the sum of the
|
||||
input data "firstSI" and "nSI" in both XkbCompatMap's "num_si" and
|
||||
"size_si" without first checking if the sum overflows the maximum
|
||||
unsigned short value, leading to a possible overflow.
|
||||
|
||||
To avoid the issue, check whether the sum does not exceed the maximum
|
||||
unsigned short value, or return a "BadValue" error otherwise.
|
||||
|
||||
CVE-2025-62231, ZDI-CAN-27560
|
||||
|
||||
This vulnerability was discovered by:
|
||||
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
||||
(cherry picked from commit 475d9f49acd0e55bc0b089ed77f732ad18585470)
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2087>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/3baad99f9c15028ed8c3e3d8408e5ec35db155aa]
|
||||
CVE: CVE-2025-62231
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
xkb/xkb.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/xkb/xkb.c b/xkb/xkb.c
|
||||
index 26d965d482..137d70da27 100644
|
||||
--- a/xkb/xkb.c
|
||||
+++ b/xkb/xkb.c
|
||||
@@ -2992,6 +2992,8 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev,
|
||||
XkbSymInterpretPtr sym;
|
||||
unsigned int skipped = 0;
|
||||
|
||||
+ if ((unsigned) (req->firstSI + req->nSI) > USHRT_MAX)
|
||||
+ return BadValue;
|
||||
if ((unsigned) (req->firstSI + req->nSI) > compat->size_si) {
|
||||
compat->num_si = compat->size_si = req->firstSI + req->nSI;
|
||||
compat->sym_interpret = reallocarray(compat->sym_interpret,
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -44,6 +44,10 @@ SRC_URI += "file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.pat
|
||||
file://CVE-2025-49179.patch \
|
||||
file://CVE-2025-49180-1.patch \
|
||||
file://CVE-2025-49180-2.patch \
|
||||
file://CVE-2025-62229.patch \
|
||||
file://CVE-2025-62230-1.patch \
|
||||
file://CVE-2025-62230-2.patch \
|
||||
file://CVE-2025-62231.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "38aadb735650c8024ee25211c190bf8aad844c5f59632761ab1ef4c4d5aeb152"
|
||||
|
||||
|
||||
89
meta/recipes-graphics/xwayland/xwayland/CVE-2025-62229.patch
Normal file
89
meta/recipes-graphics/xwayland/xwayland/CVE-2025-62229.patch
Normal file
@@ -0,0 +1,89 @@
|
||||
From 5a4286b13f631b66c20f5bc8db7b68211dcbd1d0 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Wed, 2 Jul 2025 09:46:22 +0200
|
||||
Subject: [PATCH] present: Fix use-after-free in present_create_notifies()
|
||||
|
||||
Using the Present extension, if an error occurs while processing and
|
||||
adding the notifications after presenting a pixmap, the function
|
||||
present_create_notifies() will clean up and remove the notifications
|
||||
it added.
|
||||
|
||||
However, there are two different code paths that can lead to an error
|
||||
creating the notify, one being before the notify is being added to the
|
||||
list, and another one after the notify is added.
|
||||
|
||||
When the error occurs before it's been added, it removes the elements up
|
||||
to the last added element, instead of the actual number of elements
|
||||
which were added.
|
||||
|
||||
As a result, in case of error, as with an invalid window for example, it
|
||||
leaves a dangling pointer to the last element, leading to a use after
|
||||
free case later:
|
||||
|
||||
| Invalid write of size 8
|
||||
| at 0x5361D5: present_clear_window_notifies (present_notify.c:42)
|
||||
| by 0x534A56: present_destroy_window (present_screen.c:107)
|
||||
| by 0x41E441: xwl_destroy_window (xwayland-window.c:1959)
|
||||
| by 0x4F9EC9: compDestroyWindow (compwindow.c:622)
|
||||
| by 0x51EAC4: damageDestroyWindow (damage.c:1592)
|
||||
| by 0x4FDC29: DbeDestroyWindow (dbe.c:1291)
|
||||
| by 0x4EAC55: FreeWindowResources (window.c:1023)
|
||||
| by 0x4EAF59: DeleteWindow (window.c:1091)
|
||||
| by 0x4DE59A: doFreeResource (resource.c:890)
|
||||
| by 0x4DEFB2: FreeClientResources (resource.c:1156)
|
||||
| by 0x4A9AFB: CloseDownClient (dispatch.c:3567)
|
||||
| by 0x5DCC78: ClientReady (connection.c:603)
|
||||
| Address 0x16126200 is 16 bytes inside a block of size 2,048 free'd
|
||||
| at 0x4841E43: free (vg_replace_malloc.c:989)
|
||||
| by 0x5363DD: present_destroy_notifies (present_notify.c:111)
|
||||
| by 0x53638D: present_create_notifies (present_notify.c:100)
|
||||
| by 0x5368E9: proc_present_pixmap_common (present_request.c:164)
|
||||
| by 0x536A7D: proc_present_pixmap (present_request.c:189)
|
||||
| by 0x536FA9: proc_present_dispatch (present_request.c:337)
|
||||
| by 0x4A1E4E: Dispatch (dispatch.c:561)
|
||||
| by 0x4B00F1: dix_main (main.c:284)
|
||||
| by 0x42879D: main (stubmain.c:34)
|
||||
| Block was alloc'd at
|
||||
| at 0x48463F3: calloc (vg_replace_malloc.c:1675)
|
||||
| by 0x5362A1: present_create_notifies (present_notify.c:81)
|
||||
| by 0x5368E9: proc_present_pixmap_common (present_request.c:164)
|
||||
| by 0x536A7D: proc_present_pixmap (present_request.c:189)
|
||||
| by 0x536FA9: proc_present_dispatch (present_request.c:337)
|
||||
| by 0x4A1E4E: Dispatch (dispatch.c:561)
|
||||
| by 0x4B00F1: dix_main (main.c:284)
|
||||
| by 0x42879D: main (stubmain.c:34)
|
||||
|
||||
To fix the issue, count and remove the actual number of notify elements
|
||||
added in case of error.
|
||||
|
||||
CVE-2025-62229, ZDI-CAN-27238
|
||||
|
||||
This vulnerability was discovered by:
|
||||
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2086>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/5a4286b13f631b66c20f5bc8db7b68211dcbd1d0]
|
||||
CVE: CVE-2025-62229
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
present/present_notify.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/present/present_notify.c b/present/present_notify.c
|
||||
index 7d19d9cfe1..fe84d1f070 100644
|
||||
--- a/present/present_notify.c
|
||||
+++ b/present/present_notify.c
|
||||
@@ -92,7 +92,7 @@ present_create_notifies(ClientPtr client, int num_notifies, xPresentNotify *x_no
|
||||
if (status != Success)
|
||||
goto bail;
|
||||
|
||||
- added = i;
|
||||
+ added++;
|
||||
}
|
||||
return Success;
|
||||
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
From 865089ca70840c0f13a61df135f7b44a9782a175 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Wed, 10 Sep 2025 15:55:06 +0200
|
||||
Subject: [PATCH] xkb: Make the RT_XKBCLIENT resource private
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Currently, the resource in only available to the xkb.c source file.
|
||||
|
||||
In preparation for the next commit, to be able to free the resources
|
||||
from XkbRemoveResourceClient(), make that variable private instead.
|
||||
|
||||
This is related to:
|
||||
|
||||
CVE-2025-62230, ZDI-CAN-27545
|
||||
|
||||
This vulnerability was discovered by:
|
||||
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
||||
(cherry picked from commit 99790a2c9205a52fbbec01f21a92c9b7f4ed1d8f)
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2087>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/865089ca70840c0f13a61df135f7b44a9782a175]
|
||||
CVE: CVE-2025-62230
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
include/xkbsrv.h | 2 ++
|
||||
xkb/xkb.c | 2 +-
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/xkbsrv.h b/include/xkbsrv.h
|
||||
index fbb5427e1c..b2766277cf 100644
|
||||
--- a/include/xkbsrv.h
|
||||
+++ b/include/xkbsrv.h
|
||||
@@ -58,6 +58,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#include "inputstr.h"
|
||||
#include "events.h"
|
||||
|
||||
+extern RESTYPE RT_XKBCLIENT;
|
||||
+
|
||||
typedef struct _XkbInterest {
|
||||
DeviceIntPtr dev;
|
||||
ClientPtr client;
|
||||
diff --git a/xkb/xkb.c b/xkb/xkb.c
|
||||
index 5131bfcdf7..26d965d482 100644
|
||||
--- a/xkb/xkb.c
|
||||
+++ b/xkb/xkb.c
|
||||
@@ -51,7 +51,7 @@ int XkbKeyboardErrorCode;
|
||||
CARD32 xkbDebugFlags = 0;
|
||||
static CARD32 xkbDebugCtrls = 0;
|
||||
|
||||
-static RESTYPE RT_XKBCLIENT;
|
||||
+RESTYPE RT_XKBCLIENT = 0;
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
From 87fe2553937a99fd914ad0cde999376a3adc3839 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Wed, 10 Sep 2025 15:58:57 +0200
|
||||
Subject: [PATCH] xkb: Free the XKB resource when freeing XkbInterest
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
XkbRemoveResourceClient() would free the XkbInterest data associated
|
||||
with the device, but not the resource associated with it.
|
||||
|
||||
As a result, when the client terminates, the resource delete function
|
||||
gets called and accesses already freed memory:
|
||||
|
||||
| Invalid read of size 8
|
||||
| at 0x5BC0C0: XkbRemoveResourceClient (xkbEvents.c:1047)
|
||||
| by 0x5B3391: XkbClientGone (xkb.c:7094)
|
||||
| by 0x4DF138: doFreeResource (resource.c:890)
|
||||
| by 0x4DFB50: FreeClientResources (resource.c:1156)
|
||||
| by 0x4A9A59: CloseDownClient (dispatch.c:3550)
|
||||
| by 0x5E0A53: ClientReady (connection.c:601)
|
||||
| by 0x5E4FEF: ospoll_wait (ospoll.c:657)
|
||||
| by 0x5DC834: WaitForSomething (WaitFor.c:206)
|
||||
| by 0x4A1BA5: Dispatch (dispatch.c:491)
|
||||
| by 0x4B0070: dix_main (main.c:277)
|
||||
| by 0x4285E7: main (stubmain.c:34)
|
||||
| Address 0x1893e278 is 184 bytes inside a block of size 928 free'd
|
||||
| at 0x4842E43: free (vg_replace_malloc.c:989)
|
||||
| by 0x49C1A6: CloseDevice (devices.c:1067)
|
||||
| by 0x49C522: CloseOneDevice (devices.c:1193)
|
||||
| by 0x49C6E4: RemoveDevice (devices.c:1244)
|
||||
| by 0x5873D4: remove_master (xichangehierarchy.c:348)
|
||||
| by 0x587921: ProcXIChangeHierarchy (xichangehierarchy.c:504)
|
||||
| by 0x579BF1: ProcIDispatch (extinit.c:390)
|
||||
| by 0x4A1D85: Dispatch (dispatch.c:551)
|
||||
| by 0x4B0070: dix_main (main.c:277)
|
||||
| by 0x4285E7: main (stubmain.c:34)
|
||||
| Block was alloc'd at
|
||||
| at 0x48473F3: calloc (vg_replace_malloc.c:1675)
|
||||
| by 0x49A118: AddInputDevice (devices.c:262)
|
||||
| by 0x4A0E58: AllocDevicePair (devices.c:2846)
|
||||
| by 0x5866EE: add_master (xichangehierarchy.c:153)
|
||||
| by 0x5878C2: ProcXIChangeHierarchy (xichangehierarchy.c:493)
|
||||
| by 0x579BF1: ProcIDispatch (extinit.c:390)
|
||||
| by 0x4A1D85: Dispatch (dispatch.c:551)
|
||||
| by 0x4B0070: dix_main (main.c:277)
|
||||
| by 0x4285E7: main (stubmain.c:34)
|
||||
|
||||
To avoid that issue, make sure to free the resources when freeing the
|
||||
device XkbInterest data.
|
||||
|
||||
CVE-2025-62230, ZDI-CAN-27545
|
||||
|
||||
This vulnerability was discovered by:
|
||||
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
||||
(cherry picked from commit 10c94238bdad17c11707e0bdaaa3a9cd54c504be)
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2087>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/87fe2553937a99fd914ad0cde999376a3adc3839]
|
||||
CVE: CVE-2025-62230
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
xkb/xkbEvents.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
|
||||
index 0bbd661867..3d04ecf0c4 100644
|
||||
--- a/xkb/xkbEvents.c
|
||||
+++ b/xkb/xkbEvents.c
|
||||
@@ -1056,6 +1056,7 @@ XkbRemoveResourceClient(DevicePtr inDev, XID id)
|
||||
autoCtrls = interest->autoCtrls;
|
||||
autoValues = interest->autoCtrlValues;
|
||||
client = interest->client;
|
||||
+ FreeResource(interest->resource, RT_XKBCLIENT);
|
||||
free(interest);
|
||||
found = TRUE;
|
||||
}
|
||||
@@ -1067,6 +1068,7 @@ XkbRemoveResourceClient(DevicePtr inDev, XID id)
|
||||
autoCtrls = victim->autoCtrls;
|
||||
autoValues = victim->autoCtrlValues;
|
||||
client = victim->client;
|
||||
+ FreeResource(victim->resource, RT_XKBCLIENT);
|
||||
free(victim);
|
||||
found = TRUE;
|
||||
}
|
||||
--
|
||||
GitLab
|
||||
|
||||
53
meta/recipes-graphics/xwayland/xwayland/CVE-2025-62231.patch
Normal file
53
meta/recipes-graphics/xwayland/xwayland/CVE-2025-62231.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
From 3baad99f9c15028ed8c3e3d8408e5ec35db155aa Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Wed, 10 Sep 2025 16:30:29 +0200
|
||||
Subject: [PATCH] xkb: Prevent overflow in XkbSetCompatMap()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The XkbCompatMap structure stores its "num_si" and "size_si" fields
|
||||
using an unsigned short.
|
||||
|
||||
However, the function _XkbSetCompatMap() will store the sum of the
|
||||
input data "firstSI" and "nSI" in both XkbCompatMap's "num_si" and
|
||||
"size_si" without first checking if the sum overflows the maximum
|
||||
unsigned short value, leading to a possible overflow.
|
||||
|
||||
To avoid the issue, check whether the sum does not exceed the maximum
|
||||
unsigned short value, or return a "BadValue" error otherwise.
|
||||
|
||||
CVE-2025-62231, ZDI-CAN-27560
|
||||
|
||||
This vulnerability was discovered by:
|
||||
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
||||
(cherry picked from commit 475d9f49acd0e55bc0b089ed77f732ad18585470)
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2087>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/3baad99f9c15028ed8c3e3d8408e5ec35db155aa]
|
||||
CVE: CVE-2025-62231
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
xkb/xkb.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/xkb/xkb.c b/xkb/xkb.c
|
||||
index 26d965d482..137d70da27 100644
|
||||
--- a/xkb/xkb.c
|
||||
+++ b/xkb/xkb.c
|
||||
@@ -2992,6 +2992,8 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev,
|
||||
XkbSymInterpretPtr sym;
|
||||
unsigned int skipped = 0;
|
||||
|
||||
+ if ((unsigned) (req->firstSI + req->nSI) > USHRT_MAX)
|
||||
+ return BadValue;
|
||||
if ((unsigned) (req->firstSI + req->nSI) > compat->size_si) {
|
||||
compat->num_si = compat->size_si = req->firstSI + req->nSI;
|
||||
compat->sym_interpret = reallocarray(compat->sym_interpret,
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -50,6 +50,10 @@ SRC_URI = "https://www.x.org/archive/individual/xserver/xwayland-${PV}.tar.xz \
|
||||
file://CVE-2025-49178.patch \
|
||||
file://CVE-2025-49179.patch \
|
||||
file://CVE-2025-49180.patch \
|
||||
file://CVE-2025-62229.patch \
|
||||
file://CVE-2025-62230-1.patch \
|
||||
file://CVE-2025-62230-2.patch \
|
||||
file://CVE-2025-62231.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73"
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=a6a458c13f18385b7bc5069a6d7b176e"
|
||||
|
||||
DEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
|
||||
|
||||
SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-2.0 \
|
||||
SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-2.0;protocol=https \
|
||||
file://run-ptest \
|
||||
file://0001-tests-do-not-run-test-applications-from-.libs.patch \
|
||||
file://0001-Make-manpages-multilib-identical.patch \
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From 1817916388cd8180f4411e6d0eb89a8c6916dce6 Mon Sep 17 00:00:00 2001
|
||||
From: Martijn van Beurden <mvanb1@gmail.com>
|
||||
Date: Mon, 25 Apr 2022 20:29:57 +0200
|
||||
Subject: [PATCH] Fix seeking bug
|
||||
|
||||
Commit 159cd6c introduced a bug that only triggered upon seeking
|
||||
from the start of a headerless FLAC file to the first frame (so
|
||||
really not a seek at all). Furthermore that commit did nothing
|
||||
else in any other circumstance. This commit fixes that, by both
|
||||
fixing the problem and the behaviour the commit mentioned earlier
|
||||
meant to introduce.
|
||||
|
||||
Co-authored-by: Robert Kausch <robert.kausch@freac.org>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/xiph/flac/commit/7e785eb9a84f9147246eb2b0e5e35ec01db5a815]
|
||||
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
|
||||
---
|
||||
src/libFLAC/stream_decoder.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
|
||||
index ef6da44..bc78645 100644
|
||||
--- a/src/libFLAC/stream_decoder.c
|
||||
+++ b/src/libFLAC/stream_decoder.c
|
||||
@@ -3077,7 +3077,8 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s
|
||||
upper_bound = stream_length;
|
||||
upper_bound_sample = total_samples > 0 ? total_samples : target_sample /*estimate it*/;
|
||||
|
||||
- if(decoder->protected_->state == FLAC__STREAM_DECODER_READ_FRAME) {
|
||||
+ if(decoder->protected_->state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC &&
|
||||
+ decoder->private_->samples_decoded != 0) {
|
||||
if(target_sample < decoder->private_->samples_decoded) {
|
||||
if(FLAC__stream_decoder_get_decode_position(decoder, &upper_bound))
|
||||
upper_bound_sample = decoder->private_->samples_decoded;
|
||||
@@ -16,7 +16,8 @@ DEPENDS = "libogg"
|
||||
|
||||
SRC_URI = "http://downloads.xiph.org/releases/flac/${BP}.tar.xz \
|
||||
file://CVE-2020-22219.patch \
|
||||
"
|
||||
file://0001-Fix-seeking-bug.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "8ff0607e75a322dd7cd6ec48f4f225471404ae2730d0ea945127b1355155e737"
|
||||
|
||||
|
||||
111
meta/recipes-multimedia/libpng/files/CVE-2025-64505-01.patch
Normal file
111
meta/recipes-multimedia/libpng/files/CVE-2025-64505-01.patch
Normal file
@@ -0,0 +1,111 @@
|
||||
From 0fa3c0f698c2ca618a0fa44e10a822678df85373 Mon Sep 17 00:00:00 2001
|
||||
From: Cosmin Truta <ctruta@gmail.com>
|
||||
Date: Thu, 15 Feb 2024 21:53:24 +0200
|
||||
Subject: [PATCH] chore: Clean up the spurious uses of `sizeof(png_byte)`; fix
|
||||
the manual
|
||||
|
||||
By definition, `sizeof(png_byte)` is 1.
|
||||
|
||||
Remove all the occurences of `sizeof(png_byte)` from the code, and fix
|
||||
a related typo in the libpng manual.
|
||||
|
||||
Also update the main .editorconfig file to reflect the fixing expected
|
||||
by a FIXME note.
|
||||
|
||||
CVE: CVE-2025-64505
|
||||
Upstream-Status: Backport [https://github.com/pnggroup/libpng/commit/0fa3c0f698c2ca618a0fa44e10a822678df85373]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
libpng-manual.txt | 4 ++--
|
||||
libpng.3 | 4 ++--
|
||||
pngrtran.c | 17 +++++++----------
|
||||
3 files changed, 11 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/libpng-manual.txt b/libpng-manual.txt
|
||||
index eb24ef483..d2918ce31 100644
|
||||
--- a/libpng-manual.txt
|
||||
+++ b/libpng-manual.txt
|
||||
@@ -1180,11 +1180,11 @@ where row_pointers is an array of pointers to the pixel data for each row:
|
||||
If you know your image size and pixel size ahead of time, you can allocate
|
||||
row_pointers prior to calling png_read_png() with
|
||||
|
||||
- if (height > PNG_UINT_32_MAX/(sizeof (png_byte)))
|
||||
+ if (height > PNG_UINT_32_MAX / (sizeof (png_bytep)))
|
||||
png_error (png_ptr,
|
||||
"Image is too tall to process in memory");
|
||||
|
||||
- if (width > PNG_UINT_32_MAX/pixel_size)
|
||||
+ if (width > PNG_UINT_32_MAX / pixel_size)
|
||||
png_error (png_ptr,
|
||||
"Image is too wide to process in memory");
|
||||
|
||||
diff --git a/libpng.3 b/libpng.3
|
||||
index 57d06f2db..8875b219a 100644
|
||||
--- a/libpng.3
|
||||
+++ b/libpng.3
|
||||
@@ -1699,11 +1699,11 @@ where row_pointers is an array of pointers to the pixel data for each row:
|
||||
If you know your image size and pixel size ahead of time, you can allocate
|
||||
row_pointers prior to calling png_read_png() with
|
||||
|
||||
- if (height > PNG_UINT_32_MAX/(sizeof (png_byte)))
|
||||
+ if (height > PNG_UINT_32_MAX / (sizeof (png_bytep)))
|
||||
png_error (png_ptr,
|
||||
"Image is too tall to process in memory");
|
||||
|
||||
- if (width > PNG_UINT_32_MAX/pixel_size)
|
||||
+ if (width > PNG_UINT_32_MAX / pixel_size)
|
||||
png_error (png_ptr,
|
||||
"Image is too wide to process in memory");
|
||||
|
||||
diff --git a/pngrtran.c b/pngrtran.c
|
||||
index 74cca476b..041f9306c 100644
|
||||
--- a/pngrtran.c
|
||||
+++ b/pngrtran.c
|
||||
@@ -441,7 +441,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
||||
int i;
|
||||
|
||||
png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr,
|
||||
- (png_alloc_size_t)((png_uint_32)num_palette * (sizeof (png_byte))));
|
||||
+ (png_alloc_size_t)num_palette);
|
||||
for (i = 0; i < num_palette; i++)
|
||||
png_ptr->quantize_index[i] = (png_byte)i;
|
||||
}
|
||||
@@ -458,7 +458,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
||||
|
||||
/* Initialize an array to sort colors */
|
||||
png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr,
|
||||
- (png_alloc_size_t)((png_uint_32)num_palette * (sizeof (png_byte))));
|
||||
+ (png_alloc_size_t)num_palette);
|
||||
|
||||
/* Initialize the quantize_sort array */
|
||||
for (i = 0; i < num_palette; i++)
|
||||
@@ -592,11 +592,9 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
||||
|
||||
/* Initialize palette index arrays */
|
||||
png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr,
|
||||
- (png_alloc_size_t)((png_uint_32)num_palette *
|
||||
- (sizeof (png_byte))));
|
||||
+ (png_alloc_size_t)num_palette);
|
||||
png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr,
|
||||
- (png_alloc_size_t)((png_uint_32)num_palette *
|
||||
- (sizeof (png_byte))));
|
||||
+ (png_alloc_size_t)num_palette);
|
||||
|
||||
/* Initialize the sort array */
|
||||
for (i = 0; i < num_palette; i++)
|
||||
@@ -761,12 +759,11 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
||||
size_t num_entries = ((size_t)1 << total_bits);
|
||||
|
||||
png_ptr->palette_lookup = (png_bytep)png_calloc(png_ptr,
|
||||
- (png_alloc_size_t)(num_entries * (sizeof (png_byte))));
|
||||
+ (png_alloc_size_t)(num_entries));
|
||||
|
||||
- distance = (png_bytep)png_malloc(png_ptr, (png_alloc_size_t)(num_entries *
|
||||
- (sizeof (png_byte))));
|
||||
+ distance = (png_bytep)png_malloc(png_ptr, (png_alloc_size_t)num_entries);
|
||||
|
||||
- memset(distance, 0xff, num_entries * (sizeof (png_byte)));
|
||||
+ memset(distance, 0xff, num_entries);
|
||||
|
||||
for (i = 0; i < num_palette; i++)
|
||||
{
|
||||
163
meta/recipes-multimedia/libpng/files/CVE-2025-64505-02.patch
Normal file
163
meta/recipes-multimedia/libpng/files/CVE-2025-64505-02.patch
Normal file
@@ -0,0 +1,163 @@
|
||||
From ea094764f3436e3c6524622724c2d342a3eff235 Mon Sep 17 00:00:00 2001
|
||||
From: Cosmin Truta <ctruta@gmail.com>
|
||||
Date: Sat, 8 Nov 2025 17:16:59 +0200
|
||||
Subject: [PATCH] Fix a memory leak in function `png_set_quantize`; refactor
|
||||
|
||||
Release the previously-allocated array `quantize_index` before
|
||||
reallocating it. This avoids leaking memory when the function
|
||||
`png_set_quantize` is called multiple times on the same `png_struct`.
|
||||
|
||||
This function assumed single-call usage, but fuzzing revealed that
|
||||
repeated calls would overwrite the pointers without freeing the
|
||||
original allocations, leaking 256 bytes per call for `quantize_index`
|
||||
and additional memory for `quantize_sort` when histogram-based
|
||||
quantization is used.
|
||||
|
||||
Also remove the array `quantize_sort` from the list of `png_struct`
|
||||
members and make it a local variable. This array is initialized,
|
||||
used and released exclusively inside the function `png_set_quantize`.
|
||||
|
||||
Reported-by: Samsung-PENTEST <Samsung-PENTEST@users.noreply.github.com>
|
||||
Analyzed-by: degrigis <degrigis@users.noreply.github.com>
|
||||
Reviewed-by: John Bowler <jbowler@acm.org>
|
||||
|
||||
CVE: CVE-2025-64505
|
||||
Upstream-Status: Backport [https://github.com/pnggroup/libpng/commit/ea094764f3436e3c6524622724c2d342a3eff235]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
pngrtran.c | 43 +++++++++++++++++++++++--------------------
|
||||
pngstruct.h | 1 -
|
||||
2 files changed, 23 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/pngrtran.c b/pngrtran.c
|
||||
index 1809db704..4632dd521 100644
|
||||
--- a/pngrtran.c
|
||||
+++ b/pngrtran.c
|
||||
@@ -440,6 +440,12 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
||||
{
|
||||
int i;
|
||||
|
||||
+ /* Initialize the array to index colors.
|
||||
+ *
|
||||
+ * Be careful to avoid leaking memory. Applications are allowed to call
|
||||
+ * this function more than once per png_struct.
|
||||
+ */
|
||||
+ png_free(png_ptr, png_ptr->quantize_index);
|
||||
png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr,
|
||||
(png_alloc_size_t)num_palette);
|
||||
for (i = 0; i < num_palette; i++)
|
||||
@@ -454,15 +460,14 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
||||
* Perhaps not the best solution, but good enough.
|
||||
*/
|
||||
|
||||
- int i;
|
||||
+ png_bytep quantize_sort;
|
||||
+ int i, j;
|
||||
|
||||
- /* Initialize an array to sort colors */
|
||||
- png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr,
|
||||
+ /* Initialize the local array to sort colors. */
|
||||
+ quantize_sort = (png_bytep)png_malloc(png_ptr,
|
||||
(png_alloc_size_t)num_palette);
|
||||
-
|
||||
- /* Initialize the quantize_sort array */
|
||||
for (i = 0; i < num_palette; i++)
|
||||
- png_ptr->quantize_sort[i] = (png_byte)i;
|
||||
+ quantize_sort[i] = (png_byte)i;
|
||||
|
||||
/* Find the least used palette entries by starting a
|
||||
* bubble sort, and running it until we have sorted
|
||||
@@ -474,19 +479,18 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
||||
for (i = num_palette - 1; i >= maximum_colors; i--)
|
||||
{
|
||||
int done; /* To stop early if the list is pre-sorted */
|
||||
- int j;
|
||||
|
||||
done = 1;
|
||||
for (j = 0; j < i; j++)
|
||||
{
|
||||
- if (histogram[png_ptr->quantize_sort[j]]
|
||||
- < histogram[png_ptr->quantize_sort[j + 1]])
|
||||
+ if (histogram[quantize_sort[j]]
|
||||
+ < histogram[quantize_sort[j + 1]])
|
||||
{
|
||||
png_byte t;
|
||||
|
||||
- t = png_ptr->quantize_sort[j];
|
||||
- png_ptr->quantize_sort[j] = png_ptr->quantize_sort[j + 1];
|
||||
- png_ptr->quantize_sort[j + 1] = t;
|
||||
+ t = quantize_sort[j];
|
||||
+ quantize_sort[j] = quantize_sort[j + 1];
|
||||
+ quantize_sort[j + 1] = t;
|
||||
done = 0;
|
||||
}
|
||||
}
|
||||
@@ -498,18 +502,18 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
||||
/* Swap the palette around, and set up a table, if necessary */
|
||||
if (full_quantize != 0)
|
||||
{
|
||||
- int j = num_palette;
|
||||
+ j = num_palette;
|
||||
|
||||
/* Put all the useful colors within the max, but don't
|
||||
* move the others.
|
||||
*/
|
||||
for (i = 0; i < maximum_colors; i++)
|
||||
{
|
||||
- if ((int)png_ptr->quantize_sort[i] >= maximum_colors)
|
||||
+ if ((int)quantize_sort[i] >= maximum_colors)
|
||||
{
|
||||
do
|
||||
j--;
|
||||
- while ((int)png_ptr->quantize_sort[j] >= maximum_colors);
|
||||
+ while ((int)quantize_sort[j] >= maximum_colors);
|
||||
|
||||
palette[i] = palette[j];
|
||||
}
|
||||
@@ -517,7 +521,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
||||
}
|
||||
else
|
||||
{
|
||||
- int j = num_palette;
|
||||
+ j = num_palette;
|
||||
|
||||
/* Move all the used colors inside the max limit, and
|
||||
* develop a translation table.
|
||||
@@ -525,13 +529,13 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
||||
for (i = 0; i < maximum_colors; i++)
|
||||
{
|
||||
/* Only move the colors we need to */
|
||||
- if ((int)png_ptr->quantize_sort[i] >= maximum_colors)
|
||||
+ if ((int)quantize_sort[i] >= maximum_colors)
|
||||
{
|
||||
png_color tmp_color;
|
||||
|
||||
do
|
||||
j--;
|
||||
- while ((int)png_ptr->quantize_sort[j] >= maximum_colors);
|
||||
+ while ((int)quantize_sort[j] >= maximum_colors);
|
||||
|
||||
tmp_color = palette[j];
|
||||
palette[j] = palette[i];
|
||||
@@ -569,8 +573,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
||||
}
|
||||
}
|
||||
}
|
||||
- png_free(png_ptr, png_ptr->quantize_sort);
|
||||
- png_ptr->quantize_sort = NULL;
|
||||
+ png_free(png_ptr, quantize_sort);
|
||||
}
|
||||
else
|
||||
{
|
||||
diff --git a/pngstruct.h b/pngstruct.h
|
||||
index 084422bc1..fe5fa0415 100644
|
||||
--- a/pngstruct.h
|
||||
+++ b/pngstruct.h
|
||||
@@ -413,7 +413,6 @@ struct png_struct_def
|
||||
|
||||
#ifdef PNG_READ_QUANTIZE_SUPPORTED
|
||||
/* The following three members were added at version 1.0.14 and 1.2.4 */
|
||||
- png_bytep quantize_sort; /* working sort array */
|
||||
png_bytep index_to_palette; /* where the original index currently is
|
||||
in the palette */
|
||||
png_bytep palette_to_index; /* which original index points to this
|
||||
52
meta/recipes-multimedia/libpng/files/CVE-2025-64505-03.patch
Normal file
52
meta/recipes-multimedia/libpng/files/CVE-2025-64505-03.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From 6a528eb5fd0dd7f6de1c39d30de0e41473431c37 Mon Sep 17 00:00:00 2001
|
||||
From: Cosmin Truta <ctruta@gmail.com>
|
||||
Date: Sat, 8 Nov 2025 23:58:26 +0200
|
||||
Subject: [PATCH] Fix a buffer overflow in `png_do_quantize`
|
||||
|
||||
Allocate the quantize_index array to PNG_MAX_PALETTE_LENGTH (256 bytes)
|
||||
instead of num_palette bytes. This approach matches the allocation
|
||||
pattern for `palette[]`, `trans_alpha[]` and `riffled_palette[]` which
|
||||
were similarly oversized in libpng 1.2.1 to prevent buffer overflows
|
||||
from malformed PNG files with out-of-range palette indices.
|
||||
|
||||
Out-of-range palette indices `index >= num_palette` will now read
|
||||
identity-mapped values from the `quantize_index` array (where index N
|
||||
maps to palette entry N). This prevents undefined behavior while
|
||||
avoiding runtime bounds checking overhead in the performance-critical
|
||||
pixel processing loop.
|
||||
|
||||
Reported-by: Samsung-PENTEST <Samsung-PENTEST@users.noreply.github.com>
|
||||
Analyzed-by: degrigis <degrigis@users.noreply.github.com>
|
||||
|
||||
CVE: CVE-2025-64505
|
||||
Upstream-Status: Backport [https://github.com/pnggroup/libpng/commit/6a528eb5fd0dd7f6de1c39d30de0e41473431c37]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
pngrtran.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/pngrtran.c b/pngrtran.c
|
||||
index 4632dd521..9c2475fde 100644
|
||||
--- a/pngrtran.c
|
||||
+++ b/pngrtran.c
|
||||
@@ -441,14 +441,18 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
||||
int i;
|
||||
|
||||
/* Initialize the array to index colors.
|
||||
+ *
|
||||
+ * Ensure quantize_index can fit 256 elements (PNG_MAX_PALETTE_LENGTH)
|
||||
+ * rather than num_palette elements. This is to prevent buffer overflows
|
||||
+ * caused by malformed PNG files with out-of-range palette indices.
|
||||
*
|
||||
* Be careful to avoid leaking memory. Applications are allowed to call
|
||||
* this function more than once per png_struct.
|
||||
*/
|
||||
png_free(png_ptr, png_ptr->quantize_index);
|
||||
png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr,
|
||||
- (png_alloc_size_t)num_palette);
|
||||
- for (i = 0; i < num_palette; i++)
|
||||
+ PNG_MAX_PALETTE_LENGTH);
|
||||
+ for (i = 0; i < PNG_MAX_PALETTE_LENGTH; i++)
|
||||
png_ptr->quantize_index[i] = (png_byte)i;
|
||||
}
|
||||
|
||||
57
meta/recipes-multimedia/libpng/files/CVE-2025-64506.patch
Normal file
57
meta/recipes-multimedia/libpng/files/CVE-2025-64506.patch
Normal file
@@ -0,0 +1,57 @@
|
||||
From 2bd84c019c300b78e811743fbcddb67c9d9bf821 Mon Sep 17 00:00:00 2001
|
||||
From: Cosmin Truta <ctruta@gmail.com>
|
||||
Date: Fri, 7 Nov 2025 22:40:05 +0200
|
||||
Subject: [PATCH] Fix a heap buffer overflow in `png_write_image_8bit`
|
||||
|
||||
The condition guarding the pre-transform path incorrectly allowed 8-bit
|
||||
input data to enter `png_write_image_8bit` which expects 16-bit input.
|
||||
This caused out-of-bounds reads when processing 8-bit grayscale+alpha
|
||||
images (GitHub #688), or 8-bit RGB or RGB+alpha images (GitHub #746),
|
||||
with the `convert_to_8bit` flag set (an invalid combination that should
|
||||
bypass the pre-transform path).
|
||||
|
||||
The second part of the condition, i.e.
|
||||
|
||||
colormap == 0 && convert_to_8bit != 0
|
||||
|
||||
failed to verify that input was 16-bit, i.e.
|
||||
|
||||
linear != 0
|
||||
|
||||
contradicting the comment "This only applies when the input is 16-bit".
|
||||
|
||||
The fix consists in restructuring the condition to ensure both the
|
||||
`alpha` path and the `convert_to_8bit` path require linear (16-bit)
|
||||
input. The corrected condition, i.e.
|
||||
|
||||
linear != 0 && (alpha != 0 || display->convert_to_8bit != 0)
|
||||
|
||||
matches the expectation of the `png_write_image_8bit` function and
|
||||
prevents treating 8-bit buffers as 16-bit data.
|
||||
|
||||
Reported-by: Samsung-PENTEST <Samsung-PENTEST@users.noreply.github.com>
|
||||
Reported-by: weijinjinnihao <weijinjinnihao@users.noreply.github.com>
|
||||
Analyzed-by: degrigis <degrigis@users.noreply.github.com>
|
||||
Reviewed-by: John Bowler <jbowler@acm.org>
|
||||
|
||||
CVE: CVE-2025-64506
|
||||
Upstream-Status: Backport [https://github.com/pnggroup/libpng/commit/2bd84c019c300b78e811743fbcddb67c9d9bf821]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
pngwrite.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/pngwrite.c b/pngwrite.c
|
||||
index 35a5d17b6..83148960e 100644
|
||||
--- a/pngwrite.c
|
||||
+++ b/pngwrite.c
|
||||
@@ -2129,8 +2129,7 @@ png_image_write_main(png_voidp argument)
|
||||
* before it is written. This only applies when the input is 16-bit and
|
||||
* either there is an alpha channel or it is converted to 8-bit.
|
||||
*/
|
||||
- if ((linear != 0 && alpha != 0 ) ||
|
||||
- (colormap == 0 && display->convert_to_8bit != 0))
|
||||
+ if (linear != 0 && (alpha != 0 || display->convert_to_8bit != 0))
|
||||
{
|
||||
png_bytep row = png_voidcast(png_bytep, png_malloc(png_ptr,
|
||||
png_get_rowbytes(png_ptr, info_ptr)));
|
||||
103
meta/recipes-multimedia/libpng/files/CVE-2025-64720.patch
Normal file
103
meta/recipes-multimedia/libpng/files/CVE-2025-64720.patch
Normal file
@@ -0,0 +1,103 @@
|
||||
From 08da33b4c88cfcd36e5a706558a8d7e0e4773643 Mon Sep 17 00:00:00 2001
|
||||
From: Cosmin Truta <ctruta@gmail.com>
|
||||
Date: Wed, 12 Nov 2025 13:46:23 +0200
|
||||
Subject: [PATCH] Fix a buffer overflow in `png_init_read_transformations`
|
||||
|
||||
The palette compositing code in `png_init_read_transformations` was
|
||||
incorrectly applying background compositing when PNG_FLAG_OPTIMIZE_ALPHA
|
||||
was set. This violated the premultiplied alpha invariant
|
||||
`component <= alpha` expected by `png_image_read_composite`, causing
|
||||
values that exceeded the valid range for the PNG_sRGB_FROM_LINEAR lookup
|
||||
tables.
|
||||
|
||||
When PNG_ALPHA_OPTIMIZED is active, palette entries should contain pure
|
||||
premultiplied RGB values without background compositing. The background
|
||||
compositing must happen later in `png_image_read_composite` where the
|
||||
actual background color from the PNG file is available.
|
||||
|
||||
The fix consists in introducing conditional behavior based on
|
||||
PNG_FLAG_OPTIMIZE_ALPHA: when set, the code performs only
|
||||
premultiplication using the formula `component * alpha + 127) / 255`
|
||||
with proper gamma correction. When not set, the original background
|
||||
compositing calculation based on the `png_composite` macro is preserved.
|
||||
|
||||
This prevents buffer overflows in `png_image_read_composite` where
|
||||
out-of-range premultiplied values would cause out-of-bounds array access
|
||||
in `png_sRGB_base[]` and `png_sRGB_delta[]`.
|
||||
|
||||
Reported-by: Samsung-PENTEST <Samsung-PENTEST@users.noreply.github.com>
|
||||
Analyzed-by: John Bowler <jbowler@acm.org>
|
||||
|
||||
CVE: CVE-2025-64720
|
||||
Upstream-Status: Backport [https://github.com/pnggroup/libpng/commit/08da33b4c88cfcd36e5a706558a8d7e0e4773643]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
pngrtran.c | 52 ++++++++++++++++++++++++++++++++++++++++++----------
|
||||
1 file changed, 42 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/pngrtran.c b/pngrtran.c
|
||||
index 548780030..2f5202255 100644
|
||||
--- a/pngrtran.c
|
||||
+++ b/pngrtran.c
|
||||
@@ -1698,19 +1698,51 @@ png_init_read_transformations(png_structrp png_ptr)
|
||||
}
|
||||
else /* if (png_ptr->trans_alpha[i] != 0xff) */
|
||||
{
|
||||
- png_byte v, w;
|
||||
+ if ((png_ptr->flags & PNG_FLAG_OPTIMIZE_ALPHA) != 0)
|
||||
+ {
|
||||
+ /* Premultiply only:
|
||||
+ * component = round((component * alpha) / 255)
|
||||
+ */
|
||||
+ png_uint_32 component;
|
||||
|
||||
- v = png_ptr->gamma_to_1[palette[i].red];
|
||||
- png_composite(w, v, png_ptr->trans_alpha[i], back_1.red);
|
||||
- palette[i].red = png_ptr->gamma_from_1[w];
|
||||
+ component = png_ptr->gamma_to_1[palette[i].red];
|
||||
+ component =
|
||||
+ (component * png_ptr->trans_alpha[i] + 128) / 255;
|
||||
+ palette[i].red = png_ptr->gamma_from_1[component];
|
||||
|
||||
- v = png_ptr->gamma_to_1[palette[i].green];
|
||||
- png_composite(w, v, png_ptr->trans_alpha[i], back_1.green);
|
||||
- palette[i].green = png_ptr->gamma_from_1[w];
|
||||
+ component = png_ptr->gamma_to_1[palette[i].green];
|
||||
+ component =
|
||||
+ (component * png_ptr->trans_alpha[i] + 128) / 255;
|
||||
+ palette[i].green = png_ptr->gamma_from_1[component];
|
||||
|
||||
- v = png_ptr->gamma_to_1[palette[i].blue];
|
||||
- png_composite(w, v, png_ptr->trans_alpha[i], back_1.blue);
|
||||
- palette[i].blue = png_ptr->gamma_from_1[w];
|
||||
+ component = png_ptr->gamma_to_1[palette[i].blue];
|
||||
+ component =
|
||||
+ (component * png_ptr->trans_alpha[i] + 128) / 255;
|
||||
+ palette[i].blue = png_ptr->gamma_from_1[component];
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* Composite with background color:
|
||||
+ * component =
|
||||
+ * alpha * component + (1 - alpha) * background
|
||||
+ */
|
||||
+ png_byte v, w;
|
||||
+
|
||||
+ v = png_ptr->gamma_to_1[palette[i].red];
|
||||
+ png_composite(w, v,
|
||||
+ png_ptr->trans_alpha[i], back_1.red);
|
||||
+ palette[i].red = png_ptr->gamma_from_1[w];
|
||||
+
|
||||
+ v = png_ptr->gamma_to_1[palette[i].green];
|
||||
+ png_composite(w, v,
|
||||
+ png_ptr->trans_alpha[i], back_1.green);
|
||||
+ palette[i].green = png_ptr->gamma_from_1[w];
|
||||
+
|
||||
+ v = png_ptr->gamma_to_1[palette[i].blue];
|
||||
+ png_composite(w, v,
|
||||
+ png_ptr->trans_alpha[i], back_1.blue);
|
||||
+ palette[i].blue = png_ptr->gamma_from_1[w];
|
||||
+ }
|
||||
}
|
||||
}
|
||||
else
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user