mirror of
https://git.yoctoproject.org/poky
synced 2026-02-21 08:59:41 +01:00
Compare commits
68 Commits
kirkstone-
...
yocto-4.0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81ab000fa4 | ||
|
|
3c825671cb | ||
|
|
b4dcef5ed5 | ||
|
|
a7f2f317f5 | ||
|
|
bedacbb603 | ||
|
|
9e416e05f6 | ||
|
|
f29a38bdcb | ||
|
|
bc3d85398a | ||
|
|
31dd8d47a6 | ||
|
|
7a75b9b4a7 | ||
|
|
1e39b807b7 | ||
|
|
a7033065b6 | ||
|
|
ab47f0cc84 | ||
|
|
37cd90079b | ||
|
|
5e3b686673 | ||
|
|
9c13654827 | ||
|
|
fc448b1b26 | ||
|
|
1ccf83e5d5 | ||
|
|
ac7ccf3ea7 | ||
|
|
fe4b8e0b69 | ||
|
|
7103a733a1 | ||
|
|
8fa7ff501e | ||
|
|
a485d82c25 | ||
|
|
875170d8f8 | ||
|
|
87e1bc09ca | ||
|
|
db3621b983 | ||
|
|
47c3b0bc3f | ||
|
|
5a3578faec | ||
|
|
f4219fb3e2 | ||
|
|
0a3f902542 | ||
|
|
9b3bd34826 | ||
|
|
4d3871178a | ||
|
|
ad1a2c9947 | ||
|
|
de4b007ac0 | ||
|
|
86182e972c | ||
|
|
e8aec82955 | ||
|
|
b6acab6e64 | ||
|
|
d668325fd8 | ||
|
|
78620e54fd | ||
|
|
d3219fb24b | ||
|
|
843820d9e4 | ||
|
|
c0623fde1f | ||
|
|
7def40e0b1 | ||
|
|
be98aa95ad | ||
|
|
4ee43d7d68 | ||
|
|
cb43809aa3 | ||
|
|
e4547e0671 | ||
|
|
9f2ecf7157 | ||
|
|
85c0d7d0aa | ||
|
|
6b95583a82 | ||
|
|
6cc6cd3f8d | ||
|
|
022d6ec767 | ||
|
|
580a1571c4 | ||
|
|
def97edcef | ||
|
|
65b1587627 | ||
|
|
fcecadd605 | ||
|
|
36c444aafc | ||
|
|
bfcca9e202 | ||
|
|
3171dcc835 | ||
|
|
0ef633a0bb | ||
|
|
4c0768543a | ||
|
|
53e9e45350 | ||
|
|
5e6e115925 | ||
|
|
4d49fa2619 | ||
|
|
152e759cb6 | ||
|
|
50856ee7a6 | ||
|
|
a17ec857df | ||
|
|
8a1287dec6 |
@@ -1335,7 +1335,7 @@ class FetchLatestVersionTest(FetcherTest):
|
||||
# combination version pattern
|
||||
("sysprof", "git://git.yoctoproject.org/sysprof.git;protocol=https;branch=master", "cd44ee6644c3641507fb53b8a2a69137f2971219", "")
|
||||
: "1.2.0",
|
||||
("u-boot-mkimage", "git://source.denx.de/u-boot/u-boot.git;branch=master;protocol=https", "62c175fbb8a0f9a926c88294ea9f7e88eb898f6c", "")
|
||||
("u-boot-mkimage", "git://git.yoctoproject.org/bbfetchtests-u-boot.git;branch=master;protocol=https", "62c175fbb8a0f9a926c88294ea9f7e88eb898f6c", "")
|
||||
: "2014.01",
|
||||
# version pattern "yyyymmdd"
|
||||
("mobile-broadband-provider-info", "git://git.yoctoproject.org/mobile-broadband-provider-info.git;protocol=https;branch=master", "4ed19e11c2975105b71b956440acdb25d46a347d", "")
|
||||
|
||||
@@ -171,13 +171,13 @@ from sphinx.search import SearchEnglish
|
||||
from sphinx.search import languages
|
||||
class DashFriendlySearchEnglish(SearchEnglish):
|
||||
|
||||
# Accept words that can include hyphens
|
||||
_word_re = re.compile(r'[\w\-]+')
|
||||
# Accept words that can include 'inner' hyphens or dots
|
||||
_word_re = re.compile(r'[\w]+(?:[\.\-][\w]+)*')
|
||||
|
||||
js_splitter_code = r"""
|
||||
function splitQuery(query) {
|
||||
return query
|
||||
.split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}-]+/gu)
|
||||
.split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}\-\.]+/gu)
|
||||
.filter(term => term.length > 0);
|
||||
}
|
||||
"""
|
||||
|
||||
@@ -543,6 +543,7 @@ your Yocto Project build host:
|
||||
DISKPART> select vdisk file="<path_to_VHDX_file>"
|
||||
DISKPART> attach vdisk readonly
|
||||
DISKPART> compact vdisk
|
||||
DISKPART> detach
|
||||
DISKPART> exit
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -34,3 +34,4 @@ Release 4.0 (kirkstone)
|
||||
release-notes-4.0.25
|
||||
release-notes-4.0.26
|
||||
release-notes-4.0.27
|
||||
release-notes-4.0.28
|
||||
|
||||
224
documentation/migration-guides/release-notes-4.0.28.rst
Normal file
224
documentation/migration-guides/release-notes-4.0.28.rst
Normal file
@@ -0,0 +1,224 @@
|
||||
Release notes for Yocto-4.0.28 (Kirkstone)
|
||||
------------------------------------------
|
||||
|
||||
Security Fixes in Yocto-4.0.28
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- binutils: Fix :cve_nist:`2025-1180`, :cve_nist:`2025-1182`, :cve_nist:`2025-5244` and
|
||||
:cve_nist:`2025-5245`
|
||||
- connman: Fix :cve_nist:`2025-32366`
|
||||
- ffmpeg: Fix :cve_nist:`2025-1373`, :cve_nist:`2025-22919` and :cve_nist:`2025-22921`
|
||||
- ffmpeg: Ignore :cve_nist:`2022-48434`
|
||||
- ghostscript: Fix :cve_nist:`2025-48708`
|
||||
- git: Fix :cve_nist:`2024-50349` and :cve_nist:`2024-52006`
|
||||
- glib-2.0: Fix :cve_nist:`2025-4373`
|
||||
- glibc: Fix for :cve_nist:`2025-4802`
|
||||
- go: Fix :cve_nist:`2025-4673`
|
||||
- go: ignore :cve_nist:`2024-3566`
|
||||
- icu: Fix :cve_nist:`2025-5222`
|
||||
- iputils: Fix :cve_nist:`2025-47268`
|
||||
- libsoup-2.4: Fix :cve_nist:`2025-2784`, :cve_nist:`2025-4476`, :cve_nist:`2025-4948`,
|
||||
:cve_nist:`2025-4969`, :cve_nist:`2025-32050`, :cve_nist:`2025-32052`, :cve_nist:`2025-32053`,
|
||||
:cve_nist:`2025-32907`, :cve_nist:`2025-32910`, :cve_nist:`2025-32911`, :cve_nist:`2025-32912`,
|
||||
:cve_nist:`2025-32913`, :cve_nist:`2025-32914`, :cve_nist:`2025-46420` and :cve_nist:`2025-46421`
|
||||
- libsoup: Fix :cve_nist:`2025-2784`, :cve_nist:`2025-4476`, :cve_nist:`2025-4948`,
|
||||
:cve_nist:`2025-4969`, :cve_nist:`2025-32050`, :cve_nist:`2025-32051`, :cve_nist:`2025-32052`,
|
||||
:cve_nist:`2025-32053`, :cve_nist:`2025-32907`, :cve_nist:`2025-46420` and :cve_nist:`2025-46421`
|
||||
- linux-yocto/5.15: Fix :cve_nist:`2024-26952`, :cve_nist:`2025-21941`, :cve_nist:`2025-21957`,
|
||||
:cve_nist:`2025-21959`, :cve_nist:`2025-21962`, :cve_nist:`2025-21963`, :cve_nist:`2025-21964`,
|
||||
:cve_nist:`2025-21968`, :cve_nist:`2025-21996`, :cve_nist:`2025-22018`, :cve_nist:`2025-22020`,
|
||||
:cve_nist:`2025-22035`, :cve_nist:`2025-22054`, :cve_nist:`2025-22056`, :cve_nist:`2025-22063`,
|
||||
:cve_nist:`2025-22066`, :cve_nist:`2025-22081`, :cve_nist:`2025-22097`, :cve_nist:`2025-23136`,
|
||||
:cve_nist:`2025-37785`, :cve_nist:`2025-37803`, :cve_nist:`2025-37805`, :cve_nist:`2025-38152`,
|
||||
:cve_nist:`2025-39728` and :cve_nist:`2025-39735`
|
||||
- net-tools: Fix :cve_nist:`2025-46836`
|
||||
- openssh: Fix :cve_nist:`2025-32728`
|
||||
- python3: Fix :cve_nist:`2024-12718`, :cve_nist:`2025-0938`, :cve_nist:`2025-4138`,
|
||||
:cve_nist:`2025-4330`, :cve_nist:`2025-4435`, :cve_nist:`2025-4516` and :cve_nist:`2025-4517`
|
||||
- python3-requests: Fix :cve_nist:`2024-47081`
|
||||
- python3-setuptools: Fix :cve_nist:`2025-47273`
|
||||
- ruby: Fix :cve_nist:`2025-27221`
|
||||
- screen: Fix :cve_nist:`2025-46802`, :cve_nist:`2025-46804` and :cve_nist:`2025-46805`
|
||||
- taglib: Fix :cve_nist:`2023-47466`
|
||||
|
||||
|
||||
Fixes in Yocto-4.0.28
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- babeltrace/libatomic-ops: correct the :term:`SRC_URI`
|
||||
- brief-yoctoprojectqs/ref-manual: Switch to new CDN
|
||||
- bsp guide: update kernel version example to 6.12
|
||||
- bsp-guide: update lonely "4.12" kernel reference to "6.12"
|
||||
- build-appliance-image: Update to kirkstone head revision
|
||||
- cmake: Correctly handle cost data of tests with arbitrary chars in name
|
||||
- conf.py: tweak SearchEnglish to be hyphen-friendly
|
||||
- contributor-guide/submit-changes: encourage patch version changelogs
|
||||
- dev-manual/sbom.rst: fix wrong build outputs
|
||||
- docs: Clean up explanation of minimum required version numbers
|
||||
- docs: README: specify how to contribute instead of pointing at another file
|
||||
- docs: conf.py: silence SyntaxWarning on js_splitter_code
|
||||
- e2fsprogs: removed 'sed -u' option
|
||||
- ffmpeg: Add "libswresample libavcodec" to :term:`CVE_PRODUCT`
|
||||
- ffmpeg: upgrade to 5.0.3
|
||||
- gcc: AArch64 - Fix strict-align cpymem/setmem
|
||||
- glibc: nptl Fix indentation
|
||||
- glibc: nptl Remove unnecessary catch-all-wake in condvar group switch
|
||||
- glibc: nptl Remove unnecessary quadruple check in pthread_cond_wait
|
||||
- glibc: nptl Update comments and indentation for new condvar implementation
|
||||
- glibc: nptl Use a single loop in pthread_cond_wait instaed of a nested loop
|
||||
- glibc: nptl Use all of g1_start and g_signals
|
||||
- glibc: nptl rename __condvar_quiesce_and_switch_g1
|
||||
- glibc: pthreads NPTL lost wakeup fix 2
|
||||
- kernel.bbclass: add original package name to :term:`RPROVIDES` for -image and -base
|
||||
- libpng: Improve ptest
|
||||
- linux-yocto/5.15: update to v5.15.184
|
||||
- migration-guides: add release notes for 4.0.26 and 4.0.27
|
||||
- nfs-utils: don't use signals to shut down nfs server.
|
||||
- poky.conf: bump version for 4.0.28
|
||||
- python3: upgrade to 3.10.18
|
||||
- ref-manual/release-process: update releases.svg
|
||||
- ref-manual/variables.rst: document :term:`INHIBIT_DEFAULT_RUST_DEPS`
|
||||
:term:`INHIBIT_UPDATERCD_BBCLASS` :term:`SSTATE_SKIP_CREATION` :term:`WIC_CREATE_EXTRA_ARGS`
|
||||
:term:`IMAGE_ROOTFS_MAXSIZE` :term:`INITRAMFS_MAXSIZE`
|
||||
- ref-manual: clarify :term:`KCONFIG_MODE` default behaviour
|
||||
- ref-manual: classes: nativesdk: move note to appropriate section
|
||||
- ref-manual: classes: reword to clarify that native/nativesdk options are exclusive
|
||||
- ref-manual: kernel-fitimage.bbclass does not use :term:`SPL_SIGN_KEYNAME`
|
||||
- scripts/install-buildtools: Update to 4.0.27
|
||||
- sphinx-lint: role missing opening tag colon
|
||||
- sphinx-lint: trailing whitespace
|
||||
- sphinx-lint: unbalanced inline literal markup
|
||||
- sysstat: correct the :term:`SRC_URI`
|
||||
- systemtap: add sysroot Python paths to configure flags
|
||||
- test-manual/intro: remove Buildbot version used
|
||||
- util-linux: Add fix to isolate test fstab entries using CUSTOM_FSTAB
|
||||
- xz: Update :term:`LICENSE` variable for xz packages
|
||||
|
||||
|
||||
Known Issues in Yocto-4.0.28
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- N/A
|
||||
|
||||
|
||||
Contributors to Yocto-4.0.28
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Aditya Tayade
|
||||
- Adrian Freihofer
|
||||
- Aleksandar Nikolic
|
||||
- Alper Ak
|
||||
- Antonin Godard
|
||||
- Archana Polampalli
|
||||
- Ashish Sharma
|
||||
- Bruce Ashfield
|
||||
- Carlos Sánchez de La Lama
|
||||
- Changqing Li
|
||||
- Christos Gavros
|
||||
- Colin Pinnell McAllister
|
||||
- Deepesh Varatharajan
|
||||
- Divya Chellam
|
||||
- Enrico Jörns
|
||||
- Etienne Cordonnier
|
||||
- Guocai He
|
||||
- Harish Sadineni
|
||||
- Hitendra Prajapati
|
||||
- Jiaying Song
|
||||
- Lee Chee Yang
|
||||
- Martin Jansa
|
||||
- Moritz Haase
|
||||
- NeilBrown
|
||||
- Peter Marko
|
||||
- Poonam Jadhav
|
||||
- Praveen Kumar
|
||||
- Quentin Schulz
|
||||
- Richard Purdie
|
||||
- Robert P. J. Day
|
||||
- Soumya Sambu
|
||||
- Steve Sakoman
|
||||
- Sundeep KOKKONDA
|
||||
- Sunil Dora
|
||||
- Trevor Woerner
|
||||
- Vijay Anusuri
|
||||
- Virendra Thakur
|
||||
- Yi Zhao
|
||||
- aszh07
|
||||
|
||||
|
||||
Repositories / Downloads for Yocto-4.0.28
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
poky
|
||||
|
||||
- Repository Location: :yocto_git:`/poky`
|
||||
- Branch: :yocto_git:`kirkstone </poky/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.28 </poky/log/?h=yocto-4.0.28>`
|
||||
- Git Revision: :yocto_git:`78c9cb3eaf071932567835742608404d5ce23cc4 </poky/commit/?id=78c9cb3eaf071932567835742608404d5ce23cc4>`
|
||||
- Release Artefact: poky-78c9cb3eaf071932567835742608404d5ce23cc4
|
||||
- sha: 9c73c6f89e70c2041a52851e5cc582e5a2f05ad2fdc110d2c518f2c4994e8de3
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.28/poky-78c9cb3eaf071932567835742608404d5ce23cc4.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.28/poky-78c9cb3eaf071932567835742608404d5ce23cc4.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.28 </openembedded-core/log/?h=yocto-4.0.28>`
|
||||
- Git Revision: :oe_git:`75e54301c5076eb0454aee33c870adf078f563fd </openembedded-core/commit/?id=75e54301c5076eb0454aee33c870adf078f563fd>`
|
||||
- Release Artefact: oecore-75e54301c5076eb0454aee33c870adf078f563fd
|
||||
- sha: c5ffceab90881c4041ec4304da8b7b32d9c1f89a4c63ee7b8cbd53c796b0187b
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.28/oecore-75e54301c5076eb0454aee33c870adf078f563fd.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.28/oecore-75e54301c5076eb0454aee33c870adf078f563fd.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.28 </meta-mingw/log/?h=yocto-4.0.28>`
|
||||
- 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.28/meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.28/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.28 </meta-gplv2/log/?h=yocto-4.0.28>`
|
||||
- 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.28/meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.28/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.28 </bitbake/log/?h=yocto-4.0.28>`
|
||||
- Git Revision: :oe_git:`046871d9fd76efdca7b72718b328d8f545523f7e </bitbake/commit/?id=046871d9fd76efdca7b72718b328d8f545523f7e>`
|
||||
- Release Artefact: bitbake-046871d9fd76efdca7b72718b328d8f545523f7e
|
||||
- sha: e9df0a9f5921b583b539188d66b23f120e1751000e7822e76c3391d5c76ee21a
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.28/bitbake-046871d9fd76efdca7b72718b328d8f545523f7e.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.28/bitbake-046871d9fd76efdca7b72718b328d8f545523f7e.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.28 </meta-yocto/log/?h=yocto-4.0.28>`
|
||||
- Git Revision: :yocto_git:`0bf3dcef1caa80fb047bf9c3514314ab658e30ea </meta-yocto/commit/?id=0bf3dcef1caa80fb047bf9c3514314ab658e30ea>`
|
||||
|
||||
yocto-docs
|
||||
|
||||
- Repository Location: :yocto_git:`/yocto-docs`
|
||||
- Branch: :yocto_git:`kirkstone </yocto-docs/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.28 </yocto-docs/log/?h=yocto-4.0.28>`
|
||||
- Git Revision: :yocto_git:`97cd3ee7f3bf1de8454708d1852ea9cdbd45c39b </yocto-docs/commit/?id=97cd3ee7f3bf1de8454708d1852ea9cdbd45c39b>`
|
||||
|
||||
@@ -2438,8 +2438,8 @@ The contents of ``sayhello_0.1.bb`` are::
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
do_install(){
|
||||
install -d ${D}/usr/bin
|
||||
install -m 0700 sayhello ${D}/usr/bin
|
||||
install -d ${D}${bindir}
|
||||
install -m 0700 sayhello ${D}${bindir}
|
||||
}
|
||||
|
||||
After placing the recipes in a custom layer we can run ``bitbake sayhello``
|
||||
|
||||
@@ -4571,6 +4571,27 @@ system and gives an overview of their function and contents.
|
||||
the :term:`KERNEL_PATH` variable. Both variables are common variables
|
||||
used by external Makefiles to point to the kernel source directory.
|
||||
|
||||
:term:`KERNEL_SPLIT_MODULES`
|
||||
When inheriting the :ref:`ref-classes-kernel-module-split` class, this
|
||||
variable controls whether kernel modules are split into separate packages
|
||||
or bundled into a single package.
|
||||
|
||||
For some use cases, a monolithic kernel module package
|
||||
:term:`KERNEL_PACKAGE_NAME` that contains all modules built from the
|
||||
kernel sources may be preferred to speed up the installation.
|
||||
|
||||
By default, this variable is set to ``1``, resulting in one package per
|
||||
module. Setting it to any other value will generate a single monolithic
|
||||
package containing all kernel modules.
|
||||
|
||||
.. note::
|
||||
|
||||
If :term:`KERNEL_SPLIT_MODULES` is set to 0, it is still possible to
|
||||
install all kernel modules at once by adding ``kernel-modules`` (assuming
|
||||
:term:`KERNEL_PACKAGE_NAME` is ``kernel-modules``) to :term:`IMAGE_INSTALL`.
|
||||
The way it works is that a placeholder "kernel-modules" package will be
|
||||
created and will depend on every other individual kernel module packages.
|
||||
|
||||
:term:`KERNEL_SRC`
|
||||
The location of the kernel sources. This variable is set to the value
|
||||
of the :term:`STAGING_KERNEL_DIR` within
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
#DISTRO_VERSION = "3.4+snapshot-${METADATA_REVISION}"
|
||||
DISTRO_VERSION = "4.0.28"
|
||||
DISTRO_VERSION = "4.0.29"
|
||||
DISTRO_CODENAME = "kirkstone"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${METADATA_REVISION}', 'snapshot')}"
|
||||
|
||||
@@ -194,3 +194,27 @@ class skipIfQemu(OETestDecorator):
|
||||
self.logger.debug("Checking if qemu MACHINE")
|
||||
if self.case.td.get('MACHINE', '').startswith('qemu'):
|
||||
self.case.skipTest('Test only runs on real hardware')
|
||||
|
||||
@registerDecorator
|
||||
class skipIfArch(OETestDecorator):
|
||||
"""
|
||||
Skip test if HOST_ARCH is present in the tuple specified.
|
||||
"""
|
||||
|
||||
attrs = ('archs',)
|
||||
def setUpDecorator(self):
|
||||
arch = self.case.td['HOST_ARCH']
|
||||
if arch in self.archs:
|
||||
self.case.skipTest('Test skipped on %s' % arch)
|
||||
|
||||
@registerDecorator
|
||||
class skipIfNotArch(OETestDecorator):
|
||||
"""
|
||||
Skip test if HOST_ARCH is not present in the tuple specified.
|
||||
"""
|
||||
|
||||
attrs = ('archs',)
|
||||
def setUpDecorator(self):
|
||||
arch = self.case.td['HOST_ARCH']
|
||||
if arch not in self.archs:
|
||||
self.case.skipTest('Test skipped on %s' % arch)
|
||||
|
||||
@@ -36,6 +36,7 @@ SRC_URI = "https://github.com/lathiat/avahi/releases/download/v${PV}/avahi-${PV}
|
||||
file://CVE-2023-38472.patch \
|
||||
file://CVE-2023-38473.patch \
|
||||
file://CVE-2024-52616.patch \
|
||||
file://CVE-2024-52615.patch \
|
||||
"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://github.com/lathiat/avahi/releases/"
|
||||
|
||||
228
meta/recipes-connectivity/avahi/files/CVE-2024-52615.patch
Normal file
228
meta/recipes-connectivity/avahi/files/CVE-2024-52615.patch
Normal file
@@ -0,0 +1,228 @@
|
||||
From 4e2e1ea0908d7e6ad7f38ae04fdcdf2411f8b942 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Sekletar <msekleta@redhat.com>
|
||||
Date: Wed, 27 Nov 2024 18:07:32 +0100
|
||||
Subject: [PATCH] core/wide-area: fix for CVE-2024-52615
|
||||
|
||||
CVE: CVE-2024-52615
|
||||
Upstream-Status: Backport [https://github.com/avahi/avahi/commit/4e2e1ea0908d7e6ad7f38ae04fdcdf2411f8b942]
|
||||
|
||||
Signed-off-by: Zhang Peng <peng.zhang1.cn@windriver.com>
|
||||
---
|
||||
avahi-core/wide-area.c | 128 ++++++++++++++++++++++-------------------
|
||||
1 file changed, 69 insertions(+), 59 deletions(-)
|
||||
|
||||
diff --git a/avahi-core/wide-area.c b/avahi-core/wide-area.c
|
||||
index 00a15056e..06df7afc6 100644
|
||||
--- a/avahi-core/wide-area.c
|
||||
+++ b/avahi-core/wide-area.c
|
||||
@@ -81,6 +81,10 @@ struct AvahiWideAreaLookup {
|
||||
|
||||
AvahiAddress dns_server_used;
|
||||
|
||||
+ int fd;
|
||||
+ AvahiWatch *watch;
|
||||
+ AvahiProtocol proto;
|
||||
+
|
||||
AVAHI_LLIST_FIELDS(AvahiWideAreaLookup, lookups);
|
||||
AVAHI_LLIST_FIELDS(AvahiWideAreaLookup, by_key);
|
||||
};
|
||||
@@ -88,9 +92,6 @@ struct AvahiWideAreaLookup {
|
||||
struct AvahiWideAreaLookupEngine {
|
||||
AvahiServer *server;
|
||||
|
||||
- int fd_ipv4, fd_ipv6;
|
||||
- AvahiWatch *watch_ipv4, *watch_ipv6;
|
||||
-
|
||||
/* Cache */
|
||||
AVAHI_LLIST_HEAD(AvahiWideAreaCacheEntry, cache);
|
||||
AvahiHashmap *cache_by_key;
|
||||
@@ -125,35 +126,67 @@ static AvahiWideAreaLookup* find_lookup(AvahiWideAreaLookupEngine *e, uint16_t i
|
||||
return l;
|
||||
}
|
||||
|
||||
+static void socket_event(AVAHI_GCC_UNUSED AvahiWatch *w, int fd, AVAHI_GCC_UNUSED AvahiWatchEvent events, void *userdata);
|
||||
+
|
||||
static int send_to_dns_server(AvahiWideAreaLookup *l, AvahiDnsPacket *p) {
|
||||
+ AvahiWideAreaLookupEngine *e;
|
||||
AvahiAddress *a;
|
||||
+ AvahiServer *s;
|
||||
+ AvahiWatch *w;
|
||||
+ int r;
|
||||
|
||||
assert(l);
|
||||
assert(p);
|
||||
|
||||
- if (l->engine->n_dns_servers <= 0)
|
||||
+ e = l->engine;
|
||||
+ assert(e);
|
||||
+
|
||||
+ s = e->server;
|
||||
+ assert(s);
|
||||
+
|
||||
+ if (e->n_dns_servers <= 0)
|
||||
return -1;
|
||||
|
||||
- assert(l->engine->current_dns_server < l->engine->n_dns_servers);
|
||||
+ assert(e->current_dns_server < e->n_dns_servers);
|
||||
|
||||
- a = &l->engine->dns_servers[l->engine->current_dns_server];
|
||||
+ a = &e->dns_servers[e->current_dns_server];
|
||||
l->dns_server_used = *a;
|
||||
|
||||
- if (a->proto == AVAHI_PROTO_INET) {
|
||||
+ if (l->fd >= 0) {
|
||||
+ /* We are reusing lookup object and sending packet to another server so let's cleanup before we establish connection to new server. */
|
||||
+ s->poll_api->watch_free(l->watch);
|
||||
+ l->watch = NULL;
|
||||
|
||||
- if (l->engine->fd_ipv4 < 0)
|
||||
- return -1;
|
||||
+ close(l->fd);
|
||||
+ l->fd = -EBADF;
|
||||
+ }
|
||||
|
||||
- return avahi_send_dns_packet_ipv4(l->engine->fd_ipv4, AVAHI_IF_UNSPEC, p, NULL, &a->data.ipv4, AVAHI_DNS_PORT);
|
||||
+ assert(a->proto == AVAHI_PROTO_INET || a->proto == AVAHI_PROTO_INET6);
|
||||
|
||||
- } else {
|
||||
- assert(a->proto == AVAHI_PROTO_INET6);
|
||||
+ if (a->proto == AVAHI_PROTO_INET)
|
||||
+ r = s->config.use_ipv4 ? avahi_open_unicast_socket_ipv4() : -1;
|
||||
+ else
|
||||
+ r = s->config.use_ipv6 ? avahi_open_unicast_socket_ipv6() : -1;
|
||||
|
||||
- if (l->engine->fd_ipv6 < 0)
|
||||
- return -1;
|
||||
+ if (r < 0) {
|
||||
+ avahi_log_error(__FILE__ ": Failed to create socket for wide area lookup");
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
- return avahi_send_dns_packet_ipv6(l->engine->fd_ipv6, AVAHI_IF_UNSPEC, p, NULL, &a->data.ipv6, AVAHI_DNS_PORT);
|
||||
+ w = s->poll_api->watch_new(s->poll_api, r, AVAHI_WATCH_IN, socket_event, l);
|
||||
+ if (!w) {
|
||||
+ close(r);
|
||||
+ avahi_log_error(__FILE__ ": Failed to create socket watch for wide area lookup");
|
||||
+ return -1;
|
||||
}
|
||||
+
|
||||
+ l->fd = r;
|
||||
+ l->watch = w;
|
||||
+ l->proto = a->proto;
|
||||
+
|
||||
+ return a->proto == AVAHI_PROTO_INET ?
|
||||
+ avahi_send_dns_packet_ipv4(l->fd, AVAHI_IF_UNSPEC, p, NULL, &a->data.ipv4, AVAHI_DNS_PORT):
|
||||
+ avahi_send_dns_packet_ipv6(l->fd, AVAHI_IF_UNSPEC, p, NULL, &a->data.ipv6, AVAHI_DNS_PORT);
|
||||
}
|
||||
|
||||
static void next_dns_server(AvahiWideAreaLookupEngine *e) {
|
||||
@@ -246,6 +279,9 @@ AvahiWideAreaLookup *avahi_wide_area_lookup_new(
|
||||
l->dead = 0;
|
||||
l->key = avahi_key_ref(key);
|
||||
l->cname_key = avahi_key_new_cname(l->key);
|
||||
+ l->fd = -EBADF;
|
||||
+ l->watch = NULL;
|
||||
+ l->proto = AVAHI_PROTO_UNSPEC;
|
||||
l->callback = callback;
|
||||
l->userdata = userdata;
|
||||
|
||||
@@ -314,6 +350,12 @@ static void lookup_destroy(AvahiWideAreaLookup *l) {
|
||||
if (l->cname_key)
|
||||
avahi_key_unref(l->cname_key);
|
||||
|
||||
+ if (l->watch)
|
||||
+ l->engine->server->poll_api->watch_free(l->watch);
|
||||
+
|
||||
+ if (l->fd >= 0)
|
||||
+ close(l->fd);
|
||||
+
|
||||
avahi_free(l);
|
||||
}
|
||||
|
||||
@@ -572,14 +614,20 @@ static void handle_packet(AvahiWideAreaLookupEngine *e, AvahiDnsPacket *p) {
|
||||
}
|
||||
|
||||
static void socket_event(AVAHI_GCC_UNUSED AvahiWatch *w, int fd, AVAHI_GCC_UNUSED AvahiWatchEvent events, void *userdata) {
|
||||
- AvahiWideAreaLookupEngine *e = userdata;
|
||||
+ AvahiWideAreaLookup *l = userdata;
|
||||
+ AvahiWideAreaLookupEngine *e = l->engine;
|
||||
AvahiDnsPacket *p = NULL;
|
||||
|
||||
- if (fd == e->fd_ipv4)
|
||||
- p = avahi_recv_dns_packet_ipv4(e->fd_ipv4, NULL, NULL, NULL, NULL, NULL);
|
||||
+ assert(l);
|
||||
+ assert(e);
|
||||
+ assert(l->fd == fd);
|
||||
+
|
||||
+ if (l->proto == AVAHI_PROTO_INET)
|
||||
+ p = avahi_recv_dns_packet_ipv4(l->fd, NULL, NULL, NULL, NULL, NULL);
|
||||
else {
|
||||
- assert(fd == e->fd_ipv6);
|
||||
- p = avahi_recv_dns_packet_ipv6(e->fd_ipv6, NULL, NULL, NULL, NULL, NULL);
|
||||
+ assert(l->proto == AVAHI_PROTO_INET6);
|
||||
+
|
||||
+ p = avahi_recv_dns_packet_ipv6(l->fd, NULL, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
if (p) {
|
||||
@@ -598,32 +646,6 @@ AvahiWideAreaLookupEngine *avahi_wide_area_engine_new(AvahiServer *s) {
|
||||
e->server = s;
|
||||
e->cleanup_dead = 0;
|
||||
|
||||
- /* Create sockets */
|
||||
- e->fd_ipv4 = s->config.use_ipv4 ? avahi_open_unicast_socket_ipv4() : -1;
|
||||
- e->fd_ipv6 = s->config.use_ipv6 ? avahi_open_unicast_socket_ipv6() : -1;
|
||||
-
|
||||
- if (e->fd_ipv4 < 0 && e->fd_ipv6 < 0) {
|
||||
- avahi_log_error(__FILE__": Failed to create wide area sockets: %s", strerror(errno));
|
||||
-
|
||||
- if (e->fd_ipv6 >= 0)
|
||||
- close(e->fd_ipv6);
|
||||
-
|
||||
- if (e->fd_ipv4 >= 0)
|
||||
- close(e->fd_ipv4);
|
||||
-
|
||||
- avahi_free(e);
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- /* Create watches */
|
||||
-
|
||||
- e->watch_ipv4 = e->watch_ipv6 = NULL;
|
||||
-
|
||||
- if (e->fd_ipv4 >= 0)
|
||||
- e->watch_ipv4 = s->poll_api->watch_new(e->server->poll_api, e->fd_ipv4, AVAHI_WATCH_IN, socket_event, e);
|
||||
- if (e->fd_ipv6 >= 0)
|
||||
- e->watch_ipv6 = s->poll_api->watch_new(e->server->poll_api, e->fd_ipv6, AVAHI_WATCH_IN, socket_event, e);
|
||||
-
|
||||
e->n_dns_servers = e->current_dns_server = 0;
|
||||
|
||||
/* Initialize cache */
|
||||
@@ -651,18 +673,6 @@ void avahi_wide_area_engine_free(AvahiWideAreaLookupEngine *e) {
|
||||
avahi_hashmap_free(e->lookups_by_id);
|
||||
avahi_hashmap_free(e->lookups_by_key);
|
||||
|
||||
- if (e->watch_ipv4)
|
||||
- e->server->poll_api->watch_free(e->watch_ipv4);
|
||||
-
|
||||
- if (e->watch_ipv6)
|
||||
- e->server->poll_api->watch_free(e->watch_ipv6);
|
||||
-
|
||||
- if (e->fd_ipv6 >= 0)
|
||||
- close(e->fd_ipv6);
|
||||
-
|
||||
- if (e->fd_ipv4 >= 0)
|
||||
- close(e->fd_ipv4);
|
||||
-
|
||||
avahi_free(e);
|
||||
}
|
||||
|
||||
@@ -680,7 +690,7 @@ void avahi_wide_area_set_servers(AvahiWideAreaLookupEngine *e, const AvahiAddres
|
||||
|
||||
if (a) {
|
||||
for (e->n_dns_servers = 0; n > 0 && e->n_dns_servers < AVAHI_WIDE_AREA_SERVERS_MAX; a++, n--)
|
||||
- if ((a->proto == AVAHI_PROTO_INET && e->fd_ipv4 >= 0) || (a->proto == AVAHI_PROTO_INET6 && e->fd_ipv6 >= 0))
|
||||
+ if (a->proto == AVAHI_PROTO_INET || a->proto == AVAHI_PROTO_INET6)
|
||||
e->dns_servers[e->n_dns_servers++] = *a;
|
||||
} else {
|
||||
assert(n == 0);
|
||||
30
meta/recipes-connectivity/ofono/ofono/CVE-2023-4232.patch
Normal file
30
meta/recipes-connectivity/ofono/ofono/CVE-2023-4232.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From 2ff2da7ac374a790f8b2a0216bcb4e3126498225 Mon Sep 17 00:00:00 2001
|
||||
From: "Sicelo A. Mhlongo" <absicsz@gmail.com>
|
||||
Date: Wed, 4 Dec 2024 10:18:52 +0200
|
||||
Subject: [PATCH] smsutil: check status report fits in buffer
|
||||
|
||||
Fixes CVE-2023-4232
|
||||
|
||||
CVE: CVE-2023-4232
|
||||
Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=2ff2da7ac374a790f8b2a0216bcb4e3126498225]
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
src/smsutil.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/smsutil.c b/src/smsutil.c
|
||||
index ac89f16c..a706e26f 100644
|
||||
--- a/src/smsutil.c
|
||||
+++ b/src/smsutil.c
|
||||
@@ -1088,6 +1088,9 @@ static gboolean decode_status_report(const unsigned char *pdu, int len,
|
||||
if ((len - offset) < expected)
|
||||
return FALSE;
|
||||
|
||||
+ if (expected > (int)sizeof(out->status_report.ud))
|
||||
+ return FALSE;
|
||||
+
|
||||
memcpy(out->status_report.ud, pdu + offset, expected);
|
||||
}
|
||||
|
||||
--
|
||||
2.30.2
|
||||
37
meta/recipes-connectivity/ofono/ofono/CVE-2023-4235.patch
Normal file
37
meta/recipes-connectivity/ofono/ofono/CVE-2023-4235.patch
Normal file
@@ -0,0 +1,37 @@
|
||||
From 02aa0f9bad3d9e47a152fc045d0f51874d901d7e Mon Sep 17 00:00:00 2001
|
||||
From: "Sicelo A. Mhlongo" <absicsz@gmail.com>
|
||||
Date: Wed, 4 Dec 2024 10:18:51 +0200
|
||||
Subject: [PATCH] smsutil: check deliver reports fit in buffer
|
||||
|
||||
Fixes CVE-2023-4235
|
||||
|
||||
CVE: CVE-2023-4235
|
||||
Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=02aa0f9bad3d9e47a152fc045d0f51874d901d7e]
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
src/smsutil.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/smsutil.c b/src/smsutil.c
|
||||
index 484bfd0b..ac89f16c 100644
|
||||
--- a/src/smsutil.c
|
||||
+++ b/src/smsutil.c
|
||||
@@ -1240,10 +1240,16 @@ static gboolean decode_deliver_report(const unsigned char *pdu, int len,
|
||||
return FALSE;
|
||||
|
||||
if (out->type == SMS_TYPE_DELIVER_REPORT_ERROR) {
|
||||
+ if (expected > (int) sizeof(out->deliver_err_report.ud))
|
||||
+ return FALSE;
|
||||
+
|
||||
out->deliver_err_report.udl = udl;
|
||||
memcpy(out->deliver_err_report.ud,
|
||||
pdu + offset, expected);
|
||||
} else {
|
||||
+ if (expected > (int) sizeof(out->deliver_ack_report.ud))
|
||||
+ return FALSE;
|
||||
+
|
||||
out->deliver_ack_report.udl = udl;
|
||||
memcpy(out->deliver_ack_report.ud,
|
||||
pdu + offset, expected);
|
||||
--
|
||||
2.30.2
|
||||
@@ -26,6 +26,8 @@ SRC_URI = "\
|
||||
file://CVE-2024-7547.patch \
|
||||
file://CVE-2024-7540_CVE-2024-7541_CVE-2024-7542.patch \
|
||||
file://CVE-2024-7537.patch \
|
||||
file://CVE-2023-4232.patch \
|
||||
file://CVE-2023-4235.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "c0b96d3013447ec2bcb74579bef90e4e59c68dbfa4b9c6fbce5d12401a43aac7"
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
From e70e34d857d4003199bcb5d3b52ca8102ccc1b98 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Mraz <tomas@openssl.org>
|
||||
Date: Mon, 5 Aug 2024 17:54:14 +0200
|
||||
Subject: [PATCH] dh_kmgmt.c: Avoid expensive public key validation for known
|
||||
safe-prime groups
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The partial validation is fully sufficient to check the key validity.
|
||||
|
||||
Thanks to Szilárd Pfeiffer for reporting the issue.
|
||||
|
||||
Reviewed-by: Neil Horman <nhorman@openssl.org>
|
||||
Reviewed-by: Matt Caswell <matt@openssl.org>
|
||||
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
|
||||
(Merged from https://github.com/openssl/openssl/pull/25088)
|
||||
|
||||
CVE: CVE-2024-41996
|
||||
|
||||
Upstream-Status: Backport [https://github.com/openssl/openssl/commit/e70e34d857d4003199bcb5d3b52ca8102ccc1b98]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
providers/implementations/keymgmt/dh_kmgmt.c | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/providers/implementations/keymgmt/dh_kmgmt.c b/providers/implementations/keymgmt/dh_kmgmt.c
|
||||
index 795a3f2..3e7a811 100644
|
||||
--- a/providers/implementations/keymgmt/dh_kmgmt.c
|
||||
+++ b/providers/implementations/keymgmt/dh_kmgmt.c
|
||||
@@ -387,9 +387,11 @@ static int dh_validate_public(const DH *dh, int checktype)
|
||||
if (pub_key == NULL)
|
||||
return 0;
|
||||
|
||||
- /* The partial test is only valid for named group's with q = (p - 1) / 2 */
|
||||
- if (checktype == OSSL_KEYMGMT_VALIDATE_QUICK_CHECK
|
||||
- && ossl_dh_is_named_safe_prime_group(dh))
|
||||
+ /*
|
||||
+ * The partial test is only valid for named group's with q = (p - 1) / 2
|
||||
+ * but for that case it is also fully sufficient to check the key validity.
|
||||
+ */
|
||||
+ if (ossl_dh_is_named_safe_prime_group(dh))
|
||||
return ossl_dh_check_pub_key_partial(dh, pub_key, &res);
|
||||
|
||||
return DH_check_pub_key_ex(dh, pub_key);
|
||||
--
|
||||
2.40.0
|
||||
@@ -12,13 +12,14 @@ SRC_URI = "https://github.com/openssl/openssl/releases/download/openssl-${PV}/op
|
||||
file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \
|
||||
file://afalg.patch \
|
||||
file://0001-Configure-do-not-tweak-mips-cflags.patch \
|
||||
file://CVE-2024-41996.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:class-nativesdk = " \
|
||||
file://environment.d-openssl.sh \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "57e03c50feab5d31b152af2b764f10379aecd8ee92f16c985983ce4a99f7ef86"
|
||||
SRC_URI[sha256sum] = "dfdd77e4ea1b57ff3a6dbde6b0bdc3f31db5ac99e7fdd4eaf9e1fbb6ec2db8ce"
|
||||
|
||||
inherit lib_package multilib_header multilib_script ptest perlnative
|
||||
MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
|
||||
113
meta/recipes-core/coreutils/coreutils/CVE-2025-5278.patch
Normal file
113
meta/recipes-core/coreutils/coreutils/CVE-2025-5278.patch
Normal file
@@ -0,0 +1,113 @@
|
||||
From ed9ae6a4a02d322378739a895ae2090ca2bf6cdc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
|
||||
Date: Tue, 20 May 2025 16:03:44 +0100
|
||||
Subject: [PATCH] sort: fix buffer under-read (CWE-127)
|
||||
|
||||
* src/sort.c (begfield): Check pointer adjustment
|
||||
to avoid Out-of-range pointer offset (CWE-823).
|
||||
(limfield): Likewise.
|
||||
* tests/sort/sort-field-limit.sh: Add a new test,
|
||||
which triggers with ASAN or Valgrind.
|
||||
* tests/local.mk: Reference the new test.
|
||||
* NEWS: Mention bug fix introduced in v7.2 (2009).
|
||||
Fixes https://bugs.gnu.org/78507
|
||||
|
||||
CVE: CVE-2025-5278
|
||||
|
||||
Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/coreutils.git/commit/?id=8c9602e3a145e9596dc1a63c6ed67865814b6633]
|
||||
[Adjusted for 9.0 version and adjusted test case to not use valgrind.]
|
||||
|
||||
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||
---
|
||||
src/sort.c | 12 ++++++++++--
|
||||
tests/local.mk | 1 +
|
||||
tests/misc/sort-field-limit.sh | 35 ++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 46 insertions(+), 2 deletions(-)
|
||||
create mode 100755 tests/misc/sort-field-limit.sh
|
||||
|
||||
diff --git a/src/sort.c b/src/sort.c
|
||||
index 5f4c817de..07b96d34b 100644
|
||||
--- a/src/sort.c
|
||||
+++ b/src/sort.c
|
||||
@@ -1642,7 +1642,11 @@ begfield (struct line const *line, struct keyfield const *key)
|
||||
++ptr;
|
||||
|
||||
/* Advance PTR by SCHAR (if possible), but no further than LIM. */
|
||||
- ptr = MIN (lim, ptr + schar);
|
||||
+ size_t remaining_bytes = lim - ptr;
|
||||
+ if (schar < remaining_bytes)
|
||||
+ ptr += schar;
|
||||
+ else
|
||||
+ ptr = lim;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
@@ -1743,7 +1747,11 @@ limfield (struct line const *line, struct keyfield const *key)
|
||||
++ptr;
|
||||
|
||||
/* Advance PTR by ECHAR (if possible), but no further than LIM. */
|
||||
- ptr = MIN (lim, ptr + echar);
|
||||
+ size_t remaining_bytes = lim - ptr;
|
||||
+ if (echar < remaining_bytes)
|
||||
+ ptr += echar;
|
||||
+ else
|
||||
+ ptr = lim;
|
||||
}
|
||||
|
||||
return ptr;
|
||||
diff --git a/tests/local.mk b/tests/local.mk
|
||||
index 228d0e368..ced85c44c 100644
|
||||
--- a/tests/local.mk
|
||||
+++ b/tests/local.mk
|
||||
@@ -373,6 +373,7 @@ all_tests = \
|
||||
tests/misc/sort-debug-keys.sh \
|
||||
tests/misc/sort-debug-warn.sh \
|
||||
tests/misc/sort-discrim.sh \
|
||||
+ tests/misc/sort-field-limit.sh \
|
||||
tests/misc/sort-files0-from.pl \
|
||||
tests/misc/sort-float.sh \
|
||||
tests/misc/sort-h-thousands-sep.sh \
|
||||
diff --git a/tests/misc/sort-field-limit.sh b/tests/misc/sort-field-limit.sh
|
||||
new file mode 100755
|
||||
index 000000000..dc5b4c964
|
||||
--- /dev/null
|
||||
+++ b/tests/misc/sort-field-limit.sh
|
||||
@@ -0,0 +1,35 @@
|
||||
+#!/bin/sh
|
||||
+# From 7.2-9.7, this would trigger an out of bounds mem read
|
||||
+
|
||||
+# Copyright (C) 2025 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software: you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation, either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
+
|
||||
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
|
||||
+print_ver_ sort
|
||||
+getlimits_
|
||||
+
|
||||
+# This issue triggers with valgrind or ASAN
|
||||
+valgrind --error-exitcode=1 sort --version 2>/dev/null &&
|
||||
+ VALGRIND='valgrind --error-exitcode=1'
|
||||
+
|
||||
+{ printf '%s\n' aa bb; } > in || framework_failure_
|
||||
+
|
||||
+_POSIX2_VERSION=200809 sort +0.${SIZE_MAX}R in > out || fail=1
|
||||
+compare in out || fail=1
|
||||
+
|
||||
+_POSIX2_VERSION=200809 sort +1 -1.${SIZE_MAX}R in > out || fail=1
|
||||
+compare in out || fail=1
|
||||
+
|
||||
+Exit $fail
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -19,6 +19,7 @@ SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
|
||||
file://0001-uname-report-processor-and-hardware-correctly.patch \
|
||||
file://0001-local.mk-fix-cross-compiling-problem.patch \
|
||||
file://e8b56ebd536e82b15542a00c888109471936bfda.patch \
|
||||
file://CVE-2025-5278.patch \
|
||||
file://run-ptest \
|
||||
file://0001-split-do-not-shrink-hold-buffer.patch \
|
||||
"
|
||||
|
||||
@@ -31,6 +31,9 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
|
||||
file://CVE-2021-36369.patch \
|
||||
file://CVE-2023-36328.patch \
|
||||
file://CVE-2023-48795.patch \
|
||||
file://0001-Add-m_snprintf-that-won-t-return-negative.patch \
|
||||
file://0001-Handle-arbitrary-length-paths-and-commands-in-multih.patch \
|
||||
file://CVE-2025-47203.patch \
|
||||
"
|
||||
|
||||
PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
From ac2433cb8daa1279d14f8b2cd4c7e1f3405787d4 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Johnston <matt@ucc.asn.au>
|
||||
Date: Fri, 1 Apr 2022 12:10:48 +0800
|
||||
Subject: [PATCH] Add m_snprintf() that won't return negative
|
||||
|
||||
Origin: https://github.com/mkj/dropbear/commit/ac2433cb8daa1279d14f8b2cd4c7e1f3405787d4
|
||||
|
||||
Upstream-Status: Backport [https://github.com/mkj/dropbear/commit/ac2433cb8daa1279d14f8b2cd4c7e1f3405787d4]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
dbutil.c | 13 +++++++++++++
|
||||
dbutil.h | 2 ++
|
||||
2 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/dbutil.c b/dbutil.c
|
||||
index 5af6330..d4c3298 100644
|
||||
--- a/dbutil.c
|
||||
+++ b/dbutil.c
|
||||
@@ -691,3 +691,16 @@ void fsync_parent_dir(const char* fn) {
|
||||
m_free(fn_dir);
|
||||
#endif
|
||||
}
|
||||
+
|
||||
+int m_snprintf(char *str, size_t size, const char *format, ...) {
|
||||
+ va_list param;
|
||||
+ int ret;
|
||||
+
|
||||
+ va_start(param, format);
|
||||
+ ret = vsnprintf(str, size, format, param);
|
||||
+ va_end(param);
|
||||
+ if (ret < 0) {
|
||||
+ dropbear_exit("snprintf failed");
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/dbutil.h b/dbutil.h
|
||||
index 2a1c82c..71cffe8 100644
|
||||
--- a/dbutil.h
|
||||
+++ b/dbutil.h
|
||||
@@ -70,6 +70,8 @@ void m_close(int fd);
|
||||
void setnonblocking(int fd);
|
||||
void disallow_core(void);
|
||||
int m_str_to_uint(const char* str, unsigned int *val);
|
||||
+/* The same as snprintf() but exits rather than returning negative */
|
||||
+int m_snprintf(char *str, size_t size, const char *format, ...);
|
||||
|
||||
/* Used to force mp_ints to be initialised */
|
||||
#define DEF_MP_INT(X) mp_int X = {0, 0, 0, NULL}
|
||||
@@ -0,0 +1,126 @@
|
||||
From fe15c36664a984de9e1b2386ac52d4b8577cac93 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Johnston <matt@ucc.asn.au>
|
||||
Date: Mon, 1 Apr 2024 11:50:26 +0800
|
||||
Subject: [PATCH] Handle arbitrary length paths and commands in
|
||||
multihop_passthrough_args()
|
||||
|
||||
Origin: https://github.com/mkj/dropbear/commit/7894254afa9b1d3a836911b7ccea1fe18391b881
|
||||
Origin: https://github.com/mkj/dropbear/commit/2f1177e55f33afd676e08c9449ab7ab517fc3b30
|
||||
Origin: https://github.com/mkj/dropbear/commit/697b1f86c0b2b0caf12e9e32bab29161093ab5d4
|
||||
Origin: https://github.com/mkj/dropbear/commit/dd03da772bfad6174425066ff9752b60e25ed183
|
||||
Origin: https://github.com/mkj/dropbear/commit/d59436a4d56de58b856142a5d489a4a8fc7382ed
|
||||
|
||||
Upstream-Status: Backport [see commits above]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
cli-runopts.c | 63 +++++++++++++++++++++------------------------------
|
||||
1 file changed, 26 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/cli-runopts.c b/cli-runopts.c
|
||||
index 255b47e..9798f62 100644
|
||||
--- a/cli-runopts.c
|
||||
+++ b/cli-runopts.c
|
||||
@@ -523,61 +523,50 @@ static void loadidentityfile(const char* filename, int warnfail) {
|
||||
|
||||
#if DROPBEAR_CLI_MULTIHOP
|
||||
|
||||
-static char*
|
||||
-multihop_passthrough_args() {
|
||||
- char *ret;
|
||||
- int total;
|
||||
- unsigned int len = 0;
|
||||
+/* Fill out -i, -y, -W options that make sense for all
|
||||
+ * the intermediate processes */
|
||||
+static char* multihop_passthrough_args(void) {
|
||||
+ char *args = NULL;
|
||||
+ unsigned int len, total;
|
||||
+#if DROPBEAR_CLI_PUBKEY_AUTH
|
||||
m_list_elem *iter;
|
||||
- /* Fill out -i, -y, -W options that make sense for all
|
||||
- * the intermediate processes */
|
||||
+#endif
|
||||
+ /* Sufficient space for non-string args */
|
||||
+ len = 100;
|
||||
+
|
||||
+ /* String arguments have arbitrary length, so determine space required */
|
||||
#if DROPBEAR_CLI_PUBKEY_AUTH
|
||||
for (iter = cli_opts.privkeys->first; iter; iter = iter->next)
|
||||
{
|
||||
sign_key * key = (sign_key*)iter->item;
|
||||
- len += 3 + strlen(key->filename);
|
||||
+ len += 4 + strlen(key->filename);
|
||||
}
|
||||
-#endif /* DROPBEAR_CLI_PUBKEY_AUTH */
|
||||
+#endif
|
||||
|
||||
- len += 30; /* space for -W <size>, terminator. */
|
||||
- ret = m_malloc(len);
|
||||
+ args = m_malloc(len);
|
||||
total = 0;
|
||||
|
||||
- if (cli_opts.no_hostkey_check)
|
||||
- {
|
||||
- int written = snprintf(ret+total, len-total, "-y -y ");
|
||||
- total += written;
|
||||
- }
|
||||
- else if (cli_opts.always_accept_key)
|
||||
- {
|
||||
- int written = snprintf(ret+total, len-total, "-y ");
|
||||
- total += written;
|
||||
+ /* Create new argument string */
|
||||
+
|
||||
+ if (cli_opts.no_hostkey_check) {
|
||||
+ total += m_snprintf(args+total, len-total, "-y -y ");
|
||||
+ } else if (cli_opts.always_accept_key) {
|
||||
+ total += m_snprintf(args+total, len-total, "-y ");
|
||||
}
|
||||
|
||||
- if (opts.recv_window != DEFAULT_RECV_WINDOW)
|
||||
- {
|
||||
- int written = snprintf(ret+total, len-total, "-W %u ", opts.recv_window);
|
||||
- total += written;
|
||||
+ if (opts.recv_window != DEFAULT_RECV_WINDOW) {
|
||||
+ total += m_snprintf(args+total, len-total, "-W %u ", opts.recv_window);
|
||||
}
|
||||
|
||||
#if DROPBEAR_CLI_PUBKEY_AUTH
|
||||
for (iter = cli_opts.privkeys->first; iter; iter = iter->next)
|
||||
{
|
||||
sign_key * key = (sign_key*)iter->item;
|
||||
- const size_t size = len - total;
|
||||
- int written = snprintf(ret+total, size, "-i %s ", key->filename);
|
||||
- dropbear_assert((unsigned int)written < size);
|
||||
- total += written;
|
||||
+ total += m_snprintf(args+total, len-total, "-i %s ", key->filename);
|
||||
}
|
||||
#endif /* DROPBEAR_CLI_PUBKEY_AUTH */
|
||||
|
||||
- /* if args were passed, total will be not zero, and it will have a space at the end, so remove that */
|
||||
- if (total > 0)
|
||||
- {
|
||||
- total--;
|
||||
- }
|
||||
-
|
||||
- return ret;
|
||||
+ return args;
|
||||
}
|
||||
|
||||
/* Sets up 'onion-forwarding' connections. This will spawn
|
||||
@@ -608,7 +597,7 @@ static void parse_multihop_hostname(const char* orighostarg, const char* argv0)
|
||||
&& strchr(cli_opts.username, '@')) {
|
||||
unsigned int len = strlen(orighostarg) + strlen(cli_opts.username) + 2;
|
||||
hostbuf = m_malloc(len);
|
||||
- snprintf(hostbuf, len, "%s@%s", cli_opts.username, orighostarg);
|
||||
+ m_snprintf(hostbuf, len, "%s@%s", cli_opts.username, orighostarg);
|
||||
} else {
|
||||
hostbuf = m_strdup(orighostarg);
|
||||
}
|
||||
@@ -642,7 +631,7 @@ static void parse_multihop_hostname(const char* orighostarg, const char* argv0)
|
||||
+ strlen(passthrough_args)
|
||||
+ 30;
|
||||
cli_opts.proxycmd = m_malloc(cmd_len);
|
||||
- snprintf(cli_opts.proxycmd, cmd_len, "%s -B %s:%s %s %s",
|
||||
+ m_snprintf(cli_opts.proxycmd, cmd_len, "%s -B %s:%s %s %s",
|
||||
argv0, cli_opts.remotehost, cli_opts.remoteport,
|
||||
passthrough_args, remainder);
|
||||
#ifndef DISABLE_ZLIB
|
||||
344
meta/recipes-core/dropbear/dropbear/CVE-2025-47203.patch
Normal file
344
meta/recipes-core/dropbear/dropbear/CVE-2025-47203.patch
Normal file
@@ -0,0 +1,344 @@
|
||||
From e5a0ef27c227f7ae69d9a9fec98a056494409b9b Mon Sep 17 00:00:00 2001
|
||||
From: Matt Johnston <matt@ucc.asn.au>
|
||||
Date: Mon, 5 May 2025 23:14:19 +0800
|
||||
Subject: [PATCH] Execute multihop commands directly, no shell
|
||||
|
||||
This avoids problems with shell escaping if arguments contain special
|
||||
characters.
|
||||
|
||||
Origin: https://github.com/mkj/dropbear/commit/e5a0ef27c227f7ae69d9a9fec98a056494409b9b
|
||||
Bug: https://www.openwall.com/lists/oss-security/2025/05/13/1
|
||||
Bug-Debian: https://deb.freexian.com/extended-lts/tracker/CVE-2025-47203
|
||||
|
||||
CVE: CVE-2025-47203
|
||||
Upstream-Status: Backport [https://github.com/mkj/dropbear/commit/e5a0ef27c227f7ae69d9a9fec98a056494409b9b]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
cli-main.c | 60 ++++++++++++++++++++++++++++--------------
|
||||
cli-runopts.c | 84 +++++++++++++++++++++++++++++++++++------------------------
|
||||
dbutil.c | 9 +++++--
|
||||
dbutil.h | 1 +
|
||||
runopts.h | 5 ++++
|
||||
5 files changed, 104 insertions(+), 55 deletions(-)
|
||||
|
||||
diff --git a/cli-main.c b/cli-main.c
|
||||
index 7f455d1..53c55c1 100644
|
||||
--- a/cli-main.c
|
||||
+++ b/cli-main.c
|
||||
@@ -73,9 +73,8 @@ int main(int argc, char ** argv) {
|
||||
|
||||
pid_t proxy_cmd_pid = 0;
|
||||
#if DROPBEAR_CLI_PROXYCMD
|
||||
- if (cli_opts.proxycmd) {
|
||||
+ if (cli_opts.proxycmd || cli_opts.proxyexec) {
|
||||
cli_proxy_cmd(&sock_in, &sock_out, &proxy_cmd_pid);
|
||||
- m_free(cli_opts.proxycmd);
|
||||
if (signal(SIGINT, kill_proxy_sighandler) == SIG_ERR ||
|
||||
signal(SIGTERM, kill_proxy_sighandler) == SIG_ERR ||
|
||||
signal(SIGHUP, kill_proxy_sighandler) == SIG_ERR) {
|
||||
@@ -96,7 +95,8 @@ int main(int argc, char ** argv) {
|
||||
}
|
||||
#endif /* DBMULTI stuff */
|
||||
|
||||
-static void exec_proxy_cmd(const void *user_data_cmd) {
|
||||
+#if DROPBEAR_CLI_PROXYCMD
|
||||
+static void shell_proxy_cmd(const void *user_data_cmd) {
|
||||
const char *cmd = user_data_cmd;
|
||||
char *usershell;
|
||||
|
||||
@@ -105,40 +105,62 @@ static void exec_proxy_cmd(const void *user_data_cmd) {
|
||||
dropbear_exit("Failed to run '%s'\n", cmd);
|
||||
}
|
||||
|
||||
-#if DROPBEAR_CLI_PROXYCMD
|
||||
+static void exec_proxy_cmd(const void *unused) {
|
||||
+ (void)unused;
|
||||
+ run_command(cli_opts.proxyexec[0], cli_opts.proxyexec, ses.maxfd);
|
||||
+ dropbear_exit("Failed to run '%s'\n", cli_opts.proxyexec[0]);
|
||||
+}
|
||||
+
|
||||
static void cli_proxy_cmd(int *sock_in, int *sock_out, pid_t *pid_out) {
|
||||
- char * ex_cmd = NULL;
|
||||
- size_t ex_cmdlen;
|
||||
+ char * cmd_arg = NULL;
|
||||
+ void (*exec_fn)(const void *user_data) = NULL;
|
||||
int ret;
|
||||
|
||||
+ /* exactly one of cli_opts.proxycmd or cli_opts.proxyexec should be set */
|
||||
+
|
||||
/* File descriptor "-j &3" */
|
||||
- if (*cli_opts.proxycmd == '&') {
|
||||
+ if (cli_opts.proxycmd && *cli_opts.proxycmd == '&') {
|
||||
char *p = cli_opts.proxycmd + 1;
|
||||
int sock = strtoul(p, &p, 10);
|
||||
/* must be a single number, and not stdin/stdout/stderr */
|
||||
if (sock > 2 && sock < 1024 && *p == '\0') {
|
||||
*sock_in = sock;
|
||||
*sock_out = sock;
|
||||
- return;
|
||||
+ goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
- /* Normal proxycommand */
|
||||
-
|
||||
- /* So that spawn_command knows which shell to run */
|
||||
- fill_passwd(cli_opts.own_user);
|
||||
-
|
||||
- ex_cmdlen = strlen(cli_opts.proxycmd) + 6; /* "exec " + command + '\0' */
|
||||
- ex_cmd = m_malloc(ex_cmdlen);
|
||||
- snprintf(ex_cmd, ex_cmdlen, "exec %s", cli_opts.proxycmd);
|
||||
+ if (cli_opts.proxycmd) {
|
||||
+ /* Normal proxycommand */
|
||||
+ size_t shell_cmdlen;
|
||||
+ /* So that spawn_command knows which shell to run */
|
||||
+ fill_passwd(cli_opts.own_user);
|
||||
+
|
||||
+ shell_cmdlen = strlen(cli_opts.proxycmd) + 6; /* "exec " + command + '\0' */
|
||||
+ cmd_arg = m_malloc(shell_cmdlen);
|
||||
+ snprintf(cmd_arg, shell_cmdlen, "exec %s", cli_opts.proxycmd);
|
||||
+ exec_fn = shell_proxy_cmd;
|
||||
+ } else {
|
||||
+ /* No shell */
|
||||
+ exec_fn = exec_proxy_cmd;
|
||||
+ }
|
||||
|
||||
- ret = spawn_command(exec_proxy_cmd, ex_cmd,
|
||||
- sock_out, sock_in, NULL, pid_out);
|
||||
- m_free(ex_cmd);
|
||||
+ ret = spawn_command(exec_fn, cmd_arg, sock_out, sock_in, NULL, pid_out);
|
||||
if (ret == DROPBEAR_FAILURE) {
|
||||
dropbear_exit("Failed running proxy command");
|
||||
*sock_in = *sock_out = -1;
|
||||
}
|
||||
+
|
||||
+cleanup:
|
||||
+ m_free(cli_opts.proxycmd);
|
||||
+ m_free(cmd_arg);
|
||||
+ if (cli_opts.proxyexec) {
|
||||
+ char **a = NULL;
|
||||
+ for (a = cli_opts.proxyexec; *a; a++) {
|
||||
+ m_free_direct(*a);
|
||||
+ }
|
||||
+ m_free(cli_opts.proxyexec);
|
||||
+ }
|
||||
}
|
||||
|
||||
static void kill_proxy_sighandler(int UNUSED(signo)) {
|
||||
diff --git a/cli-runopts.c b/cli-runopts.c
|
||||
index 9798f62..0f3dcd0 100644
|
||||
--- a/cli-runopts.c
|
||||
+++ b/cli-runopts.c
|
||||
@@ -525,47 +525,69 @@ static void loadidentityfile(const char* filename, int warnfail) {
|
||||
|
||||
/* Fill out -i, -y, -W options that make sense for all
|
||||
* the intermediate processes */
|
||||
-static char* multihop_passthrough_args(void) {
|
||||
- char *args = NULL;
|
||||
- unsigned int len, total;
|
||||
+static char** multihop_args(const char* argv0, const char* prior_hops) {
|
||||
+ /* null terminated array */
|
||||
+ char **args = NULL;
|
||||
+ size_t max_args = 14, pos = 0, len;
|
||||
#if DROPBEAR_CLI_PUBKEY_AUTH
|
||||
m_list_elem *iter;
|
||||
#endif
|
||||
- /* Sufficient space for non-string args */
|
||||
- len = 100;
|
||||
|
||||
- /* String arguments have arbitrary length, so determine space required */
|
||||
#if DROPBEAR_CLI_PUBKEY_AUTH
|
||||
for (iter = cli_opts.privkeys->first; iter; iter = iter->next)
|
||||
{
|
||||
- sign_key * key = (sign_key*)iter->item;
|
||||
- len += 4 + strlen(key->filename);
|
||||
+ /* "-i file" for each */
|
||||
+ max_args += 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
- args = m_malloc(len);
|
||||
- total = 0;
|
||||
+ args = m_malloc(sizeof(char*) * max_args);
|
||||
+ pos = 0;
|
||||
|
||||
- /* Create new argument string */
|
||||
+ args[pos] = m_strdup(argv0);
|
||||
+ pos++;
|
||||
|
||||
if (cli_opts.no_hostkey_check) {
|
||||
- total += m_snprintf(args+total, len-total, "-y -y ");
|
||||
+ args[pos] = m_strdup("-y");
|
||||
+ pos++;
|
||||
+ args[pos] = m_strdup("-y");
|
||||
+ pos++;
|
||||
} else if (cli_opts.always_accept_key) {
|
||||
- total += m_snprintf(args+total, len-total, "-y ");
|
||||
+ args[pos] = m_strdup("-y");
|
||||
+ pos++;
|
||||
}
|
||||
|
||||
if (opts.recv_window != DEFAULT_RECV_WINDOW) {
|
||||
- total += m_snprintf(args+total, len-total, "-W %u ", opts.recv_window);
|
||||
+ args[pos] = m_strdup("-W");
|
||||
+ pos++;
|
||||
+ args[pos] = m_malloc(11);
|
||||
+ m_snprintf(args[pos], 11, "%u", opts.recv_window);
|
||||
+ pos++;
|
||||
}
|
||||
|
||||
#if DROPBEAR_CLI_PUBKEY_AUTH
|
||||
for (iter = cli_opts.privkeys->first; iter; iter = iter->next)
|
||||
{
|
||||
sign_key * key = (sign_key*)iter->item;
|
||||
- total += m_snprintf(args+total, len-total, "-i %s ", key->filename);
|
||||
+ args[pos] = m_strdup("-i");
|
||||
+ pos++;
|
||||
+ args[pos] = m_strdup(key->filename);
|
||||
+ pos++;
|
||||
}
|
||||
#endif /* DROPBEAR_CLI_PUBKEY_AUTH */
|
||||
|
||||
+ /* last hop */
|
||||
+ args[pos] = m_strdup("-B");
|
||||
+ pos++;
|
||||
+ len = strlen(cli_opts.remotehost) + strlen(cli_opts.remoteport) + 2;
|
||||
+ args[pos] = m_malloc(len);
|
||||
+ snprintf(args[pos], len, "%s:%s", cli_opts.remotehost, cli_opts.remoteport);
|
||||
+ pos++;
|
||||
+
|
||||
+ /* hostnames of prior hops */
|
||||
+ args[pos] = m_strdup(prior_hops);
|
||||
+ pos++;
|
||||
+
|
||||
return args;
|
||||
}
|
||||
|
||||
@@ -585,7 +607,7 @@ static void parse_multihop_hostname(const char* orighostarg, const char* argv0)
|
||||
char *userhostarg = NULL;
|
||||
char *hostbuf = NULL;
|
||||
char *last_hop = NULL;
|
||||
- char *remainder = NULL;
|
||||
+ char *prior_hops = NULL;
|
||||
|
||||
/* both scp and rsync parse a user@host argument
|
||||
* and turn it into "-l user host". This breaks
|
||||
@@ -603,6 +625,8 @@ static void parse_multihop_hostname(const char* orighostarg, const char* argv0)
|
||||
}
|
||||
userhostarg = hostbuf;
|
||||
|
||||
+ /* Split off any last hostname and use that as remotehost/remoteport.
|
||||
+ * That is used for authorized_keys checking etc */
|
||||
last_hop = strrchr(userhostarg, ',');
|
||||
if (last_hop) {
|
||||
if (last_hop == userhostarg) {
|
||||
@@ -610,36 +634,28 @@ static void parse_multihop_hostname(const char* orighostarg, const char* argv0)
|
||||
}
|
||||
*last_hop = '\0';
|
||||
last_hop++;
|
||||
- remainder = userhostarg;
|
||||
+ prior_hops = userhostarg;
|
||||
userhostarg = last_hop;
|
||||
}
|
||||
|
||||
+ /* Update cli_opts.remotehost and cli_opts.remoteport */
|
||||
parse_hostname(userhostarg);
|
||||
|
||||
- if (last_hop) {
|
||||
- /* Set up the proxycmd */
|
||||
- unsigned int cmd_len = 0;
|
||||
- char *passthrough_args = multihop_passthrough_args();
|
||||
+ /* Construct any multihop proxy command. Use proxyexec to
|
||||
+ * avoid worrying about shell escaping. */
|
||||
+ if (prior_hops) {
|
||||
+ cli_opts.proxyexec = multihop_args(argv0, prior_hops);
|
||||
+ /* Any -J argument has been copied to proxyexec */
|
||||
if (cli_opts.proxycmd) {
|
||||
dropbear_exit("-J can't be used with multihop mode");
|
||||
}
|
||||
- if (cli_opts.remoteport == NULL) {
|
||||
- cli_opts.remoteport = "22";
|
||||
- }
|
||||
- cmd_len = strlen(argv0) + strlen(remainder)
|
||||
- + strlen(cli_opts.remotehost) + strlen(cli_opts.remoteport)
|
||||
- + strlen(passthrough_args)
|
||||
- + 30;
|
||||
- cli_opts.proxycmd = m_malloc(cmd_len);
|
||||
- m_snprintf(cli_opts.proxycmd, cmd_len, "%s -B %s:%s %s %s",
|
||||
- argv0, cli_opts.remotehost, cli_opts.remoteport,
|
||||
- passthrough_args, remainder);
|
||||
+
|
||||
#ifndef DISABLE_ZLIB
|
||||
- /* The stream will be incompressible since it's encrypted. */
|
||||
+ /* This outer stream will be incompressible since it's encrypted. */
|
||||
opts.compress_mode = DROPBEAR_COMPRESS_OFF;
|
||||
#endif
|
||||
- m_free(passthrough_args);
|
||||
}
|
||||
+
|
||||
m_free(hostbuf);
|
||||
}
|
||||
#endif /* !DROPBEAR_CLI_MULTIHOP */
|
||||
diff --git a/dbutil.c b/dbutil.c
|
||||
index d4c3298..a51c1f9 100644
|
||||
--- a/dbutil.c
|
||||
+++ b/dbutil.c
|
||||
@@ -347,7 +347,6 @@ int spawn_command(void(*exec_fn)(const void *user_data), const void *exec_data,
|
||||
void run_shell_command(const char* cmd, unsigned int maxfd, char* usershell) {
|
||||
char * argv[4];
|
||||
char * baseshell = NULL;
|
||||
- unsigned int i;
|
||||
|
||||
baseshell = basename(usershell);
|
||||
|
||||
@@ -369,6 +368,12 @@ void run_shell_command(const char* cmd, unsigned int maxfd, char* usershell) {
|
||||
argv[1] = NULL;
|
||||
}
|
||||
|
||||
+ run_command(usershell, argv, maxfd);
|
||||
+}
|
||||
+
|
||||
+void run_command(const char* argv0, char** args, unsigned int maxfd) {
|
||||
+ unsigned int i;
|
||||
+
|
||||
/* Re-enable SIGPIPE for the executed process */
|
||||
if (signal(SIGPIPE, SIG_DFL) == SIG_ERR) {
|
||||
dropbear_exit("signal() error");
|
||||
@@ -380,7 +385,7 @@ void run_shell_command(const char* cmd, unsigned int maxfd, char* usershell) {
|
||||
m_close(i);
|
||||
}
|
||||
|
||||
- execv(usershell, argv);
|
||||
+ execv(argv0, args);
|
||||
}
|
||||
|
||||
#if DEBUG_TRACE
|
||||
diff --git a/dbutil.h b/dbutil.h
|
||||
index 71cffe8..5d86485 100644
|
||||
--- a/dbutil.h
|
||||
+++ b/dbutil.h
|
||||
@@ -60,6 +60,7 @@ char * stripcontrol(const char * text);
|
||||
int spawn_command(void(*exec_fn)(const void *user_data), const void *exec_data,
|
||||
int *writefd, int *readfd, int *errfd, pid_t *pid);
|
||||
void run_shell_command(const char* cmd, unsigned int maxfd, char* usershell);
|
||||
+void run_command(const char* argv0, char** args, unsigned int maxfd);
|
||||
#if ENABLE_CONNECT_UNIX
|
||||
int connect_unix(const char* addr);
|
||||
#endif
|
||||
diff --git a/runopts.h b/runopts.h
|
||||
index 01201d2..b49dc13 100644
|
||||
--- a/runopts.h
|
||||
+++ b/runopts.h
|
||||
@@ -179,7 +179,12 @@ typedef struct cli_runopts {
|
||||
unsigned int netcat_port;
|
||||
#endif
|
||||
#if DROPBEAR_CLI_PROXYCMD
|
||||
+ /* A proxy command to run via the user's shell */
|
||||
char *proxycmd;
|
||||
+#endif
|
||||
+#if DROPBEAR_CLI_MULTIHOP
|
||||
+ /* Similar to proxycmd, but is arguments for execve(), not shell */
|
||||
+ char **proxyexec;
|
||||
#endif
|
||||
char *bind_address;
|
||||
char *bind_port;
|
||||
@@ -1,6 +1,6 @@
|
||||
SRCBRANCH ?= "release/2.35/master"
|
||||
PV = "2.35"
|
||||
SRCREV_glibc ?= "d2febe7c407665c18cfea1930c65f41899ab3aa3"
|
||||
SRCREV_glibc ?= "a66bc3941ff298e474d5f02d0c3303401951141f"
|
||||
SRCREV_localedef ?= "794da69788cbf9bf57b59a852f9f11307663fa87"
|
||||
|
||||
GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
|
||||
|
||||
@@ -1,249 +0,0 @@
|
||||
From 32917e7ee972e7a01127a04454f12ef31dc312ed Mon Sep 17 00:00:00 2001
|
||||
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||
Date: Wed, 11 Jun 2025 03:19:10 -0700
|
||||
Subject: [PATCH] elf: Ignore LD_LIBRARY_PATH and debug env var for setuid for
|
||||
static
|
||||
|
||||
It mimics the ld.so behavior.
|
||||
Checked on x86_64-linux-gnu.
|
||||
|
||||
[New Test Case]
|
||||
elf: Test case for bug 32976
|
||||
[https://sourceware.org/bugzilla/show_bug.cgi?id=32976]
|
||||
|
||||
Check that LD_LIBRARY_PATH is ignored for AT_SECURE statically
|
||||
linked binaries, using support_capture_subprogram_self_sgid.
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/cgit/glibc/commit/?id=5451fa962cd0a90a0e2ec1d8910a559ace02bba0 &&
|
||||
https://sourceware.org/cgit/glibc/commit/?id=d8f7a79335b0d861c12c42aec94c04cd5bb181e2]
|
||||
|
||||
CVE: CVE-2025-4802
|
||||
|
||||
Co-authored-by: Florian Weimer <fweimer@redhat.com>
|
||||
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
|
||||
---
|
||||
elf/Makefile | 4 ++
|
||||
elf/dl-support.c | 46 ++++++++---------
|
||||
elf/tst-dlopen-sgid-mod.c | 1 +
|
||||
elf/tst-dlopen-sgid.c | 104 ++++++++++++++++++++++++++++++++++++++
|
||||
4 files changed, 132 insertions(+), 23 deletions(-)
|
||||
create mode 100644 elf/tst-dlopen-sgid-mod.c
|
||||
create mode 100644 elf/tst-dlopen-sgid.c
|
||||
|
||||
diff --git a/elf/Makefile b/elf/Makefile
|
||||
index 61c41ea6..3ad66ab6 100644
|
||||
--- a/elf/Makefile
|
||||
+++ b/elf/Makefile
|
||||
@@ -274,6 +274,7 @@ tests-static-normal := \
|
||||
tst-array1-static \
|
||||
tst-array5-static \
|
||||
tst-dl-iter-static \
|
||||
+ tst-dlopen-sgid \
|
||||
tst-dst-static \
|
||||
tst-env-setuid \
|
||||
tst-env-setuid-tunables \
|
||||
@@ -807,6 +808,7 @@ modules-names = \
|
||||
tst-dlmopen-gethostbyname-mod \
|
||||
tst-dlmopen-twice-mod1 \
|
||||
tst-dlmopen-twice-mod2 \
|
||||
+ tst-dlopen-sgid-mod \
|
||||
tst-dlopenfaillinkmod \
|
||||
tst-dlopenfailmod1 \
|
||||
tst-dlopenfailmod2 \
|
||||
@@ -2913,3 +2915,5 @@ $(objpfx)tst-recursive-tls.out: \
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
|
||||
$(objpfx)tst-recursive-tlsmod%.os: tst-recursive-tlsmodN.c
|
||||
$(compile-command.c) -DVAR=thread_$* -DFUNC=get_threadvar_$*
|
||||
+
|
||||
+$(objpfx)tst-dlopen-sgid.out: $(objpfx)tst-dlopen-sgid-mod.so
|
||||
diff --git a/elf/dl-support.c b/elf/dl-support.c
|
||||
index 09079c12..c2baed69 100644
|
||||
--- a/elf/dl-support.c
|
||||
+++ b/elf/dl-support.c
|
||||
@@ -272,8 +272,6 @@ _dl_non_dynamic_init (void)
|
||||
_dl_main_map.l_phdr = GL(dl_phdr);
|
||||
_dl_main_map.l_phnum = GL(dl_phnum);
|
||||
|
||||
- _dl_verbose = *(getenv ("LD_WARN") ?: "") == '\0' ? 0 : 1;
|
||||
-
|
||||
/* Set up the data structures for the system-supplied DSO early,
|
||||
so they can influence _dl_init_paths. */
|
||||
setup_vdso (NULL, NULL);
|
||||
@@ -281,27 +279,6 @@ _dl_non_dynamic_init (void)
|
||||
/* With vDSO setup we can initialize the function pointers. */
|
||||
setup_vdso_pointers ();
|
||||
|
||||
- /* Initialize the data structures for the search paths for shared
|
||||
- objects. */
|
||||
- _dl_init_paths (getenv ("LD_LIBRARY_PATH"), "LD_LIBRARY_PATH",
|
||||
- /* No glibc-hwcaps selection support in statically
|
||||
- linked binaries. */
|
||||
- NULL, NULL);
|
||||
-
|
||||
- /* Remember the last search directory added at startup. */
|
||||
- _dl_init_all_dirs = GL(dl_all_dirs);
|
||||
-
|
||||
- _dl_lazy = *(getenv ("LD_BIND_NOW") ?: "") == '\0';
|
||||
-
|
||||
- _dl_bind_not = *(getenv ("LD_BIND_NOT") ?: "") != '\0';
|
||||
-
|
||||
- _dl_dynamic_weak = *(getenv ("LD_DYNAMIC_WEAK") ?: "") == '\0';
|
||||
-
|
||||
- _dl_profile_output = getenv ("LD_PROFILE_OUTPUT");
|
||||
- if (_dl_profile_output == NULL || _dl_profile_output[0] == '\0')
|
||||
- _dl_profile_output
|
||||
- = &"/var/tmp\0/var/profile"[__libc_enable_secure ? 9 : 0];
|
||||
-
|
||||
if (__libc_enable_secure)
|
||||
{
|
||||
static const char unsecure_envvars[] =
|
||||
@@ -324,6 +301,29 @@ _dl_non_dynamic_init (void)
|
||||
#endif
|
||||
}
|
||||
|
||||
+ _dl_verbose = *(getenv ("LD_WARN") ?: "") == '\0' ? 0 : 1;
|
||||
+
|
||||
+ /* Initialize the data structures for the search paths for shared
|
||||
+ objects. */
|
||||
+ _dl_init_paths (getenv ("LD_LIBRARY_PATH"), "LD_LIBRARY_PATH",
|
||||
+ /* No glibc-hwcaps selection support in statically
|
||||
+ linked binaries. */
|
||||
+ NULL, NULL);
|
||||
+
|
||||
+ /* Remember the last search directory added at startup. */
|
||||
+ _dl_init_all_dirs = GL(dl_all_dirs);
|
||||
+
|
||||
+ _dl_lazy = *(getenv ("LD_BIND_NOW") ?: "") == '\0';
|
||||
+
|
||||
+ _dl_bind_not = *(getenv ("LD_BIND_NOT") ?: "") != '\0';
|
||||
+
|
||||
+ _dl_dynamic_weak = *(getenv ("LD_DYNAMIC_WEAK") ?: "") == '\0';
|
||||
+
|
||||
+ _dl_profile_output = getenv ("LD_PROFILE_OUTPUT");
|
||||
+ if (_dl_profile_output == NULL || _dl_profile_output[0] == '\0')
|
||||
+ _dl_profile_output
|
||||
+ = &"/var/tmp\0/var/profile"[__libc_enable_secure ? 9 : 0];
|
||||
+
|
||||
#ifdef DL_PLATFORM_INIT
|
||||
DL_PLATFORM_INIT;
|
||||
#endif
|
||||
diff --git a/elf/tst-dlopen-sgid-mod.c b/elf/tst-dlopen-sgid-mod.c
|
||||
new file mode 100644
|
||||
index 00000000..5eb79eef
|
||||
--- /dev/null
|
||||
+++ b/elf/tst-dlopen-sgid-mod.c
|
||||
@@ -0,0 +1 @@
|
||||
+/* Opening this object should not succeed. */
|
||||
diff --git a/elf/tst-dlopen-sgid.c b/elf/tst-dlopen-sgid.c
|
||||
new file mode 100644
|
||||
index 00000000..47829a40
|
||||
--- /dev/null
|
||||
+++ b/elf/tst-dlopen-sgid.c
|
||||
@@ -0,0 +1,104 @@
|
||||
+/* Test case for ignored LD_LIBRARY_PATH in static startug (bug 32976).
|
||||
+ Copyright (C) 2025 Free Software Foundation, Inc.
|
||||
+ This file is part of the GNU C Library.
|
||||
+
|
||||
+ The GNU C Library is free software; you can redistribute it and/or
|
||||
+ modify it under the terms of the GNU Lesser General Public
|
||||
+ License as published by the Free Software Foundation; either
|
||||
+ version 2.1 of the License, or (at your option) any later version.
|
||||
+
|
||||
+ The GNU C Library is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ Lesser General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU Lesser General Public
|
||||
+ License along with the GNU C Library; if not, see
|
||||
+ <https://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+#include <dlfcn.h>
|
||||
+#include <gnu/lib-names.h>
|
||||
+#include <stddef.h>
|
||||
+#include <stdint.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
+#include <support/capture_subprocess.h>
|
||||
+#include <support/check.h>
|
||||
+#include <support/support.h>
|
||||
+#include <support/temp_file.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+/* This is the name of our test object. Use a custom module for
|
||||
+ testing, so that this object does not get picked up from the system
|
||||
+ path. */
|
||||
+static const char dso_name[] = "tst-dlopen-sgid-mod.so";
|
||||
+
|
||||
+/* Used to mark the recursive invocation. */
|
||||
+static const char magic_argument[] = "run-actual-test";
|
||||
+
|
||||
+static int
|
||||
+do_test (void)
|
||||
+{
|
||||
+/* Pathname of the directory that receives the shared objects this
|
||||
+ test attempts to load. */
|
||||
+ char *libdir = support_create_temp_directory ("tst-dlopen-sgid-");
|
||||
+
|
||||
+ /* This is supposed to be ignored and stripped. */
|
||||
+ TEST_COMPARE (setenv ("LD_LIBRARY_PATH", libdir, 1), 0);
|
||||
+
|
||||
+ /* Copy of libc.so.6. */
|
||||
+ {
|
||||
+ char *from = xasprintf ("%s/%s", support_objdir_root, LIBC_SO);
|
||||
+ char *to = xasprintf ("%s/%s", libdir, LIBC_SO);
|
||||
+ add_temp_file (to);
|
||||
+ support_copy_file (from, to);
|
||||
+ free (to);
|
||||
+ free (from);
|
||||
+ }
|
||||
+
|
||||
+ /* Copy of the test object. */
|
||||
+ {
|
||||
+ char *from = xasprintf ("%s/elf/%s", support_objdir_root, dso_name);
|
||||
+ char *to = xasprintf ("%s/%s", libdir, dso_name);
|
||||
+ add_temp_file (to);
|
||||
+ support_copy_file (from, to);
|
||||
+ free (to);
|
||||
+ free (from);
|
||||
+ }
|
||||
+
|
||||
+ TEST_COMPARE (support_capture_subprogram_self_sgid (magic_argument), 0);
|
||||
+
|
||||
+ free (libdir);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+alternative_main (int argc, char **argv)
|
||||
+{
|
||||
+ if (argc == 2 && strcmp (argv[1], magic_argument) == 0)
|
||||
+ {
|
||||
+ if (getgid () == getegid ())
|
||||
+ /* This can happen if the file system is mounted nosuid. */
|
||||
+ FAIL_UNSUPPORTED ("SGID failed: GID and EGID match (%jd)\n",
|
||||
+ (intmax_t) getgid ());
|
||||
+
|
||||
+ /* Should be removed due to SGID. */
|
||||
+ TEST_COMPARE_STRING (getenv ("LD_LIBRARY_PATH"), NULL);
|
||||
+
|
||||
+ TEST_VERIFY (dlopen (dso_name, RTLD_NOW) == NULL);
|
||||
+ {
|
||||
+ const char *message = dlerror ();
|
||||
+ TEST_COMPARE_STRING (message,
|
||||
+ "tst-dlopen-sgid-mod.so:"
|
||||
+ " cannot open shared object file:"
|
||||
+ " No such file or directory");
|
||||
+ }
|
||||
+
|
||||
+ support_record_failure_barrier ();
|
||||
+ exit (EXIT_SUCCESS);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#define PREPARE alternative_main
|
||||
+#include <support/test-driver.c>
|
||||
--
|
||||
2.49.0
|
||||
|
||||
@@ -27,6 +27,7 @@ CVE_CHECK_IGNORE += "CVE-2023-4527"
|
||||
CVE_CHECK_IGNORE += " \
|
||||
CVE-2023-0687 CVE-2023-4813 CVE-2023-4806 CVE-2023-4911 CVE-2023-5156 \
|
||||
CVE-2024-2961 CVE-2024-33599 CVE-2024-33600 CVE-2024-33601 CVE-2024-33602 \
|
||||
CVE-2025-0395 CVE-2025-4802 CVE-2025-8058 \
|
||||
"
|
||||
|
||||
DEPENDS += "gperf-native bison-native"
|
||||
@@ -61,7 +62,6 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
|
||||
file://0022-sysdeps-gnu-configure.ac-Set-libc_cv_rootsbindir-onl.patch \
|
||||
file://0023-timezone-Make-shell-interpreter-overridable-in-tzsel.patch \
|
||||
file://0024-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \
|
||||
file://0025-CVE-2025-4802.patch \
|
||||
file://0026-PR25847-1.patch \
|
||||
file://0026-PR25847-2.patch \
|
||||
file://0026-PR25847-3.patch \
|
||||
|
||||
@@ -24,7 +24,7 @@ IMAGE_FSTYPES = "wic.vmdk wic.vhd wic.vhdx"
|
||||
|
||||
inherit core-image setuptools3
|
||||
|
||||
SRCREV ?= "f66b3ae54394b3b6dd6f654683ed602ee7caa688"
|
||||
SRCREV ?= "3c825671cb8f30e6205f1bcf177f3432161295f5"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=kirkstone \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
From 71e1e8af5ee46dad1b57bb96cfbf1c3ad21fbd7b Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Fri, 4 Jul 2025 14:28:26 +0200
|
||||
Subject: [PATCH] schematron: Fix memory safety issues in
|
||||
xmlSchematronReportOutput
|
||||
|
||||
Fix use-after-free (CVE-2025-49794) and type confusion (CVE-2025-49796)
|
||||
in xmlSchematronReportOutput.
|
||||
|
||||
Fixes #931.
|
||||
Fixes #933.
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/71e1e8af5ee46dad1b57bb96cfbf1c3ad21fbd7b]
|
||||
CVE: CVE-2025-49794 CVE-2025-49796
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
result/schematron/cve-2025-49794_0.err | 2 ++
|
||||
result/schematron/cve-2025-49796_0.err | 2 ++
|
||||
schematron.c | 37 +++++++++++++++-----------
|
||||
test/schematron/cve-2025-49794.sct | 10 +++++++
|
||||
test/schematron/cve-2025-49794_0.xml | 6 +++++
|
||||
test/schematron/cve-2025-49796.sct | 9 +++++++
|
||||
test/schematron/cve-2025-49796_0.xml | 3 +++
|
||||
7 files changed, 53 insertions(+), 16 deletions(-)
|
||||
create mode 100644 result/schematron/cve-2025-49794_0.err
|
||||
create mode 100644 result/schematron/cve-2025-49796_0.err
|
||||
create mode 100644 test/schematron/cve-2025-49794.sct
|
||||
create mode 100644 test/schematron/cve-2025-49794_0.xml
|
||||
create mode 100644 test/schematron/cve-2025-49796.sct
|
||||
create mode 100644 test/schematron/cve-2025-49796_0.xml
|
||||
|
||||
diff --git a/result/schematron/cve-2025-49794_0.err b/result/schematron/cve-2025-49794_0.err
|
||||
new file mode 100644
|
||||
index 0000000..5775231
|
||||
--- /dev/null
|
||||
+++ b/result/schematron/cve-2025-49794_0.err
|
||||
@@ -0,0 +1,2 @@
|
||||
+./test/schematron/cve-2025-49794_0.xml:2: element boo0: schematron error : /librar0/boo0 line 2:
|
||||
+./test/schematron/cve-2025-49794_0.xml fails to validate
|
||||
diff --git a/result/schematron/cve-2025-49796_0.err b/result/schematron/cve-2025-49796_0.err
|
||||
new file mode 100644
|
||||
index 0000000..bf875ee
|
||||
--- /dev/null
|
||||
+++ b/result/schematron/cve-2025-49796_0.err
|
||||
@@ -0,0 +1,2 @@
|
||||
+./test/schematron/cve-2025-49796_0.xml:2: element boo0: schematron error : /librar0/boo0 line 2:
|
||||
+./test/schematron/cve-2025-49796_0.xml fails to validate
|
||||
diff --git a/schematron.c b/schematron.c
|
||||
index ddbb069..5ebca64 100644
|
||||
--- a/schematron.c
|
||||
+++ b/schematron.c
|
||||
@@ -1239,27 +1239,16 @@ exit:
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
-static xmlNodePtr
|
||||
+static xmlXPathObjectPtr
|
||||
xmlSchematronGetNode(xmlSchematronValidCtxtPtr ctxt,
|
||||
xmlNodePtr cur, const xmlChar *xpath) {
|
||||
- xmlNodePtr node = NULL;
|
||||
- xmlXPathObjectPtr ret;
|
||||
|
||||
if ((ctxt == NULL) || (cur == NULL) || (xpath == NULL))
|
||||
return(NULL);
|
||||
|
||||
ctxt->xctxt->doc = cur->doc;
|
||||
ctxt->xctxt->node = cur;
|
||||
- ret = xmlXPathEval(xpath, ctxt->xctxt);
|
||||
- if (ret == NULL)
|
||||
- return(NULL);
|
||||
-
|
||||
- if ((ret->type == XPATH_NODESET) &&
|
||||
- (ret->nodesetval != NULL) && (ret->nodesetval->nodeNr > 0))
|
||||
- node = ret->nodesetval->nodeTab[0];
|
||||
-
|
||||
- xmlXPathFreeObject(ret);
|
||||
- return(node);
|
||||
+ return(xmlXPathEval(xpath, ctxt->xctxt));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1304,18 +1293,26 @@ xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ctxt,
|
||||
(child->type == XML_CDATA_SECTION_NODE))
|
||||
ret = xmlStrcat(ret, child->content);
|
||||
else if (IS_SCHEMATRON(child, "name")) {
|
||||
+ xmlXPathObject *obj = NULL;
|
||||
xmlChar *path;
|
||||
|
||||
path = xmlGetNoNsProp(child, BAD_CAST "path");
|
||||
|
||||
node = cur;
|
||||
if (path != NULL) {
|
||||
- node = xmlSchematronGetNode(ctxt, cur, path);
|
||||
- if (node == NULL)
|
||||
- node = cur;
|
||||
+ obj = xmlSchematronGetNode(ctxt, cur, path);
|
||||
+ if ((obj != NULL) &&
|
||||
+ (obj->type == XPATH_NODESET) &&
|
||||
+ (obj->nodesetval != NULL) &&
|
||||
+ (obj->nodesetval->nodeNr > 0))
|
||||
+ node = obj->nodesetval->nodeTab[0];
|
||||
xmlFree(path);
|
||||
}
|
||||
|
||||
+ switch (node->type) {
|
||||
+ case XML_ELEMENT_NODE:
|
||||
+ case XML_ATTRIBUTE_NODE:
|
||||
+
|
||||
if ((node->ns == NULL) || (node->ns->prefix == NULL))
|
||||
ret = xmlStrcat(ret, node->name);
|
||||
else {
|
||||
@@ -1323,6 +1320,14 @@ xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ctxt,
|
||||
ret = xmlStrcat(ret, BAD_CAST ":");
|
||||
ret = xmlStrcat(ret, node->name);
|
||||
}
|
||||
+ break;
|
||||
+
|
||||
+ /* TODO: handle other node types */
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ xmlXPathFreeObject(obj);
|
||||
} else {
|
||||
child = child->next;
|
||||
continue;
|
||||
diff --git a/test/schematron/cve-2025-49794.sct b/test/schematron/cve-2025-49794.sct
|
||||
new file mode 100644
|
||||
index 0000000..7fc9ee3
|
||||
--- /dev/null
|
||||
+++ b/test/schematron/cve-2025-49794.sct
|
||||
@@ -0,0 +1,10 @@
|
||||
+<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
|
||||
+ <sch:pattern id="">
|
||||
+ <sch:rule context="boo0">
|
||||
+ <sch:report test="not(0)">
|
||||
+ <sch:name path="	e|namespace::*|e"/>
|
||||
+ </sch:report>
|
||||
+ <sch:report test="0"></sch:report>
|
||||
+ </sch:rule>
|
||||
+ </sch:pattern>
|
||||
+</sch:schema>
|
||||
diff --git a/test/schematron/cve-2025-49794_0.xml b/test/schematron/cve-2025-49794_0.xml
|
||||
new file mode 100644
|
||||
index 0000000..debc64b
|
||||
--- /dev/null
|
||||
+++ b/test/schematron/cve-2025-49794_0.xml
|
||||
@@ -0,0 +1,6 @@
|
||||
+<librar0>
|
||||
+ <boo0 t="">
|
||||
+ <author></author>
|
||||
+ </boo0>
|
||||
+ <ins></ins>
|
||||
+</librar0>
|
||||
diff --git a/test/schematron/cve-2025-49796.sct b/test/schematron/cve-2025-49796.sct
|
||||
new file mode 100644
|
||||
index 0000000..e9702d7
|
||||
--- /dev/null
|
||||
+++ b/test/schematron/cve-2025-49796.sct
|
||||
@@ -0,0 +1,9 @@
|
||||
+<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
|
||||
+ <sch:pattern id="">
|
||||
+ <sch:rule context="boo0">
|
||||
+ <sch:report test="not(0)">
|
||||
+ <sch:name path="/"/>
|
||||
+ </sch:report>
|
||||
+ </sch:rule>
|
||||
+ </sch:pattern>
|
||||
+</sch:schema>
|
||||
diff --git a/test/schematron/cve-2025-49796_0.xml b/test/schematron/cve-2025-49796_0.xml
|
||||
new file mode 100644
|
||||
index 0000000..be33c4e
|
||||
--- /dev/null
|
||||
+++ b/test/schematron/cve-2025-49796_0.xml
|
||||
@@ -0,0 +1,3 @@
|
||||
+<librar0>
|
||||
+ <boo0/>
|
||||
+</librar0>
|
||||
--
|
||||
2.49.0
|
||||
|
||||
56
meta/recipes-core/libxml/libxml2/CVE-2025-6021.patch
Normal file
56
meta/recipes-core/libxml/libxml2/CVE-2025-6021.patch
Normal file
@@ -0,0 +1,56 @@
|
||||
From acbbeef9f5dcdcc901c5f3fa14d583ef8cfd22f0 Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Tue, 27 May 2025 12:53:17 +0200
|
||||
Subject: [PATCH] tree: Fix integer overflow in xmlBuildQName
|
||||
|
||||
This issue affects memory safety.
|
||||
|
||||
Fixes #926.
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/acbbeef9f5dcdcc901c5f3fa14d583ef8cfd22f0]
|
||||
CVE: CVE-2025-6021
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
tree.c | 12 +++++++++---
|
||||
1 file changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tree.c b/tree.c
|
||||
index 6e04dfb..cdf863c 100644
|
||||
--- a/tree.c
|
||||
+++ b/tree.c
|
||||
@@ -50,6 +50,10 @@
|
||||
#include "buf.h"
|
||||
#include "save.h"
|
||||
|
||||
+#ifndef SIZE_MAX
|
||||
+#define SIZE_MAX ((size_t) -1)
|
||||
+#endif
|
||||
+
|
||||
int __xmlRegisterCallbacks = 0;
|
||||
|
||||
/************************************************************************
|
||||
@@ -222,16 +226,18 @@ xmlGetParameterEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
|
||||
xmlChar *
|
||||
xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix,
|
||||
xmlChar *memory, int len) {
|
||||
- int lenn, lenp;
|
||||
+ size_t lenn, lenp;
|
||||
xmlChar *ret;
|
||||
|
||||
- if (ncname == NULL) return(NULL);
|
||||
+ if ((ncname == NULL) || (len < 0)) return(NULL);
|
||||
if (prefix == NULL) return((xmlChar *) ncname);
|
||||
|
||||
lenn = strlen((char *) ncname);
|
||||
lenp = strlen((char *) prefix);
|
||||
+ if (lenn >= SIZE_MAX - lenp - 1)
|
||||
+ return(NULL);
|
||||
|
||||
- if ((memory == NULL) || (len < lenn + lenp + 2)) {
|
||||
+ if ((memory == NULL) || ((size_t) len < lenn + lenp + 2)) {
|
||||
ret = (xmlChar *) xmlMallocAtomic(lenn + lenp + 2);
|
||||
if (ret == NULL) {
|
||||
xmlTreeErrMemory("building QName");
|
||||
--
|
||||
2.49.0
|
||||
|
||||
103
meta/recipes-core/libxml/libxml2/CVE-2025-6170.patch
Normal file
103
meta/recipes-core/libxml/libxml2/CVE-2025-6170.patch
Normal file
@@ -0,0 +1,103 @@
|
||||
From 5e9ec5c107d3f5b5179c3dbc19df43df041cd55b Mon Sep 17 00:00:00 2001
|
||||
From: Michael Mann <mmann78@netscape.net>
|
||||
Date: Fri, 20 Jun 2025 23:05:00 -0400
|
||||
Subject: [PATCH] [CVE-2025-6170] Fix potential buffer overflows of interactive
|
||||
shell
|
||||
|
||||
Fixes #941
|
||||
|
||||
CVE: CVE-2025-6170
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/5e9ec5c107d3f5b5179c3dbc19df43df041cd55b]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
debugXML.c | 15 ++++++++++-----
|
||||
result/scripts/long_command | 8 ++++++++
|
||||
test/scripts/long_command.script | 6 ++++++
|
||||
test/scripts/long_command.xml | 1 +
|
||||
4 files changed, 25 insertions(+), 5 deletions(-)
|
||||
create mode 100644 result/scripts/long_command
|
||||
create mode 100644 test/scripts/long_command.script
|
||||
create mode 100644 test/scripts/long_command.xml
|
||||
|
||||
diff --git a/debugXML.c b/debugXML.c
|
||||
index ed56b0f8..452b9573 100644
|
||||
--- a/debugXML.c
|
||||
+++ b/debugXML.c
|
||||
@@ -1050,6 +1050,10 @@ xmlCtxtDumpOneNode(xmlDebugCtxtPtr ctxt, xmlNodePtr node)
|
||||
xmlCtxtGenericNodeCheck(ctxt, node);
|
||||
}
|
||||
|
||||
+#define MAX_PROMPT_SIZE 500
|
||||
+#define MAX_ARG_SIZE 400
|
||||
+#define MAX_COMMAND_SIZE 100
|
||||
+
|
||||
/**
|
||||
* xmlCtxtDumpNode:
|
||||
* @output: the FILE * for the output
|
||||
@@ -2802,10 +2806,10 @@ void
|
||||
xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
|
||||
FILE * output)
|
||||
{
|
||||
- char prompt[500] = "/ > ";
|
||||
+ char prompt[MAX_PROMPT_SIZE] = "/ > ";
|
||||
char *cmdline = NULL, *cur;
|
||||
- char command[100];
|
||||
- char arg[400];
|
||||
+ char command[MAX_COMMAND_SIZE];
|
||||
+ char arg[MAX_ARG_SIZE];
|
||||
int i;
|
||||
xmlShellCtxtPtr ctxt;
|
||||
xmlXPathObjectPtr list;
|
||||
@@ -2863,7 +2867,8 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
|
||||
cur++;
|
||||
i = 0;
|
||||
while ((*cur != ' ') && (*cur != '\t') &&
|
||||
- (*cur != '\n') && (*cur != '\r')) {
|
||||
+ (*cur != '\n') && (*cur != '\r') &&
|
||||
+ (i < (MAX_COMMAND_SIZE - 1))) {
|
||||
if (*cur == 0)
|
||||
break;
|
||||
command[i++] = *cur++;
|
||||
@@ -2878,7 +2883,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
|
||||
while ((*cur == ' ') || (*cur == '\t'))
|
||||
cur++;
|
||||
i = 0;
|
||||
- while ((*cur != '\n') && (*cur != '\r') && (*cur != 0)) {
|
||||
+ while ((*cur != '\n') && (*cur != '\r') && (*cur != 0) && (i < (MAX_ARG_SIZE-1))) {
|
||||
if (*cur == 0)
|
||||
break;
|
||||
arg[i++] = *cur++;
|
||||
diff --git a/result/scripts/long_command b/result/scripts/long_command
|
||||
new file mode 100644
|
||||
index 00000000..e6f00708
|
||||
--- /dev/null
|
||||
+++ b/result/scripts/long_command
|
||||
@@ -0,0 +1,8 @@
|
||||
+/ > b > b > Object is a Node Set :
|
||||
+Set contains 1 nodes:
|
||||
+1 ELEMENT a:c
|
||||
+b > Unknown command This_is_a_really_long_command_string_designed_to_test_the_limits_of_the_memory_that_stores_the_comm
|
||||
+b > b > Unknown command ess_currents_of_time_and_existence
|
||||
+b > <?xml version="1.0"?>
|
||||
+<a xmlns:a="bar"><b xmlns:a="foo">Navigating_the_labyrinthine_corridors_of_human_cognition_one_often_encounters_the_perplexing_paradox_that_the_more_we_delve_into_the_intricate_dance_of_neural_pathways_and_synaptic_firings_the_further_we_seem_to_stray_from_a_truly_holistic_understanding_of_consciousness_a_phenomenon_that_remains_as_elusive_as_a_moonbeam_caught_in_a_spiderweb_yet_undeniably_shapes_every_fleeting_thought_every_prof</b></a>
|
||||
+b >
|
||||
\ No newline at end of file
|
||||
diff --git a/test/scripts/long_command.script b/test/scripts/long_command.script
|
||||
new file mode 100644
|
||||
index 00000000..00f6df09
|
||||
--- /dev/null
|
||||
+++ b/test/scripts/long_command.script
|
||||
@@ -0,0 +1,6 @@
|
||||
+cd a/b
|
||||
+set <a:c/>
|
||||
+xpath //*[namespace-uri()="foo"]
|
||||
+This_is_a_really_long_command_string_designed_to_test_the_limits_of_the_memory_that_stores_the_command_please_dont_crash foo
|
||||
+set Navigating_the_labyrinthine_corridors_of_human_cognition_one_often_encounters_the_perplexing_paradox_that_the_more_we_delve_into_the_intricate_dance_of_neural_pathways_and_synaptic_firings_the_further_we_seem_to_stray_from_a_truly_holistic_understanding_of_consciousness_a_phenomenon_that_remains_as_elusive_as_a_moonbeam_caught_in_a_spiderweb_yet_undeniably_shapes_every_fleeting_thought_every_profound_emotion_and_every_grand_aspiration_that_propels_our_species_ever_onward_through_the_relentless_currents_of_time_and_existence
|
||||
+save -
|
||||
diff --git a/test/scripts/long_command.xml b/test/scripts/long_command.xml
|
||||
new file mode 100644
|
||||
index 00000000..1ba44016
|
||||
--- /dev/null
|
||||
+++ b/test/scripts/long_command.xml
|
||||
@@ -0,0 +1 @@
|
||||
+<a xmlns:a="bar"><b xmlns:a="foo"/></a>
|
||||
@@ -39,6 +39,9 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar;subdir=${BP};name=testt
|
||||
file://CVE-2025-24928.patch \
|
||||
file://CVE-2025-32414.patch \
|
||||
file://CVE-2025-32415.patch \
|
||||
file://CVE-2025-6021.patch \
|
||||
file://CVE-2025-49794-CVE-2025-49796.patch \
|
||||
file://CVE-2025-6170.patch \
|
||||
"
|
||||
|
||||
SRC_URI[archive.sha256sum] = "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee"
|
||||
|
||||
25
meta/recipes-core/ncurses/files/CVE-2025-6141.patch
Normal file
25
meta/recipes-core/ncurses/files/CVE-2025-6141.patch
Normal file
@@ -0,0 +1,25 @@
|
||||
From 27d1493340d714e7be6e08c0a8f43e48276149c4 Mon Sep 17 00:00:00 2001
|
||||
From: "Thomas E. Dickey" <dickey@invisible-island.net>
|
||||
Date: Sat, 29 Mar 2025 22:52:37 +0000
|
||||
Subject: [PATCH] snapshot of project "ncurses", label v6_5_20250329
|
||||
|
||||
CVE: CVE-2025-6141
|
||||
Upstream-Status: Backport [https://github.com/ThomasDickey/ncurses-snapshots/commit/27d1493340d714e7be6e08c0a8f43e48276149c4]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
ncurses/tinfo/parse_entry.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/ncurses/tinfo/parse_entry.c b/ncurses/tinfo/parse_entry.c
|
||||
index a2278c07..c551c780 100644
|
||||
--- a/ncurses/tinfo/parse_entry.c
|
||||
+++ b/ncurses/tinfo/parse_entry.c
|
||||
@@ -954,6 +954,8 @@ postprocess_termcap(TERMTYPE2 *tp, bool has_base)
|
||||
bp = tp->Strings[from_ptr->nte_index];
|
||||
if (VALID_STRING(bp)) {
|
||||
for (dp = buf2; *bp; bp++) {
|
||||
+ if ((size_t) (dp - buf2) >= (sizeof(buf2) - sizeof(TERMTYPE2)))
|
||||
+ break;
|
||||
if (bp[0] == '$' && bp[1] == '<') {
|
||||
while (*bp && *bp != '>') {
|
||||
++bp;
|
||||
@@ -6,6 +6,7 @@ SRC_URI += "file://0001-tic-hang.patch \
|
||||
file://CVE-2023-29491.patch \
|
||||
file://CVE-2023-50495.patch \
|
||||
file://CVE-2023-45918.patch \
|
||||
file://CVE-2025-6141.patch \
|
||||
"
|
||||
# commit id corresponds to the revision in package version
|
||||
SRCREV = "a0bc708bc6954b5d3c0a38d92b683c3ec3135260"
|
||||
|
||||
92
meta/recipes-core/systemd/systemd/CVE-2025-4598-0001.patch
Normal file
92
meta/recipes-core/systemd/systemd/CVE-2025-4598-0001.patch
Normal file
@@ -0,0 +1,92 @@
|
||||
From 2108812a76bd078a2bbd7583308ff18bf01f2383 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Tue, 29 Apr 2025 14:47:59 +0200
|
||||
Subject: [PATCH 1/3] coredump: restore compatibility with older patterns
|
||||
|
||||
This was broken in f45b8015513d38ee5f7cc361db9c5b88c9aae704. Unfortunately
|
||||
the review does not talk about backward compatibility at all. There are
|
||||
two places where it matters:
|
||||
- During upgrades, the replacement of kernel.core_pattern is asynchronous.
|
||||
For example, during rpm upgrades, it would be updated a post-transaction
|
||||
file trigger. In other scenarios, the update might only happen after
|
||||
reboot. We have a potentially long window where the old pattern is in
|
||||
place. We need to capture coredumps during upgrades too.
|
||||
- With --backtrace. The interface of --backtrace, in hindsight, is not
|
||||
great. But there are users of --backtrace which were written to use
|
||||
a specific set of arguments, and we can't just break compatiblity.
|
||||
One example is systemd-coredump-python, but there are also reports of
|
||||
users using --backtrace to generate coredump logs.
|
||||
|
||||
Thus, we require the original set of args, and will use the additional args if
|
||||
found.
|
||||
|
||||
A test is added to verify that --backtrace works with and without the optional
|
||||
args.
|
||||
|
||||
(cherry picked from commit ded0aac389e647d35bce7ec4a48e718d77c0435b)
|
||||
(cherry picked from commit f9b8b75c11bba9b63096904be98cc529c304eb97)
|
||||
(cherry picked from commit 385a33b043406ad79a7207f3906c3b15192a3333)
|
||||
(cherry picked from commit c6f79626b6d175c6a5b62b8c5d957a83eb882301)
|
||||
(cherry picked from commit 9f02346d50e33c24acf879ce4dd5937d56473325)
|
||||
(cherry picked from commit ac0aa5d1fdc21db1ef035fce562cb6fc8602b544)
|
||||
|
||||
Upstream-Status: Backport [https://github.com/systemd/systemd-stable/commit/cadd1b1a1f39fd13b1115a10f563017201d7b56a]
|
||||
|
||||
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||
---
|
||||
src/coredump/coredump.c | 21 ++++++++++++++-------
|
||||
1 file changed, 14 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
|
||||
index 79280ab986..d598f6f59a 100644
|
||||
--- a/src/coredump/coredump.c
|
||||
+++ b/src/coredump/coredump.c
|
||||
@@ -84,8 +84,12 @@ enum {
|
||||
META_ARGV_SIGNAL, /* %s: number of signal causing dump */
|
||||
META_ARGV_TIMESTAMP, /* %t: time of dump, expressed as seconds since the Epoch (we expand this to µs granularity) */
|
||||
META_ARGV_RLIMIT, /* %c: core file size soft resource limit */
|
||||
- META_ARGV_HOSTNAME, /* %h: hostname */
|
||||
+ _META_ARGV_REQUIRED,
|
||||
+ /* The fields below were added to kernel/core_pattern at later points, so they might be missing. */
|
||||
+ META_ARGV_HOSTNAME = _META_ARGV_REQUIRED, /* %h: hostname */
|
||||
_META_ARGV_MAX,
|
||||
+ /* If new fields are added, they should be added here, to maintain compatibility
|
||||
+ * with callers which don't know about the new fields. */
|
||||
|
||||
/* The following indexes are cached for a couple of special fields we use (and
|
||||
* thereby need to be retrieved quickly) for naming coredump files, and attaching
|
||||
@@ -96,7 +100,7 @@ enum {
|
||||
_META_MANDATORY_MAX,
|
||||
|
||||
/* The rest are similar to the previous ones except that we won't fail if one of
|
||||
- * them is missing. */
|
||||
+ * them is missing in a message sent over the socket. */
|
||||
|
||||
META_EXE = _META_MANDATORY_MAX,
|
||||
META_UNIT,
|
||||
@@ -1278,14 +1282,17 @@ static int gather_pid_metadata_from_argv(
|
||||
char *t;
|
||||
|
||||
/* We gather all metadata that were passed via argv[] into an array of iovecs that
|
||||
- * we'll forward to the socket unit */
|
||||
+ * we'll forward to the socket unit.
|
||||
+ *
|
||||
+ * We require at least _META_ARGV_REQUIRED args, but will accept more.
|
||||
+ * We know how to parse _META_ARGV_MAX args. The rest will be ignored. */
|
||||
|
||||
- if (argc < _META_ARGV_MAX)
|
||||
+ if (argc < _META_ARGV_REQUIRED)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
- "Not enough arguments passed by the kernel (%i, expected %i).",
|
||||
- argc, _META_ARGV_MAX);
|
||||
+ "Not enough arguments passed by the kernel (%i, expected between %i and %i).",
|
||||
+ argc, _META_ARGV_REQUIRED, _META_ARGV_MAX);
|
||||
|
||||
- for (int i = 0; i < _META_ARGV_MAX; i++) {
|
||||
+ for (int i = 0; i < MIN(argc, _META_ARGV_MAX); i++) {
|
||||
|
||||
t = argv[i];
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
106
meta/recipes-core/systemd/systemd/CVE-2025-4598-0002.patch
Normal file
106
meta/recipes-core/systemd/systemd/CVE-2025-4598-0002.patch
Normal file
@@ -0,0 +1,106 @@
|
||||
From fb22bb743556d4d14463b0f0373c24d07d2e7b28 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Mon, 26 May 2025 12:04:44 +0200
|
||||
Subject: [PATCH 2/3] coredump: get rid of _META_MANDATORY_MAX
|
||||
|
||||
No functional change. This change is done in preparation for future changes.
|
||||
Currently, the list of fields which are received on the command line is a
|
||||
strict subset of the fields which are always expected to be received on a
|
||||
socket. But when we add new kernel args in the future, we'll have two
|
||||
non-overlapping sets and this approach will not work. Get rid of the variable
|
||||
and enumerate the required fields. This set will never change, so this is
|
||||
actually more maintainable.
|
||||
|
||||
The message with the hint where to add new fields is switched with
|
||||
_META_ARGV_MAX. The new order is more correct.
|
||||
|
||||
(cherry-picked from 49f1f2d4a7612bbed5211a73d11d6a94fbe3bb69)
|
||||
(cherry-picked from aea6a631bca93e8b04a11aaced694f25f4da155e)
|
||||
(cherry picked from cf16b6b6b2e0a656531bfd73ad66be3817b155cd)
|
||||
|
||||
(cherry picked from commit b46a4f023cd80b24c8f1aa7a95700bc0cb828cdc)
|
||||
(cherry picked from commit 5855552310ed279180c21cb803408aa2ce36053d)
|
||||
(cherry picked from commit cc31f2d4146831b9f2fe7bf584468908ff9c4de5)
|
||||
|
||||
Upstream-Status: Backport [https://github.com/systemd/systemd-stable/commit/2c81e60fe0b8c506a4fe902e45bed6f58f482b39]
|
||||
|
||||
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||
---
|
||||
src/coredump/coredump.c | 29 ++++++++++++++++++++---------
|
||||
1 file changed, 20 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
|
||||
index d598f6f59a..0b27086288 100644
|
||||
--- a/src/coredump/coredump.c
|
||||
+++ b/src/coredump/coredump.c
|
||||
@@ -71,7 +71,7 @@
|
||||
* size. See DATA_SIZE_MAX in journal-importer.h. */
|
||||
assert_cc(JOURNAL_SIZE_MAX <= DATA_SIZE_MAX);
|
||||
|
||||
-enum {
|
||||
+typedef enum {
|
||||
/* We use these as array indexes for our process metadata cache.
|
||||
*
|
||||
* The first indices of the cache stores the same metadata as the ones passed by
|
||||
@@ -87,9 +87,9 @@ enum {
|
||||
_META_ARGV_REQUIRED,
|
||||
/* The fields below were added to kernel/core_pattern at later points, so they might be missing. */
|
||||
META_ARGV_HOSTNAME = _META_ARGV_REQUIRED, /* %h: hostname */
|
||||
- _META_ARGV_MAX,
|
||||
/* If new fields are added, they should be added here, to maintain compatibility
|
||||
* with callers which don't know about the new fields. */
|
||||
+ _META_ARGV_MAX,
|
||||
|
||||
/* The following indexes are cached for a couple of special fields we use (and
|
||||
* thereby need to be retrieved quickly) for naming coredump files, and attaching
|
||||
@@ -97,16 +97,15 @@ enum {
|
||||
* environment. */
|
||||
|
||||
META_COMM = _META_ARGV_MAX,
|
||||
- _META_MANDATORY_MAX,
|
||||
|
||||
/* The rest are similar to the previous ones except that we won't fail if one of
|
||||
* them is missing in a message sent over the socket. */
|
||||
|
||||
- META_EXE = _META_MANDATORY_MAX,
|
||||
+ META_EXE,
|
||||
META_UNIT,
|
||||
META_PROC_AUXV,
|
||||
_META_MAX
|
||||
-};
|
||||
+} meta_argv_t;
|
||||
|
||||
static const char * const meta_field_names[_META_MAX] = {
|
||||
[META_ARGV_PID] = "COREDUMP_PID=",
|
||||
@@ -1192,12 +1191,24 @@ static int process_socket(int fd) {
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
|
||||
- /* Make sure we received at least all fields we need. */
|
||||
- for (int i = 0; i < _META_MANDATORY_MAX; i++)
|
||||
+ /* Make sure we received all the expected fields. We support being called by an *older*
|
||||
+ * systemd-coredump from the outside, so we require only the basic set of fields that
|
||||
+ * was being sent when the support for sending to containers over a socket was added
|
||||
+ * in a108c43e36d3ceb6e34efe37c014fc2cda856000. */
|
||||
+ meta_argv_t i;
|
||||
+ VA_ARGS_FOREACH(i,
|
||||
+ META_ARGV_PID,
|
||||
+ META_ARGV_UID,
|
||||
+ META_ARGV_GID,
|
||||
+ META_ARGV_SIGNAL,
|
||||
+ META_ARGV_TIMESTAMP,
|
||||
+ META_ARGV_RLIMIT,
|
||||
+ META_ARGV_HOSTNAME,
|
||||
+ META_COMM)
|
||||
if (!context.meta[i]) {
|
||||
r = log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
- "A mandatory argument (%i) has not been sent, aborting.",
|
||||
- i);
|
||||
+ "Mandatory argument %s not received on socket, aborting.",
|
||||
+ meta_field_names[i]);
|
||||
goto finish;
|
||||
}
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
144
meta/recipes-core/systemd/systemd/CVE-2025-4598-0003.patch
Normal file
144
meta/recipes-core/systemd/systemd/CVE-2025-4598-0003.patch
Normal file
@@ -0,0 +1,144 @@
|
||||
From 89730dea979b2d22fd548b622cd88bac99ff1d6b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Tue, 29 Apr 2025 14:47:59 +0200
|
||||
Subject: [PATCH 3/3] coredump: use %d in kernel core pattern
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The kernel provides %d which is documented as
|
||||
"dump mode—same as value returned by prctl(2) PR_GET_DUMPABLE".
|
||||
|
||||
We already query /proc/pid/auxv for this information, but unfortunately this
|
||||
check is subject to a race, because the crashed process may be replaced by an
|
||||
attacker before we read this data, for example replacing a SUID process that
|
||||
was killed by a signal with another process that is not SUID, tricking us into
|
||||
making the coredump of the original process readable by the attacker.
|
||||
|
||||
With this patch, we effectively add one more check to the list of conditions
|
||||
that need be satisfied if we are to make the coredump accessible to the user.
|
||||
|
||||
Reportedy-by: Qualys Security Advisory <qsa@qualys.com>
|
||||
|
||||
(cherry-picked from commit 0c49e0049b7665bb7769a13ef346fef92e1ad4d6)
|
||||
(cherry-picked from commit c58a8a6ec9817275bb4babaa2c08e0e35090d4e3)
|
||||
(cherry picked from commit 19d439189ab85dd7222bdd59fd442bbcc8ea99a7)
|
||||
(cherry picked from commit 254ab8d2a7866679cee006d844d078774cbac3c9)
|
||||
(cherry picked from commit 7fc7aa5a4d28d7768dfd1eb85be385c3ea949168)
|
||||
(cherry picked from commit 19b228662e0fcc6596c0395a0af8486a4b3f1627)
|
||||
|
||||
CVE: CVE-2025-4598
|
||||
|
||||
Upstream-Status: Backport [https://github.com/systemd/systemd-stable/commit/2eb46dce078334805c547cbcf5e6462cf9d2f9f0]
|
||||
|
||||
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||
---
|
||||
man/systemd-coredump.xml | 12 ++++++++++++
|
||||
src/coredump/coredump.c | 21 ++++++++++++++++++---
|
||||
sysctl.d/50-coredump.conf.in | 2 +-
|
||||
3 files changed, 31 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/man/systemd-coredump.xml b/man/systemd-coredump.xml
|
||||
index cb9f47745b..ba7cad12bc 100644
|
||||
--- a/man/systemd-coredump.xml
|
||||
+++ b/man/systemd-coredump.xml
|
||||
@@ -259,6 +259,18 @@ COREDUMP_FILENAME=/var/lib/systemd/coredump/core.Web….552351.….zst
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
+ <varlistentry>
|
||||
+ <term><varname>COREDUMP_DUMPABLE=</varname></term>
|
||||
+
|
||||
+ <listitem><para>The <constant>PR_GET_DUMPABLE</constant> field as reported by the kernel, see
|
||||
+ <citerefentry
|
||||
+ project='man-pages'><refentrytitle>prctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>.
|
||||
+ </para>
|
||||
+
|
||||
+ <xi:include href="version-info.xml" xpointer="v258"/>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
<varlistentry>
|
||||
<term><varname>COREDUMP_OPEN_FDS=</varname></term>
|
||||
|
||||
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
|
||||
index 0b27086288..aca6a2eb6b 100644
|
||||
--- a/src/coredump/coredump.c
|
||||
+++ b/src/coredump/coredump.c
|
||||
@@ -87,6 +87,7 @@ typedef enum {
|
||||
_META_ARGV_REQUIRED,
|
||||
/* The fields below were added to kernel/core_pattern at later points, so they might be missing. */
|
||||
META_ARGV_HOSTNAME = _META_ARGV_REQUIRED, /* %h: hostname */
|
||||
+ META_ARGV_DUMPABLE, /* %d: as set by the kernel */
|
||||
/* If new fields are added, they should be added here, to maintain compatibility
|
||||
* with callers which don't know about the new fields. */
|
||||
_META_ARGV_MAX,
|
||||
@@ -115,6 +116,7 @@ static const char * const meta_field_names[_META_MAX] = {
|
||||
[META_ARGV_TIMESTAMP] = "COREDUMP_TIMESTAMP=",
|
||||
[META_ARGV_RLIMIT] = "COREDUMP_RLIMIT=",
|
||||
[META_ARGV_HOSTNAME] = "COREDUMP_HOSTNAME=",
|
||||
+ [META_ARGV_DUMPABLE] = "COREDUMP_DUMPABLE=",
|
||||
[META_COMM] = "COREDUMP_COMM=",
|
||||
[META_EXE] = "COREDUMP_EXE=",
|
||||
[META_UNIT] = "COREDUMP_UNIT=",
|
||||
@@ -125,6 +127,7 @@ typedef struct Context {
|
||||
const char *meta[_META_MAX];
|
||||
size_t meta_size[_META_MAX];
|
||||
pid_t pid;
|
||||
+ unsigned dumpable;
|
||||
bool is_pid1;
|
||||
bool is_journald;
|
||||
} Context;
|
||||
@@ -470,14 +473,16 @@ static int grant_user_access(int core_fd, const Context *context) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
- /* We allow access if we got all the data and at_secure is not set and
|
||||
- * the uid/gid matches euid/egid. */
|
||||
+ /* We allow access if dumpable on the command line was exactly 1, we got all the data,
|
||||
+ * at_secure is not set, and the uid/gid match euid/egid. */
|
||||
bool ret =
|
||||
+ context->dumpable == 1 &&
|
||||
at_secure == 0 &&
|
||||
uid != UID_INVALID && euid != UID_INVALID && uid == euid &&
|
||||
gid != GID_INVALID && egid != GID_INVALID && gid == egid;
|
||||
- log_debug("Will %s access (uid="UID_FMT " euid="UID_FMT " gid="GID_FMT " egid="GID_FMT " at_secure=%s)",
|
||||
+ log_debug("Will %s access (dumpable=%u uid="UID_FMT " euid="UID_FMT " gid="GID_FMT " egid="GID_FMT " at_secure=%s)",
|
||||
ret ? "permit" : "restrict",
|
||||
+ context->dumpable,
|
||||
uid, euid, gid, egid, yes_no(at_secure));
|
||||
return ret;
|
||||
}
|
||||
@@ -1102,6 +1107,16 @@ static int save_context(Context *context, const struct iovec_wrapper *iovw) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to parse PID \"%s\": %m", context->meta[META_ARGV_PID]);
|
||||
|
||||
+ /* The value is set to contents of /proc/sys/fs/suid_dumpable, which we set to 2,
|
||||
+ * if the process is marked as not dumpable, see PR_SET_DUMPABLE(2const). */
|
||||
+ if (context->meta[META_ARGV_DUMPABLE]) {
|
||||
+ r = safe_atou(context->meta[META_ARGV_DUMPABLE], &context->dumpable);
|
||||
+ if (r < 0)
|
||||
+ return log_error_errno(r, "Failed to parse dumpable field \"%s\": %m", context->meta[META_ARGV_DUMPABLE]);
|
||||
+ if (context->dumpable > 2)
|
||||
+ log_notice("Got unexpected %%d/dumpable value %u.", context->dumpable);
|
||||
+ }
|
||||
+
|
||||
unit = context->meta[META_UNIT];
|
||||
context->is_pid1 = streq(context->meta[META_ARGV_PID], "1") || streq_ptr(unit, SPECIAL_INIT_SCOPE);
|
||||
context->is_journald = streq_ptr(unit, SPECIAL_JOURNALD_SERVICE);
|
||||
diff --git a/sysctl.d/50-coredump.conf.in b/sysctl.d/50-coredump.conf.in
|
||||
index 5fb551a8cf..9c10a89828 100644
|
||||
--- a/sysctl.d/50-coredump.conf.in
|
||||
+++ b/sysctl.d/50-coredump.conf.in
|
||||
@@ -13,7 +13,7 @@
|
||||
# the core dump.
|
||||
#
|
||||
# See systemd-coredump(8) and core(5).
|
||||
-kernel.core_pattern=|{{ROOTLIBEXECDIR}}/systemd-coredump %P %u %g %s %t %c %h
|
||||
+kernel.core_pattern=|{{ROOTLIBEXECDIR}}/systemd-coredump %P %u %g %s %t %c %h %d
|
||||
|
||||
# Allow 16 coredumps to be dispatched in parallel by the kernel.
|
||||
# We collect metadata from /proc/%P/, and thus need to make sure the crashed
|
||||
--
|
||||
2.34.1
|
||||
|
||||
36
meta/recipes-core/systemd/systemd/CVE-2025-4598-0004.patch
Normal file
36
meta/recipes-core/systemd/systemd/CVE-2025-4598-0004.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
From a0c698c720441782fcf2cb7dfd01e69baf8f1f39 Mon Sep 17 00:00:00 2001
|
||||
From: Dan Streetman <ddstreet@ieee.org>
|
||||
Date: Thu, 2 Feb 2023 15:58:10 -0500
|
||||
Subject: [PATCH] basic/macro: add macro to iterate variadic args
|
||||
|
||||
(cherry picked from commit e179f2d89c9f0c951636d74de00136b4075cd1ac)
|
||||
(cherry picked from commit cd4f43bf378ff33ce5cfeacd96f7f3726603bddc)
|
||||
|
||||
Upstream-Status: Backport [https://github.com/systemd/systemd-stable/commit/c288a3aafdf11cd93eb7a21e4d587c6fc218a29c]
|
||||
|
||||
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||
---
|
||||
src/basic/macro.h | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/src/basic/macro.h b/src/basic/macro.h
|
||||
index 9e62f9c71c..16242902ec 100644
|
||||
--- a/src/basic/macro.h
|
||||
+++ b/src/basic/macro.h
|
||||
@@ -454,4 +454,13 @@ typedef struct {
|
||||
|
||||
assert_cc(sizeof(dummy_t) == 0);
|
||||
|
||||
+/* Iterate through each variadic arg. All must be the same type as 'entry' or must be implicitly
|
||||
+ * convertable. The iteration variable 'entry' must already be defined. */
|
||||
+#define VA_ARGS_FOREACH(entry, ...) \
|
||||
+ _VA_ARGS_FOREACH(entry, UNIQ_T(_entries_, UNIQ), UNIQ_T(_current_, UNIQ), ##__VA_ARGS__)
|
||||
+#define _VA_ARGS_FOREACH(entry, _entries_, _current_, ...) \
|
||||
+ for (typeof(entry) _entries_[] = { __VA_ARGS__ }, *_current_ = _entries_; \
|
||||
+ ((long)(_current_ - _entries_) < (long)ELEMENTSOF(_entries_)) && ({ entry = *_current_; true; }); \
|
||||
+ _current_++)
|
||||
+
|
||||
#include "log.h"
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -31,6 +31,10 @@ SRC_URI += "file://touchscreen.rules \
|
||||
file://0001-core-fix-build-when-seccomp-is-off.patch \
|
||||
file://0001-journal-Make-sd_journal_previous-next-return-0-at-HE.patch \
|
||||
file://0001-basic-do-not-warn-in-mkdir_p-when-parent-directory-e.patch \
|
||||
file://CVE-2025-4598-0001.patch \
|
||||
file://CVE-2025-4598-0002.patch \
|
||||
file://CVE-2025-4598-0003.patch \
|
||||
file://CVE-2025-4598-0004.patch \
|
||||
"
|
||||
|
||||
# patches needed by musl
|
||||
|
||||
@@ -18,7 +18,7 @@ SRCBRANCH ?= "binutils-2_38-branch"
|
||||
|
||||
UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)"
|
||||
|
||||
SRCREV ?= "4d71e17a9fd8d319359ded891eb3034a2325d4c0"
|
||||
SRCREV ?= "9bee8d65d32ac1480997c13ce76ae7991180f1ed"
|
||||
BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=${SRCBRANCH};protocol=git"
|
||||
SRC_URI = "\
|
||||
${BINUTILS_GIT_URI} \
|
||||
@@ -78,5 +78,7 @@ SRC_URI = "\
|
||||
file://0040-CVE-2025-1182.patch \
|
||||
file://0041-CVE-2025-5244.patch \
|
||||
file://0042-CVE-2025-5245.patch \
|
||||
file://0043-CVE-2025-7546.patch \
|
||||
file://0043-CVE-2025-7545.patch \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Sat, 21 Jun 2025 06:36:56 +0800
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h08c3cbe5926e4d355b5cb70bbec2b1eeb40c2944]
|
||||
CVE: CVE-2025-7545
|
||||
|
||||
Since the output section contents are copied from the input, don't
|
||||
extend the output section size beyond the input section size.
|
||||
|
||||
PR binutils/33049
|
||||
* objcopy.c (copy_section): Don't extend the output section
|
||||
size beyond the input section size.
|
||||
|
||||
Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
|
||||
|
||||
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
|
||||
index d53aa5c6..874f163b 100644
|
||||
--- a/binutils/objcopy.c
|
||||
+++ b/binutils/objcopy.c
|
||||
@@ -4444,6 +4444,7 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
|
||||
char *to = (char *) memhunk;
|
||||
char *end = (char *) memhunk + size;
|
||||
int i;
|
||||
+ bfd_size_type memhunk_size = size;
|
||||
|
||||
/* If the section address is not exactly divisible by the interleave,
|
||||
then we must bias the from address. If the copy_byte is less than
|
||||
@@ -4463,6 +4464,11 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
|
||||
}
|
||||
|
||||
size = (size + interleave - 1 - copy_byte) / interleave * copy_width;
|
||||
+
|
||||
+ /* Don't extend the output section size. */
|
||||
+ if (size > memhunk_size)
|
||||
+ size = memhunk_size;
|
||||
+
|
||||
osection->lma /= interleave;
|
||||
if (copy_byte < extra)
|
||||
osection->lma++;
|
||||
@@ -0,0 +1,44 @@
|
||||
From 41461010eb7c79fee7a9d5f6209accdaac66cc6b Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Sat, 21 Jun 2025 06:52:00 +0800
|
||||
Subject: [PATCH] elf: Report corrupted group section
|
||||
|
||||
Report corrupted group section instead of trying to recover.
|
||||
|
||||
PR binutils/33050
|
||||
* elf.c (bfd_elf_set_group_contents): Report corrupted group
|
||||
section.
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=41461010eb7c79fee7a9d5f6209accdaac66cc6b]
|
||||
CVE: CVE-2025-7546
|
||||
|
||||
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
||||
Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
|
||||
---
|
||||
bfd/elf.c | 23 ++++++++++-------------
|
||||
1 file changed, 10 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf.c b/bfd/elf.c
|
||||
index 14ce15c7254..ee894eb05f2 100644
|
||||
--- a/bfd/elf.c
|
||||
+++ b/bfd/elf.c
|
||||
@@ -3611,8 +3611,18 @@
|
||||
break;
|
||||
}
|
||||
|
||||
+ /* We should always get here with loc == sec->contents + 4. Return
|
||||
+ an error for bogus SHT_GROUP sections. */
|
||||
loc -= 4;
|
||||
- BFD_ASSERT (loc == sec->contents);
|
||||
+ if (loc != sec->contents)
|
||||
+ {
|
||||
+ /* xgettext:c-format */
|
||||
+ _bfd_error_handler (_("%pB: corrupted group section: `%pA'"),
|
||||
+ abfd, sec);
|
||||
+ bfd_set_error (bfd_error_bad_value);
|
||||
+ *failedptr = true;
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
H_PUT_32 (abfd, sec->flags & SEC_LINK_ONCE ? GRP_COMDAT : 0, loc);
|
||||
}
|
||||
@@ -9,6 +9,9 @@ SRC_URI[sha256sum] = "3fc2bee78dfb7c41fd9605061fc69138db7df007eae2f669a1f56e8bac
|
||||
|
||||
inherit meson pkgconfig gtk-doc
|
||||
|
||||
# distinguish from apache:orc
|
||||
CVE_PRODUCT = "gstreamer:orc"
|
||||
|
||||
GTKDOC_MESON_OPTION = "gtk_doc"
|
||||
GTKDOC_MESON_ENABLE_FLAG = "enabled"
|
||||
GTKDOC_MESON_DISABLE_FLAG = "disabled"
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
From f05b1329126d5be6de501f9d1e3e36738bc08857 Mon Sep 17 00:00:00 2001
|
||||
From: Illia Volochii <illia.volochii@gmail.com>
|
||||
Date: Wed, 18 Jun 2025 16:25:01 +0300
|
||||
Subject: [PATCH] Merge commit from fork
|
||||
|
||||
* Apply Quentin's suggestion
|
||||
|
||||
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
|
||||
|
||||
* Add tests for disabled redirects in the pool manager
|
||||
|
||||
* Add a possible fix for the issue with not raised `MaxRetryError`
|
||||
|
||||
* Make urllib3 handle redirects instead of JS when JSPI is used
|
||||
|
||||
* Fix info in the new comment
|
||||
|
||||
* State that redirects with XHR are not controlled by urllib3
|
||||
|
||||
* Remove excessive params from new test requests
|
||||
|
||||
* Add tests reaching max non-0 redirects
|
||||
|
||||
* Test redirects with Emscripten
|
||||
|
||||
* Fix `test_merge_pool_kwargs`
|
||||
|
||||
* Add a changelog entry
|
||||
|
||||
* Parametrize tests
|
||||
|
||||
* Drop a fix for Emscripten
|
||||
|
||||
* Apply Seth's suggestion to docs
|
||||
|
||||
Co-authored-by: Seth Michael Larson <sethmichaellarson@gmail.com>
|
||||
|
||||
* Use a minor release instead of the patch one
|
||||
|
||||
---------
|
||||
|
||||
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
|
||||
Co-authored-by: Seth Michael Larson <sethmichaellarson@gmail.com>
|
||||
|
||||
Changes:
|
||||
- skip docs/reference/contrib/emscripten.rst, dummyserver/app.py and
|
||||
test/contrib/emscripten/test_emscripten.py files which are not presented.
|
||||
|
||||
CVE: CVE-2025-50181
|
||||
Upstream-Status: Backport [https://github.com/urllib3/urllib3/commit/f05b1329126d5be6de501f9d1e3e36738bc08857]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
src/urllib3/poolmanager.py | 18 +++-
|
||||
test/with_dummyserver/test_poolmanager.py | 101 ++++++++++++++++++++++
|
||||
2 files changed, 118 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/urllib3/poolmanager.py b/src/urllib3/poolmanager.py
|
||||
index fb51bf7..a8de7c6 100644
|
||||
--- a/src/urllib3/poolmanager.py
|
||||
+++ b/src/urllib3/poolmanager.py
|
||||
@@ -170,6 +170,22 @@ class PoolManager(RequestMethods):
|
||||
|
||||
def __init__(self, num_pools=10, headers=None, **connection_pool_kw):
|
||||
RequestMethods.__init__(self, headers)
|
||||
+ if "retries" in connection_pool_kw:
|
||||
+ retries = connection_pool_kw["retries"]
|
||||
+ if not isinstance(retries, Retry):
|
||||
+ # When Retry is initialized, raise_on_redirect is based
|
||||
+ # on a redirect boolean value.
|
||||
+ # But requests made via a pool manager always set
|
||||
+ # redirect to False, and raise_on_redirect always ends
|
||||
+ # up being False consequently.
|
||||
+ # Here we fix the issue by setting raise_on_redirect to
|
||||
+ # a value needed by the pool manager without considering
|
||||
+ # the redirect boolean.
|
||||
+ raise_on_redirect = retries is not False
|
||||
+ retries = Retry.from_int(retries, redirect=False)
|
||||
+ retries.raise_on_redirect = raise_on_redirect
|
||||
+ connection_pool_kw = connection_pool_kw.copy()
|
||||
+ connection_pool_kw["retries"] = retries
|
||||
self.connection_pool_kw = connection_pool_kw
|
||||
self.pools = RecentlyUsedContainer(num_pools)
|
||||
|
||||
@@ -389,7 +405,7 @@ class PoolManager(RequestMethods):
|
||||
kw["body"] = None
|
||||
kw["headers"] = HTTPHeaderDict(kw["headers"])._prepare_for_method_change()
|
||||
|
||||
- retries = kw.get("retries")
|
||||
+ retries = kw.get("retries", response.retries)
|
||||
if not isinstance(retries, Retry):
|
||||
retries = Retry.from_int(retries, redirect=redirect)
|
||||
|
||||
diff --git a/test/with_dummyserver/test_poolmanager.py b/test/with_dummyserver/test_poolmanager.py
|
||||
index 509daf2..f84f169 100644
|
||||
--- a/test/with_dummyserver/test_poolmanager.py
|
||||
+++ b/test/with_dummyserver/test_poolmanager.py
|
||||
@@ -82,6 +82,89 @@ class TestPoolManager(HTTPDummyServerTestCase):
|
||||
assert r.status == 200
|
||||
assert r.data == b"Dummy server!"
|
||||
|
||||
+ @pytest.mark.parametrize(
|
||||
+ "retries",
|
||||
+ (0, Retry(total=0), Retry(redirect=0), Retry(total=0, redirect=0)),
|
||||
+ )
|
||||
+ def test_redirects_disabled_for_pool_manager_with_0(
|
||||
+ self, retries: typing.Literal[0] | Retry
|
||||
+ ) -> None:
|
||||
+ """
|
||||
+ Check handling redirects when retries is set to 0 on the pool
|
||||
+ manager.
|
||||
+ """
|
||||
+ with PoolManager(retries=retries) as http:
|
||||
+ with pytest.raises(MaxRetryError):
|
||||
+ http.request("GET", f"{self.base_url}/redirect")
|
||||
+
|
||||
+ # Setting redirect=True should not change the behavior.
|
||||
+ with pytest.raises(MaxRetryError):
|
||||
+ http.request("GET", f"{self.base_url}/redirect", redirect=True)
|
||||
+
|
||||
+ # Setting redirect=False should not make it follow the redirect,
|
||||
+ # but MaxRetryError should not be raised.
|
||||
+ response = http.request("GET", f"{self.base_url}/redirect", redirect=False)
|
||||
+ assert response.status == 303
|
||||
+
|
||||
+ @pytest.mark.parametrize(
|
||||
+ "retries",
|
||||
+ (
|
||||
+ False,
|
||||
+ Retry(total=False),
|
||||
+ Retry(redirect=False),
|
||||
+ Retry(total=False, redirect=False),
|
||||
+ ),
|
||||
+ )
|
||||
+ def test_redirects_disabled_for_pool_manager_with_false(
|
||||
+ self, retries: typing.Literal[False] | Retry
|
||||
+ ) -> None:
|
||||
+ """
|
||||
+ Check that setting retries set to False on the pool manager disables
|
||||
+ raising MaxRetryError and redirect=True does not change the
|
||||
+ behavior.
|
||||
+ """
|
||||
+ with PoolManager(retries=retries) as http:
|
||||
+ response = http.request("GET", f"{self.base_url}/redirect")
|
||||
+ assert response.status == 303
|
||||
+
|
||||
+ response = http.request("GET", f"{self.base_url}/redirect", redirect=True)
|
||||
+ assert response.status == 303
|
||||
+
|
||||
+ response = http.request("GET", f"{self.base_url}/redirect", redirect=False)
|
||||
+ assert response.status == 303
|
||||
+
|
||||
+ def test_redirects_disabled_for_individual_request(self) -> None:
|
||||
+ """
|
||||
+ Check handling redirects when they are meant to be disabled
|
||||
+ on the request level.
|
||||
+ """
|
||||
+ with PoolManager() as http:
|
||||
+ # Check when redirect is not passed.
|
||||
+ with pytest.raises(MaxRetryError):
|
||||
+ http.request("GET", f"{self.base_url}/redirect", retries=0)
|
||||
+ response = http.request("GET", f"{self.base_url}/redirect", retries=False)
|
||||
+ assert response.status == 303
|
||||
+
|
||||
+ # Check when redirect=True.
|
||||
+ with pytest.raises(MaxRetryError):
|
||||
+ http.request(
|
||||
+ "GET", f"{self.base_url}/redirect", retries=0, redirect=True
|
||||
+ )
|
||||
+ response = http.request(
|
||||
+ "GET", f"{self.base_url}/redirect", retries=False, redirect=True
|
||||
+ )
|
||||
+ assert response.status == 303
|
||||
+
|
||||
+ # Check when redirect=False.
|
||||
+ response = http.request(
|
||||
+ "GET", f"{self.base_url}/redirect", retries=0, redirect=False
|
||||
+ )
|
||||
+ assert response.status == 303
|
||||
+ response = http.request(
|
||||
+ "GET", f"{self.base_url}/redirect", retries=False, redirect=False
|
||||
+ )
|
||||
+ assert response.status == 303
|
||||
+
|
||||
def test_cross_host_redirect(self):
|
||||
with PoolManager() as http:
|
||||
cross_host_location = "%s/echo?a=b" % self.base_url_alt
|
||||
@@ -136,6 +219,24 @@ class TestPoolManager(HTTPDummyServerTestCase):
|
||||
pool = http.connection_from_host(self.host, self.port)
|
||||
assert pool.num_connections == 1
|
||||
|
||||
+ # Check when retries are configured for the pool manager.
|
||||
+ with PoolManager(retries=1) as http:
|
||||
+ with pytest.raises(MaxRetryError):
|
||||
+ http.request(
|
||||
+ "GET",
|
||||
+ f"{self.base_url}/redirect",
|
||||
+ fields={"target": f"/redirect?target={self.base_url}/"},
|
||||
+ )
|
||||
+
|
||||
+ # Here we allow more retries for the request.
|
||||
+ response = http.request(
|
||||
+ "GET",
|
||||
+ f"{self.base_url}/redirect",
|
||||
+ fields={"target": f"/redirect?target={self.base_url}/"},
|
||||
+ retries=2,
|
||||
+ )
|
||||
+ assert response.status == 200
|
||||
+
|
||||
def test_redirect_cross_host_remove_headers(self):
|
||||
with PoolManager() as http:
|
||||
r = http.request(
|
||||
--
|
||||
2.40.0
|
||||
@@ -7,6 +7,10 @@ SRC_URI[sha256sum] = "f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e32
|
||||
|
||||
inherit pypi setuptools3
|
||||
|
||||
SRC_URI += " \
|
||||
file://CVE-2025-50181.patch \
|
||||
"
|
||||
|
||||
RDEPENDS:${PN} += "\
|
||||
${PYTHON_PN}-certifi \
|
||||
${PYTHON_PN}-cryptography \
|
||||
|
||||
@@ -51,7 +51,7 @@ SRC_URI[sha256sum] = "ae665bc678abd9ab6a6e1573d2481625a53719bc517e9a634ed2b9fefa
|
||||
UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
|
||||
UPSTREAM_CHECK_URI = "https://www.python.org/downloads/source/"
|
||||
|
||||
CVE_PRODUCT = "python"
|
||||
CVE_PRODUCT = "python:python python_software_foundation:python"
|
||||
|
||||
# Upstream consider this expected behaviour
|
||||
CVE_CHECK_IGNORE += "CVE-2007-4559"
|
||||
|
||||
212
meta/recipes-devtools/ruby/ruby/CVE-2024-43398-0001.patch
Normal file
212
meta/recipes-devtools/ruby/ruby/CVE-2024-43398-0001.patch
Normal file
@@ -0,0 +1,212 @@
|
||||
From 0496940d5998ccbc50d16fb734993ab50fc60c2d Mon Sep 17 00:00:00 2001
|
||||
From: NAITOH Jun <naitoh@gmail.com>
|
||||
Date: Mon, 18 Mar 2024 23:30:47 +0900
|
||||
Subject: [PATCH] Optimize the parse_attributes method to use `Source#match`
|
||||
to parse XML. (#119)
|
||||
|
||||
## Why?
|
||||
|
||||
Improve maintainability by consolidating processing into `Source#match`.
|
||||
|
||||
## Benchmark
|
||||
```
|
||||
RUBYLIB= BUNDLER_ORIG_RUBYLIB= /Users/naitoh/.rbenv/versions/3.3.0/bin/ruby -v -S benchmark-driver /Users/naitoh/ghq/github.com/naitoh/rexml/benchmark/parse.yaml
|
||||
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin22]
|
||||
Calculating -------------------------------------
|
||||
before after before(YJIT) after(YJIT)
|
||||
dom 10.891 10.622 16.356 17.403 i/s - 100.000 times in 9.182130s 9.414177s 6.113806s 5.746133s
|
||||
sax 30.335 29.845 49.749 54.877 i/s - 100.000 times in 3.296483s 3.350595s 2.010071s 1.822259s
|
||||
pull 35.514 34.801 61.123 66.908 i/s - 100.000 times in 2.815793s 2.873484s 1.636041s 1.494591s
|
||||
stream 35.141 34.475 52.110 56.836 i/s - 100.000 times in 2.845646s 2.900638s 1.919017s 1.759456s
|
||||
|
||||
Comparison:
|
||||
dom
|
||||
after(YJIT): 17.4 i/s
|
||||
before(YJIT): 16.4 i/s - 1.06x slower
|
||||
before: 10.9 i/s - 1.60x slower
|
||||
after: 10.6 i/s - 1.64x slower
|
||||
|
||||
sax
|
||||
after(YJIT): 54.9 i/s
|
||||
before(YJIT): 49.7 i/s - 1.10x slower
|
||||
before: 30.3 i/s - 1.81x slower
|
||||
after: 29.8 i/s - 1.84x slower
|
||||
|
||||
pull
|
||||
after(YJIT): 66.9 i/s
|
||||
before(YJIT): 61.1 i/s - 1.09x slower
|
||||
before: 35.5 i/s - 1.88x slower
|
||||
after: 34.8 i/s - 1.92x slower
|
||||
|
||||
stream
|
||||
after(YJIT): 56.8 i/s
|
||||
before(YJIT): 52.1 i/s - 1.09x slower
|
||||
before: 35.1 i/s - 1.62x slower
|
||||
after: 34.5 i/s - 1.65x slower
|
||||
|
||||
```
|
||||
|
||||
- YJIT=ON : 1.06x - 1.10x faster
|
||||
- YJIT=OFF : 0.97x - 0.98x faster
|
||||
|
||||
CVE: CVE-2024-43398
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/0496940d5998ccbc50d16fb734993ab50fc60c2d]
|
||||
|
||||
Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
|
||||
---
|
||||
lib/rexml/parsers/baseparser.rb | 116 ++++++++++++--------------------
|
||||
test/parse/test_element.rb | 4 +-
|
||||
test/test_core.rb | 20 +++++-
|
||||
3 files changed, 64 insertions(+), 76 deletions(-)
|
||||
|
||||
Index: ruby-3.1.3/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
===================================================================
|
||||
--- ruby-3.1.3.orig/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ ruby-3.1.3/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -114,7 +114,7 @@ module REXML
|
||||
|
||||
module Private
|
||||
INSTRUCTION_END = /#{NAME}(\s+.*?)?\?>/um
|
||||
- TAG_PATTERN = /((?>#{QNAME_STR}))/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
|
||||
@@ -136,7 +136,6 @@ module REXML
|
||||
self.stream = source
|
||||
@listeners = []
|
||||
@entity_expansion_count = 0
|
||||
- @attributes_scanner = StringScanner.new('')
|
||||
end
|
||||
|
||||
def add_listener( listener )
|
||||
@@ -635,86 +634,60 @@ module REXML
|
||||
def parse_attributes(prefixes, curr_ns)
|
||||
attributes = {}
|
||||
closed = false
|
||||
- match_data = @source.match(/^(.*?)(\/)?>/um, true)
|
||||
- if match_data.nil?
|
||||
- message = "Start tag isn't ended"
|
||||
- raise REXML::ParseException.new(message, @source)
|
||||
- end
|
||||
+ while true
|
||||
+ if @source.match(">", true)
|
||||
+ return attributes, closed
|
||||
+ elsif @source.match("/>", true)
|
||||
+ closed = true
|
||||
+ return attributes, closed
|
||||
+ elsif match = @source.match(QNAME, true)
|
||||
+ name = match[1]
|
||||
+ prefix = match[2]
|
||||
+ local_part = match[3]
|
||||
|
||||
- raw_attributes = match_data[1]
|
||||
- closed = !match_data[2].nil?
|
||||
- return attributes, closed if raw_attributes.nil?
|
||||
- return attributes, closed if raw_attributes.empty?
|
||||
-
|
||||
- @attributes_scanner.string = raw_attributes
|
||||
- scanner = @attributes_scanner
|
||||
- until scanner.eos?
|
||||
- if scanner.scan(/\s+/)
|
||||
- break if scanner.eos?
|
||||
- end
|
||||
-
|
||||
- pos = scanner.pos
|
||||
- while true
|
||||
- break if scanner.scan(ATTRIBUTE_PATTERN)
|
||||
- unless scanner.scan(QNAME)
|
||||
- message = "Invalid attribute name: <#{scanner.rest}>"
|
||||
- raise REXML::ParseException.new(message, @source)
|
||||
- end
|
||||
- name = scanner[0]
|
||||
- unless scanner.scan(/\s*=\s*/um)
|
||||
+ unless @source.match(/\s*=\s*/um, true)
|
||||
message = "Missing attribute equal: <#{name}>"
|
||||
raise REXML::ParseException.new(message, @source)
|
||||
end
|
||||
- quote = scanner.scan(/['"]/)
|
||||
- unless quote
|
||||
- message = "Missing attribute value start quote: <#{name}>"
|
||||
- raise REXML::ParseException.new(message, @source)
|
||||
- end
|
||||
- unless scanner.scan(/.*#{Regexp.escape(quote)}/um)
|
||||
- match_data = @source.match(/^(.*?)(\/)?>/um, true)
|
||||
- if match_data
|
||||
- scanner << "/" if closed
|
||||
- scanner << ">"
|
||||
- scanner << match_data[1]
|
||||
- scanner.pos = pos
|
||||
- closed = !match_data[2].nil?
|
||||
- next
|
||||
+ 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
|
||||
- message =
|
||||
- "Missing attribute value end quote: <#{name}>: <#{quote}>"
|
||||
- raise REXML::ParseException.new(message, @source)
|
||||
end
|
||||
- end
|
||||
- name = scanner[1]
|
||||
- prefix = scanner[2]
|
||||
- local_part = scanner[3]
|
||||
- # quote = scanner[4]
|
||||
- value = scanner[5]
|
||||
- if prefix == "xmlns"
|
||||
- if local_part == "xml"
|
||||
- if value != "http://www.w3.org/XML/1998/namespace"
|
||||
- msg = "The 'xml' prefix must not be bound to any other namespace "+
|
||||
+ value = match[2]
|
||||
+ if prefix == "xmlns"
|
||||
+ if local_part == "xml"
|
||||
+ if value != "http://www.w3.org/XML/1998/namespace"
|
||||
+ msg = "The 'xml' prefix must not be bound to any other namespace "+
|
||||
+ "(http://www.w3.org/TR/REC-xml-names/#ns-decl)"
|
||||
+ raise REXML::ParseException.new( msg, @source, self )
|
||||
+ end
|
||||
+ elsif local_part == "xmlns"
|
||||
+ msg = "The 'xmlns' prefix must not be declared "+
|
||||
"(http://www.w3.org/TR/REC-xml-names/#ns-decl)"
|
||||
- raise REXML::ParseException.new( msg, @source, self )
|
||||
+ raise REXML::ParseException.new( msg, @source, self)
|
||||
end
|
||||
- elsif local_part == "xmlns"
|
||||
- msg = "The 'xmlns' prefix must not be declared "+
|
||||
- "(http://www.w3.org/TR/REC-xml-names/#ns-decl)"
|
||||
- raise REXML::ParseException.new( msg, @source, self)
|
||||
+ curr_ns << local_part
|
||||
+ elsif prefix
|
||||
+ prefixes << prefix unless prefix == "xml"
|
||||
end
|
||||
- curr_ns << local_part
|
||||
- elsif prefix
|
||||
- prefixes << prefix unless prefix == "xml"
|
||||
- end
|
||||
|
||||
- if attributes.has_key?(name)
|
||||
- msg = "Duplicate attribute #{name.inspect}"
|
||||
- raise REXML::ParseException.new(msg, @source, self)
|
||||
- end
|
||||
+ if attributes.has_key?(name)
|
||||
+ msg = "Duplicate attribute #{name.inspect}"
|
||||
+ raise REXML::ParseException.new(msg, @source, self)
|
||||
+ end
|
||||
|
||||
- attributes[name] = value
|
||||
+ attributes[name] = value
|
||||
+ else
|
||||
+ message = "Invalid attribute name: <#{@source.buffer.split(%r{[/>\s]}).first}>"
|
||||
+ raise REXML::ParseException.new(message, @source)
|
||||
+ end
|
||||
end
|
||||
- return attributes, closed
|
||||
end
|
||||
end
|
||||
end
|
||||
130
meta/recipes-devtools/ruby/ruby/CVE-2024-43398-0002.patch
Normal file
130
meta/recipes-devtools/ruby/ruby/CVE-2024-43398-0002.patch
Normal file
@@ -0,0 +1,130 @@
|
||||
From cb158582f18cebb3bf7b3f21f230e2fb17d435aa Mon Sep 17 00:00:00 2001
|
||||
From: Sutou Kouhei <kou@clear-code.com>
|
||||
Date: Sat, 17 Aug 2024 17:39:14 +0900
|
||||
Subject: [PATCH] parser: keep the current namespaces instead of stack of Set
|
||||
|
||||
It improves namespace resolution performance for deep element.
|
||||
|
||||
CVE: CVE-2024-43398
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ruby/rexml/commit/cb158582f18cebb3bf7b3f21f230e2fb17d435aa]
|
||||
|
||||
Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
|
||||
|
||||
---
|
||||
lib/rexml/parsers/baseparser.rb | 45 +++++++++++++++++++++++++--------
|
||||
1 file changed, 35 insertions(+), 10 deletions(-)
|
||||
|
||||
Index: ruby-3.1.3/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
===================================================================
|
||||
--- ruby-3.1.3.orig/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
+++ ruby-3.1.3/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb
|
||||
@@ -152,7 +152,8 @@ module REXML
|
||||
@tags = []
|
||||
@stack = []
|
||||
@entities = []
|
||||
- @nsstack = []
|
||||
+ @namespaces = {}
|
||||
+ @namespaces_restore_stack = []
|
||||
end
|
||||
|
||||
def position
|
||||
@@ -235,7 +236,6 @@ module REXML
|
||||
@source.string = "<!DOCTYPE" + @source.buffer
|
||||
raise REXML::ParseException.new(message, @source)
|
||||
end
|
||||
- @nsstack.unshift(curr_ns=Set.new)
|
||||
name = parse_name(base_error_message)
|
||||
if @source.match(/\s*\[/um, true)
|
||||
id = [nil, nil, nil]
|
||||
@@ -320,7 +320,7 @@ module REXML
|
||||
val = attdef[4] if val == "#FIXED "
|
||||
pairs[attdef[0]] = val
|
||||
if attdef[0] =~ /^xmlns:(.*)/
|
||||
- @nsstack[0] << $1
|
||||
+ @namespaces[$1] = val
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -365,7 +365,7 @@ module REXML
|
||||
begin
|
||||
if @source.match("<", true)
|
||||
if @source.match("/", true)
|
||||
- @nsstack.shift
|
||||
+ @namespaces_restore_stack.pop
|
||||
last_tag = @tags.pop
|
||||
md = @source.match(CLOSE_PATTERN, true)
|
||||
if md and !last_tag
|
||||
@@ -411,18 +411,18 @@ module REXML
|
||||
@document_status = :in_element
|
||||
prefixes = Set.new
|
||||
prefixes << md[2] if md[2]
|
||||
- @nsstack.unshift(curr_ns=Set.new)
|
||||
- attributes, closed = parse_attributes(prefixes, curr_ns)
|
||||
+ push_namespaces_restore
|
||||
+ attributes, closed = parse_attributes(@prefixes)
|
||||
# Verify that all of the prefixes have been defined
|
||||
for prefix in prefixes
|
||||
- unless @nsstack.find{|k| k.member?(prefix)}
|
||||
+ unless @namespaces.key?(prefix)
|
||||
raise UndefinedNamespaceException.new(prefix,@source,self)
|
||||
end
|
||||
end
|
||||
|
||||
if closed
|
||||
@closed = tag
|
||||
- @nsstack.shift
|
||||
+ pop_namespaces_restore
|
||||
else
|
||||
@tags.push( tag )
|
||||
end
|
||||
@@ -512,6 +512,31 @@ module REXML
|
||||
end
|
||||
|
||||
private
|
||||
+ def add_namespace(prefix, uri)
|
||||
+ @namespaces_restore_stack.last[prefix] = @namespaces[prefix]
|
||||
+ if uri.nil?
|
||||
+ @namespaces.delete(prefix)
|
||||
+ else
|
||||
+ @namespaces[prefix] = uri
|
||||
+ end
|
||||
+ end
|
||||
+
|
||||
+ def push_namespaces_restore
|
||||
+ namespaces_restore = {}
|
||||
+ @namespaces_restore_stack.push(namespaces_restore)
|
||||
+ namespaces_restore
|
||||
+ end
|
||||
+
|
||||
+ def pop_namespaces_restore
|
||||
+ namespaces_restore = @namespaces_restore_stack.pop
|
||||
+ namespaces_restore.each do |prefix, uri|
|
||||
+ if uri.nil?
|
||||
+ @namespaces.delete(prefix)
|
||||
+ else
|
||||
+ @namespaces[prefix] = uri
|
||||
+ end
|
||||
+ end
|
||||
+ end
|
||||
|
||||
def record_entity_expansion
|
||||
@entity_expansion_count += 1
|
||||
@@ -631,7 +656,7 @@ module REXML
|
||||
[:processing_instruction, match_data[1], match_data[2]]
|
||||
end
|
||||
|
||||
- def parse_attributes(prefixes, curr_ns)
|
||||
+ def parse_attributes(prefixes)
|
||||
attributes = {}
|
||||
closed = false
|
||||
while true
|
||||
@@ -672,7 +697,7 @@ module REXML
|
||||
"(http://www.w3.org/TR/REC-xml-names/#ns-decl)"
|
||||
raise REXML::ParseException.new( msg, @source, self)
|
||||
end
|
||||
- curr_ns << local_part
|
||||
+ add_namespace(local_part, value)
|
||||
elsif prefix
|
||||
prefixes << prefix unless prefix == "xml"
|
||||
end
|
||||
@@ -47,17 +47,17 @@ diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/
|
||||
index e32c7f4..154f2ac 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
|
||||
@@ -634,6 +634,7 @@ module REXML
|
||||
@@ -658,6 +658,7 @@ module REXML
|
||||
|
||||
def parse_attributes(prefixes, curr_ns)
|
||||
def parse_attributes(prefixes)
|
||||
attributes = {}
|
||||
+ expanded_names = {}
|
||||
closed = false
|
||||
match_data = @source.match(/^(.*?)(\/)?>/um, true)
|
||||
if match_data.nil?
|
||||
@@ -641,6 +642,20 @@ module REXML
|
||||
raise REXML::ParseException.new(message, @source)
|
||||
end
|
||||
while true
|
||||
if @source.match(">", true)
|
||||
@@ -707,6 +708,20 @@ module REXML
|
||||
raise REXML::ParseException.new(msg, @source, self)
|
||||
end
|
||||
|
||||
+ unless prefix == "xmlns"
|
||||
+ uri = @namespaces[prefix]
|
||||
@@ -73,9 +73,6 @@ index e32c7f4..154f2ac 100644
|
||||
+ expanded_names[expanded_name] = prefix
|
||||
+ end
|
||||
+
|
||||
raw_attributes = match_data[1]
|
||||
closed = !match_data[2].nil?
|
||||
return attributes, closed if raw_attributes.nil?
|
||||
--
|
||||
2.40.0
|
||||
|
||||
attributes[name] = value
|
||||
else
|
||||
message = "Invalid attribute name: <#{@source.buffer.split(%r{[/>\s]}).first}>"
|
||||
@@ -48,7 +48,9 @@ SRC_URI = "http://cache.ruby-lang.org/pub/ruby/${SHRT_VER}/ruby-${PV}.tar.gz \
|
||||
file://CVE-2024-41946.patch \
|
||||
file://CVE-2025-27220.patch \
|
||||
file://CVE-2025-27219.patch \
|
||||
file://CVE-2024-43398.patch \
|
||||
file://CVE-2024-43398-0001.patch \
|
||||
file://CVE-2024-43398-0002.patch \
|
||||
file://CVE-2024-43398-0003.patch \
|
||||
file://CVE-2025-27221-0001.patch \
|
||||
file://CVE-2025-27221-0002.patch \
|
||||
"
|
||||
|
||||
@@ -10,7 +10,7 @@ SRCREV = "2735e3d6b7eccb05ab232825c618c837d27a5010"
|
||||
PV = "1.7.0+git${SRCPV}"
|
||||
|
||||
UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
|
||||
SRC_URI = "git://git.eclipse.org/r/tcf/org.eclipse.tcf.agent.git;protocol=https;branch=master \
|
||||
SRC_URI = "git://gitlab.eclipse.org/eclipse/tcf/tcf.agent.git;protocol=https;branch=master \
|
||||
file://ldflags.patch \
|
||||
file://tcf-agent.init \
|
||||
file://tcf-agent.service \
|
||||
|
||||
@@ -28,6 +28,8 @@ CVE_CHECK_IGNORE += "CVE-2023-38560 CVE-2024-46954"
|
||||
CVE_CHECK_IGNORE += "CVE-2024-29507 CVE-2025-27833"
|
||||
# Only impacts codepaths relevant for Windows builds
|
||||
CVE_CHECK_IGNORE += "CVE-2025-27837"
|
||||
# Vulnerable code was introduced later, so 9.55.0 is not affected yet
|
||||
CVE_CHECK_IGNORE += "CVE-2025-46646"
|
||||
|
||||
def gs_verdir(v):
|
||||
return "".join(v.split("."))
|
||||
|
||||
99
meta/recipes-extended/iputils/iputils/CVE-2025-48964.patch
Normal file
99
meta/recipes-extended/iputils/iputils/CVE-2025-48964.patch
Normal file
@@ -0,0 +1,99 @@
|
||||
From afa36390394a6e0cceba03b52b59b6d41710608c Mon Sep 17 00:00:00 2001
|
||||
From: Cyril Hrubis <metan@ucw.cz>
|
||||
Date: Fri, 16 May 2025 17:57:10 +0200
|
||||
Subject: [PATCH] ping: Fix moving average rtt calculation
|
||||
|
||||
The rts->rtt counts an exponential weight moving average in a fixed
|
||||
point, that means that even if we limit the triptime to fit into a 32bit
|
||||
number the average will overflow because because fixed point needs eight
|
||||
more bits.
|
||||
|
||||
We also have to limit the triptime to 32bit number because otherwise the
|
||||
moving average may stil overflow if we manage to produce a large enough
|
||||
triptime.
|
||||
|
||||
Fixes: CVE-2025-48964
|
||||
Fixes: https://bugzilla.suse.com/show_bug.cgi?id=1243772
|
||||
Closes: https://github.com/iputils/iputils-ghsa-25fr-jw29-74f9/pull/1
|
||||
Reported-by: Mohamed Maatallah <hotelsmaatallahrecemail@gmail.com>
|
||||
Reviewed-by: Petr Vorel <pvorel@suse.cz>
|
||||
Tested-by: Petr Vorel <pvorel@suse.cz>
|
||||
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
|
||||
Reviewed-by: Mohamed Maatallah <hotelsmaatallahrecemail@gmail.com>
|
||||
Signed-off-by: Cyril Hrubis <metan@ucw.cz>
|
||||
|
||||
CVE: CVE-2025-48964
|
||||
Upstream-Status: Backport [https://github.com/iputils/iputils/commit/afa36390394a6e0cceba03b52b59b6d41710608c]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
iputils_common.h | 2 +-
|
||||
ping/ping.h | 2 +-
|
||||
ping/ping_common.c | 8 ++++----
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/iputils_common.h b/iputils_common.h
|
||||
index 829a749..1296905 100644
|
||||
--- a/iputils_common.h
|
||||
+++ b/iputils_common.h
|
||||
@@ -11,7 +11,7 @@
|
||||
__typeof__(&arr[0]))])) * 0)
|
||||
|
||||
/* 1000001 = 1000000 tv_sec + 1 tv_usec */
|
||||
-#define TV_SEC_MAX_VAL (LONG_MAX/1000001)
|
||||
+#define TV_SEC_MAX_VAL (INT32_MAX/1000001)
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define iputils_attribute_format(t, n, m) __attribute__((__format__ (t, n, m)))
|
||||
diff --git a/ping/ping.h b/ping/ping.h
|
||||
index 4dce538..bc1fab2 100644
|
||||
--- a/ping/ping.h
|
||||
+++ b/ping/ping.h
|
||||
@@ -180,7 +180,7 @@ struct ping_rts {
|
||||
long tmax; /* maximum round trip time */
|
||||
double tsum; /* sum of all times, for doing average */
|
||||
double tsum2;
|
||||
- int rtt;
|
||||
+ uint64_t rtt; /* Exponential weight moving average calculated in fixed point */
|
||||
int rtt_addend;
|
||||
uint16_t acked;
|
||||
int pipesize;
|
||||
diff --git a/ping/ping_common.c b/ping/ping_common.c
|
||||
index 2a3e556..fad5228 100644
|
||||
--- a/ping/ping_common.c
|
||||
+++ b/ping/ping_common.c
|
||||
@@ -273,7 +273,7 @@ int __schedule_exit(int next)
|
||||
|
||||
static inline void update_interval(struct ping_rts *rts)
|
||||
{
|
||||
- int est = rts->rtt ? rts->rtt / 8 : rts->interval * 1000;
|
||||
+ int est = rts->rtt ? (int)(rts->rtt / 8) : rts->interval * 1000;
|
||||
|
||||
rts->interval = (est + rts->rtt_addend + 500) / 1000;
|
||||
if (rts->uid && rts->interval < MINUSERINTERVAL)
|
||||
@@ -768,7 +768,7 @@ restamp:
|
||||
if (triptime > rts->tmax)
|
||||
rts->tmax = triptime;
|
||||
if (!rts->rtt)
|
||||
- rts->rtt = triptime * 8;
|
||||
+ rts->rtt = ((uint64_t)triptime) * 8;
|
||||
else
|
||||
rts->rtt += triptime - rts->rtt / 8;
|
||||
if (rts->opt_adaptive)
|
||||
@@ -935,7 +935,7 @@ int finish(struct ping_rts *rts)
|
||||
int ipg = (1000000 * (long long)tv.tv_sec + tv.tv_nsec / 1000) / (rts->ntransmitted - 1);
|
||||
|
||||
printf(_("%sipg/ewma %d.%03d/%d.%03d ms"),
|
||||
- comma, ipg / 1000, ipg % 1000, rts->rtt / 8000, (rts->rtt / 8) % 1000);
|
||||
+ comma, ipg / 1000, ipg % 1000, (int)(rts->rtt / 8000), (int)((rts->rtt / 8) % 1000));
|
||||
}
|
||||
putchar('\n');
|
||||
return (!rts->nreceived || (rts->deadline && rts->nreceived < rts->npackets));
|
||||
@@ -960,7 +960,7 @@ void status(struct ping_rts *rts)
|
||||
fprintf(stderr, _(", min/avg/ewma/max = %ld.%03ld/%lu.%03ld/%d.%03d/%ld.%03ld ms"),
|
||||
(long)rts->tmin / 1000, (long)rts->tmin % 1000,
|
||||
tavg / 1000, tavg % 1000,
|
||||
- rts->rtt / 8000, (rts->rtt / 8) % 1000, (long)rts->tmax / 1000, (long)rts->tmax % 1000);
|
||||
+ (int)(rts->rtt / 8000), (int)((rts->rtt / 8) % 1000), (long)rts->tmax / 1000, (long)rts->tmax % 1000);
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
@@ -13,6 +13,7 @@ DEPENDS = "gnutls"
|
||||
SRC_URI = "git://github.com/iputils/iputils;branch=master;protocol=https \
|
||||
file://0001-rarpd-rdisc-Drop-PrivateUsers.patch \
|
||||
file://CVE-2025-47268.patch \
|
||||
file://CVE-2025-48964.patch \
|
||||
"
|
||||
SRCREV = "1d1e7c43210d8af316a41cb2c53d612a4c16f34d"
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From cb0d2b0c9a7f1672d4edaa4beacdd96e5b53ead1 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Stoeckmann <stoeckmann@users.noreply.github.com>
|
||||
Date: Sun, 11 May 2025 02:17:19 +0200
|
||||
Subject: [PATCH] rar: Fix double free with over 4 billion nodes (#2598)
|
||||
|
||||
If a system is capable of handling 4 billion nodes in memory, a double
|
||||
free could occur because of an unsigned integer overflow leading to a
|
||||
realloc call with size argument of 0. Eventually, the client will
|
||||
release that memory again, triggering a double free.
|
||||
|
||||
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
|
||||
|
||||
CVE: CVE-2025-5914
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/09685126fcec664e2b8ca595e1fc371bd494d209]
|
||||
Signed-off-by: Colin Pinnell McAllister <colin.mcallister@garmin.com>
|
||||
---
|
||||
libarchive/archive_read_support_format_rar.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
|
||||
index 793e8e98..b9f5450d 100644
|
||||
--- a/libarchive/archive_read_support_format_rar.c
|
||||
+++ b/libarchive/archive_read_support_format_rar.c
|
||||
@@ -335,8 +335,8 @@ struct rar
|
||||
int found_first_header;
|
||||
char has_endarc_header;
|
||||
struct data_block_offsets *dbo;
|
||||
- unsigned int cursor;
|
||||
- unsigned int nodes;
|
||||
+ size_t cursor;
|
||||
+ size_t nodes;
|
||||
char filename_must_match;
|
||||
|
||||
/* LZSS members */
|
||||
@@ -1186,7 +1186,7 @@ archive_read_format_rar_seek_data(struct archive_read *a, int64_t offset,
|
||||
int whence)
|
||||
{
|
||||
int64_t client_offset, ret;
|
||||
- unsigned int i;
|
||||
+ size_t i;
|
||||
struct rar *rar = (struct rar *)(a->format->data);
|
||||
|
||||
if (rar->compression_method == COMPRESS_METHOD_STORE)
|
||||
--
|
||||
2.49.0
|
||||
|
||||
217
meta/recipes-extended/libarchive/libarchive/CVE-2025-5915.patch
Normal file
217
meta/recipes-extended/libarchive/libarchive/CVE-2025-5915.patch
Normal file
@@ -0,0 +1,217 @@
|
||||
From a612bf62f86a6faa47bd57c52b94849f0a404d8c Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Stoeckmann <stoeckmann@users.noreply.github.com>
|
||||
Date: Sun, 11 May 2025 19:00:11 +0200
|
||||
Subject: [PATCH] rar: Fix heap-buffer-overflow (#2599)
|
||||
|
||||
A filter block size must not be larger than the lzss window, which is
|
||||
defined
|
||||
by dictionary size, which in turn can be derived from unpacked file
|
||||
size.
|
||||
|
||||
While at it, improve error messages and fix lzss window wrap around
|
||||
logic.
|
||||
|
||||
Fixes https://github.com/libarchive/libarchive/issues/2565
|
||||
|
||||
---------
|
||||
|
||||
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
|
||||
Co-authored-by: Tim Kientzle <kientzle@acm.org>
|
||||
|
||||
CVE: CVE-2025-5915
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/a612bf62f86a6faa47bd57c52b94849f0a404d8c]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
Makefile.am | 2 +
|
||||
libarchive/archive_read_support_format_rar.c | 17 ++++---
|
||||
libarchive/test/CMakeLists.txt | 1 +
|
||||
.../test/test_read_format_rar_overflow.c | 48 +++++++++++++++++++
|
||||
.../test/test_read_format_rar_overflow.rar.uu | 11 +++++
|
||||
5 files changed, 72 insertions(+), 7 deletions(-)
|
||||
create mode 100644 libarchive/test/test_read_format_rar_overflow.c
|
||||
create mode 100644 libarchive/test/test_read_format_rar_overflow.rar.uu
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 3fd2fdb..e486a8d 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -505,6 +505,7 @@ libarchive_test_SOURCES= \
|
||||
libarchive/test/test_read_format_rar_encryption_header.c \
|
||||
libarchive/test/test_read_format_rar_filter.c \
|
||||
libarchive/test/test_read_format_rar_invalid1.c \
|
||||
+ libarchive/test/test_read_format_rar_overflow.c \
|
||||
libarchive/test/test_read_format_rar5.c \
|
||||
libarchive/test/test_read_format_raw.c \
|
||||
libarchive/test/test_read_format_tar.c \
|
||||
@@ -848,6 +849,7 @@ libarchive_test_EXTRA_DIST=\
|
||||
libarchive/test/test_read_format_rar_multivolume.part0003.rar.uu \
|
||||
libarchive/test/test_read_format_rar_multivolume.part0004.rar.uu \
|
||||
libarchive/test/test_read_format_rar_noeof.rar.uu \
|
||||
+ libarchive/test/test_read_format_rar_overflow.rar.uu \
|
||||
libarchive/test/test_read_format_rar_ppmd_lzss_conversion.rar.uu \
|
||||
libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu \
|
||||
libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu \
|
||||
diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
|
||||
index 091a993..4d3b966 100644
|
||||
--- a/libarchive/archive_read_support_format_rar.c
|
||||
+++ b/libarchive/archive_read_support_format_rar.c
|
||||
@@ -451,7 +451,7 @@ static int read_filter(struct archive_read *, int64_t *);
|
||||
static int rar_decode_byte(struct archive_read*, uint8_t *);
|
||||
static int execute_filter(struct archive_read*, struct rar_filter *,
|
||||
struct rar_virtual_machine *, size_t);
|
||||
-static int copy_from_lzss_window(struct archive_read *, void *, int64_t, int);
|
||||
+static int copy_from_lzss_window(struct archive_read *, uint8_t *, int64_t, int);
|
||||
static inline void vm_write_32(struct rar_virtual_machine*, size_t, uint32_t);
|
||||
static inline uint32_t vm_read_32(struct rar_virtual_machine*, size_t);
|
||||
|
||||
@@ -2899,7 +2899,7 @@ expand(struct archive_read *a, int64_t *end)
|
||||
}
|
||||
|
||||
if ((symbol = read_next_symbol(a, &rar->maincode)) < 0)
|
||||
- return (ARCHIVE_FATAL);
|
||||
+ goto bad_data;
|
||||
|
||||
if (symbol < 256)
|
||||
{
|
||||
@@ -2926,14 +2926,14 @@ expand(struct archive_read *a, int64_t *end)
|
||||
else
|
||||
{
|
||||
if (parse_codes(a) != ARCHIVE_OK)
|
||||
- return (ARCHIVE_FATAL);
|
||||
+ goto bad_data;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if(symbol==257)
|
||||
{
|
||||
if (!read_filter(a, end))
|
||||
- return (ARCHIVE_FATAL);
|
||||
+ goto bad_data;
|
||||
continue;
|
||||
}
|
||||
else if(symbol==258)
|
||||
@@ -3018,7 +3018,7 @@ expand(struct archive_read *a, int64_t *end)
|
||||
{
|
||||
if ((lowoffsetsymbol =
|
||||
read_next_symbol(a, &rar->lowoffsetcode)) < 0)
|
||||
- return (ARCHIVE_FATAL);
|
||||
+ goto bad_data;
|
||||
if(lowoffsetsymbol == 16)
|
||||
{
|
||||
rar->numlowoffsetrepeats = 15;
|
||||
@@ -3066,7 +3066,7 @@ bad_data:
|
||||
}
|
||||
|
||||
static int
|
||||
-copy_from_lzss_window(struct archive_read *a, void *buffer,
|
||||
+copy_from_lzss_window(struct archive_read *a, uint8_t *buffer,
|
||||
int64_t startpos, int length)
|
||||
{
|
||||
int windowoffs, firstpart;
|
||||
@@ -3081,7 +3081,7 @@ copy_from_lzss_window(struct archive_read *a, void *buffer,
|
||||
}
|
||||
if (firstpart < length) {
|
||||
memcpy(buffer, &rar->lzss.window[windowoffs], firstpart);
|
||||
- memcpy(buffer, &rar->lzss.window[0], length - firstpart);
|
||||
+ memcpy(buffer + firstpart, &rar->lzss.window[0], length - firstpart);
|
||||
} else {
|
||||
memcpy(buffer, &rar->lzss.window[windowoffs], length);
|
||||
}
|
||||
@@ -3228,6 +3228,9 @@ parse_filter(struct archive_read *a, const uint8_t *bytes, uint16_t length, uint
|
||||
else
|
||||
blocklength = prog ? prog->oldfilterlength : 0;
|
||||
|
||||
+ if (blocklength > rar->dictionary_size)
|
||||
+ return 0;
|
||||
+
|
||||
registers[3] = PROGRAM_SYSTEM_GLOBAL_ADDRESS;
|
||||
registers[4] = blocklength;
|
||||
registers[5] = prog ? prog->usagecount : 0;
|
||||
diff --git a/libarchive/test/CMakeLists.txt b/libarchive/test/CMakeLists.txt
|
||||
index bbbff22..05c6fd7 100644
|
||||
--- a/libarchive/test/CMakeLists.txt
|
||||
+++ b/libarchive/test/CMakeLists.txt
|
||||
@@ -154,6 +154,7 @@ IF(ENABLE_TEST)
|
||||
test_read_format_rar_encryption_partially.c
|
||||
test_read_format_rar_invalid1.c
|
||||
test_read_format_rar_filter.c
|
||||
+ test_read_format_rar_overflow.c
|
||||
test_read_format_rar5.c
|
||||
test_read_format_raw.c
|
||||
test_read_format_tar.c
|
||||
diff --git a/libarchive/test/test_read_format_rar_overflow.c b/libarchive/test/test_read_format_rar_overflow.c
|
||||
new file mode 100644
|
||||
index 0000000..b39ed6b
|
||||
--- /dev/null
|
||||
+++ b/libarchive/test/test_read_format_rar_overflow.c
|
||||
@@ -0,0 +1,48 @@
|
||||
+/*-
|
||||
+ * Copyright (c) 2003-2025 Tim Kientzle
|
||||
+ * All rights reserved.
|
||||
+ *
|
||||
+ * Redistribution and use in source and binary forms, with or without
|
||||
+ * modification, are permitted provided that the following conditions
|
||||
+ * are met:
|
||||
+ * 1. Redistributions of source code must retain the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer.
|
||||
+ * 2. Redistributions in binary form must reproduce the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer in the
|
||||
+ * documentation and/or other materials provided with the distribution.
|
||||
+ *
|
||||
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
+ */
|
||||
+#include "test.h"
|
||||
+
|
||||
+DEFINE_TEST(test_read_format_rar_overflow)
|
||||
+{
|
||||
+ struct archive *a;
|
||||
+ struct archive_entry *ae;
|
||||
+ const char reffile[] = "test_read_format_rar_overflow.rar";
|
||||
+ const void *buff;
|
||||
+ size_t size;
|
||||
+ int64_t offset;
|
||||
+
|
||||
+ extract_reference_file(reffile);
|
||||
+ assert((a = archive_read_new()) != NULL);
|
||||
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
|
||||
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
|
||||
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, reffile, 1024));
|
||||
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
|
||||
+ assertEqualInt(48, archive_entry_size(ae));
|
||||
+ /* The next call should reproduce Issue #2565 */
|
||||
+ assertEqualIntA(a, ARCHIVE_FATAL, archive_read_data_block(a, &buff, &size, &offset));
|
||||
+
|
||||
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
|
||||
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
|
||||
+}
|
||||
diff --git a/libarchive/test/test_read_format_rar_overflow.rar.uu b/libarchive/test/test_read_format_rar_overflow.rar.uu
|
||||
new file mode 100644
|
||||
index 0000000..48fd3fd
|
||||
--- /dev/null
|
||||
+++ b/libarchive/test/test_read_format_rar_overflow.rar.uu
|
||||
@@ -0,0 +1,11 @@
|
||||
+begin 644 test_read_format_rar_overflow.rar
|
||||
+M4F%R(1H'`,($=```(0`@`0``,`````(````````````S`0``````,`"_B%_:
|
||||
+MZ?^[:7``?S!!,`@P,KB@,T@RN33)MTEB@5Z3<`DP`K35`.0P63@P<,Q&0?#,
|
||||
+MA##,,",S,(@P,#,@##`&,#":(3`!,#"(`9HPS,,S13`P,#`P,*`PHPS,,S1A
|
||||
+M,!,!,#","9H@S12D#$PP!C`P`*'F03":,,T8H`@\,/DPJS!/,"30,#`3N%LP
|
||||
+MCQ6:S3"!,#LP22<-,$5%B"5B$S!)(&*>G#+@!`E`%0ODC])62=DO,)BYJX'P
|
||||
+M=/LPZ3!!008?%S`P,#`P,#`P,#`P,#`P,#`P,#`P2$PP,#`P03!(,#`P,#`&
|
||||
+M,`7),#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P
|
||||
+-,#`P,#`P,#`P,#`P,```
|
||||
+`
|
||||
+end
|
||||
--
|
||||
2.40.0
|
||||
|
||||
116
meta/recipes-extended/libarchive/libarchive/CVE-2025-5916.patch
Normal file
116
meta/recipes-extended/libarchive/libarchive/CVE-2025-5916.patch
Normal file
@@ -0,0 +1,116 @@
|
||||
From ef093729521fcf73fa4007d5ae77adfe4df42403 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Stoeckmann <stoeckmann@users.noreply.github.com>
|
||||
Date: Mon, 7 Apr 2025 00:24:13 +0200
|
||||
Subject: [PATCH] warc: Prevent signed integer overflow (#2568)
|
||||
|
||||
If a warc archive claims to have more than INT64_MAX - 4 content bytes,
|
||||
the inevitable failure to skip all these bytes could lead to parsing
|
||||
data which should be ignored instead.
|
||||
|
||||
The test case contains a conversation entry with that many bytes and if
|
||||
the entry is not properly skipped, the warc implementation would read
|
||||
the conversation data as a new file entry.
|
||||
|
||||
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
|
||||
|
||||
CVE: CVE-2025-5916
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/ef093729521fcf73fa4007d5ae77adfe4df42403]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
Makefile.am | 1 +
|
||||
libarchive/archive_read_support_format_warc.c | 7 ++++--
|
||||
libarchive/test/test_read_format_warc.c | 24 +++++++++++++++++++
|
||||
.../test_read_format_warc_incomplete.warc.uu | 10 ++++++++
|
||||
4 files changed, 40 insertions(+), 2 deletions(-)
|
||||
create mode 100644 libarchive/test/test_read_format_warc_incomplete.warc.uu
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index e486a8d..dd1620d 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -913,6 +913,7 @@ libarchive_test_EXTRA_DIST=\
|
||||
libarchive/test/test_read_format_ustar_filename_eucjp.tar.Z.uu \
|
||||
libarchive/test/test_read_format_ustar_filename_koi8r.tar.Z.uu \
|
||||
libarchive/test/test_read_format_warc.warc.uu \
|
||||
+ libarchive/test/test_read_format_warc_incomplete.warc.uu \
|
||||
libarchive/test/test_read_format_zip.zip.uu \
|
||||
libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu \
|
||||
libarchive/test/test_read_format_zip_7z_deflate.zip.uu \
|
||||
diff --git a/libarchive/archive_read_support_format_warc.c b/libarchive/archive_read_support_format_warc.c
|
||||
index 2732996..19cf5a3 100644
|
||||
--- a/libarchive/archive_read_support_format_warc.c
|
||||
+++ b/libarchive/archive_read_support_format_warc.c
|
||||
@@ -379,7 +379,8 @@ start_over:
|
||||
case LAST_WT:
|
||||
default:
|
||||
/* consume the content and start over */
|
||||
- _warc_skip(a);
|
||||
+ if (_warc_skip(a) < 0)
|
||||
+ return (ARCHIVE_FATAL);
|
||||
goto start_over;
|
||||
}
|
||||
return (ARCHIVE_OK);
|
||||
@@ -432,7 +433,9 @@ _warc_skip(struct archive_read *a)
|
||||
{
|
||||
struct warc_s *w = a->format->data;
|
||||
|
||||
- __archive_read_consume(a, w->cntlen + 4U/*\r\n\r\n separator*/);
|
||||
+ if (__archive_read_consume(a, w->cntlen) < 0 ||
|
||||
+ __archive_read_consume(a, 4U/*\r\n\r\n separator*/) < 0)
|
||||
+ return (ARCHIVE_FATAL);
|
||||
w->cntlen = 0U;
|
||||
w->cntoff = 0U;
|
||||
return (ARCHIVE_OK);
|
||||
diff --git a/libarchive/test/test_read_format_warc.c b/libarchive/test/test_read_format_warc.c
|
||||
index 658ab8a..8a6d178 100644
|
||||
--- a/libarchive/test/test_read_format_warc.c
|
||||
+++ b/libarchive/test/test_read_format_warc.c
|
||||
@@ -80,3 +80,27 @@ DEFINE_TEST(test_read_format_warc)
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
|
||||
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
|
||||
}
|
||||
+
|
||||
+DEFINE_TEST(test_read_format_warc_incomplete)
|
||||
+{
|
||||
+ const char reffile[] = "test_read_format_warc_incomplete.warc";
|
||||
+ struct archive_entry *ae;
|
||||
+ struct archive *a;
|
||||
+
|
||||
+ extract_reference_file(reffile);
|
||||
+ assert((a = archive_read_new()) != NULL);
|
||||
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
|
||||
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
|
||||
+ assertEqualIntA(a, ARCHIVE_OK,
|
||||
+ archive_read_open_filename(a, reffile, 10240));
|
||||
+
|
||||
+ /* Entry cannot be parsed */
|
||||
+ assertEqualIntA(a, ARCHIVE_FATAL, archive_read_next_header(a, &ae));
|
||||
+
|
||||
+ /* Verify archive format. */
|
||||
+ assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0));
|
||||
+
|
||||
+ /* Verify closing and resource freeing */
|
||||
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
|
||||
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
|
||||
+}
|
||||
diff --git a/libarchive/test/test_read_format_warc_incomplete.warc.uu b/libarchive/test/test_read_format_warc_incomplete.warc.uu
|
||||
new file mode 100644
|
||||
index 0000000..b91b97e
|
||||
--- /dev/null
|
||||
+++ b/libarchive/test/test_read_format_warc_incomplete.warc.uu
|
||||
@@ -0,0 +1,10 @@
|
||||
+begin 644 test_read_format_warc_incomplete.warc
|
||||
+M5T%20R\Q+C`-"E=!4D,M5'EP93H@8V]N=F5R<VEO;@T*5T%20RU$871E.B`R
|
||||
+M,#(U+3`S+3,P5#$U.C`P.C0P6@T*0V]N=&5N="U,96YG=&@Z(#DR,C,S-S(P
|
||||
+M,S8X-30W-S4X,#<-"@T*5T%20R\Q+C`-"E=!4D,M5'EP93H@<F5S;W5R8V4-
|
||||
+M"E=!4D,M5&%R9V5T+55223H@9FEL93HO+W)E861M92YT>'0-"E=!4D,M1&%T
|
||||
+M93H@,C`R-2TP,RTS,%0Q-3HP,#HT,%H-"D-O;G1E;G0M5'EP93H@=&5X="]P
|
||||
+M;&%I;@T*0V]N=&5N="U,96YG=&@Z(#,X#0H-"E1H92!R96%D;64N='AT('-H
|
||||
+4;W5L9"!N;W0@8F4@=FES:6)L90H`
|
||||
+`
|
||||
+end
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
From 7c02cde37a63580cd1859183fbbd2cf04a89be85 Mon Sep 17 00:00:00 2001
|
||||
From: Brian Campbell <Brian.Campbell@ed.ac.uk>
|
||||
Date: Sat, 26 Apr 2025 05:11:19 +0100
|
||||
Subject: [PATCH] Fix overflow in build_ustar_entry (#2588)
|
||||
|
||||
The calculations for the suffix and prefix can increment the endpoint
|
||||
for a trailing slash. Hence the limits used should be one lower than the
|
||||
maximum number of bytes.
|
||||
|
||||
Without this patch, when this happens for both the prefix and the
|
||||
suffix, we end up with 156 + 100 bytes, and the write of the null at the
|
||||
end will overflow the 256 byte buffer. This can be reproduced by running
|
||||
```
|
||||
mkdir -p foo/bar
|
||||
bsdtar cvf test.tar foo////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////bar
|
||||
```
|
||||
when bsdtar is compiled with Address Sanitiser, although I originally
|
||||
noticed this by accident with a genuine filename on a CHERI capability
|
||||
system, which faults immediately on the buffer overflow.
|
||||
|
||||
CVE: CVE-2025-5917
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/7c02cde37a63580cd1859183fbbd2cf04a89be85]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
libarchive/archive_write_set_format_pax.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libarchive/archive_write_set_format_pax.c b/libarchive/archive_write_set_format_pax.c
|
||||
index cf1f477..8e6aade 100644
|
||||
--- a/libarchive/archive_write_set_format_pax.c
|
||||
+++ b/libarchive/archive_write_set_format_pax.c
|
||||
@@ -1546,7 +1546,7 @@ build_ustar_entry_name(char *dest, const char *src, size_t src_length,
|
||||
const char *filename, *filename_end;
|
||||
char *p;
|
||||
int need_slash = 0; /* Was there a trailing slash? */
|
||||
- size_t suffix_length = 99;
|
||||
+ size_t suffix_length = 98; /* 99 - 1 for trailing slash */
|
||||
size_t insert_length;
|
||||
|
||||
/* Length of additional dir element to be added. */
|
||||
@@ -1598,7 +1598,7 @@ build_ustar_entry_name(char *dest, const char *src, size_t src_length,
|
||||
/* Step 2: Locate the "prefix" section of the dirname, including
|
||||
* trailing '/'. */
|
||||
prefix = src;
|
||||
- prefix_end = prefix + 155;
|
||||
+ prefix_end = prefix + 154 /* 155 - 1 for trailing / */;
|
||||
if (prefix_end > filename)
|
||||
prefix_end = filename;
|
||||
while (prefix_end > prefix && *prefix_end != '/')
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -35,6 +35,10 @@ SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
|
||||
file://CVE-2024-48958.patch \
|
||||
file://CVE-2024-20696.patch \
|
||||
file://CVE-2025-25724.patch \
|
||||
file://CVE-2025-5914.patch \
|
||||
file://CVE-2025-5915.patch \
|
||||
file://CVE-2025-5916.patch \
|
||||
file://CVE-2025-5917.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_URI = "http://libarchive.org/"
|
||||
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
From 10b80543807e3fc5af5f8bcfd8bb6e219bb3cecc Mon Sep 17 00:00:00 2001
|
||||
From: "Dmitry V. Levin" <ldv@strace.io>
|
||||
Date: Tue, 18 Feb 2025 08:00:00 +0000
|
||||
Subject: [PATCH] pam_inline: introduce pam_asprintf(), pam_snprintf(), and
|
||||
pam_sprintf()
|
||||
|
||||
pam_asprintf() is essentially asprintf() with the following semantic
|
||||
difference: it returns the string itself instead of its length.
|
||||
|
||||
pam_snprintf() is essentially snprintf() with the following semantic
|
||||
difference: it returns -1 in case of truncation.
|
||||
|
||||
pam_sprintf() is essentially snprintf() but with a check that the buffer
|
||||
is an array, and with an automatically calculated buffer size.
|
||||
|
||||
Use of these helpers would make error checking simpler.
|
||||
|
||||
(cherry picked from commit 10b80543807e3fc5af5f8bcfd8bb6e219bb3cecc)
|
||||
Signed-off-by: Dmitry V. Levin <ldv@strace.io>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/linux-pam/linux-pam/commit/10b80543807e3fc5af5f8bcfd8bb6e219bb3cecc]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
libpam/include/pam_cc_compat.h | 6 ++++++
|
||||
libpam/include/pam_inline.h | 37 ++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 43 insertions(+)
|
||||
|
||||
diff --git a/libpam/include/pam_cc_compat.h b/libpam/include/pam_cc_compat.h
|
||||
index 6919036..45c74b5 100644
|
||||
--- a/libpam/include/pam_cc_compat.h
|
||||
+++ b/libpam/include/pam_cc_compat.h
|
||||
@@ -21,6 +21,12 @@
|
||||
# define PAM_ATTRIBUTE_ALIGNED(arg) /* empty */
|
||||
#endif
|
||||
|
||||
+#if PAM_GNUC_PREREQ(3, 0)
|
||||
+# define PAM_ATTRIBUTE_MALLOC __attribute__((__malloc__))
|
||||
+#else
|
||||
+# define PAM_ATTRIBUTE_MALLOC /* empty */
|
||||
+#endif
|
||||
+
|
||||
#if PAM_GNUC_PREREQ(4, 6)
|
||||
# define DIAG_PUSH_IGNORE_CAST_QUAL \
|
||||
_Pragma("GCC diagnostic push"); \
|
||||
diff --git a/libpam/include/pam_inline.h b/libpam/include/pam_inline.h
|
||||
index ec2f3bf..666a028 100644
|
||||
--- a/libpam/include/pam_inline.h
|
||||
+++ b/libpam/include/pam_inline.h
|
||||
@@ -9,6 +9,9 @@
|
||||
#define PAM_INLINE_H
|
||||
|
||||
#include "pam_cc_compat.h"
|
||||
+#include <stdarg.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
@@ -66,6 +69,40 @@ pam_str_skip_icase_prefix_len(const char *str, const char *prefix, size_t prefix
|
||||
#define pam_str_skip_icase_prefix(str_, prefix_) \
|
||||
pam_str_skip_icase_prefix_len((str_), (prefix_), sizeof(prefix_) - 1 + PAM_MUST_BE_ARRAY(prefix_))
|
||||
|
||||
+static inline char * PAM_FORMAT((printf, 1, 2)) PAM_NONNULL((1)) PAM_ATTRIBUTE_MALLOC
|
||||
+pam_asprintf(const char *fmt, ...)
|
||||
+{
|
||||
+ int rc;
|
||||
+ char *res;
|
||||
+ va_list ap;
|
||||
+
|
||||
+ va_start(ap, fmt);
|
||||
+ rc = vasprintf(&res, fmt, ap);
|
||||
+ va_end(ap);
|
||||
+
|
||||
+ return rc < 0 ? NULL : res;
|
||||
+}
|
||||
+
|
||||
+static inline int PAM_FORMAT((printf, 3, 4)) PAM_NONNULL((3))
|
||||
+pam_snprintf(char *str, size_t size, const char *fmt, ...)
|
||||
+{
|
||||
+ int rc;
|
||||
+ va_list ap;
|
||||
+
|
||||
+ va_start(ap, fmt);
|
||||
+ rc = vsnprintf(str, size, fmt, ap);
|
||||
+ va_end(ap);
|
||||
+
|
||||
+ if (rc < 0 || (unsigned int) rc >= size)
|
||||
+ return -1;
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+#define pam_sprintf(str_, fmt_, ...) \
|
||||
+ pam_snprintf((str_), sizeof(str_) + PAM_MUST_BE_ARRAY(str_), (fmt_), \
|
||||
+ ##__VA_ARGS__)
|
||||
+
|
||||
+
|
||||
static inline int
|
||||
pam_read_passwords(int fd, int npass, char **passwords)
|
||||
{
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
From cc9d40b7cdbd3e15ccaa324a0dda1680ef9dea13 Mon Sep 17 00:00:00 2001
|
||||
From: Jacob Heider <jacob@pkgx.dev>
|
||||
Date: Wed, 17 Jan 2024 11:49:26 -0500
|
||||
Subject: [PATCH] pam_namespace: include stdint.h
|
||||
|
||||
pam_namespace.c makes use of SIZE_MAX but doesn't include stdint.h,
|
||||
resulting in the following build failures on 1.6.0:
|
||||
|
||||
pam_namespace.c: In function 'process_line':
|
||||
pam_namespace.c:649:41: error: 'SIZE_MAX' undeclared (first use in this function)
|
||||
649 | if (count > UINT_MAX || count > SIZE_MAX / sizeof(uid_t)) {
|
||||
| ^~~~~~~~
|
||||
pam_namespace.c:41:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
|
||||
40 | #include "argv_parse.h"
|
||||
+++ |+#include <stdint.h>
|
||||
41 |
|
||||
pam_namespace.c:649:41: note: each undeclared identifier is reported only once for each function it appears in
|
||||
649 | if (count > UINT_MAX || count > SIZE_MAX / sizeof(uid_t)) {
|
||||
| ^~~~~~~~
|
||||
|
||||
Fixes: v1.6.0~100 ("pam_namespace: validate amount of uids in config")
|
||||
Resolves: https://github.com/linux-pam/linux-pam/issues/733
|
||||
|
||||
Upstream-Status: Backport [https://github.com/linux-pam/linux-pam/commit/cc9d40b7cdbd3e15ccaa324a0dda1680ef9dea13]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
modules/pam_namespace/pam_namespace.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/modules/pam_namespace/pam_namespace.c b/modules/pam_namespace/pam_namespace.c
|
||||
index f72d67189..b16731c22 100644
|
||||
--- a/modules/pam_namespace/pam_namespace.c
|
||||
+++ b/modules/pam_namespace/pam_namespace.c
|
||||
@@ -34,6 +34,8 @@
|
||||
|
||||
#define _ATFILE_SOURCE
|
||||
|
||||
+#include "config.h"
|
||||
+#include <stdint.h>
|
||||
#include "pam_cc_compat.h"
|
||||
#include "pam_inline.h"
|
||||
#include "pam_namespace.h"
|
||||
1588
meta/recipes-extended/pam/libpam/CVE-2025-6020-01.patch
Normal file
1588
meta/recipes-extended/pam/libpam/CVE-2025-6020-01.patch
Normal file
File diff suppressed because it is too large
Load Diff
187
meta/recipes-extended/pam/libpam/CVE-2025-6020-02.patch
Normal file
187
meta/recipes-extended/pam/libpam/CVE-2025-6020-02.patch
Normal file
@@ -0,0 +1,187 @@
|
||||
From 592d84e1265d04c3104acee815a503856db503a1 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Bal-Petre <olivier.bal-petre@ssi.gouv.fr>
|
||||
Date: Tue, 4 Mar 2025 14:37:02 +0100
|
||||
Subject: [PATCH] pam_namespace: add flags to indicate path safety
|
||||
|
||||
Add two flags in the script to indicate if the paths to the polydir
|
||||
and the instance directories are safe (root owned and writable by
|
||||
root only).
|
||||
|
||||
Signed-off-by: Olivier Bal-Petre <olivier.bal-petre@ssi.gouv.fr>
|
||||
Signed-off-by: Dmitry V. Levin <ldv@strace.io>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/linux-pam/linux-pam/commit/592d84e1265d04c3104acee815a503856db503a1]
|
||||
CVE: CVE-2025-6020
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
modules/pam_namespace/namespace.init | 56 ++++++++++++-------
|
||||
modules/pam_namespace/pam_namespace.c | 79 ++++++++++++++++++++++++++-
|
||||
2 files changed, 115 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/modules/pam_namespace/namespace.init b/modules/pam_namespace/namespace.init
|
||||
index 67d4aa2..8782178 100755
|
||||
--- a/modules/pam_namespace/namespace.init
|
||||
+++ b/modules/pam_namespace/namespace.init
|
||||
@@ -1,25 +1,43 @@
|
||||
#!/bin/sh
|
||||
-# It receives polydir path as $1, the instance path as $2,
|
||||
-# a flag whether the instance dir was newly created (0 - no, 1 - yes) in $3,
|
||||
-# and user name in $4.
|
||||
+# It receives as arguments:
|
||||
+# - $1 polydir path (see WARNING below)
|
||||
+# - $2 instance path (see WARNING below)
|
||||
+# - $3 flag whether the instance dir was newly created (0 - no, 1 - yes)
|
||||
+# - $4 user name
|
||||
+# - $5 flag whether the polydir path ($1) is safe (0 - unsafe, 1 -safe)
|
||||
+# - $6 flag whether the instance path ($2) is safe (0 - unsafe, 1 - safe)
|
||||
+#
|
||||
+# WARNING: This script is invoked with full root privileges. Accessing
|
||||
+# the polydir ($1) and the instance ($2) directories in this context may be
|
||||
+# extremely dangerous as those can be under user control. The flags $5 and $6
|
||||
+# are provided to let you know if all the segments part of the path (except the
|
||||
+# last one) are owned by root and are writable by root only. If the path does
|
||||
+# not meet these criteria, you expose yourself to possible symlink attacks when
|
||||
+# accessing these path.
|
||||
+# However, even if the path components are safe, the content of the
|
||||
+# directories may still be owned/writable by a user, so care must be taken!
|
||||
#
|
||||
# The following section will copy the contents of /etc/skel if this is a
|
||||
# newly created home directory.
|
||||
-if [ "$3" = 1 ]; then
|
||||
- # This line will fix the labeling on all newly created directories
|
||||
- [ -x /sbin/restorecon ] && /sbin/restorecon "$1"
|
||||
- user="$4"
|
||||
- passwd=$(getent passwd "$user")
|
||||
- homedir=$(echo "$passwd" | cut -f6 -d":")
|
||||
- if [ "$1" = "$homedir" ]; then
|
||||
- gid=$(echo "$passwd" | cut -f4 -d":")
|
||||
- cp -rT /etc/skel "$homedir"
|
||||
- chown -R "$user":"$gid" "$homedir"
|
||||
- mask=$(awk '/^UMASK/{gsub("#.*$", "", $2); print $2; exit}' /etc/login.defs)
|
||||
- mode=$(printf "%o" $((0777 & ~$mask)))
|
||||
- chmod ${mode:-700} "$homedir"
|
||||
- [ -x /sbin/restorecon ] && /sbin/restorecon -R "$homedir"
|
||||
- fi
|
||||
-fi
|
||||
|
||||
+# Executes only if the polydir path is safe
|
||||
+if [ "$5" = 1 ]; then
|
||||
+
|
||||
+ if [ "$3" = 1 ]; then
|
||||
+ # This line will fix the labeling on all newly created directories
|
||||
+ [ -x /sbin/restorecon ] && /sbin/restorecon "$1"
|
||||
+ user="$4"
|
||||
+ passwd=$(getent passwd "$user")
|
||||
+ homedir=$(echo "$passwd" | cut -f6 -d":")
|
||||
+ if [ "$1" = "$homedir" ]; then
|
||||
+ gid=$(echo "$passwd" | cut -f4 -d":")
|
||||
+ cp -rT /etc/skel "$homedir"
|
||||
+ chown -R "$user":"$gid" "$homedir"
|
||||
+ mask=$(sed -E -n 's/^UMASK[[:space:]]+([^#[:space:]]+).*/\1/p' /etc/login.defs)
|
||||
+ mode=$(printf "%o" $((0777 & ~mask)))
|
||||
+ chmod ${mode:-700} "$homedir"
|
||||
+ [ -x /sbin/restorecon ] && /sbin/restorecon -R "$homedir"
|
||||
+ fi
|
||||
+ fi
|
||||
+fi
|
||||
exit 0
|
||||
diff --git a/modules/pam_namespace/pam_namespace.c b/modules/pam_namespace/pam_namespace.c
|
||||
index 22d8445..8cba036 100644
|
||||
--- a/modules/pam_namespace/pam_namespace.c
|
||||
+++ b/modules/pam_namespace/pam_namespace.c
|
||||
@@ -1390,6 +1390,79 @@ static int check_inst_parent(int dfd, struct instance_data *idata)
|
||||
return PAM_SUCCESS;
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Check for a given absolute path that all segments except the last one are:
|
||||
+ * 1. a directory owned by root and not writable by group or others
|
||||
+ * 2. a symlink owned by root and referencing a directory respecting 1.
|
||||
+ * Returns 0 if safe, -1 is unsafe.
|
||||
+ * If the path is not accessible (does not exist, hidden under a mount...),
|
||||
+ * returns -1 (unsafe).
|
||||
+ */
|
||||
+static int check_safe_path(const char *path, struct instance_data *idata)
|
||||
+{
|
||||
+ char *p = strdup(path);
|
||||
+ char *d;
|
||||
+ char *dir = p;
|
||||
+ struct stat st;
|
||||
+
|
||||
+ if (p == NULL)
|
||||
+ return -1;
|
||||
+
|
||||
+ /* Check path is absolute */
|
||||
+ if (p[0] != '/')
|
||||
+ goto error;
|
||||
+
|
||||
+ strip_trailing_slashes(p);
|
||||
+
|
||||
+ /* Last segment of the path may be owned by the user */
|
||||
+ if ((d = strrchr(dir, '/')) != NULL)
|
||||
+ *d = '\0';
|
||||
+
|
||||
+ while ((d=strrchr(dir, '/')) != NULL) {
|
||||
+
|
||||
+ /* Do not follow symlinks */
|
||||
+ if (lstat(dir, &st) != 0)
|
||||
+ goto error;
|
||||
+
|
||||
+ if (S_ISLNK(st.st_mode)) {
|
||||
+ if (st.st_uid != 0) {
|
||||
+ if (idata->flags & PAMNS_DEBUG)
|
||||
+ pam_syslog(idata->pamh, LOG_DEBUG,
|
||||
+ "Path deemed unsafe: Symlink %s should be owned by root", dir);
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ /* Follow symlinks */
|
||||
+ if (stat(dir, &st) != 0)
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ if (!S_ISDIR(st.st_mode)) {
|
||||
+ if (idata->flags & PAMNS_DEBUG)
|
||||
+ pam_syslog(idata->pamh, LOG_DEBUG,
|
||||
+ "Path deemed unsafe: %s is expected to be a directory", dir);
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ if (st.st_uid != 0 ||
|
||||
+ ((st.st_mode & (S_IWGRP|S_IWOTH)) && !(st.st_mode & S_ISVTX))) {
|
||||
+ if (idata->flags & PAMNS_DEBUG)
|
||||
+ pam_syslog(idata->pamh, LOG_DEBUG,
|
||||
+ "Path deemed unsafe: %s should be owned by root, and not be writable by group or others", dir);
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ *d = '\0';
|
||||
+ }
|
||||
+
|
||||
+ free(p);
|
||||
+ return 0;
|
||||
+
|
||||
+error:
|
||||
+ free(p);
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* Check to see if there is a namespace initialization script in
|
||||
* the /etc/security directory. If such a script exists
|
||||
@@ -1438,7 +1511,11 @@ static int inst_init(const struct polydir_s *polyptr, const char *ipath,
|
||||
close_fds_pre_exec(idata);
|
||||
|
||||
execle(init_script, init_script,
|
||||
- polyptr->dir, ipath, newdir?"1":"0", idata->user, NULL, envp);
|
||||
+ polyptr->dir, ipath,
|
||||
+ newdir ? "1":"0", idata->user,
|
||||
+ (check_safe_path(polyptr->dir, idata) == -1) ? "0":"1",
|
||||
+ (check_safe_path(ipath, idata) == -1) ? "0":"1",
|
||||
+ NULL, envp);
|
||||
_exit(1);
|
||||
} else if (pid > 0) {
|
||||
while (((rc = waitpid(pid, &status, 0)) == (pid_t)-1) &&
|
||||
--
|
||||
2.50.1
|
||||
|
||||
35
meta/recipes-extended/pam/libpam/CVE-2025-6020-03.patch
Normal file
35
meta/recipes-extended/pam/libpam/CVE-2025-6020-03.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
From 976c20079358d133514568fc7fd95c02df8b5773 Mon Sep 17 00:00:00 2001
|
||||
From: "Dmitry V. Levin" <ldv@strace.io>
|
||||
Date: Tue, 27 May 2025 08:00:00 +0000
|
||||
Subject: [PATCH] pam_namespace: secure_opendir: do not look at the group
|
||||
ownership
|
||||
|
||||
When the directory is not group-writable, the group ownership does
|
||||
not matter, and when it is group-writable, there should not be any
|
||||
exceptions for the root group as there is no guarantee that the root
|
||||
group does not include non-root users.
|
||||
|
||||
Upstream-Status: Backport [https://github.com/linux-pam/linux-pam/commit/976c20079358d133514568fc7fd95c02df8b5773]
|
||||
CVE: CVE-2025-6020
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
modules/pam_namespace/pam_namespace.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/modules/pam_namespace/pam_namespace.c b/modules/pam_namespace/pam_namespace.c
|
||||
index 8cba036..630cf0a 100644
|
||||
--- a/modules/pam_namespace/pam_namespace.c
|
||||
+++ b/modules/pam_namespace/pam_namespace.c
|
||||
@@ -215,8 +215,7 @@ static int secure_opendir(const char *path, int opm, mode_t mode,
|
||||
if (dfd_next == -1)
|
||||
goto error;
|
||||
} else if (st.st_uid != 0
|
||||
- || (st.st_gid != 0 && (st.st_mode & S_IWGRP))
|
||||
- || (st.st_mode & S_IWOTH)) {
|
||||
+ || (st.st_mode & (S_IWGRP|S_IWOTH))) {
|
||||
/* do not follow symlinks on subdirectories */
|
||||
flags |= O_NOFOLLOW;
|
||||
}
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -29,6 +29,11 @@ SRC_URI = "https://github.com/linux-pam/linux-pam/releases/download/v${PV}/Linux
|
||||
file://CVE-2024-22365.patch \
|
||||
file://CVE-2024-10041-1.patch \
|
||||
file://CVE-2024-10041-2.patch \
|
||||
file://0001-pam_namespace-include-stdint-h.patch \
|
||||
file://0001-pam_inline-introduce-pam_asprint.patch \
|
||||
file://CVE-2025-6020-01.patch \
|
||||
file://CVE-2025-6020-02.patch \
|
||||
file://CVE-2025-6020-03.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "e4ec7131a91da44512574268f493c6d8ca105c87091691b8e9b56ca685d4f94d"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 6e835350b7413210c410d3578cfab804186b7a4f Mon Sep 17 00:00:00 2001
|
||||
From 8c69192754ba73dd6e3273728a21aa73988f4bfb Mon Sep 17 00:00:00 2001
|
||||
From: Kai Kang <kai.kang@windriver.com>
|
||||
Date: Tue, 17 Nov 2020 11:13:40 +0800
|
||||
Subject: [PATCH] sudo.conf.in: fix conflict with multilib
|
||||
@@ -15,13 +15,12 @@ Update the comments in sudo.conf.in to avoid the conflict.
|
||||
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
||||
|
||||
Upstream-Status: Inappropriate [OE configuration specific]
|
||||
|
||||
---
|
||||
examples/sudo.conf.in | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/examples/sudo.conf.in b/examples/sudo.conf.in
|
||||
index 2187457..0908d24 100644
|
||||
index bdd676c..094341c 100644
|
||||
--- a/examples/sudo.conf.in
|
||||
+++ b/examples/sudo.conf.in
|
||||
@@ -4,7 +4,7 @@
|
||||
@@ -53,7 +52,7 @@ index 2187457..0908d24 100644
|
||||
# Sudo plugin directory:
|
||||
@@ -74,7 +74,7 @@
|
||||
# The default directory to use when searching for plugins that are
|
||||
# specified without a fully qualified path name.
|
||||
# specified without a fully-qualified path name.
|
||||
#
|
||||
-#Path plugin_dir @plugindir@
|
||||
+#Path plugin_dir $plugindir
|
||||
|
||||
@@ -4,7 +4,7 @@ HOMEPAGE = "http://www.sudo.ws"
|
||||
BUGTRACKER = "http://www.sudo.ws/bugs/"
|
||||
SECTION = "admin"
|
||||
LICENSE = "ISC & BSD-3-Clause & BSD-2-Clause & Zlib"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=5100e20d35f9015f9eef6bdb27ba194f \
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=2841c822e587db145364ca95e9be2ffa \
|
||||
file://plugins/sudoers/redblack.c;beginline=1;endline=46;md5=03e35317699ba00b496251e0dfe9f109 \
|
||||
file://lib/util/reallocarray.c;beginline=3;endline=15;md5=397dd45c7683e90b9f8bf24638cf03bf \
|
||||
file://lib/util/fnmatch.c;beginline=3;endline=27;md5=004d7d2866ba1f5b41174906849d2e0f \
|
||||
|
||||
@@ -1,3 +1,55 @@
|
||||
# FIXME: the LIC_FILES_CHKSUM values have been updated by 'devtool upgrade'.
|
||||
# The following is the difference between the old and the new license text.
|
||||
# Please update the LICENSE value if needed, and summarize the changes in
|
||||
# the commit message via 'License-Update:' tag.
|
||||
# (example: 'License-Update: copyright years updated.')
|
||||
#
|
||||
# The changes:
|
||||
#
|
||||
# --- LICENSE.md
|
||||
# +++ LICENSE.md
|
||||
# @@ -1,6 +1,6 @@
|
||||
# Sudo is distributed under the following license:
|
||||
#
|
||||
# - Copyright (c) 1994-1996, 1998-2023
|
||||
# + Copyright (c) 1994-1996, 1998-2025
|
||||
# Todd C. Miller <Todd.Miller@sudo.ws>
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# @@ -247,9 +247,9 @@
|
||||
#
|
||||
# The file arc4random.c bears the following license:
|
||||
#
|
||||
# - Copyright (c) 1996, David Mazieres <dm@uun.org>
|
||||
# - Copyright (c) 2008, Damien Miller <djm@openbsd.org>
|
||||
# - Copyright (c) 2013, Markus Friedl <markus@openbsd.org>
|
||||
# + Copyright (c) 1996, David Mazieres <dm@uun.org>
|
||||
# + Copyright (c) 2008, Damien Miller <djm@openbsd.org>
|
||||
# + Copyright (c) 2013, Markus Friedl <markus@openbsd.org>
|
||||
# Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# @@ -282,7 +282,7 @@
|
||||
#
|
||||
# The file getentropy.c bears the following license:
|
||||
#
|
||||
# - Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
|
||||
# + Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
|
||||
# Copyright (c) 2014 Bob Beck <beck@obtuse.com>
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# @@ -299,7 +299,7 @@
|
||||
#
|
||||
# The embedded copy of zlib bears the following license:
|
||||
#
|
||||
# - Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
||||
# + Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
|
||||
#
|
||||
# This software is provided 'as-is', without any express or implied
|
||||
# warranty. In no event will the authors be held liable for any damages
|
||||
#
|
||||
#
|
||||
|
||||
require sudo.inc
|
||||
|
||||
SRC_URI = "https://www.sudo.ws/dist/sudo-${PV}.tar.gz \
|
||||
@@ -7,7 +59,7 @@ SRC_URI = "https://www.sudo.ws/dist/sudo-${PV}.tar.gz \
|
||||
|
||||
PAM_SRC_URI = "file://sudo.pam"
|
||||
|
||||
SRC_URI[sha256sum] = "199c0cdbfa7efcfffa9c88684a8e2fb206a62b70a316507e4a91c89c873bbcc8"
|
||||
SRC_URI[sha256sum] = "ff607ea717072197738a78f778692cd6df9a7e3e404565f51de063ca27455d32"
|
||||
|
||||
DEPENDS += " virtual/crypt ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
|
||||
RDEPENDS:${PN} += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-limits pam-plugin-keyinit', '', d)}"
|
||||
55
meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2025-7345.patch
Normal file
55
meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2025-7345.patch
Normal file
@@ -0,0 +1,55 @@
|
||||
From 4af78023ce7d3b5e3cec422a59bb4f48fa4f5886 Mon Sep 17 00:00:00 2001
|
||||
From: Matthias Clasen <mclasen@redhat.com>
|
||||
Date: Fri, 11 Jul 2025 11:02:05 -0400
|
||||
Subject: [PATCH] jpeg: Be more careful with chunked icc data
|
||||
|
||||
We we inadvertendly trusting the sequence numbers not to lie.
|
||||
If they do we would report a larger data size than we actually
|
||||
allocated, leading to out of bounds memory access in base64
|
||||
encoding later on.
|
||||
|
||||
This has been assigned CVE-2025-7345.
|
||||
|
||||
Fixes: #249
|
||||
|
||||
CVE: CVE-2025-7345
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/commit/4af78023ce7d3b5e3cec422a59bb4f48fa4f5886]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
gdk-pixbuf/io-jpeg.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
|
||||
index 3841fc0..9ee1d21 100644
|
||||
--- a/gdk-pixbuf/io-jpeg.c
|
||||
+++ b/gdk-pixbuf/io-jpeg.c
|
||||
@@ -356,6 +356,7 @@ jpeg_parse_exif_app2_segment (JpegExifContext *context, jpeg_saved_marker_ptr ma
|
||||
context->icc_profile = g_new (gchar, chunk_size);
|
||||
/* copy the segment data to the profile space */
|
||||
memcpy (context->icc_profile, marker->data + 14, chunk_size);
|
||||
+ ret = TRUE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -377,12 +378,15 @@ jpeg_parse_exif_app2_segment (JpegExifContext *context, jpeg_saved_marker_ptr ma
|
||||
/* copy the segment data to the profile space */
|
||||
memcpy (context->icc_profile + offset, marker->data + 14, chunk_size);
|
||||
|
||||
- /* it's now this big plus the new data we've just copied */
|
||||
- context->icc_profile_size += chunk_size;
|
||||
+ context->icc_profile_size = MAX (context->icc_profile_size, offset + chunk_size);
|
||||
|
||||
/* success */
|
||||
ret = TRUE;
|
||||
out:
|
||||
+ if (!ret) {
|
||||
+ g_free (context->icc_profile);
|
||||
+ context->icc_profile = NULL;
|
||||
+ }
|
||||
return ret;
|
||||
}
|
||||
|
||||
--
|
||||
2.40.0
|
||||
@@ -20,6 +20,7 @@ SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
|
||||
file://run-ptest \
|
||||
file://fatal-loader.patch \
|
||||
file://0001-meson.build-allow-a-subset-of-tests-in-cross-compile.patch \
|
||||
file://CVE-2025-7345.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "ee9b6c75d13ba096907a2e3c6b27b61bcd17f5c7ebeab5a5b439d2f2e39fe44b"
|
||||
|
||||
92
meta/recipes-graphics/xwayland/xwayland/CVE-2025-49175.patch
Normal file
92
meta/recipes-graphics/xwayland/xwayland/CVE-2025-49175.patch
Normal file
@@ -0,0 +1,92 @@
|
||||
From 0885e0b26225c90534642fe911632ec0779eebee Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Fri, 28 Mar 2025 09:43:52 +0100
|
||||
Subject: [PATCH] render: Avoid 0 or less animated cursors
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Animated cursors use a series of cursors that the client can set.
|
||||
|
||||
By default, the Xserver assumes at least one cursor is specified
|
||||
while a client may actually pass no cursor at all.
|
||||
|
||||
That causes an out-of-bound read creating the animated cursor and a
|
||||
crash of the Xserver:
|
||||
|
||||
| Invalid read of size 8
|
||||
| at 0x5323F4: AnimCursorCreate (animcur.c:325)
|
||||
| by 0x52D4C5: ProcRenderCreateAnimCursor (render.c:1817)
|
||||
| by 0x52DC80: ProcRenderDispatch (render.c:1999)
|
||||
| by 0x4A1E9D: Dispatch (dispatch.c:560)
|
||||
| by 0x4B0169: dix_main (main.c:284)
|
||||
| by 0x4287F5: main (stubmain.c:34)
|
||||
| Address 0x59aa010 is 0 bytes after a block of size 0 alloc'd
|
||||
| at 0x48468D3: reallocarray (vg_replace_malloc.c:1803)
|
||||
| by 0x52D3DA: ProcRenderCreateAnimCursor (render.c:1802)
|
||||
| by 0x52DC80: ProcRenderDispatch (render.c:1999)
|
||||
| by 0x4A1E9D: Dispatch (dispatch.c:560)
|
||||
| by 0x4B0169: dix_main (main.c:284)
|
||||
| by 0x4287F5: main (stubmain.c:34)
|
||||
|
|
||||
| Invalid read of size 2
|
||||
| at 0x5323F7: AnimCursorCreate (animcur.c:325)
|
||||
| by 0x52D4C5: ProcRenderCreateAnimCursor (render.c:1817)
|
||||
| by 0x52DC80: ProcRenderDispatch (render.c:1999)
|
||||
| by 0x4A1E9D: Dispatch (dispatch.c:560)
|
||||
| by 0x4B0169: dix_main (main.c:284)
|
||||
| by 0x4287F5: main (stubmain.c:34)
|
||||
| Address 0x8 is not stack'd, malloc'd or (recently) free'd
|
||||
|
||||
To avoid the issue, check the number of cursors specified and return a
|
||||
BadValue error in both the proc handler (early) and the animated cursor
|
||||
creation (as this is a public function) if there is 0 or less cursor.
|
||||
|
||||
CVE-2025-49175
|
||||
|
||||
This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
|
||||
reported by Julian Suleder via ERNW Vulnerability Disclosure.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: José Expósito <jexposit@redhat.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
|
||||
|
||||
CVE: CVE-2025-49175
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/0885e0b26225c90534642fe911632ec0779eebee]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
render/animcur.c | 3 +++
|
||||
render/render.c | 2 ++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/render/animcur.c b/render/animcur.c
|
||||
index ef27bda..77942d8 100644
|
||||
--- a/render/animcur.c
|
||||
+++ b/render/animcur.c
|
||||
@@ -304,6 +304,9 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor,
|
||||
int rc = BadAlloc, i;
|
||||
AnimCurPtr ac;
|
||||
|
||||
+ if (ncursor <= 0)
|
||||
+ return BadValue;
|
||||
+
|
||||
for (i = 0; i < screenInfo.numScreens; i++)
|
||||
if (!GetAnimCurScreen(screenInfo.screens[i]))
|
||||
return BadImplementation;
|
||||
diff --git a/render/render.c b/render/render.c
|
||||
index 5bc2a20..a8c2da0 100644
|
||||
--- a/render/render.c
|
||||
+++ b/render/render.c
|
||||
@@ -1795,6 +1795,8 @@ ProcRenderCreateAnimCursor(ClientPtr client)
|
||||
ncursor =
|
||||
(client->req_len -
|
||||
(bytes_to_int32(sizeof(xRenderCreateAnimCursorReq)))) >> 1;
|
||||
+ if (ncursor <= 0)
|
||||
+ return BadValue;
|
||||
cursors = xallocarray(ncursor, sizeof(CursorPtr) + sizeof(CARD32));
|
||||
if (!cursors)
|
||||
return BadAlloc;
|
||||
--
|
||||
2.40.0
|
||||
@@ -0,0 +1,93 @@
|
||||
From 03731b326a80b582e48d939fe62cb1e2b10400d9 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Mon, 7 Apr 2025 16:13:34 +0200
|
||||
Subject: [PATCH] os: Do not overflow the integer size with BigRequest
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The BigRequest extension allows requests larger than the 16-bit length
|
||||
limit.
|
||||
|
||||
It uses integers for the request length and checks for the size not to
|
||||
exceed the maxBigRequestSize limit, but does so after translating the
|
||||
length to integer by multiplying the given size in bytes by 4.
|
||||
|
||||
In doing so, it might overflow the integer size limit before actually
|
||||
checking for the overflow, defeating the purpose of the test.
|
||||
|
||||
To avoid the issue, make sure to check that the request size does not
|
||||
overflow the maxBigRequestSize limit prior to any conversion.
|
||||
|
||||
The caller Dispatch() function however expects the return value to be in
|
||||
bytes, so we cannot just return the converted value in case of error, as
|
||||
that would also overflow the integer size.
|
||||
|
||||
To preserve the existing API, we use a negative value for the X11 error
|
||||
code BadLength as the function only return positive values, 0 or -1 and
|
||||
update the caller Dispatch() function to take that case into account to
|
||||
return the error code to the offending client.
|
||||
|
||||
CVE-2025-49176
|
||||
|
||||
This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
|
||||
reported by Julian Suleder via ERNW Vulnerability Disclosure.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
|
||||
|
||||
CVE: CVE-2025-49176
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/03731b326a80b582e48d939fe62cb1e2b10400d9]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
dix/dispatch.c | 9 +++++----
|
||||
os/io.c | 4 ++++
|
||||
2 files changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dix/dispatch.c b/dix/dispatch.c
|
||||
index 9e98d54..20473f1 100644
|
||||
--- a/dix/dispatch.c
|
||||
+++ b/dix/dispatch.c
|
||||
@@ -513,9 +513,10 @@ Dispatch(void)
|
||||
|
||||
/* now, finally, deal with client requests */
|
||||
result = ReadRequestFromClient(client);
|
||||
- if (result <= 0) {
|
||||
- if (result < 0)
|
||||
- CloseDownClient(client);
|
||||
+ if (result == 0)
|
||||
+ break;
|
||||
+ else if (result == -1) {
|
||||
+ CloseDownClient(client);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -536,7 +537,7 @@ Dispatch(void)
|
||||
client->index,
|
||||
client->requestBuffer);
|
||||
#endif
|
||||
- if (result > (maxBigRequestSize << 2))
|
||||
+ if (result < 0 || result > (maxBigRequestSize << 2))
|
||||
result = BadLength;
|
||||
else {
|
||||
result = XaceHookDispatch(client, client->majorOp);
|
||||
diff --git a/os/io.c b/os/io.c
|
||||
index 841a0ee..aeece86 100644
|
||||
--- a/os/io.c
|
||||
+++ b/os/io.c
|
||||
@@ -296,6 +296,10 @@ ReadRequestFromClient(ClientPtr client)
|
||||
needed = get_big_req_len(request, client);
|
||||
}
|
||||
client->req_len = needed;
|
||||
+ if (needed > MAXINT >> 2) {
|
||||
+ /* Check for potential integer overflow */
|
||||
+ return -(BadLength);
|
||||
+ }
|
||||
needed <<= 2; /* needed is in bytes now */
|
||||
}
|
||||
if (gotnow < needed) {
|
||||
--
|
||||
2.40.0
|
||||
@@ -0,0 +1,38 @@
|
||||
From 4fc4d76b2c7aaed61ed2653f997783a3714c4fe1 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Wed, 18 Jun 2025 08:39:02 +0200
|
||||
Subject: [PATCH] os: Check for integer overflow on BigRequest length
|
||||
|
||||
Check for another possible integer overflow once we get a complete xReq
|
||||
with BigRequest.
|
||||
|
||||
Related to CVE-2025-49176
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Suggested-by: Peter Harris <pharris2@rocketsoftware.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2028>
|
||||
|
||||
CVE: CVE-2025-49176
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/4fc4d76b2c7aaed61ed2653f997783a3714c4fe1]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
os/io.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/os/io.c b/os/io.c
|
||||
index aeece86..67465f9 100644
|
||||
--- a/os/io.c
|
||||
+++ b/os/io.c
|
||||
@@ -395,6 +395,8 @@ ReadRequestFromClient(ClientPtr client)
|
||||
needed = get_big_req_len(request, client);
|
||||
}
|
||||
client->req_len = needed;
|
||||
+ if (needed > MAXINT >> 2)
|
||||
+ return -(BadLength);
|
||||
needed <<= 2;
|
||||
}
|
||||
if (gotnow < needed) {
|
||||
--
|
||||
2.40.0
|
||||
55
meta/recipes-graphics/xwayland/xwayland/CVE-2025-49177.patch
Normal file
55
meta/recipes-graphics/xwayland/xwayland/CVE-2025-49177.patch
Normal file
@@ -0,0 +1,55 @@
|
||||
From ab02fb96b1c701c3bb47617d965522c34befa6af Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Mon, 28 Apr 2025 10:05:36 +0200
|
||||
Subject: [PATCH] xfixes: Check request length for SetClientDisconnectMode
|
||||
|
||||
The handler of XFixesSetClientDisconnectMode does not check the client
|
||||
request length.
|
||||
|
||||
A client could send a shorter request and read data from a former
|
||||
request.
|
||||
|
||||
Fix the issue by checking the request size matches.
|
||||
|
||||
CVE-2025-49177
|
||||
|
||||
This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
|
||||
reported by Julian Suleder via ERNW Vulnerability Disclosure.
|
||||
|
||||
Fixes: e167299f6 - xfixes: Add ClientDisconnectMode
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
|
||||
|
||||
CVE: CVE-2025-49177
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/ab02fb96b1c701c3bb47617d965522c34befa6af]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
xfixes/disconnect.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xfixes/disconnect.c b/xfixes/disconnect.c
|
||||
index 28aac45..d6da1f9 100644
|
||||
--- a/xfixes/disconnect.c
|
||||
+++ b/xfixes/disconnect.c
|
||||
@@ -67,6 +67,7 @@ ProcXFixesSetClientDisconnectMode(ClientPtr client)
|
||||
ClientDisconnectPtr pDisconnect = GetClientDisconnect(client);
|
||||
|
||||
REQUEST(xXFixesSetClientDisconnectModeReq);
|
||||
+ REQUEST_SIZE_MATCH(xXFixesSetClientDisconnectModeReq);
|
||||
|
||||
pDisconnect->disconnect_mode = stuff->disconnect_mode;
|
||||
|
||||
@@ -80,7 +81,7 @@ SProcXFixesSetClientDisconnectMode(ClientPtr client)
|
||||
|
||||
swaps(&stuff->length);
|
||||
|
||||
- REQUEST_AT_LEAST_SIZE(xXFixesSetClientDisconnectModeReq);
|
||||
+ REQUEST_SIZE_MATCH(xXFixesSetClientDisconnectModeReq);
|
||||
|
||||
swapl(&stuff->disconnect_mode);
|
||||
|
||||
--
|
||||
2.40.0
|
||||
50
meta/recipes-graphics/xwayland/xwayland/CVE-2025-49178.patch
Normal file
50
meta/recipes-graphics/xwayland/xwayland/CVE-2025-49178.patch
Normal file
@@ -0,0 +1,50 @@
|
||||
From d55c54cecb5e83eaa2d56bed5cc4461f9ba318c2 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Mon, 28 Apr 2025 10:46:03 +0200
|
||||
Subject: [PATCH] os: Account for bytes to ignore when sharing input buffer
|
||||
|
||||
When reading requests from the clients, the input buffer might be shared
|
||||
and used between different clients.
|
||||
|
||||
If a given client sends a full request with non-zero bytes to ignore,
|
||||
the bytes to ignore may still be non-zero even though the request is
|
||||
full, in which case the buffer could be shared with another client who's
|
||||
request will not be processed because of those bytes to ignore, leading
|
||||
to a possible hang of the other client request.
|
||||
|
||||
To avoid the issue, make sure we have zero bytes to ignore left in the
|
||||
input request when sharing the input buffer with another client.
|
||||
|
||||
CVE-2025-49178
|
||||
|
||||
This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
|
||||
reported by Julian Suleder via ERNW Vulnerability Disclosure.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
|
||||
|
||||
CVE: CVE-2025-49178
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/d55c54cecb5e83eaa2d56bed5cc4461f9ba318c2]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
os/io.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/os/io.c b/os/io.c
|
||||
index 67465f9..f92a40e 100644
|
||||
--- a/os/io.c
|
||||
+++ b/os/io.c
|
||||
@@ -444,7 +444,7 @@ ReadRequestFromClient(ClientPtr client)
|
||||
*/
|
||||
|
||||
gotnow -= needed;
|
||||
- if (!gotnow)
|
||||
+ if (!gotnow && !oci->ignoreBytes)
|
||||
AvailableInput = oc;
|
||||
if (move_header) {
|
||||
if (client->req_len < bytes_to_int32(sizeof(xBigReq) - sizeof(xReq))) {
|
||||
--
|
||||
2.40.0
|
||||
69
meta/recipes-graphics/xwayland/xwayland/CVE-2025-49179.patch
Normal file
69
meta/recipes-graphics/xwayland/xwayland/CVE-2025-49179.patch
Normal file
@@ -0,0 +1,69 @@
|
||||
From 9d205323894af62b9726fcbaeb5fc69b3c9f61ba Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Mon, 28 Apr 2025 11:47:15 +0200
|
||||
Subject: [PATCH] record: Check for overflow in
|
||||
RecordSanityCheckRegisterClients()
|
||||
|
||||
The RecordSanityCheckRegisterClients() checks for the request length,
|
||||
but does not check for integer overflow.
|
||||
|
||||
A client might send a very large value for either the number of clients
|
||||
or the number of protocol ranges that will cause an integer overflow in
|
||||
the request length computation, defeating the check for request length.
|
||||
|
||||
To avoid the issue, explicitly check the number of clients against the
|
||||
limit of clients (which is much lower than an maximum integer value) and
|
||||
the number of protocol ranges (multiplied by the record length) do not
|
||||
exceed the maximum integer value.
|
||||
|
||||
This way, we ensure that the final computation for the request length
|
||||
will not overflow the maximum integer limit.
|
||||
|
||||
CVE-2025-49179
|
||||
|
||||
This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
|
||||
reported by Julian Suleder via ERNW Vulnerability Disclosure.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
(cherry picked from commit 2bde9ca49a8fd9a1e6697d5e7ef837870d66f5d4)
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2026>
|
||||
|
||||
CVE: CVE-2025-49179
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/9d205323894af62b9726fcbaeb5fc69b3c9f61ba]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
record/record.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/record/record.c b/record/record.c
|
||||
index e123867..018e53f 100644
|
||||
--- a/record/record.c
|
||||
+++ b/record/record.c
|
||||
@@ -45,6 +45,7 @@ and Jim Haggerty of Metheus.
|
||||
#include "inputstr.h"
|
||||
#include "eventconvert.h"
|
||||
#include "scrnintstr.h"
|
||||
+#include "opaque.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
@@ -1298,6 +1299,13 @@ RecordSanityCheckRegisterClients(RecordContextPtr pContext, ClientPtr client,
|
||||
int i;
|
||||
XID recordingClient;
|
||||
|
||||
+ /* LimitClients is 2048 at max, way less that MAXINT */
|
||||
+ if (stuff->nClients > LimitClients)
|
||||
+ return BadValue;
|
||||
+
|
||||
+ if (stuff->nRanges > (MAXINT - 4 * stuff->nClients) / SIZEOF(xRecordRange))
|
||||
+ return BadValue;
|
||||
+
|
||||
if (((client->req_len << 2) - SIZEOF(xRecordRegisterClientsReq)) !=
|
||||
4 * stuff->nClients + SIZEOF(xRecordRange) * stuff->nRanges)
|
||||
return BadLength;
|
||||
--
|
||||
2.40.0
|
||||
45
meta/recipes-graphics/xwayland/xwayland/CVE-2025-49180.patch
Normal file
45
meta/recipes-graphics/xwayland/xwayland/CVE-2025-49180.patch
Normal file
@@ -0,0 +1,45 @@
|
||||
From 3c3a4b767b16174d3213055947ea7f4f88e10ec6 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Tue, 20 May 2025 15:18:19 +0200
|
||||
Subject: [PATCH] randr: Check for overflow in RRChangeProviderProperty()
|
||||
|
||||
A client might send a request causing an integer overflow when computing
|
||||
the total size to allocate in RRChangeProviderProperty().
|
||||
|
||||
To avoid the issue, check that total length in bytes won't exceed the
|
||||
maximum integer value.
|
||||
|
||||
CVE-2025-49180
|
||||
|
||||
This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
|
||||
reported by Julian Suleder via ERNW Vulnerability Disclosure.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
|
||||
|
||||
CVE: CVE-2025-49180
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/3c3a4b767b16174d3213055947ea7f4f88e10ec6]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
randr/rrproviderproperty.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/randr/rrproviderproperty.c b/randr/rrproviderproperty.c
|
||||
index 90c5a9a..0aa35ad 100644
|
||||
--- a/randr/rrproviderproperty.c
|
||||
+++ b/randr/rrproviderproperty.c
|
||||
@@ -179,7 +179,8 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type,
|
||||
|
||||
if (mode == PropModeReplace || len > 0) {
|
||||
void *new_data = NULL, *old_data = NULL;
|
||||
-
|
||||
+ if (total_len > MAXINT / size_in_bytes)
|
||||
+ return BadValue;
|
||||
total_size = total_len * size_in_bytes;
|
||||
new_value.data = (void *) malloc(total_size);
|
||||
if (!new_value.data && total_size) {
|
||||
--
|
||||
2.40.0
|
||||
@@ -43,6 +43,13 @@ SRC_URI = "https://www.x.org/archive/individual/xserver/xwayland-${PV}.tar.xz \
|
||||
file://CVE-2025-26601-3.patch \
|
||||
file://CVE-2025-26601-4.patch \
|
||||
file://CVE-2022-49737.patch \
|
||||
file://CVE-2025-49175.patch \
|
||||
file://CVE-2025-49176-0001.patch \
|
||||
file://CVE-2025-49176-0002.patch \
|
||||
file://CVE-2025-49177.patch \
|
||||
file://CVE-2025-49178.patch \
|
||||
file://CVE-2025-49179.patch \
|
||||
file://CVE-2025-49180.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73"
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ python () {
|
||||
raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
|
||||
}
|
||||
|
||||
SRCREV_machine ?= "90d8b830089647dcc97fd836c4f1fde65f24f6d6"
|
||||
SRCREV_meta ?= "9c4fc176eca557a5763bda2831fa5ea2985fadeb"
|
||||
SRCREV_machine ?= "76da2cf32fe004e10f581744496e71547d0a4361"
|
||||
SRCREV_meta ?= "5932fcfa6982f5b86a13849b84ef3d80a557a030"
|
||||
|
||||
SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \
|
||||
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.15;destsuffix=${KMETA}"
|
||||
|
||||
LINUX_VERSION ?= "5.15.184"
|
||||
LINUX_VERSION ?= "5.15.186"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ KCONFIG_MODE = "--allnoconfig"
|
||||
|
||||
require recipes-kernel/linux/linux-yocto.inc
|
||||
|
||||
LINUX_VERSION ?= "5.15.184"
|
||||
LINUX_VERSION ?= "5.15.186"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
@@ -14,8 +14,8 @@ DEPENDS += "openssl-native util-linux-native"
|
||||
KMETA = "kernel-meta"
|
||||
KCONF_BSP_AUDIT_LEVEL = "2"
|
||||
|
||||
SRCREV_machine ?= "660c504885ff7bd0edf06980c19539373e6bba05"
|
||||
SRCREV_meta ?= "9c4fc176eca557a5763bda2831fa5ea2985fadeb"
|
||||
SRCREV_machine ?= "4175c60a7b8e282d802be846bae75eeba398969e"
|
||||
SRCREV_meta ?= "5932fcfa6982f5b86a13849b84ef3d80a557a030"
|
||||
|
||||
PV = "${LINUX_VERSION}+git${SRCPV}"
|
||||
|
||||
|
||||
@@ -14,24 +14,24 @@ KBRANCH:qemux86 ?= "v5.15/standard/base"
|
||||
KBRANCH:qemux86-64 ?= "v5.15/standard/base"
|
||||
KBRANCH:qemumips64 ?= "v5.15/standard/mti-malta64"
|
||||
|
||||
SRCREV_machine:qemuarm ?= "27eaa24a0448c2ec0a7402e76fd208b6e2998eda"
|
||||
SRCREV_machine:qemuarm64 ?= "f97f77899cbaf0bd844d15f9eeceac0ead4c8a76"
|
||||
SRCREV_machine:qemumips ?= "a76e6f5b3fe8e298e66874f5e7e03acc3a0097ca"
|
||||
SRCREV_machine:qemuppc ?= "1fc08762bbe900514d2a810a1b48d70e8c3f045e"
|
||||
SRCREV_machine:qemuriscv64 ?= "9a9d15d3fcaa246682b1283a37af48a9c71b6b13"
|
||||
SRCREV_machine:qemuriscv32 ?= "9a9d15d3fcaa246682b1283a37af48a9c71b6b13"
|
||||
SRCREV_machine:qemux86 ?= "9a9d15d3fcaa246682b1283a37af48a9c71b6b13"
|
||||
SRCREV_machine:qemux86-64 ?= "9a9d15d3fcaa246682b1283a37af48a9c71b6b13"
|
||||
SRCREV_machine:qemumips64 ?= "19e099ff3a9f78fe5f88c4dc44ab4f28b2981c25"
|
||||
SRCREV_machine ?= "9a9d15d3fcaa246682b1283a37af48a9c71b6b13"
|
||||
SRCREV_meta ?= "9c4fc176eca557a5763bda2831fa5ea2985fadeb"
|
||||
SRCREV_machine:qemuarm ?= "d93c7fcf604b572bf93497e00017f9cf34fa34c7"
|
||||
SRCREV_machine:qemuarm64 ?= "9e9701d7239420165b342f3c363961ee3040a91e"
|
||||
SRCREV_machine:qemumips ?= "be5800a6d9002fd12668c0f8ada68ad7cab4398c"
|
||||
SRCREV_machine:qemuppc ?= "6fa52ff2eb31c6855f51a0d4f96339c50437d139"
|
||||
SRCREV_machine:qemuriscv64 ?= "48702d462c58d69b4b382bb34984f2f0881d0bb1"
|
||||
SRCREV_machine:qemuriscv32 ?= "48702d462c58d69b4b382bb34984f2f0881d0bb1"
|
||||
SRCREV_machine:qemux86 ?= "48702d462c58d69b4b382bb34984f2f0881d0bb1"
|
||||
SRCREV_machine:qemux86-64 ?= "48702d462c58d69b4b382bb34984f2f0881d0bb1"
|
||||
SRCREV_machine:qemumips64 ?= "bb909213f7e13fd17e39d95e5d1b646a7b0bacf2"
|
||||
SRCREV_machine ?= "48702d462c58d69b4b382bb34984f2f0881d0bb1"
|
||||
SRCREV_meta ?= "5932fcfa6982f5b86a13849b84ef3d80a557a030"
|
||||
|
||||
# set your preferred provider of linux-yocto to 'linux-yocto-upstream', and you'll
|
||||
# get the <version>/base branch, which is pure upstream -stable, and the same
|
||||
# meta SRCREV as the linux-yocto-standard builds. Select your version using the
|
||||
# normal PREFERRED_VERSION settings.
|
||||
BBCLASSEXTEND = "devupstream:target"
|
||||
SRCREV_machine:class-devupstream ?= "98f47d0e9b8c557d3063d3ea661cbea1489af330"
|
||||
SRCREV_machine:class-devupstream ?= "1c700860e8bc079c5c71d73c55e51865d273943c"
|
||||
PN:class-devupstream = "linux-yocto-upstream"
|
||||
KBRANCH:class-devupstream = "v5.15/base"
|
||||
|
||||
@@ -39,7 +39,7 @@ SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRA
|
||||
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.15;destsuffix=${KMETA}"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
|
||||
LINUX_VERSION ?= "5.15.184"
|
||||
LINUX_VERSION ?= "5.15.186"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
DEPENDS += "openssl-native util-linux-native"
|
||||
|
||||
@@ -90,6 +90,12 @@ CVE_CHECK_IGNORE += "CVE-2025-1373"
|
||||
# bugfix: https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/3bc28e9d1ab33627cea3c632dd6b0c33e22e93ba
|
||||
CVE_CHECK_IGNORE += "CVE-2022-48434"
|
||||
|
||||
# These two vulnerabilities were fixed in 5.0.3
|
||||
# bugfix: https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/2cdddcd6ec90c7a248ffe792d85faa4d89eab9f7
|
||||
CVE_CHECK_IGNORE += "CVE-2022-3109"
|
||||
# bugfix: https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/481e81be1271ac9a0124ee615700390c2371bd89
|
||||
CVE_CHECK_IGNORE += "CVE-2022-3341"
|
||||
|
||||
# Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717
|
||||
ARM_INSTRUCTION_SET:armv4 = "arm"
|
||||
ARM_INSTRUCTION_SET:armv5 = "arm"
|
||||
|
||||
340
meta/recipes-support/curl/curl/CVE-2024-11053-0001.patch
Normal file
340
meta/recipes-support/curl/curl/CVE-2024-11053-0001.patch
Normal file
@@ -0,0 +1,340 @@
|
||||
From 9bee39bfed2c413b4cc4eb306a57ac92a1854907 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Sat, 12 Oct 2024 23:54:39 +0200
|
||||
Subject: [PATCH] url: use same credentials on redirect
|
||||
|
||||
Previously it could lose the username and only use the password.
|
||||
|
||||
Added test 998 and 999 to verify.
|
||||
|
||||
Reported-by: Tobias Bora
|
||||
Fixes #15262
|
||||
Closes #15282
|
||||
|
||||
CVE: CVE-2024-11053
|
||||
Upstream-Status: Backport [https://github.com/curl/curl/commit/9bee39bfed2c413b4cc4eb306a57ac92a1854907]
|
||||
|
||||
Changes:
|
||||
- Refresh patch context.
|
||||
- Small change in the Makefile to add a new test.
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
lib/transfer.c | 3 ++
|
||||
lib/url.c | 18 ++++----
|
||||
lib/urldata.h | 8 ++++
|
||||
tests/data/Makefile.inc | 2 +-
|
||||
tests/data/test998 | 92 +++++++++++++++++++++++++++++++++++++++++
|
||||
tests/data/test999 | 81 ++++++++++++++++++++++++++++++++++++
|
||||
6 files changed, 194 insertions(+), 10 deletions(-)
|
||||
create mode 100644 tests/data/test998
|
||||
create mode 100644 tests/data/test999
|
||||
|
||||
diff --git a/lib/transfer.c b/lib/transfer.c
|
||||
index d567c4b..cd7365b 100644
|
||||
--- a/lib/transfer.c
|
||||
+++ b/lib/transfer.c
|
||||
@@ -1479,6 +1479,9 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
+ if(data->set.str[STRING_USERNAME] ||
|
||||
+ data->set.str[STRING_PASSWORD])
|
||||
+ data->state.creds_from = CREDS_OPTION;
|
||||
if(!result)
|
||||
result = Curl_setstropt(&data->state.aptr.user,
|
||||
data->set.str[STRING_USERNAME]);
|
||||
diff --git a/lib/url.c b/lib/url.c
|
||||
index 9406cca..99d1082 100644
|
||||
--- a/lib/url.c
|
||||
+++ b/lib/url.c
|
||||
@@ -2098,10 +2098,10 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
||||
return result;
|
||||
|
||||
/*
|
||||
- * User name and password set with their own options override the
|
||||
- * credentials possibly set in the URL.
|
||||
+ * username and password set with their own options override the credentials
|
||||
+ * possibly set in the URL, but netrc does not.
|
||||
*/
|
||||
- if(!data->state.aptr.passwd) {
|
||||
+ if(!data->state.aptr.passwd || (data->state.creds_from != CREDS_OPTION)) {
|
||||
uc = curl_url_get(uh, CURLUPART_PASSWORD, &data->state.up.password, 0);
|
||||
if(!uc) {
|
||||
char *decoded;
|
||||
@@ -2112,6 +2112,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
||||
return result;
|
||||
conn->passwd = decoded;
|
||||
result = Curl_setstropt(&data->state.aptr.passwd, decoded);
|
||||
+ data->state.creds_from = CREDS_URL;
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
@@ -2119,7 +2120,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
||||
return Curl_uc_to_curlcode(uc);
|
||||
}
|
||||
|
||||
- if(!data->state.aptr.user) {
|
||||
+ if(!data->state.aptr.user || (data->state.creds_from != CREDS_OPTION)) {
|
||||
/* we don't use the URL API's URL decoder option here since it rejects
|
||||
control codes and we want to allow them for some schemes in the user
|
||||
and password fields */
|
||||
@@ -2133,13 +2134,10 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
||||
return result;
|
||||
conn->user = decoded;
|
||||
result = Curl_setstropt(&data->state.aptr.user, decoded);
|
||||
+ data->state.creds_from = CREDS_URL;
|
||||
}
|
||||
else if(uc != CURLUE_NO_USER)
|
||||
return Curl_uc_to_curlcode(uc);
|
||||
- else if(data->state.aptr.passwd) {
|
||||
- /* no user was set but a password, set a blank user */
|
||||
- result = Curl_setstropt(&data->state.aptr.user, "");
|
||||
- }
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
@@ -3032,7 +3030,8 @@ static CURLcode override_login(struct Curl_easy *data,
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
- if(data->state.aptr.user) {
|
||||
+ if(data->state.aptr.user &&
|
||||
+ (data->state.creds_from != CREDS_NETRC)) {
|
||||
uc = curl_url_set(data->state.uh, CURLUPART_USER, data->state.aptr.user,
|
||||
CURLU_URLENCODE);
|
||||
if(uc)
|
||||
@@ -3048,6 +3047,7 @@ static CURLcode override_login(struct Curl_easy *data,
|
||||
CURLcode result = Curl_setstropt(&data->state.aptr.passwd, *passwdp);
|
||||
if(result)
|
||||
return result;
|
||||
+ data->state.creds_from = CREDS_NETRC;
|
||||
}
|
||||
if(data->state.aptr.passwd) {
|
||||
uc = curl_url_set(data->state.uh, CURLUPART_PASSWORD,
|
||||
diff --git a/lib/urldata.h b/lib/urldata.h
|
||||
index e78a7e8..d252e73 100644
|
||||
--- a/lib/urldata.h
|
||||
+++ b/lib/urldata.h
|
||||
@@ -1324,6 +1324,11 @@ struct urlpieces {
|
||||
char *query;
|
||||
};
|
||||
|
||||
+#define CREDS_NONE 0
|
||||
+#define CREDS_URL 1 /* from URL */
|
||||
+#define CREDS_OPTION 2 /* set with a CURLOPT_ */
|
||||
+#define CREDS_NETRC 3 /* found in netrc */
|
||||
+
|
||||
struct UrlState {
|
||||
/* Points to the connection cache */
|
||||
struct conncache *conn_cache;
|
||||
@@ -1454,6 +1459,9 @@ struct UrlState {
|
||||
char *proxypasswd;
|
||||
} aptr;
|
||||
|
||||
+ unsigned int creds_from:2; /* where is the server credentials originating
|
||||
+ from, see the CREDS_* defines above */
|
||||
+
|
||||
#ifdef CURLDEBUG
|
||||
BIT(conncache_lock);
|
||||
#endif
|
||||
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
|
||||
index 5415f37..00cdfb8 100644
|
||||
--- a/tests/data/Makefile.inc
|
||||
+++ b/tests/data/Makefile.inc
|
||||
@@ -123,7 +123,7 @@ test954 test955 test956 test957 test958 test959 test960 test961 test962 \
|
||||
test963 test964 test965 test966 test967 test968 test969 test970 test971 \
|
||||
test972 \
|
||||
\
|
||||
-test980 test981 test982 test983 test984 test985 test986 \
|
||||
+test980 test981 test982 test983 test984 test985 test986 test998 test999 \
|
||||
\
|
||||
test1000 test1001 test1002 test1003 test1004 test1005 test1006 test1007 \
|
||||
test1008 test1009 test1010 test1011 test1012 test1013 test1014 test1015 \
|
||||
diff --git a/tests/data/test998 b/tests/data/test998
|
||||
new file mode 100644
|
||||
index 0000000..6dcd95f
|
||||
--- /dev/null
|
||||
+++ b/tests/data/test998
|
||||
@@ -0,0 +1,92 @@
|
||||
+<testcase>
|
||||
+<info>
|
||||
+<keywords>
|
||||
+HTTP
|
||||
+--location-trusted
|
||||
+</keywords>
|
||||
+</info>
|
||||
+
|
||||
+#
|
||||
+# Server-side
|
||||
+<reply>
|
||||
+<data>
|
||||
+HTTP/1.1 301 redirect
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Server: test-server/fake
|
||||
+Content-Length: 0
|
||||
+Connection: close
|
||||
+Content-Type: text/html
|
||||
+Location: http://somewhere.else.example/a/path/%TESTNUMBER0002
|
||||
+
|
||||
+</data>
|
||||
+<data2>
|
||||
+HTTP/1.1 200 OK
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Content-Length: 6
|
||||
+Content-Type: text/html
|
||||
+Funny-head: yesyes
|
||||
+
|
||||
+-foo-
|
||||
+</data2>
|
||||
+
|
||||
+<datacheck>
|
||||
+HTTP/1.1 301 redirect
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Server: test-server/fake
|
||||
+Content-Length: 0
|
||||
+Connection: close
|
||||
+Content-Type: text/html
|
||||
+Location: http://somewhere.else.example/a/path/%TESTNUMBER0002
|
||||
+
|
||||
+HTTP/1.1 200 OK
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Content-Length: 6
|
||||
+Content-Type: text/html
|
||||
+Funny-head: yesyes
|
||||
+
|
||||
+-foo-
|
||||
+</datacheck>
|
||||
+
|
||||
+</reply>
|
||||
+
|
||||
+#
|
||||
+# Client-side
|
||||
+<client>
|
||||
+<features>
|
||||
+proxy
|
||||
+</features>
|
||||
+<server>
|
||||
+http
|
||||
+</server>
|
||||
+<name>
|
||||
+HTTP with auth in URL redirected to another host
|
||||
+</name>
|
||||
+<command>
|
||||
+-x %HOSTIP:%HTTPPORT http://alberto:einstein@somwhere.example/%TESTNUMBER --location-trusted
|
||||
+</command>
|
||||
+</client>
|
||||
+
|
||||
+#
|
||||
+# Verify data after the test has been "shot"
|
||||
+<verify>
|
||||
+<strip>
|
||||
+QUIT
|
||||
+</strip>
|
||||
+<protocol>
|
||||
+GET http://somwhere.example/998 HTTP/1.1
|
||||
+Host: somwhere.example
|
||||
+Authorization: Basic YWxiZXJ0bzplaW5zdGVpbg==
|
||||
+User-Agent: curl/%VERSION
|
||||
+Accept: */*
|
||||
+Proxy-Connection: Keep-Alive
|
||||
+
|
||||
+GET http://somewhere.else.example/a/path/9980002 HTTP/1.1
|
||||
+Host: somewhere.else.example
|
||||
+Authorization: Basic YWxiZXJ0bzplaW5zdGVpbg==
|
||||
+User-Agent: curl/%VERSION
|
||||
+Accept: */*
|
||||
+Proxy-Connection: Keep-Alive
|
||||
+
|
||||
+</protocol>
|
||||
+</verify>
|
||||
+</testcase>
|
||||
diff --git a/tests/data/test999 b/tests/data/test999
|
||||
new file mode 100644
|
||||
index 0000000..e805cde
|
||||
--- /dev/null
|
||||
+++ b/tests/data/test999
|
||||
@@ -0,0 +1,81 @@
|
||||
+<testcase>
|
||||
+<info>
|
||||
+<keywords>
|
||||
+HTTP
|
||||
+--location-trusted
|
||||
+</keywords>
|
||||
+</info>
|
||||
+
|
||||
+#
|
||||
+# Server-side
|
||||
+<reply>
|
||||
+<data nocheck="yes">
|
||||
+HTTP/1.1 200 OK
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Content-Length: 6
|
||||
+Content-Type: text/html
|
||||
+Funny-head: yesyes
|
||||
+
|
||||
+-foo-
|
||||
+</data>
|
||||
+
|
||||
+<datacheck>
|
||||
+HTTP/1.1 301 redirect
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Server: test-server/fake
|
||||
+Content-Length: 0
|
||||
+Connection: close
|
||||
+Content-Type: text/html
|
||||
+Location: http://somewhere.else.example/a/path/%TESTNUMBER0002
|
||||
+
|
||||
+HTTP/1.1 200 OK
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Content-Length: 6
|
||||
+Content-Type: text/html
|
||||
+Funny-head: yesyes
|
||||
+
|
||||
+-foo-
|
||||
+</datacheck>
|
||||
+
|
||||
+</reply>
|
||||
+
|
||||
+#
|
||||
+# Client-side
|
||||
+<client>
|
||||
+<features>
|
||||
+proxy
|
||||
+</features>
|
||||
+<server>
|
||||
+http
|
||||
+</server>
|
||||
+<name>
|
||||
+HTTP with auth in first URL but not second
|
||||
+</name>
|
||||
+<command>
|
||||
+-x %HOSTIP:%HTTPPORT http://alberto:einstein@somwhere.example/%TESTNUMBER http://somewhere.else.example/%TESTNUMBER
|
||||
+</command>
|
||||
+</client>
|
||||
+
|
||||
+#
|
||||
+# Verify data after the test has been "shot"
|
||||
+<verify>
|
||||
+<strip>
|
||||
+QUIT
|
||||
+</strip>
|
||||
+<protocol>
|
||||
+GET http://somwhere.example/%TESTNUMBER HTTP/1.1
|
||||
+Host: somwhere.example
|
||||
+Authorization: Basic YWxiZXJ0bzplaW5zdGVpbg==
|
||||
+User-Agent: curl/%VERSION
|
||||
+Accept: */*
|
||||
+Proxy-Connection: Keep-Alive
|
||||
+
|
||||
+GET http://somewhere.else.example/%TESTNUMBER HTTP/1.1
|
||||
+Host: somewhere.else.example
|
||||
+User-Agent: curl/%VERSION
|
||||
+Accept: */*
|
||||
+Proxy-Connection: Keep-Alive
|
||||
+
|
||||
+</protocol>
|
||||
+</verify>
|
||||
+</testcase>
|
||||
--
|
||||
2.40.0
|
||||
746
meta/recipes-support/curl/curl/CVE-2024-11053-0002.patch
Normal file
746
meta/recipes-support/curl/curl/CVE-2024-11053-0002.patch
Normal file
@@ -0,0 +1,746 @@
|
||||
From e9b9bbac22c26cf67316fa8e6c6b9e831af31949 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Fri, 15 Nov 2024 11:06:36 +0100
|
||||
Subject: [PATCH] netrc: address several netrc parser flaws
|
||||
|
||||
- make sure that a match that returns a username also returns a
|
||||
password, that should be blank if no password is found
|
||||
|
||||
- fix handling of multiple logins for same host where the password/login
|
||||
order might be reversed.
|
||||
|
||||
- reject credentials provided in the .netrc if they contain ASCII control
|
||||
codes - if the used protocol does not support such (like HTTP and WS do)
|
||||
|
||||
Reported-by: Harry Sintonen
|
||||
|
||||
Add test 478, 479 and 480 to verify. Updated unit 1304.
|
||||
|
||||
Closes #15586
|
||||
|
||||
Changes:
|
||||
- Refresh patch context.
|
||||
- Adjust `%LOGDIR/` to 'log/' due to its absence in code.
|
||||
- Replaces the previous usage of the state_login, state_password, and
|
||||
state_our_login variables with the found_state enum, which includes the
|
||||
values NONE, LOGIN, and PASSWORD. As a result, all conditionals and memory
|
||||
management logic associated with these variables were updated.
|
||||
- Updates to use password and login instead of s_password and s_login,
|
||||
which do not exist in the current version. This change preserves the
|
||||
same logic while adapting the code to the current structure.
|
||||
- test478 is disabled as this version of curl does not support searching
|
||||
for a specific login in the netrc file.
|
||||
(see https://github.com/curl/curl/issues/8241)
|
||||
- test480 is disabled as this version of curl does not support quoted or
|
||||
escaped strings in the netrc file.
|
||||
(see https://github.com/curl/curl/issues/8908)
|
||||
- Small change in the Makefile to add a new test
|
||||
|
||||
CVE: CVE-2024-11053
|
||||
Upstream-Status: Backport [https://github.com/curl/curl/commit/e9b9bbac22c26cf67316fa8e6c6b9e831af31949]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
lib/netrc.c | 121 ++++++++++++++++++++++------------------
|
||||
lib/url.c | 53 ++++++++++++------
|
||||
tests/data/DISABLED | 3 +
|
||||
tests/data/Makefile.inc | 2 +-
|
||||
tests/data/test478 | 73 ++++++++++++++++++++++++
|
||||
tests/data/test479 | 107 +++++++++++++++++++++++++++++++++++
|
||||
tests/data/test480 | 38 +++++++++++++
|
||||
tests/unit/unit1304.c | 81 +++++++--------------------
|
||||
8 files changed, 348 insertions(+), 130 deletions(-)
|
||||
create mode 100644 tests/data/test478
|
||||
create mode 100644 tests/data/test479
|
||||
create mode 100644 tests/data/test480
|
||||
|
||||
diff --git a/lib/netrc.c b/lib/netrc.c
|
||||
index b771b60..23080b3 100644
|
||||
--- a/lib/netrc.c
|
||||
+++ b/lib/netrc.c
|
||||
@@ -46,6 +46,15 @@ enum host_lookup_state {
|
||||
MACDEF
|
||||
};
|
||||
|
||||
+enum found_state {
|
||||
+ NONE,
|
||||
+ LOGIN,
|
||||
+ PASSWORD
|
||||
+};
|
||||
+
|
||||
+#define FOUND_LOGIN 1
|
||||
+#define FOUND_PASSWORD 2
|
||||
+
|
||||
#define NETRC_FILE_MISSING 1
|
||||
#define NETRC_FAILED -1
|
||||
#define NETRC_SUCCESS 0
|
||||
@@ -54,7 +63,7 @@ enum host_lookup_state {
|
||||
* Returns zero on success.
|
||||
*/
|
||||
static int parsenetrc(const char *host,
|
||||
- char **loginp,
|
||||
+ char **loginp, /* might point to a username */
|
||||
char **passwordp,
|
||||
bool *login_changed,
|
||||
bool *password_changed,
|
||||
@@ -63,16 +72,14 @@ static int parsenetrc(const char *host,
|
||||
FILE *file;
|
||||
int retcode = NETRC_FILE_MISSING;
|
||||
char *login = *loginp;
|
||||
- char *password = *passwordp;
|
||||
- bool specific_login = (login && *login != 0);
|
||||
- bool login_alloc = FALSE;
|
||||
- bool password_alloc = FALSE;
|
||||
+ char *password = NULL;
|
||||
+ bool specific_login = login; /* points to something */
|
||||
enum host_lookup_state state = NOTHING;
|
||||
|
||||
- char state_login = 0; /* Found a login keyword */
|
||||
- char state_password = 0; /* Found a password keyword */
|
||||
- int state_our_login = FALSE; /* With specific_login, found *our* login
|
||||
- name */
|
||||
+ enum found_state keyword = NONE;
|
||||
+ unsigned char found = 0; /* login + password found bits, as they can come in
|
||||
+ any order */
|
||||
+ bool our_login = FALSE; /* found our login name */
|
||||
|
||||
DEBUGASSERT(netrcfile);
|
||||
|
||||
@@ -95,11 +102,7 @@ static int parsenetrc(const char *host,
|
||||
if(tok && *tok == '#')
|
||||
/* treat an initial hash as a comment line */
|
||||
continue;
|
||||
- while(tok) {
|
||||
- if((login && *login) && (password && *password)) {
|
||||
- done = TRUE;
|
||||
- break;
|
||||
- }
|
||||
+ while(tok && !done) {
|
||||
|
||||
switch(state) {
|
||||
case NOTHING:
|
||||
@@ -115,6 +118,12 @@ static int parsenetrc(const char *host,
|
||||
after this we need to search for 'login' and
|
||||
'password'. */
|
||||
state = HOSTFOUND;
|
||||
+ keyword = NONE;
|
||||
+ found = 0;
|
||||
+ our_login = FALSE;
|
||||
+ Curl_safefree(password);
|
||||
+ if(!specific_login)
|
||||
+ Curl_safefree(login);
|
||||
}
|
||||
else if(strcasecompare("default", tok)) {
|
||||
state = HOSTVALID;
|
||||
@@ -138,48 +147,55 @@ static int parsenetrc(const char *host,
|
||||
break;
|
||||
case HOSTVALID:
|
||||
/* we are now parsing sub-keywords concerning "our" host */
|
||||
- if(state_login) {
|
||||
+ if(keyword == LOGIN) {
|
||||
if(specific_login) {
|
||||
- state_our_login = !Curl_timestrcmp(login, tok);
|
||||
+ our_login = !Curl_timestrcmp(login, tok);
|
||||
}
|
||||
- else if(!login || Curl_timestrcmp(login, tok)) {
|
||||
- if(login_alloc) {
|
||||
- free(login);
|
||||
- login_alloc = FALSE;
|
||||
- }
|
||||
+ else {
|
||||
+ our_login = TRUE;
|
||||
+ free(login);
|
||||
login = strdup(tok);
|
||||
if(!login) {
|
||||
retcode = NETRC_FAILED; /* allocation failed */
|
||||
goto out;
|
||||
}
|
||||
- login_alloc = TRUE;
|
||||
}
|
||||
- state_login = 0;
|
||||
+ found |= FOUND_LOGIN;
|
||||
+ keyword = NONE;
|
||||
}
|
||||
- else if(state_password) {
|
||||
- if((state_our_login || !specific_login)
|
||||
- && (!password || Curl_timestrcmp(password, tok))) {
|
||||
- if(password_alloc) {
|
||||
- free(password);
|
||||
- password_alloc = FALSE;
|
||||
- }
|
||||
- password = strdup(tok);
|
||||
- if(!password) {
|
||||
- retcode = NETRC_FAILED; /* allocation failed */
|
||||
- goto out;
|
||||
- }
|
||||
- password_alloc = TRUE;
|
||||
+ else if(keyword == PASSWORD) {
|
||||
+ free(password);
|
||||
+ password = strdup(tok);
|
||||
+ if(!password) {
|
||||
+ retcode = NETRC_FAILED; /* allocation failed */
|
||||
+ goto out;
|
||||
}
|
||||
- state_password = 0;
|
||||
+ found |= FOUND_PASSWORD;
|
||||
+ keyword = NONE;
|
||||
}
|
||||
else if(strcasecompare("login", tok))
|
||||
- state_login = 1;
|
||||
+ keyword = LOGIN;
|
||||
else if(strcasecompare("password", tok))
|
||||
- state_password = 1;
|
||||
+ keyword = PASSWORD;
|
||||
else if(strcasecompare("machine", tok)) {
|
||||
- /* ok, there's machine here go => */
|
||||
+ /* a new machine here */
|
||||
state = HOSTFOUND;
|
||||
- state_our_login = FALSE;
|
||||
+ keyword = NONE;
|
||||
+ found = 0;
|
||||
+ Curl_safefree(password);
|
||||
+ if(!specific_login)
|
||||
+ Curl_safefree(login);
|
||||
+ }
|
||||
+ else if(strcasecompare("default", tok)) {
|
||||
+ state = HOSTVALID;
|
||||
+ retcode = NETRC_SUCCESS; /* we did find our host */
|
||||
+ Curl_safefree(password);
|
||||
+ if(!specific_login)
|
||||
+ Curl_safefree(login);
|
||||
+ }
|
||||
+ if((found == (FOUND_PASSWORD|FOUND_LOGIN)) && our_login) {
|
||||
+ done = TRUE;
|
||||
+ break;
|
||||
}
|
||||
break;
|
||||
} /* switch (state) */
|
||||
@@ -189,28 +205,27 @@ static int parsenetrc(const char *host,
|
||||
} /* while fgets() */
|
||||
|
||||
out:
|
||||
+ if(!retcode && !password && our_login) {
|
||||
+ /* success without a password, set a blank one */
|
||||
+ password = strdup("");
|
||||
+ if(!password)
|
||||
+ retcode = 1; /* out of memory */
|
||||
+ }
|
||||
if(!retcode) {
|
||||
/* success */
|
||||
*login_changed = FALSE;
|
||||
*password_changed = FALSE;
|
||||
- if(login_alloc) {
|
||||
- if(*loginp)
|
||||
- free(*loginp);
|
||||
+ if(!specific_login) {
|
||||
*loginp = login;
|
||||
*login_changed = TRUE;
|
||||
}
|
||||
- if(password_alloc) {
|
||||
- if(*passwordp)
|
||||
- free(*passwordp);
|
||||
- *passwordp = password;
|
||||
- *password_changed = TRUE;
|
||||
- }
|
||||
+ *passwordp = password;
|
||||
+ *password_changed = TRUE;
|
||||
}
|
||||
else {
|
||||
- if(login_alloc)
|
||||
+ if(!specific_login)
|
||||
free(login);
|
||||
- if(password_alloc)
|
||||
- free(password);
|
||||
+ free(password);
|
||||
}
|
||||
fclose(file);
|
||||
}
|
||||
diff --git a/lib/url.c b/lib/url.c
|
||||
index 99d1082..48835c9 100644
|
||||
--- a/lib/url.c
|
||||
+++ b/lib/url.c
|
||||
@@ -2954,6 +2954,17 @@ static CURLcode parse_remote_port(struct Curl_easy *data,
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
+static bool str_has_ctrl(const char *input)
|
||||
+{
|
||||
+ const unsigned char *str = (const unsigned char *)input;
|
||||
+ while(*str) {
|
||||
+ if(*str < 0x20)
|
||||
+ return TRUE;
|
||||
+ str++;
|
||||
+ }
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* Override the login details from the URL with that in the CURLOPT_USERPWD
|
||||
* option or a .netrc file, if applicable.
|
||||
@@ -2995,22 +3006,32 @@ static CURLcode override_login(struct Curl_easy *data,
|
||||
url_provided = TRUE;
|
||||
}
|
||||
|
||||
- ret = Curl_parsenetrc(conn->host.name,
|
||||
- userp, passwdp,
|
||||
- &netrc_user_changed, &netrc_passwd_changed,
|
||||
- data->set.str[STRING_NETRC_FILE]);
|
||||
- if(ret > 0) {
|
||||
- infof(data, "Couldn't find host %s in the %s file; using defaults",
|
||||
- conn->host.name, data->set.str[STRING_NETRC_FILE]);
|
||||
- }
|
||||
- else if(ret < 0) {
|
||||
- return CURLE_OUT_OF_MEMORY;
|
||||
- }
|
||||
- else {
|
||||
- /* set bits.netrc TRUE to remember that we got the name from a .netrc
|
||||
- file, so that it is safe to use even if we followed a Location: to a
|
||||
- different host or similar. */
|
||||
- conn->bits.netrc = TRUE;
|
||||
+ if(!*passwdp) {
|
||||
+ ret = Curl_parsenetrc(conn->host.name,
|
||||
+ userp, passwdp,
|
||||
+ &netrc_user_changed, &netrc_passwd_changed,
|
||||
+ data->set.str[STRING_NETRC_FILE]);
|
||||
+ if(ret > 0) {
|
||||
+ infof(data, "Couldn't find host %s in the %s file; using defaults",
|
||||
+ conn->host.name, data->set.str[STRING_NETRC_FILE]);
|
||||
+ }
|
||||
+ else if(ret < 0) {
|
||||
+ return CURLE_OUT_OF_MEMORY;
|
||||
+ }
|
||||
+ else {
|
||||
+ if(!(conn->handler->flags&PROTOPT_USERPWDCTRL)) {
|
||||
+ /* if the protocol can't handle control codes in credentials, make
|
||||
+ sure there are none */
|
||||
+ if(str_has_ctrl(*userp) || str_has_ctrl(*passwdp)) {
|
||||
+ failf(data, "control code detected in .netrc credentials");
|
||||
+ return CURLE_READ_ERROR;
|
||||
+ }
|
||||
+ }
|
||||
+ /* set bits.netrc TRUE to remember that we got the name from a .netrc
|
||||
+ file, so that it is safe to use even if we followed a Location: to a
|
||||
+ different host or similar. */
|
||||
+ conn->bits.netrc = TRUE;
|
||||
+ }
|
||||
}
|
||||
if(url_provided) {
|
||||
Curl_safefree(conn->user);
|
||||
diff --git a/tests/data/DISABLED b/tests/data/DISABLED
|
||||
index 7187ec3..4434c41 100644
|
||||
--- a/tests/data/DISABLED
|
||||
+++ b/tests/data/DISABLED
|
||||
@@ -85,3 +85,6 @@
|
||||
%if wolfssl
|
||||
313
|
||||
%endif
|
||||
+# 478 and 480 are backported and do not work with this version of curl
|
||||
+478
|
||||
+480
|
||||
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
|
||||
index 00cdfb8..ad41a5e 100644
|
||||
--- a/tests/data/Makefile.inc
|
||||
+++ b/tests/data/Makefile.inc
|
||||
@@ -73,7 +73,7 @@ test418 \
|
||||
\
|
||||
test430 test431 test432 test433 test434 test435 test436 \
|
||||
\
|
||||
-test446 \
|
||||
+test446 test478 test479 test480 \
|
||||
test490 test491 test492 test493 test494 \
|
||||
\
|
||||
test500 test501 test502 test503 test504 test505 test506 test507 test508 \
|
||||
diff --git a/tests/data/test478 b/tests/data/test478
|
||||
new file mode 100644
|
||||
index 0000000..c356ef5
|
||||
--- /dev/null
|
||||
+++ b/tests/data/test478
|
||||
@@ -0,0 +1,73 @@
|
||||
+<testcase>
|
||||
+<info>
|
||||
+<keywords>
|
||||
+netrc
|
||||
+HTTP
|
||||
+</keywords>
|
||||
+</info>
|
||||
+#
|
||||
+# Server-side
|
||||
+<reply>
|
||||
+<data crlf="yes">
|
||||
+HTTP/1.1 200 OK
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Server: test-server/fake
|
||||
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
||||
+ETag: "21025-dc7-39462498"
|
||||
+Accept-Ranges: bytes
|
||||
+Content-Length: 6
|
||||
+Connection: close
|
||||
+Content-Type: text/html
|
||||
+Funny-head: yesyes
|
||||
+
|
||||
+-foo-
|
||||
+</data>
|
||||
+</reply>
|
||||
+
|
||||
+#
|
||||
+# Client-side
|
||||
+<client>
|
||||
+<server>
|
||||
+http
|
||||
+</server>
|
||||
+<features>
|
||||
+proxy
|
||||
+</features>
|
||||
+<name>
|
||||
+.netrc with multiple accounts for same host
|
||||
+</name>
|
||||
+<command>
|
||||
+--netrc --netrc-file log/netrc%TESTNUMBER -x http://%HOSTIP:%HTTPPORT/ http://debbie@github.com/
|
||||
+</command>
|
||||
+<file name="log/netrc%TESTNUMBER" >
|
||||
+
|
||||
+machine github.com
|
||||
+password weird
|
||||
+password firstone
|
||||
+login daniel
|
||||
+
|
||||
+machine github.com
|
||||
+
|
||||
+machine github.com
|
||||
+login debbie
|
||||
+
|
||||
+machine github.com
|
||||
+password weird
|
||||
+password "second\r"
|
||||
+login debbie
|
||||
+
|
||||
+</file>
|
||||
+</client>
|
||||
+
|
||||
+<verify>
|
||||
+<protocol>
|
||||
+GET http://github.com/ HTTP/1.1
|
||||
+Host: github.com
|
||||
+Authorization: Basic %b64[debbie:second%0D]b64%
|
||||
+User-Agent: curl/%VERSION
|
||||
+Accept: */*
|
||||
+Proxy-Connection: Keep-Alive
|
||||
+
|
||||
+</protocol>
|
||||
+</verify>
|
||||
+</testcase>
|
||||
diff --git a/tests/data/test479 b/tests/data/test479
|
||||
new file mode 100644
|
||||
index 0000000..8d67fdf
|
||||
--- /dev/null
|
||||
+++ b/tests/data/test479
|
||||
@@ -0,0 +1,107 @@
|
||||
+<testcase>
|
||||
+<info>
|
||||
+<keywords>
|
||||
+netrc
|
||||
+HTTP
|
||||
+</keywords>
|
||||
+</info>
|
||||
+#
|
||||
+# Server-side
|
||||
+<reply>
|
||||
+<data crlf="yes">
|
||||
+HTTP/1.1 301 Follow this you fool
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Server: test-server/fake
|
||||
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
||||
+ETag: "21025-dc7-39462498"
|
||||
+Accept-Ranges: bytes
|
||||
+Content-Length: 6
|
||||
+Connection: close
|
||||
+Location: http://b.com/%TESTNUMBER0002
|
||||
+
|
||||
+-foo-
|
||||
+</data>
|
||||
+
|
||||
+<data2 crlf="yes">
|
||||
+HTTP/1.1 200 OK
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Server: test-server/fake
|
||||
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
||||
+ETag: "21025-dc7-39462498"
|
||||
+Accept-Ranges: bytes
|
||||
+Content-Length: 7
|
||||
+Connection: close
|
||||
+
|
||||
+target
|
||||
+</data2>
|
||||
+
|
||||
+<datacheck crlf="yes">
|
||||
+HTTP/1.1 301 Follow this you fool
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Server: test-server/fake
|
||||
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
||||
+ETag: "21025-dc7-39462498"
|
||||
+Accept-Ranges: bytes
|
||||
+Content-Length: 6
|
||||
+Connection: close
|
||||
+Location: http://b.com/%TESTNUMBER0002
|
||||
+
|
||||
+HTTP/1.1 200 OK
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Server: test-server/fake
|
||||
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
||||
+ETag: "21025-dc7-39462498"
|
||||
+Accept-Ranges: bytes
|
||||
+Content-Length: 7
|
||||
+Connection: close
|
||||
+
|
||||
+target
|
||||
+</datacheck>
|
||||
+</reply>
|
||||
+
|
||||
+#
|
||||
+# Client-side
|
||||
+<client>
|
||||
+<server>
|
||||
+http
|
||||
+</server>
|
||||
+<features>
|
||||
+proxy
|
||||
+</features>
|
||||
+<name>
|
||||
+.netrc with redirect and default without password
|
||||
+</name>
|
||||
+<command>
|
||||
+--netrc --netrc-file log/netrc%TESTNUMBER -L -x http://%HOSTIP:%HTTPPORT/ http://a.com/
|
||||
+</command>
|
||||
+<file name="log/netrc%TESTNUMBER" >
|
||||
+
|
||||
+machine a.com
|
||||
+ login alice
|
||||
+ password alicespassword
|
||||
+
|
||||
+default
|
||||
+ login bob
|
||||
+
|
||||
+</file>
|
||||
+</client>
|
||||
+
|
||||
+<verify>
|
||||
+<protocol>
|
||||
+GET http://a.com/ HTTP/1.1
|
||||
+Host: a.com
|
||||
+Authorization: Basic %b64[alice:alicespassword]b64%
|
||||
+User-Agent: curl/%VERSION
|
||||
+Accept: */*
|
||||
+Proxy-Connection: Keep-Alive
|
||||
+
|
||||
+GET http://b.com/%TESTNUMBER0002 HTTP/1.1
|
||||
+Host: b.com
|
||||
+Authorization: Basic %b64[bob:]b64%
|
||||
+User-Agent: curl/%VERSION
|
||||
+Accept: */*
|
||||
+Proxy-Connection: Keep-Alive
|
||||
+
|
||||
+</protocol>
|
||||
+</verify>
|
||||
+</testcase>
|
||||
diff --git a/tests/data/test480 b/tests/data/test480
|
||||
new file mode 100644
|
||||
index 0000000..f097f81
|
||||
--- /dev/null
|
||||
+++ b/tests/data/test480
|
||||
@@ -0,0 +1,38 @@
|
||||
+<testcase>
|
||||
+<info>
|
||||
+<keywords>
|
||||
+netrc
|
||||
+pop3
|
||||
+</keywords>
|
||||
+</info>
|
||||
+#
|
||||
+# Server-side
|
||||
+<reply>
|
||||
+
|
||||
+</reply>
|
||||
+
|
||||
+#
|
||||
+# Client-side
|
||||
+<client>
|
||||
+<server>
|
||||
+pop3
|
||||
+</server>
|
||||
+<name>
|
||||
+Reject .netrc with credentials using CRLF for POP3
|
||||
+</name>
|
||||
+<command>
|
||||
+--netrc --netrc-file log/netrc%TESTNUMBER pop3://%HOSTIP:%POP3PORT/%TESTNUMBER
|
||||
+</command>
|
||||
+<file name="log/netrc%TESTNUMBER" >
|
||||
+machine %HOSTIP
|
||||
+ login alice
|
||||
+ password "password\r\ncommand"
|
||||
+</file>
|
||||
+</client>
|
||||
+
|
||||
+<verify>
|
||||
+<errorcode>
|
||||
+26
|
||||
+</errorcode>
|
||||
+</verify>
|
||||
+</testcase>
|
||||
diff --git a/tests/unit/unit1304.c b/tests/unit/unit1304.c
|
||||
index a6dc64d..d2dba14 100644
|
||||
--- a/tests/unit/unit1304.c
|
||||
+++ b/tests/unit/unit1304.c
|
||||
@@ -29,13 +29,8 @@ static char filename[64];
|
||||
|
||||
static CURLcode unit_setup(void)
|
||||
{
|
||||
- password = strdup("");
|
||||
- login = strdup("");
|
||||
- if(!password || !login) {
|
||||
- Curl_safefree(password);
|
||||
- Curl_safefree(login);
|
||||
- return CURLE_OUT_OF_MEMORY;
|
||||
- }
|
||||
+ password = NULL;
|
||||
+ login = NULL;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
@@ -59,86 +54,52 @@ UNITTEST_START
|
||||
result = Curl_parsenetrc("test.example.com", &login, &password,
|
||||
&login_changed, &password_changed, filename);
|
||||
fail_unless(result == 1, "Host not found should return 1");
|
||||
- abort_unless(password != NULL, "returned NULL!");
|
||||
- fail_unless(password[0] == 0, "password should not have been changed");
|
||||
- abort_unless(login != NULL, "returned NULL!");
|
||||
- fail_unless(login[0] == 0, "login should not have been changed");
|
||||
+ abort_unless(password == NULL, "password did not return NULL!");
|
||||
+ abort_unless(login == NULL, "user did not return NULL!");
|
||||
|
||||
/*
|
||||
* Test a non existent login in our netrc file.
|
||||
*/
|
||||
- free(login);
|
||||
- login = strdup("me");
|
||||
- abort_unless(login != NULL, "returned NULL!");
|
||||
+ login = (char *)"me";
|
||||
result = Curl_parsenetrc("example.com", &login, &password,
|
||||
&login_changed, &password_changed, filename);
|
||||
fail_unless(result == 0, "Host should have been found");
|
||||
- abort_unless(password != NULL, "returned NULL!");
|
||||
- fail_unless(password[0] == 0, "password should not have been changed");
|
||||
- fail_unless(!password_changed, "password should not have been changed");
|
||||
- abort_unless(login != NULL, "returned NULL!");
|
||||
- fail_unless(strncmp(login, "me", 2) == 0,
|
||||
- "login should not have been changed");
|
||||
- fail_unless(!login_changed, "login should not have been changed");
|
||||
+ abort_unless(password == NULL, "password is not NULL!");
|
||||
|
||||
/*
|
||||
* Test a non existent login and host in our netrc file.
|
||||
*/
|
||||
- free(login);
|
||||
- login = strdup("me");
|
||||
- abort_unless(login != NULL, "returned NULL!");
|
||||
+ login = (char *)"me";
|
||||
result = Curl_parsenetrc("test.example.com", &login, &password,
|
||||
&login_changed, &password_changed, filename);
|
||||
fail_unless(result == 1, "Host not found should return 1");
|
||||
- abort_unless(password != NULL, "returned NULL!");
|
||||
- fail_unless(password[0] == 0, "password should not have been changed");
|
||||
- abort_unless(login != NULL, "returned NULL!");
|
||||
- fail_unless(strncmp(login, "me", 2) == 0,
|
||||
- "login should not have been changed");
|
||||
+ abort_unless(password == NULL, "password is not NULL!");
|
||||
|
||||
/*
|
||||
* Test a non existent login (substring of an existing one) in our
|
||||
* netrc file.
|
||||
*/
|
||||
- free(login);
|
||||
- login = strdup("admi");
|
||||
- abort_unless(login != NULL, "returned NULL!");
|
||||
+ login = (char *)"admi";
|
||||
result = Curl_parsenetrc("example.com", &login, &password,
|
||||
&login_changed, &password_changed, filename);
|
||||
fail_unless(result == 0, "Host should have been found");
|
||||
- abort_unless(password != NULL, "returned NULL!");
|
||||
- fail_unless(password[0] == 0, "password should not have been changed");
|
||||
- fail_unless(!password_changed, "password should not have been changed");
|
||||
- abort_unless(login != NULL, "returned NULL!");
|
||||
- fail_unless(strncmp(login, "admi", 4) == 0,
|
||||
- "login should not have been changed");
|
||||
- fail_unless(!login_changed, "login should not have been changed");
|
||||
+ abort_unless(password == NULL, "password is not NULL!");
|
||||
|
||||
/*
|
||||
* Test a non existent login (superstring of an existing one)
|
||||
* in our netrc file.
|
||||
*/
|
||||
- free(login);
|
||||
- login = strdup("adminn");
|
||||
- abort_unless(login != NULL, "returned NULL!");
|
||||
+ login = (char *)"adminn";
|
||||
result = Curl_parsenetrc("example.com", &login, &password,
|
||||
&login_changed, &password_changed, filename);
|
||||
fail_unless(result == 0, "Host should have been found");
|
||||
- abort_unless(password != NULL, "returned NULL!");
|
||||
- fail_unless(password[0] == 0, "password should not have been changed");
|
||||
- fail_unless(!password_changed, "password should not have been changed");
|
||||
- abort_unless(login != NULL, "returned NULL!");
|
||||
- fail_unless(strncmp(login, "adminn", 6) == 0,
|
||||
- "login should not have been changed");
|
||||
- fail_unless(!login_changed, "login should not have been changed");
|
||||
+ abort_unless(password == NULL, "password is not NULL!");
|
||||
|
||||
/*
|
||||
* Test for the first existing host in our netrc file
|
||||
* with login[0] = 0.
|
||||
*/
|
||||
- free(login);
|
||||
- login = strdup("");
|
||||
- abort_unless(login != NULL, "returned NULL!");
|
||||
+ login = NULL;
|
||||
result = Curl_parsenetrc("example.com", &login, &password,
|
||||
&login_changed, &password_changed, filename);
|
||||
fail_unless(result == 0, "Host should have been found");
|
||||
@@ -155,8 +116,9 @@ UNITTEST_START
|
||||
* with login[0] != 0.
|
||||
*/
|
||||
free(password);
|
||||
- password = strdup("");
|
||||
- abort_unless(password != NULL, "returned NULL!");
|
||||
+ free(login);
|
||||
+ password = NULL;
|
||||
+ login = NULL;
|
||||
result = Curl_parsenetrc("example.com", &login, &password,
|
||||
&login_changed, &password_changed, filename);
|
||||
fail_unless(result == 0, "Host should have been found");
|
||||
@@ -173,11 +135,9 @@ UNITTEST_START
|
||||
* with login[0] = 0.
|
||||
*/
|
||||
free(password);
|
||||
- password = strdup("");
|
||||
- abort_unless(password != NULL, "returned NULL!");
|
||||
+ password = NULL;
|
||||
free(login);
|
||||
- login = strdup("");
|
||||
- abort_unless(login != NULL, "returned NULL!");
|
||||
+ login = NULL;
|
||||
result = Curl_parsenetrc("curl.example.com", &login, &password,
|
||||
&login_changed, &password_changed, filename);
|
||||
fail_unless(result == 0, "Host should have been found");
|
||||
@@ -194,8 +154,9 @@ UNITTEST_START
|
||||
* with login[0] != 0.
|
||||
*/
|
||||
free(password);
|
||||
- password = strdup("");
|
||||
- abort_unless(password != NULL, "returned NULL!");
|
||||
+ free(login);
|
||||
+ password = NULL;
|
||||
+ login = NULL;
|
||||
result = Curl_parsenetrc("curl.example.com", &login, &password,
|
||||
&login_changed, &password_changed, filename);
|
||||
fail_unless(result == 0, "Host should have been found");
|
||||
--
|
||||
2.40.0
|
||||
175
meta/recipes-support/curl/curl/CVE-2025-0167.patch
Normal file
175
meta/recipes-support/curl/curl/CVE-2025-0167.patch
Normal file
@@ -0,0 +1,175 @@
|
||||
From 0e120c5b925e8ca75d5319e319e5ce4b8080d8eb Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Fri, 3 Jan 2025 16:22:27 +0100
|
||||
Subject: [PATCH] netrc: 'default' with no credentials is not a match
|
||||
|
||||
Test 486 verifies.
|
||||
|
||||
Reported-by: Yihang Zhou
|
||||
|
||||
Closes #15908
|
||||
|
||||
Changes:
|
||||
- Test files are added in Makefile.inc.
|
||||
- Adjust `%LOGDIR/` to 'log/' due to its absence in code.
|
||||
|
||||
CVE: CVE-2025-0167
|
||||
Upstream-Status: Backport [https://github.com/curl/curl/commit/0e120c5b925e8ca75d5319e319e5ce4b8080d8eb]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
lib/netrc.c | 7 ++-
|
||||
tests/data/Makefile.in | 2 +
|
||||
tests/data/test486 | 105 +++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 113 insertions(+), 1 deletion(-)
|
||||
create mode 100644 tests/data/test486
|
||||
|
||||
diff --git a/lib/netrc.c b/lib/netrc.c
|
||||
index 23080b3..6d87007 100644
|
||||
--- a/lib/netrc.c
|
||||
+++ b/lib/netrc.c
|
||||
@@ -205,12 +205,17 @@ static int parsenetrc(const char *host,
|
||||
} /* while fgets() */
|
||||
|
||||
out:
|
||||
- if(!retcode && !password && our_login) {
|
||||
+ if(!retcode) {
|
||||
+ if(!password && our_login) {
|
||||
/* success without a password, set a blank one */
|
||||
password = strdup("");
|
||||
if(!password)
|
||||
retcode = 1; /* out of memory */
|
||||
}
|
||||
+ else if(!login && !password)
|
||||
+ /* a default with no credentials */
|
||||
+ retcode = NETRC_FILE_MISSING;
|
||||
+ }
|
||||
if(!retcode) {
|
||||
/* success */
|
||||
*login_changed = FALSE;
|
||||
diff --git a/tests/data/Makefile.in b/tests/data/Makefile.in
|
||||
index 3da7d31..5a3ec48 100644
|
||||
--- a/tests/data/Makefile.in
|
||||
+++ b/tests/data/Makefile.in
|
||||
@@ -431,6 +431,8 @@ test409 test410 \
|
||||
\
|
||||
test430 test431 test432 test433 test434 test435 test436 \
|
||||
\
|
||||
+test486 \
|
||||
+\
|
||||
test490 test491 test492 test493 test494 \
|
||||
\
|
||||
test500 test501 test502 test503 test504 test505 test506 test507 test508 \
|
||||
diff --git a/tests/data/test486 b/tests/data/test486
|
||||
new file mode 100644
|
||||
index 0000000..6926092
|
||||
--- /dev/null
|
||||
+++ b/tests/data/test486
|
||||
@@ -0,0 +1,105 @@
|
||||
+<testcase>
|
||||
+<info>
|
||||
+<keywords>
|
||||
+netrc
|
||||
+HTTP
|
||||
+</keywords>
|
||||
+</info>
|
||||
+#
|
||||
+# Server-side
|
||||
+<reply>
|
||||
+<data crlf="yes">
|
||||
+HTTP/1.1 301 Follow this you fool
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Server: test-server/fake
|
||||
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
||||
+ETag: "21025-dc7-39462498"
|
||||
+Accept-Ranges: bytes
|
||||
+Content-Length: 6
|
||||
+Connection: close
|
||||
+Location: http://b.com/%TESTNUMBER0002
|
||||
+
|
||||
+-foo-
|
||||
+</data>
|
||||
+
|
||||
+<data2 crlf="yes">
|
||||
+HTTP/1.1 200 OK
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Server: test-server/fake
|
||||
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
||||
+ETag: "21025-dc7-39462498"
|
||||
+Accept-Ranges: bytes
|
||||
+Content-Length: 7
|
||||
+Connection: close
|
||||
+
|
||||
+target
|
||||
+</data2>
|
||||
+
|
||||
+<datacheck crlf="yes">
|
||||
+HTTP/1.1 301 Follow this you fool
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Server: test-server/fake
|
||||
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
||||
+ETag: "21025-dc7-39462498"
|
||||
+Accept-Ranges: bytes
|
||||
+Content-Length: 6
|
||||
+Connection: close
|
||||
+Location: http://b.com/%TESTNUMBER0002
|
||||
+
|
||||
+HTTP/1.1 200 OK
|
||||
+Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
+Server: test-server/fake
|
||||
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
||||
+ETag: "21025-dc7-39462498"
|
||||
+Accept-Ranges: bytes
|
||||
+Content-Length: 7
|
||||
+Connection: close
|
||||
+
|
||||
+target
|
||||
+</datacheck>
|
||||
+</reply>
|
||||
+
|
||||
+#
|
||||
+# Client-side
|
||||
+<client>
|
||||
+<server>
|
||||
+http
|
||||
+</server>
|
||||
+<features>
|
||||
+proxy
|
||||
+</features>
|
||||
+<name>
|
||||
+.netrc with redirect and "default" with no password or login
|
||||
+</name>
|
||||
+<command>
|
||||
+--netrc --netrc-file log/netrc%TESTNUMBER -L -x http://%HOSTIP:%HTTPPORT/ http://a.com/
|
||||
+</command>
|
||||
+<file name="log/netrc%TESTNUMBER" >
|
||||
+
|
||||
+machine a.com
|
||||
+ login alice
|
||||
+ password alicespassword
|
||||
+
|
||||
+default
|
||||
+
|
||||
+</file>
|
||||
+</client>
|
||||
+
|
||||
+<verify>
|
||||
+<protocol>
|
||||
+GET http://a.com/ HTTP/1.1
|
||||
+Host: a.com
|
||||
+Authorization: Basic %b64[alice:alicespassword]b64%
|
||||
+User-Agent: curl/%VERSION
|
||||
+Accept: */*
|
||||
+Proxy-Connection: Keep-Alive
|
||||
+
|
||||
+GET http://b.com/%TESTNUMBER0002 HTTP/1.1
|
||||
+Host: b.com
|
||||
+User-Agent: curl/%VERSION
|
||||
+Accept: */*
|
||||
+Proxy-Connection: Keep-Alive
|
||||
+
|
||||
+</protocol>
|
||||
+</verify>
|
||||
+</testcase>
|
||||
--
|
||||
2.40.0
|
||||
@@ -63,6 +63,9 @@ SRC_URI = "https://curl.se/download/${BP}.tar.xz \
|
||||
file://CVE-2024-8096.patch \
|
||||
file://0001-url-free-old-conn-better-on-reuse.patch \
|
||||
file://CVE-2024-9681.patch \
|
||||
file://CVE-2024-11053-0001.patch \
|
||||
file://CVE-2024-11053-0002.patch \
|
||||
file://CVE-2025-0167.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "0aaa12d7bd04b0966254f2703ce80dd5c38dbbd76af0297d3d690cdce58a583c"
|
||||
|
||||
|
||||
@@ -117,3 +117,7 @@ INSANE_SKIP:${PN} = "dev-so"
|
||||
INSANE_SKIP:${PN}-cxx = "dev-so"
|
||||
|
||||
BBCLASSEXTEND = "native nativesdk"
|
||||
|
||||
# many configure tests are failing with gcc-14
|
||||
CFLAGS += "-Wno-error=implicit-int -Wno-error=implicit-function-declaration"
|
||||
BUILD_CFLAGS += "-Wno-error=implicit-int -Wno-error=implicit-function-declaration"
|
||||
|
||||
141
meta/recipes-support/gnupg/gnupg/CVE-2025-30258-0001.patch
Normal file
141
meta/recipes-support/gnupg/gnupg/CVE-2025-30258-0001.patch
Normal file
@@ -0,0 +1,141 @@
|
||||
From 25d748c3dfc0102f9e54afea59ff26b3969bd8c1 Mon Sep 17 00:00:00 2001
|
||||
From: Werner Koch <wk@gnupg.org>
|
||||
Date: Tue, 11 Feb 2025 14:44:23 +0100
|
||||
Subject: [PATCH] gpg: Lookup key for merging/inserting only by primary key.
|
||||
|
||||
* g10/getkey.c (get_keyblock_byfpr_fast): Add arg primary_only and
|
||||
implement.
|
||||
* g10/import.c (import_one_real): Simplify filling the fpr buffer with
|
||||
zeroes.
|
||||
(import_one_real): Find key only by primary fingerprint.
|
||||
--
|
||||
|
||||
This should have been done early: When looking up the original
|
||||
keyblock we want to update, we need to lookup it up only using the
|
||||
primary key. This avoids to find a key which has the primary key also
|
||||
has a subkey.
|
||||
|
||||
GnuPG-bug-id: 7527
|
||||
|
||||
CVE: CVE-2025-30258
|
||||
Upstream-Status: Backport [https://dev.gnupg.org/rG25d748c3dfc0102f9e54afea59ff26b3969bd8c1]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
g10/getkey.c | 23 ++++++++++++++++++++---
|
||||
g10/import.c | 6 +++---
|
||||
g10/keydb.h | 3 ++-
|
||||
3 files changed, 25 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/g10/getkey.c b/g10/getkey.c
|
||||
index e49718e..7a25643 100644
|
||||
--- a/g10/getkey.c
|
||||
+++ b/g10/getkey.c
|
||||
@@ -1895,7 +1895,7 @@ get_pubkey_byfprint_fast (ctrl_t ctrl, PKT_public_key * pk,
|
||||
KBNODE keyblock;
|
||||
|
||||
err = get_keyblock_byfprint_fast (ctrl,
|
||||
- &keyblock, NULL, fprint, fprint_len, 0);
|
||||
+ &keyblock, NULL, 0, fprint, fprint_len, 0);
|
||||
if (!err)
|
||||
{
|
||||
if (pk)
|
||||
@@ -1912,11 +1912,14 @@ get_pubkey_byfprint_fast (ctrl_t ctrl, PKT_public_key * pk,
|
||||
* R_HD may be NULL. If LOCK is set the handle has been opend in
|
||||
* locked mode and keydb_disable_caching () has been called. On error
|
||||
* R_KEYBLOCK is set to NULL but R_HD must be released by the caller;
|
||||
- * it may have a value of NULL, though. This allows to do an insert
|
||||
- * operation on a locked keydb handle. */
|
||||
+ * it may have a value of NULL, though. This allows to do an
|
||||
+ * insert operation on a locked keydb handle. If PRIMARY_ONLY is set
|
||||
+ * the function returns a keyblock which has the requested fingerprint
|
||||
+ * has primary key. */
|
||||
gpg_error_t
|
||||
get_keyblock_byfprint_fast (ctrl_t ctrl,
|
||||
kbnode_t *r_keyblock, KEYDB_HANDLE *r_hd,
|
||||
+ int primary_only,
|
||||
const byte *fprint, size_t fprint_len, int lock)
|
||||
{
|
||||
gpg_error_t err;
|
||||
@@ -1924,6 +1927,8 @@ get_keyblock_byfprint_fast (ctrl_t ctrl,
|
||||
kbnode_t keyblock;
|
||||
byte fprbuf[MAX_FINGERPRINT_LEN];
|
||||
int i;
|
||||
+ byte tmpfpr[MAX_FINGERPRINT_LEN];
|
||||
+ size_t tmpfprlen;
|
||||
|
||||
if (r_keyblock)
|
||||
*r_keyblock = NULL;
|
||||
@@ -1955,6 +1960,7 @@ get_keyblock_byfprint_fast (ctrl_t ctrl,
|
||||
if (r_hd)
|
||||
*r_hd = hd;
|
||||
|
||||
+again:
|
||||
err = keydb_search_fpr (hd, fprbuf, fprint_len);
|
||||
if (gpg_err_code (err) == GPG_ERR_NOT_FOUND)
|
||||
{
|
||||
@@ -1974,6 +1980,17 @@ get_keyblock_byfprint_fast (ctrl_t ctrl,
|
||||
log_assert (keyblock->pkt->pkttype == PKT_PUBLIC_KEY
|
||||
|| keyblock->pkt->pkttype == PKT_PUBLIC_SUBKEY);
|
||||
|
||||
+ if (primary_only)
|
||||
+ {
|
||||
+ fingerprint_from_pk (keyblock->pkt->pkt.public_key, tmpfpr, &tmpfprlen);
|
||||
+ if (fprint_len != tmpfprlen || memcmp (fprint, tmpfpr, fprint_len))
|
||||
+ {
|
||||
+ release_kbnode (keyblock);
|
||||
+ keyblock = NULL;
|
||||
+ goto again;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* Not caching key here since it won't have all of the fields
|
||||
properly set. */
|
||||
|
||||
diff --git a/g10/import.c b/g10/import.c
|
||||
index bb0bf67..fb0e2ee 100644
|
||||
--- a/g10/import.c
|
||||
+++ b/g10/import.c
|
||||
@@ -1893,7 +1893,6 @@ import_one_real (ctrl_t ctrl,
|
||||
int mod_key = 0;
|
||||
int same_key = 0;
|
||||
int non_self = 0;
|
||||
- size_t an;
|
||||
char pkstrbuf[PUBKEY_STRING_SIZE];
|
||||
int merge_keys_done = 0;
|
||||
int any_filter = 0;
|
||||
@@ -1914,8 +1913,8 @@ import_one_real (ctrl_t ctrl,
|
||||
pk = node->pkt->pkt.public_key;
|
||||
|
||||
fingerprint_from_pk (pk, fpr2, &fpr2len);
|
||||
- for (an = fpr2len; an < MAX_FINGERPRINT_LEN; an++)
|
||||
- fpr2[an] = 0;
|
||||
+ if (MAX_FINGERPRINT_LEN > fpr2len)
|
||||
+ memset (fpr2+fpr2len, 0, MAX_FINGERPRINT_LEN - fpr2len);
|
||||
keyid_from_pk( pk, keyid );
|
||||
uidnode = find_next_kbnode( keyblock, PKT_USER_ID );
|
||||
|
||||
@@ -2097,6 +2096,7 @@ import_one_real (ctrl_t ctrl,
|
||||
|
||||
/* Do we have this key already in one of our pubrings ? */
|
||||
err = get_keyblock_byfprint_fast (ctrl, &keyblock_orig, &hd,
|
||||
+ 1 /*primary only */,
|
||||
fpr2, fpr2len, 1/*locked*/);
|
||||
if ((err
|
||||
&& gpg_err_code (err) != GPG_ERR_NO_PUBKEY
|
||||
diff --git a/g10/keydb.h b/g10/keydb.h
|
||||
index a91309a..51dfece 100644
|
||||
--- a/g10/keydb.h
|
||||
+++ b/g10/keydb.h
|
||||
@@ -418,7 +418,8 @@ gpg_error_t get_pubkey_byfprint_fast (ctrl_t ctrl, PKT_public_key *pk,
|
||||
gpg_error_t get_keyblock_byfprint_fast (ctrl_t ctrl,
|
||||
kbnode_t *r_keyblock,
|
||||
KEYDB_HANDLE *r_hd,
|
||||
- const byte *fprint, size_t fprint_len,
|
||||
+ int primary_only,
|
||||
+ const byte *fpr, size_t fprlen,
|
||||
int lock);
|
||||
|
||||
|
||||
--
|
||||
2.40.0
|
||||
131
meta/recipes-support/gnupg/gnupg/CVE-2025-30258-0002.patch
Normal file
131
meta/recipes-support/gnupg/gnupg/CVE-2025-30258-0002.patch
Normal file
@@ -0,0 +1,131 @@
|
||||
From 9cd371b12d80cfc5bc85cb6e5f5eebb4decbe94f Mon Sep 17 00:00:00 2001
|
||||
From: Werner Koch <wk@gnupg.org>
|
||||
Date: Thu, 20 Feb 2025 14:50:20 +0100
|
||||
Subject: [PATCH] gpg: Remove a signature check function wrapper.
|
||||
|
||||
* g10/sig-check.c (check_signature2): Rename to
|
||||
(check_signature): this and remove the old wrapper. Adjust all
|
||||
callers.
|
||||
|
||||
CVE: CVE-2025-30258
|
||||
Upstream-Status: Backport [https://dev.gnupg.org/rG9cd371b12d80cfc5bc85cb6e5f5eebb4decbe94f]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
g10/mainproc.c | 13 +++++--------
|
||||
g10/packet.h | 6 +-----
|
||||
g10/sig-check.c | 26 ++++++++------------------
|
||||
3 files changed, 14 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/g10/mainproc.c b/g10/mainproc.c
|
||||
index af11877..79d9ff2 100644
|
||||
--- a/g10/mainproc.c
|
||||
+++ b/g10/mainproc.c
|
||||
@@ -1198,19 +1198,17 @@ do_check_sig (CTX c, kbnode_t node, const void *extrahash, size_t extrahashlen,
|
||||
|
||||
/* We only get here if we are checking the signature of a binary
|
||||
(0x00) or text document (0x01). */
|
||||
- rc = check_signature2 (c->ctrl, sig, md, extrahash, extrahashlen,
|
||||
- forced_pk,
|
||||
- NULL, is_expkey, is_revkey, r_pk);
|
||||
+ rc = check_signature (c->ctrl, sig, md, extrahash, extrahashlen,
|
||||
+ forced_pk, NULL, is_expkey, is_revkey, r_pk);
|
||||
if (! rc)
|
||||
md_good = md;
|
||||
else if (gpg_err_code (rc) == GPG_ERR_BAD_SIGNATURE && md2)
|
||||
{
|
||||
PKT_public_key *pk2;
|
||||
|
||||
- rc = check_signature2 (c->ctrl, sig, md2, extrahash, extrahashlen,
|
||||
- forced_pk,
|
||||
- NULL, is_expkey, is_revkey,
|
||||
- r_pk? &pk2 : NULL);
|
||||
+ rc = check_signature (c->ctrl, sig, md2, extrahash, extrahashlen,
|
||||
+ forced_pk, NULL, is_expkey, is_revkey,
|
||||
+ r_pk? &pk2 : NULL);
|
||||
if (!rc)
|
||||
{
|
||||
md_good = md2;
|
||||
@@ -1792,7 +1790,6 @@ issuer_fpr_string (PKT_signature *sig)
|
||||
return p? bin2hex (p, n, NULL) : NULL;
|
||||
}
|
||||
|
||||
-
|
||||
static void
|
||||
print_good_bad_signature (int statno, const char *keyid_str, kbnode_t un,
|
||||
PKT_signature *sig, int rc)
|
||||
diff --git a/g10/packet.h b/g10/packet.h
|
||||
index 5a14015..8aaf32d 100644
|
||||
--- a/g10/packet.h
|
||||
+++ b/g10/packet.h
|
||||
@@ -889,16 +889,12 @@ int cmp_user_ids( PKT_user_id *a, PKT_user_id *b );
|
||||
|
||||
|
||||
/*-- sig-check.c --*/
|
||||
-/* Check a signature. This is shorthand for check_signature2 with
|
||||
- the unnamed arguments passed as NULL. */
|
||||
-int check_signature (ctrl_t ctrl, PKT_signature *sig, gcry_md_hd_t digest);
|
||||
-
|
||||
/* Check a signature. Looks up the public key from the key db. (If
|
||||
* R_PK is not NULL, it is stored at RET_PK.) DIGEST contains a
|
||||
* valid hash context that already includes the signed data. This
|
||||
* function adds the relevant meta-data to the hash before finalizing
|
||||
* it and verifying the signature. FOCRED_PK is usually NULL. */
|
||||
-gpg_error_t check_signature2 (ctrl_t ctrl,
|
||||
+gpg_error_t check_signature (ctrl_t ctrl,
|
||||
PKT_signature *sig, gcry_md_hd_t digest,
|
||||
const void *extrahash, size_t extrahashlen,
|
||||
PKT_public_key *forced_pk,
|
||||
diff --git a/g10/sig-check.c b/g10/sig-check.c
|
||||
index eb6c966..2272fa4 100644
|
||||
--- a/g10/sig-check.c
|
||||
+++ b/g10/sig-check.c
|
||||
@@ -95,17 +95,6 @@ check_key_verify_compliance (PKT_public_key *pk)
|
||||
}
|
||||
|
||||
|
||||
-
|
||||
-/* Check a signature. This is shorthand for check_signature2 with
|
||||
- the unnamed arguments passed as NULL. */
|
||||
-int
|
||||
-check_signature (ctrl_t ctrl, PKT_signature *sig, gcry_md_hd_t digest)
|
||||
-{
|
||||
- return check_signature2 (ctrl, sig, digest, NULL, 0, NULL,
|
||||
- NULL, NULL, NULL, NULL);
|
||||
-}
|
||||
-
|
||||
-
|
||||
/* Check a signature.
|
||||
*
|
||||
* Looks up the public key that created the signature (SIG->KEYID)
|
||||
@@ -151,12 +140,12 @@ check_signature (ctrl_t ctrl, PKT_signature *sig, gcry_md_hd_t digest)
|
||||
*
|
||||
* Returns 0 on success. An error code otherwise. */
|
||||
gpg_error_t
|
||||
-check_signature2 (ctrl_t ctrl,
|
||||
- PKT_signature *sig, gcry_md_hd_t digest,
|
||||
- const void *extrahash, size_t extrahashlen,
|
||||
- PKT_public_key *forced_pk,
|
||||
- u32 *r_expiredate,
|
||||
- int *r_expired, int *r_revoked, PKT_public_key **r_pk)
|
||||
+check_signature (ctrl_t ctrl,
|
||||
+ PKT_signature *sig, gcry_md_hd_t digest,
|
||||
+ const void *extrahash, size_t extrahashlen,
|
||||
+ PKT_public_key *forced_pk,
|
||||
+ u32 *r_expiredate, int *r_expired, int *r_revoked,
|
||||
+ PKT_public_key **r_pk)
|
||||
{
|
||||
int rc=0;
|
||||
PKT_public_key *pk;
|
||||
@@ -808,7 +797,8 @@ check_revocation_keys (ctrl_t ctrl, PKT_public_key *pk, PKT_signature *sig)
|
||||
hash_public_key(md,pk);
|
||||
/* Note: check_signature only checks that the signature
|
||||
is good. It does not fail if the key is revoked. */
|
||||
- rc = check_signature (ctrl, sig, md);
|
||||
+ rc = check_signature (ctrl, sig, md, NULL, 0, NULL,
|
||||
+ NULL, NULL, NULL, NULL);
|
||||
cache_sig_result(sig,rc);
|
||||
gcry_md_close (md);
|
||||
break;
|
||||
--
|
||||
2.40.0
|
||||
624
meta/recipes-support/gnupg/gnupg/CVE-2025-30258-0003.patch
Normal file
624
meta/recipes-support/gnupg/gnupg/CVE-2025-30258-0003.patch
Normal file
@@ -0,0 +1,624 @@
|
||||
From da0164efc7f32013bc24d97b9afa9f8d67c318bb Mon Sep 17 00:00:00 2001
|
||||
rom: Werner Koch <wk@gnupg.org>
|
||||
Date: Fri, 21 Feb 2025 12:16:17 +0100
|
||||
Subject: [PATCH] gpg: Fix a verification DoS due to a malicious subkey in the
|
||||
keyring.
|
||||
|
||||
* g10/getkey.c (get_pubkey): Factor code out to ...
|
||||
(get_pubkey_bykid): new. Add feature to return the keyblock.
|
||||
(get_pubkey_for_sig): Add arg r_keyblock to return the used keyblock.
|
||||
Request a signing usage.
|
||||
(get_pubkeyblock_for_sig): Remove.
|
||||
(finish_lookup): Improve debug output.
|
||||
* g10/sig-check.c (check_signature): Add arg r_keyblock and pass it
|
||||
down.
|
||||
* g10/mainproc.c (do_check_sig): Ditto.
|
||||
(check_sig_and_print): Use the keyblock returned by do_check_sig to
|
||||
show further information instead of looking it up again with
|
||||
get_pubkeyblock_for_sig. Also re-check the signature after the import
|
||||
of an included keyblock.
|
||||
--
|
||||
|
||||
The problem here is that it is possible to import a key from someone
|
||||
who added a signature subkey from another public key and thus inhibits
|
||||
that a good signature good be verified.
|
||||
|
||||
Such a malicious key signature subkey must have been created w/o the
|
||||
mandatory backsig which bind a signature subkey to its primary key.
|
||||
For encryption subkeys this is not an issue because the existence of a
|
||||
decryption private key is all you need to decrypt something and then
|
||||
it does not matter if the public subkey or its binding signature has
|
||||
been put below another primary key; in fact we do the latter for
|
||||
ADSKs.
|
||||
|
||||
GnuPG-bug-id: 7527
|
||||
Backported-from-master: 48978ccb4e20866472ef18436a32744350a65158
|
||||
|
||||
CVE: CVE-2025-30258
|
||||
Upstream-Status: Backport [https://dev.gnupg.org/rGda0164efc7f32013bc24d97b9afa9f8d67c318bb]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
g10/getkey.c | 106 ++++++++++++++++++++++++++++++------------------
|
||||
g10/gpg.h | 3 +-
|
||||
g10/keydb.h | 10 ++++-
|
||||
g10/mainproc.c | 92 ++++++++++++++++++++++++++---------------
|
||||
g10/packet.h | 2 +-
|
||||
g10/sig-check.c | 23 +++++++----
|
||||
6 files changed, 152 insertions(+), 84 deletions(-)
|
||||
|
||||
diff --git a/g10/getkey.c b/g10/getkey.c
|
||||
index 7a25643..0fa763a 100644
|
||||
--- a/g10/getkey.c
|
||||
+++ b/g10/getkey.c
|
||||
@@ -310,27 +310,50 @@ pk_from_block (PKT_public_key *pk, kbnode_t keyblock, kbnode_t found_key)
|
||||
|
||||
/* Specialized version of get_pubkey which retrieves the key based on
|
||||
* information in SIG. In contrast to get_pubkey PK is required. IF
|
||||
- * FORCED_PK is not NULL, this public key is used and copied to PK. */
|
||||
+ * FORCED_PK is not NULL, this public key is used and copied to PK.
|
||||
+ * If R_KEYBLOCK is not NULL the entire keyblock is stored there if
|
||||
+ * found and FORCED_PK is not used; if not used or on error NULL is
|
||||
+ * stored there. */
|
||||
gpg_error_t
|
||||
get_pubkey_for_sig (ctrl_t ctrl, PKT_public_key *pk, PKT_signature *sig,
|
||||
- PKT_public_key *forced_pk)
|
||||
+ PKT_public_key *forced_pk, kbnode_t *r_keyblock)
|
||||
{
|
||||
+ gpg_error_t err;
|
||||
const byte *fpr;
|
||||
size_t fprlen;
|
||||
|
||||
+ if (r_keyblock)
|
||||
+ *r_keyblock = NULL;
|
||||
+
|
||||
if (forced_pk)
|
||||
{
|
||||
copy_public_key (pk, forced_pk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ /* Make sure to request only keys cabable of signing. This makes
|
||||
+ * sure that a subkey w/o a valid backsig or with bad usage flags
|
||||
+ * will be skipped. */
|
||||
+ pk->req_usage = PUBKEY_USAGE_SIG;
|
||||
+
|
||||
/* First try the ISSUER_FPR info. */
|
||||
fpr = issuer_fpr_raw (sig, &fprlen);
|
||||
- if (fpr && !get_pubkey_byfprint (ctrl, pk, NULL, fpr, fprlen))
|
||||
+ if (fpr && !get_pubkey_byfprint (ctrl, pk, r_keyblock, fpr, fprlen))
|
||||
return 0;
|
||||
+ if (r_keyblock)
|
||||
+ {
|
||||
+ release_kbnode (*r_keyblock);
|
||||
+ *r_keyblock = NULL;
|
||||
+ }
|
||||
|
||||
/* Fallback to use the ISSUER_KEYID. */
|
||||
- return get_pubkey (ctrl, pk, sig->keyid);
|
||||
+ err = get_pubkey_bykid (ctrl, pk, r_keyblock, sig->keyid);
|
||||
+ if (err && r_keyblock)
|
||||
+ {
|
||||
+ release_kbnode (*r_keyblock);
|
||||
+ *r_keyblock = NULL;
|
||||
+ }
|
||||
+ return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -348,6 +371,10 @@ get_pubkey_for_sig (ctrl_t ctrl, PKT_public_key *pk, PKT_signature *sig,
|
||||
* usage will be returned. As such, it is essential that
|
||||
* PK->REQ_USAGE be correctly initialized!
|
||||
*
|
||||
+ * If R_KEYBLOCK is not NULL, then the first result's keyblock is
|
||||
+ * returned in *R_KEYBLOCK. This should be freed using
|
||||
+ * release_kbnode().
|
||||
+ *
|
||||
* Returns 0 on success, GPG_ERR_NO_PUBKEY if there is no public key
|
||||
* with the specified key id, or another error code if an error
|
||||
* occurs.
|
||||
@@ -355,24 +382,30 @@ get_pubkey_for_sig (ctrl_t ctrl, PKT_public_key *pk, PKT_signature *sig,
|
||||
* If the data was not read from the cache, then the self-signed data
|
||||
* has definitely been merged into the public key using
|
||||
* merge_selfsigs. */
|
||||
-int
|
||||
-get_pubkey (ctrl_t ctrl, PKT_public_key * pk, u32 * keyid)
|
||||
+gpg_error_t
|
||||
+get_pubkey_bykid (ctrl_t ctrl, PKT_public_key *pk, kbnode_t *r_keyblock,
|
||||
+ u32 *keyid)
|
||||
{
|
||||
int internal = 0;
|
||||
- int rc = 0;
|
||||
+ gpg_error_t rc = 0;
|
||||
+
|
||||
+ if (r_keyblock)
|
||||
+ *r_keyblock = NULL;
|
||||
|
||||
#if MAX_PK_CACHE_ENTRIES
|
||||
- if (pk)
|
||||
+ if (pk && !r_keyblock)
|
||||
{
|
||||
/* Try to get it from the cache. We don't do this when pk is
|
||||
- NULL as it does not guarantee that the user IDs are
|
||||
- cached. */
|
||||
+ * NULL as it does not guarantee that the user IDs are cached.
|
||||
+ * The old get_pubkey_function did not check PK->REQ_USAGE when
|
||||
+ * reading form the caceh. This is probably a bug. Note that
|
||||
+ * the cache is not used when the caller asked to return the
|
||||
+ * entire keyblock. This is because the cache does not
|
||||
+ * associate the public key wit its primary key. */
|
||||
pk_cache_entry_t ce;
|
||||
for (ce = pk_cache; ce; ce = ce->next)
|
||||
{
|
||||
if (ce->keyid[0] == keyid[0] && ce->keyid[1] == keyid[1])
|
||||
- /* XXX: We don't check PK->REQ_USAGE here, but if we don't
|
||||
- read from the cache, we do check it! */
|
||||
{
|
||||
copy_public_key (pk, ce->pk);
|
||||
return 0;
|
||||
@@ -380,6 +413,7 @@ get_pubkey (ctrl_t ctrl, PKT_public_key * pk, u32 * keyid)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+
|
||||
/* More init stuff. */
|
||||
if (!pk)
|
||||
{
|
||||
@@ -425,16 +459,18 @@ get_pubkey (ctrl_t ctrl, PKT_public_key * pk, u32 * keyid)
|
||||
ctx.req_usage = pk->req_usage;
|
||||
rc = lookup (ctrl, &ctx, 0, &kb, &found_key);
|
||||
if (!rc)
|
||||
+ pk_from_block (pk, kb, found_key);
|
||||
+ getkey_end (ctrl, &ctx);
|
||||
+ if (!rc && r_keyblock)
|
||||
{
|
||||
- pk_from_block (pk, kb, found_key);
|
||||
+ *r_keyblock = kb;
|
||||
+ kb = NULL;
|
||||
}
|
||||
- getkey_end (ctrl, &ctx);
|
||||
release_kbnode (kb);
|
||||
}
|
||||
- if (!rc)
|
||||
- goto leave;
|
||||
|
||||
- rc = GPG_ERR_NO_PUBKEY;
|
||||
+ if (rc) /* Return a more useful error code. */
|
||||
+ rc = gpg_error (GPG_ERR_NO_PUBKEY);
|
||||
|
||||
leave:
|
||||
if (!rc)
|
||||
@@ -445,6 +481,14 @@ leave:
|
||||
}
|
||||
|
||||
|
||||
+/* Wrapper for get_pubkey_bykid w/o keyblock return feature. */
|
||||
+int
|
||||
+get_pubkey (ctrl_t ctrl, PKT_public_key *pk, u32 *keyid)
|
||||
+{
|
||||
+ return get_pubkey_bykid (ctrl, pk, NULL, keyid);
|
||||
+}
|
||||
+
|
||||
+
|
||||
/* Same as get_pubkey but if the key was not found the function tries
|
||||
* to import it from LDAP. FIXME: We should not need this but swicth
|
||||
* to a fingerprint lookup. */
|
||||
@@ -557,28 +601,6 @@ get_pubkey_fast (ctrl_t ctrl, PKT_public_key * pk, u32 * keyid)
|
||||
}
|
||||
|
||||
|
||||
-/* Return the entire keyblock used to create SIG. This is a
|
||||
- * specialized version of get_pubkeyblock.
|
||||
- *
|
||||
- * FIXME: This is a hack because get_pubkey_for_sig was already called
|
||||
- * and it could have used a cache to hold the key. */
|
||||
-kbnode_t
|
||||
-get_pubkeyblock_for_sig (ctrl_t ctrl, PKT_signature *sig)
|
||||
-{
|
||||
- const byte *fpr;
|
||||
- size_t fprlen;
|
||||
- kbnode_t keyblock;
|
||||
-
|
||||
- /* First try the ISSUER_FPR info. */
|
||||
- fpr = issuer_fpr_raw (sig, &fprlen);
|
||||
- if (fpr && !get_pubkey_byfprint (ctrl, NULL, &keyblock, fpr, fprlen))
|
||||
- return keyblock;
|
||||
-
|
||||
- /* Fallback to use the ISSUER_KEYID. */
|
||||
- return get_pubkeyblock (ctrl, sig->keyid);
|
||||
-}
|
||||
-
|
||||
-
|
||||
/* Return the key block for the key with key id KEYID or NULL, if an
|
||||
* error occurs. Use release_kbnode() to release the key block.
|
||||
*
|
||||
@@ -3611,6 +3633,7 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact,
|
||||
kbnode_t latest_key;
|
||||
PKT_public_key *pk;
|
||||
int req_prim;
|
||||
+ int diag_exactfound = 0;
|
||||
u32 curtime = make_timestamp ();
|
||||
|
||||
if (r_flags)
|
||||
@@ -3641,6 +3664,7 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact,
|
||||
foundk = k;
|
||||
pk = k->pkt->pkt.public_key;
|
||||
pk->flags.exact = 1;
|
||||
+ diag_exactfound = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3661,10 +3685,14 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact,
|
||||
log_debug ("finish_lookup: checking key %08lX (%s)(req_usage=%x)\n",
|
||||
(ulong) keyid_from_pk (keyblock->pkt->pkt.public_key, NULL),
|
||||
foundk ? "one" : "all", req_usage);
|
||||
+ if (diag_exactfound && DBG_LOOKUP)
|
||||
+ log_debug ("\texact search requested and found\n");
|
||||
|
||||
if (!req_usage)
|
||||
{
|
||||
latest_key = foundk ? foundk : keyblock;
|
||||
+ if (DBG_LOOKUP)
|
||||
+ log_debug ("\tno usage requested - accepting key\n");
|
||||
goto found;
|
||||
}
|
||||
|
||||
diff --git a/g10/gpg.h b/g10/gpg.h
|
||||
index c51bbbb..0cdcb8b 100644
|
||||
--- a/g10/gpg.h
|
||||
+++ b/g10/gpg.h
|
||||
@@ -69,7 +69,8 @@ struct dirmngr_local_s;
|
||||
typedef struct dirmngr_local_s *dirmngr_local_t;
|
||||
|
||||
/* Object used to describe a keyblock node. */
|
||||
-typedef struct kbnode_struct *KBNODE; /* Deprecated use kbnode_t. */typedef struct kbnode_struct *kbnode_t;
|
||||
+typedef struct kbnode_struct *KBNODE; /* Deprecated use kbnode_t. */
|
||||
+typedef struct kbnode_struct *kbnode_t;
|
||||
|
||||
/* The handle for keydb operations. */
|
||||
typedef struct keydb_handle_s *KEYDB_HANDLE;
|
||||
diff --git a/g10/keydb.h b/g10/keydb.h
|
||||
index 51dfece..8e494f6 100644
|
||||
--- a/g10/keydb.h
|
||||
+++ b/g10/keydb.h
|
||||
@@ -332,9 +332,15 @@ void getkey_disable_caches(void);
|
||||
/* Return the public key used for signature SIG and store it at PK. */
|
||||
gpg_error_t get_pubkey_for_sig (ctrl_t ctrl,
|
||||
PKT_public_key *pk, PKT_signature *sig,
|
||||
- PKT_public_key *forced_pk);
|
||||
+ PKT_public_key *forced_pk,
|
||||
+ kbnode_t *r_keyblock);
|
||||
|
||||
-/* Return the public key with the key id KEYID and store it at PK. */
|
||||
+/* Return the public key with the key id KEYID and store it at PK.
|
||||
+ * Optionally return the entire keyblock. */
|
||||
+gpg_error_t get_pubkey_bykid (ctrl_t ctrl, PKT_public_key *pk,
|
||||
+ kbnode_t *r_keyblock, u32 *keyid);
|
||||
+
|
||||
+/* Same as get_pubkey_bykid but w/o r_keyblock. */
|
||||
int get_pubkey (ctrl_t ctrl, PKT_public_key *pk, u32 *keyid);
|
||||
|
||||
/* Same as get_pubkey but with auto LDAP fetch. */
|
||||
diff --git a/g10/mainproc.c b/g10/mainproc.c
|
||||
index 79d9ff2..6e114d2 100644
|
||||
--- a/g10/mainproc.c
|
||||
+++ b/g10/mainproc.c
|
||||
@@ -1108,12 +1108,15 @@ proc_compressed (CTX c, PACKET *pkt)
|
||||
* used to verify the signature will be stored there, or NULL if not
|
||||
* found. If FORCED_PK is not NULL, this public key is used to verify
|
||||
* _data signatures_ and no key lookup is done. Returns: 0 = valid
|
||||
- * signature or an error code
|
||||
+ * signature or an error code. If R_KEYBLOCK is not NULL the keyblock
|
||||
+ * carries the used PK is stored there. The caller should always free
|
||||
+ * the return value using release_kbnode.
|
||||
*/
|
||||
static int
|
||||
do_check_sig (CTX c, kbnode_t node, const void *extrahash, size_t extrahashlen,
|
||||
PKT_public_key *forced_pk, int *is_selfsig,
|
||||
- int *is_expkey, int *is_revkey, PKT_public_key **r_pk)
|
||||
+ int *is_expkey, int *is_revkey,
|
||||
+ PKT_public_key **r_pk, kbnode_t *r_keyblock)
|
||||
{
|
||||
PKT_signature *sig;
|
||||
gcry_md_hd_t md = NULL;
|
||||
@@ -1123,6 +1126,8 @@ do_check_sig (CTX c, kbnode_t node, const void *extrahash, size_t extrahashlen,
|
||||
|
||||
if (r_pk)
|
||||
*r_pk = NULL;
|
||||
+ if (r_keyblock)
|
||||
+ *r_keyblock = NULL;
|
||||
|
||||
log_assert (node->pkt->pkttype == PKT_SIGNATURE);
|
||||
if (is_selfsig)
|
||||
@@ -1199,16 +1204,19 @@ do_check_sig (CTX c, kbnode_t node, const void *extrahash, size_t extrahashlen,
|
||||
/* We only get here if we are checking the signature of a binary
|
||||
(0x00) or text document (0x01). */
|
||||
rc = check_signature (c->ctrl, sig, md, extrahash, extrahashlen,
|
||||
- forced_pk, NULL, is_expkey, is_revkey, r_pk);
|
||||
+ forced_pk, NULL, is_expkey, is_revkey,
|
||||
+ r_pk, r_keyblock);
|
||||
if (! rc)
|
||||
md_good = md;
|
||||
else if (gpg_err_code (rc) == GPG_ERR_BAD_SIGNATURE && md2)
|
||||
{
|
||||
PKT_public_key *pk2;
|
||||
|
||||
+ if (r_keyblock)
|
||||
+ release_kbnode (*r_keyblock);
|
||||
rc = check_signature (c->ctrl, sig, md2, extrahash, extrahashlen,
|
||||
forced_pk, NULL, is_expkey, is_revkey,
|
||||
- r_pk? &pk2 : NULL);
|
||||
+ r_pk? &pk2 : NULL, r_keyblock);
|
||||
if (!rc)
|
||||
{
|
||||
md_good = md2;
|
||||
@@ -1371,7 +1379,7 @@ list_node (CTX c, kbnode_t node)
|
||||
{
|
||||
fflush (stdout);
|
||||
rc2 = do_check_sig (c, node, NULL, 0, NULL,
|
||||
- &is_selfsig, NULL, NULL, NULL);
|
||||
+ &is_selfsig, NULL, NULL, NULL, NULL);
|
||||
switch (gpg_err_code (rc2))
|
||||
{
|
||||
case 0: sigrc = '!'; break;
|
||||
@@ -1830,7 +1838,7 @@ check_sig_and_print (CTX c, kbnode_t node)
|
||||
PKT_public_key *pk = NULL; /* The public key for the signature or NULL. */
|
||||
const void *extrahash = NULL;
|
||||
size_t extrahashlen = 0;
|
||||
- kbnode_t included_keyblock = NULL;
|
||||
+ kbnode_t keyblock = NULL;
|
||||
|
||||
if (opt.skip_verify)
|
||||
{
|
||||
@@ -1949,7 +1957,8 @@ check_sig_and_print (CTX c, kbnode_t node)
|
||||
{
|
||||
ambiguous:
|
||||
log_error(_("can't handle this ambiguous signature data\n"));
|
||||
- return 0;
|
||||
+ rc = 0;
|
||||
+ goto leave;
|
||||
}
|
||||
} /* End checking signature packet composition. */
|
||||
|
||||
@@ -1985,7 +1994,7 @@ check_sig_and_print (CTX c, kbnode_t node)
|
||||
log_info (_(" issuer \"%s\"\n"), sig->signers_uid);
|
||||
|
||||
rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
|
||||
- NULL, &is_expkey, &is_revkey, &pk);
|
||||
+ NULL, &is_expkey, &is_revkey, &pk, &keyblock);
|
||||
|
||||
/* If the key is not found but the signature includes a key block we
|
||||
* use that key block for verification and on success import it. */
|
||||
@@ -1993,6 +2002,7 @@ check_sig_and_print (CTX c, kbnode_t node)
|
||||
&& sig->flags.key_block
|
||||
&& opt.flags.auto_key_import)
|
||||
{
|
||||
+ kbnode_t included_keyblock = NULL;
|
||||
PKT_public_key *included_pk;
|
||||
const byte *kblock;
|
||||
size_t kblock_len;
|
||||
@@ -2004,10 +2014,12 @@ check_sig_and_print (CTX c, kbnode_t node)
|
||||
kblock+1, kblock_len-1,
|
||||
sig->keyid, &included_keyblock))
|
||||
{
|
||||
+ /* Note: This is the only place where we use the forced_pk
|
||||
+ * arg (ie. included_pk) with do_check_sig. */
|
||||
rc = do_check_sig (c, node, extrahash, extrahashlen, included_pk,
|
||||
- NULL, &is_expkey, &is_revkey, &pk);
|
||||
+ NULL, &is_expkey, &is_revkey, &pk, NULL);
|
||||
if (opt.verbose)
|
||||
- log_debug ("checked signature using included key block: %s\n",
|
||||
+ log_info ("checked signature using included key block: %s\n",
|
||||
gpg_strerror (rc));
|
||||
if (!rc)
|
||||
{
|
||||
@@ -2017,6 +2029,18 @@ check_sig_and_print (CTX c, kbnode_t node)
|
||||
|
||||
}
|
||||
free_public_key (included_pk);
|
||||
+ release_kbnode (included_keyblock);
|
||||
+
|
||||
+ /* To make sure that nothing strange happened we check the
|
||||
+ * signature again now using our own key store. This also
|
||||
+ * returns the keyblock which we use later on. */
|
||||
+ if (!rc)
|
||||
+ {
|
||||
+ release_kbnode (keyblock);
|
||||
+ keyblock = NULL;
|
||||
+ rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
|
||||
+ NULL, &is_expkey, &is_revkey, &pk, &keyblock);
|
||||
+ }
|
||||
}
|
||||
|
||||
/* If the key isn't found, check for a preferred keyserver. Note
|
||||
@@ -2063,8 +2087,13 @@ check_sig_and_print (CTX c, kbnode_t node)
|
||||
KEYSERVER_IMPORT_FLAG_QUICK);
|
||||
glo_ctrl.in_auto_key_retrieve--;
|
||||
if (!res)
|
||||
- rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
|
||||
- NULL, &is_expkey, &is_revkey, &pk);
|
||||
+ {
|
||||
+ release_kbnode (keyblock);
|
||||
+ keyblock = NULL;
|
||||
+ rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
|
||||
+ NULL, &is_expkey, &is_revkey, &pk,
|
||||
+ &keyblock);
|
||||
+ }
|
||||
else if (DBG_LOOKUP)
|
||||
log_debug ("lookup via %s failed: %s\n", "Pref-KS",
|
||||
gpg_strerror (res));
|
||||
@@ -2105,8 +2134,12 @@ check_sig_and_print (CTX c, kbnode_t node)
|
||||
/* Fixme: If the fingerprint is embedded in the signature,
|
||||
* compare it to the fingerprint of the returned key. */
|
||||
if (!res)
|
||||
- rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
|
||||
- NULL, &is_expkey, &is_revkey, &pk);
|
||||
+ {
|
||||
+ release_kbnode (keyblock);
|
||||
+ keyblock = NULL;
|
||||
+ rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
|
||||
+ NULL, &is_expkey, &is_revkey, &pk, &keyblock);
|
||||
+ }
|
||||
else if (DBG_LOOKUP)
|
||||
log_debug ("lookup via %s failed: %s\n", "WKD", gpg_strerror (res));
|
||||
}
|
||||
@@ -2136,8 +2169,13 @@ check_sig_and_print (CTX c, kbnode_t node)
|
||||
KEYSERVER_IMPORT_FLAG_QUICK);
|
||||
glo_ctrl.in_auto_key_retrieve--;
|
||||
if (!res)
|
||||
- rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
|
||||
- NULL, &is_expkey, &is_revkey, &pk);
|
||||
+ {
|
||||
+ release_kbnode (keyblock);
|
||||
+ keyblock = NULL;
|
||||
+ rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
|
||||
+ NULL, &is_expkey, &is_revkey, &pk,
|
||||
+ &keyblock);
|
||||
+ }
|
||||
else if (DBG_LOOKUP)
|
||||
log_debug ("lookup via %s failed: %s\n", "KS", gpg_strerror (res));
|
||||
}
|
||||
@@ -2148,7 +2186,7 @@ check_sig_and_print (CTX c, kbnode_t node)
|
||||
{
|
||||
/* We have checked the signature and the result is either a good
|
||||
* signature or a bad signature. Further examination follows. */
|
||||
- kbnode_t un, keyblock;
|
||||
+ kbnode_t un;
|
||||
int count = 0;
|
||||
int keyblock_has_pk = 0; /* For failsafe check. */
|
||||
int statno;
|
||||
@@ -2166,18 +2204,6 @@ check_sig_and_print (CTX c, kbnode_t node)
|
||||
else
|
||||
statno = STATUS_GOODSIG;
|
||||
|
||||
- /* FIXME: We should have the public key in PK and thus the
|
||||
- * keyblock has already been fetched. Thus we could use the
|
||||
- * fingerprint or PK itself to lookup the entire keyblock. That
|
||||
- * would best be done with a cache. */
|
||||
- if (included_keyblock)
|
||||
- {
|
||||
- keyblock = included_keyblock;
|
||||
- included_keyblock = NULL;
|
||||
- }
|
||||
- else
|
||||
- keyblock = get_pubkeyblock_for_sig (c->ctrl, sig);
|
||||
-
|
||||
snprintf (keyid_str, sizeof keyid_str, "%08lX%08lX [uncertain] ",
|
||||
(ulong)sig->keyid[0], (ulong)sig->keyid[1]);
|
||||
|
||||
@@ -2243,10 +2269,10 @@ check_sig_and_print (CTX c, kbnode_t node)
|
||||
* contained in the keyring.*/
|
||||
}
|
||||
|
||||
- log_assert (mainpk);
|
||||
- if (!keyblock_has_pk)
|
||||
+ if (!mainpk || !keyblock_has_pk)
|
||||
{
|
||||
- log_error ("signature key lost from keyblock\n");
|
||||
+ log_error ("signature key lost from keyblock (%p,%p,%d)\n",
|
||||
+ keyblock, mainpk, keyblock_has_pk);
|
||||
rc = gpg_error (GPG_ERR_INTERNAL);
|
||||
}
|
||||
|
||||
@@ -2514,8 +2540,8 @@ check_sig_and_print (CTX c, kbnode_t node)
|
||||
log_error (_("Can't check signature: %s\n"), gpg_strerror (rc));
|
||||
}
|
||||
|
||||
+ leave:
|
||||
free_public_key (pk);
|
||||
- release_kbnode (included_keyblock);
|
||||
xfree (issuer_fpr);
|
||||
return rc;
|
||||
}
|
||||
diff --git a/g10/packet.h b/g10/packet.h
|
||||
index 8aaf32d..669739a 100644
|
||||
--- a/g10/packet.h
|
||||
+++ b/g10/packet.h
|
||||
@@ -899,7 +899,7 @@ gpg_error_t check_signature (ctrl_t ctrl,
|
||||
const void *extrahash, size_t extrahashlen,
|
||||
PKT_public_key *forced_pk,
|
||||
u32 *r_expiredate, int *r_expired, int *r_revoked,
|
||||
- PKT_public_key **r_pk);
|
||||
+ PKT_public_key **r_pk, kbnode_t *r_keyblock);
|
||||
|
||||
|
||||
/*-- pubkey-enc.c --*/
|
||||
diff --git a/g10/sig-check.c b/g10/sig-check.c
|
||||
index 2272fa4..11f3e0c 100644
|
||||
--- a/g10/sig-check.c
|
||||
+++ b/g10/sig-check.c
|
||||
@@ -138,6 +138,11 @@ check_key_verify_compliance (PKT_public_key *pk)
|
||||
* If R_PK is not NULL, the public key is stored at that address if it
|
||||
* was found; other wise NULL is stored.
|
||||
*
|
||||
+ * If R_KEYBLOCK is not NULL, the entire keyblock used to verify the
|
||||
+ * signature is stored at that address. If no key was found or on
|
||||
+ * some other errors NULL is stored there. The callers needs to
|
||||
+ * release the keyblock using release_kbnode (kb).
|
||||
+ *
|
||||
* Returns 0 on success. An error code otherwise. */
|
||||
gpg_error_t
|
||||
check_signature (ctrl_t ctrl,
|
||||
@@ -145,7 +150,7 @@ check_signature (ctrl_t ctrl,
|
||||
const void *extrahash, size_t extrahashlen,
|
||||
PKT_public_key *forced_pk,
|
||||
u32 *r_expiredate, int *r_expired, int *r_revoked,
|
||||
- PKT_public_key **r_pk)
|
||||
+ PKT_public_key **r_pk, kbnode_t *r_keyblock)
|
||||
{
|
||||
int rc=0;
|
||||
PKT_public_key *pk;
|
||||
@@ -158,6 +163,8 @@ check_signature (ctrl_t ctrl,
|
||||
*r_revoked = 0;
|
||||
if (r_pk)
|
||||
*r_pk = NULL;
|
||||
+ if (r_keyblock)
|
||||
+ *r_keyblock = NULL;
|
||||
|
||||
pk = xtrycalloc (1, sizeof *pk);
|
||||
if (!pk)
|
||||
@@ -188,7 +195,7 @@ check_signature (ctrl_t ctrl,
|
||||
log_info(_("WARNING: signature digest conflict in message\n"));
|
||||
rc = gpg_error (GPG_ERR_GENERAL);
|
||||
}
|
||||
- else if (get_pubkey_for_sig (ctrl, pk, sig, forced_pk))
|
||||
+ else if (get_pubkey_for_sig (ctrl, pk, sig, forced_pk, r_keyblock))
|
||||
rc = gpg_error (GPG_ERR_NO_PUBKEY);
|
||||
else if ((rc = check_key_verify_compliance (pk)))
|
||||
;/* Compliance failure. */
|
||||
@@ -786,9 +793,9 @@ check_revocation_keys (ctrl_t ctrl, PKT_public_key *pk, PKT_signature *sig)
|
||||
keyid_from_fingerprint (ctrl, pk->revkey[i].fpr, pk->revkey[i].fprlen,
|
||||
keyid);
|
||||
|
||||
- if(keyid[0]==sig->keyid[0] && keyid[1]==sig->keyid[1])
|
||||
- /* The signature was generated by a designated revoker.
|
||||
- Verify the signature. */
|
||||
+ /* If the signature was generated by a designated revoker
|
||||
+ * verify the signature. */
|
||||
+ if (keyid[0] == sig->keyid[0] && keyid[1] == sig->keyid[1])
|
||||
{
|
||||
gcry_md_hd_t md;
|
||||
|
||||
@@ -796,9 +803,9 @@ check_revocation_keys (ctrl_t ctrl, PKT_public_key *pk, PKT_signature *sig)
|
||||
BUG ();
|
||||
hash_public_key(md,pk);
|
||||
/* Note: check_signature only checks that the signature
|
||||
- is good. It does not fail if the key is revoked. */
|
||||
+ * is good. It does not fail if the key is revoked. */
|
||||
rc = check_signature (ctrl, sig, md, NULL, 0, NULL,
|
||||
- NULL, NULL, NULL, NULL);
|
||||
+ NULL, NULL, NULL, NULL, NULL);
|
||||
cache_sig_result(sig,rc);
|
||||
gcry_md_close (md);
|
||||
break;
|
||||
@@ -1003,7 +1010,7 @@ check_signature_over_key_or_uid (ctrl_t ctrl, PKT_public_key *signer,
|
||||
if (IS_CERT (sig))
|
||||
signer->req_usage = PUBKEY_USAGE_CERT;
|
||||
|
||||
- rc = get_pubkey_for_sig (ctrl, signer, sig, NULL);
|
||||
+ rc = get_pubkey_for_sig (ctrl, signer, sig, NULL, NULL);
|
||||
if (rc)
|
||||
{
|
||||
xfree (signer);
|
||||
--
|
||||
2.40.0
|
||||
193
meta/recipes-support/gnupg/gnupg/CVE-2025-30258-0004.patch
Normal file
193
meta/recipes-support/gnupg/gnupg/CVE-2025-30258-0004.patch
Normal file
@@ -0,0 +1,193 @@
|
||||
From 1e581619bf5315957f2be06b3b1a7f513304c126 Mon Sep 17 00:00:00 2001
|
||||
From: Werner Koch <wk@gnupg.org>
|
||||
Date: Thu, 6 Mar 2025 17:17:17 +0100
|
||||
Subject: [PATCH] gpg: Fix regression for the recent malicious subkey DoS fix.
|
||||
|
||||
* g10/packet.h (PUBKEY_USAGE_VERIFY): New.
|
||||
* g10/getkey.c (get_pubkey_for_sig): Pass new flag also to requested
|
||||
usage.
|
||||
(finish_lookup): Introduce a verify_mode.
|
||||
--
|
||||
|
||||
Fixes-commit: da0164efc7f32013bc24d97b9afa9f8d67c318bb
|
||||
GnuPG-bug-id: 7547
|
||||
|
||||
CVE: CVE-2025-30258
|
||||
Upstream-Status: Backport [https://dev.gnupg.org/rG1e581619bf5315957f2be06b3b1a7f513304c126]
|
||||
|
||||
Reference:
|
||||
https://git.launchpad.net/ubuntu/+source/gnupg2/commit/?id=d086c55a85faafdf8448c12ed726d587e729d2d0
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
g10/getkey.c | 42 ++++++++++++++++++++++++++----------------
|
||||
g10/packet.h | 5 +++--
|
||||
2 files changed, 29 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/g10/getkey.c b/g10/getkey.c
|
||||
index 0fa763a..2a1b330 100644
|
||||
--- a/g10/getkey.c
|
||||
+++ b/g10/getkey.c
|
||||
@@ -309,11 +309,12 @@ pk_from_block (PKT_public_key *pk, kbnode_t keyblock, kbnode_t found_key)
|
||||
|
||||
|
||||
/* Specialized version of get_pubkey which retrieves the key based on
|
||||
- * information in SIG. In contrast to get_pubkey PK is required. IF
|
||||
+ * information in SIG. In contrast to get_pubkey PK is required. If
|
||||
* FORCED_PK is not NULL, this public key is used and copied to PK.
|
||||
* If R_KEYBLOCK is not NULL the entire keyblock is stored there if
|
||||
* found and FORCED_PK is not used; if not used or on error NULL is
|
||||
- * stored there. */
|
||||
+ * stored there. Use this function only to find the key for
|
||||
+ * verification; it can't be used to select a key for signing. */
|
||||
gpg_error_t
|
||||
get_pubkey_for_sig (ctrl_t ctrl, PKT_public_key *pk, PKT_signature *sig,
|
||||
PKT_public_key *forced_pk, kbnode_t *r_keyblock)
|
||||
@@ -333,8 +334,9 @@ get_pubkey_for_sig (ctrl_t ctrl, PKT_public_key *pk, PKT_signature *sig,
|
||||
|
||||
/* Make sure to request only keys cabable of signing. This makes
|
||||
* sure that a subkey w/o a valid backsig or with bad usage flags
|
||||
- * will be skipped. */
|
||||
- pk->req_usage = PUBKEY_USAGE_SIG;
|
||||
+ * will be skipped. We also request the verification mode so that
|
||||
+ * expired and reoked keys are returned. */
|
||||
+ pk->req_usage = (PUBKEY_USAGE_SIG | PUBKEY_USAGE_VERIFY);
|
||||
|
||||
/* First try the ISSUER_FPR info. */
|
||||
fpr = issuer_fpr_raw (sig, &fprlen);
|
||||
@@ -398,10 +400,10 @@ get_pubkey_bykid (ctrl_t ctrl, PKT_public_key *pk, kbnode_t *r_keyblock,
|
||||
/* Try to get it from the cache. We don't do this when pk is
|
||||
* NULL as it does not guarantee that the user IDs are cached.
|
||||
* The old get_pubkey_function did not check PK->REQ_USAGE when
|
||||
- * reading form the caceh. This is probably a bug. Note that
|
||||
+ * reading from the cache. This is probably a bug. Note that
|
||||
* the cache is not used when the caller asked to return the
|
||||
* entire keyblock. This is because the cache does not
|
||||
- * associate the public key wit its primary key. */
|
||||
+ * associate the public key with its primary key. */
|
||||
pk_cache_entry_t ce;
|
||||
for (ce = pk_cache; ce; ce = ce->next)
|
||||
{
|
||||
@@ -3634,11 +3636,17 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact,
|
||||
PKT_public_key *pk;
|
||||
int req_prim;
|
||||
int diag_exactfound = 0;
|
||||
+ int verify_mode = 0;
|
||||
u32 curtime = make_timestamp ();
|
||||
|
||||
if (r_flags)
|
||||
*r_flags = 0;
|
||||
|
||||
+ /* The verify mode is used to change the behaviour so that we can
|
||||
+ * return an expired or revoked key for signature verification. */
|
||||
+ verify_mode = ((req_usage & PUBKEY_USAGE_VERIFY)
|
||||
+ && (req_usage & PUBKEY_USAGE_SIG));
|
||||
+
|
||||
#define USAGE_MASK (PUBKEY_USAGE_SIG|PUBKEY_USAGE_ENC|PUBKEY_USAGE_CERT)
|
||||
req_usage &= USAGE_MASK;
|
||||
|
||||
@@ -3682,9 +3690,9 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact,
|
||||
}
|
||||
|
||||
if (DBG_LOOKUP)
|
||||
- log_debug ("finish_lookup: checking key %08lX (%s)(req_usage=%x)\n",
|
||||
+ log_debug ("finish_lookup: checking key %08lX (%s)(req_usage=%x%s)\n",
|
||||
(ulong) keyid_from_pk (keyblock->pkt->pkt.public_key, NULL),
|
||||
- foundk ? "one" : "all", req_usage);
|
||||
+ foundk ? "one" : "all", req_usage, verify_mode? ",verify":"");
|
||||
if (diag_exactfound && DBG_LOOKUP)
|
||||
log_debug ("\texact search requested and found\n");
|
||||
|
||||
@@ -3747,28 +3755,28 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact,
|
||||
}
|
||||
|
||||
n_subkeys++;
|
||||
- if (pk->flags.revoked)
|
||||
+ if (!verify_mode && pk->flags.revoked)
|
||||
{
|
||||
if (DBG_LOOKUP)
|
||||
log_debug ("\tsubkey has been revoked\n");
|
||||
n_revoked_or_expired++;
|
||||
continue;
|
||||
}
|
||||
- if (pk->has_expired)
|
||||
+ if (!verify_mode && pk->has_expired)
|
||||
{
|
||||
if (DBG_LOOKUP)
|
||||
log_debug ("\tsubkey has expired\n");
|
||||
n_revoked_or_expired++;
|
||||
continue;
|
||||
}
|
||||
- if (pk->timestamp > curtime && !opt.ignore_valid_from)
|
||||
+ if (!verify_mode && pk->timestamp > curtime && !opt.ignore_valid_from)
|
||||
{
|
||||
if (DBG_LOOKUP)
|
||||
log_debug ("\tsubkey not yet valid\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
- if (want_secret)
|
||||
+ if (!verify_mode && want_secret)
|
||||
{
|
||||
int secret_key_avail = agent_probe_secret_key (NULL, pk);
|
||||
|
||||
@@ -3788,7 +3796,8 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact,
|
||||
}
|
||||
|
||||
if (DBG_LOOKUP)
|
||||
- log_debug ("\tsubkey might be fine\n");
|
||||
+ log_debug ("\tsubkey might be fine%s\n",
|
||||
+ verify_mode? " for verification":"");
|
||||
/* In case a key has a timestamp of 0 set, we make sure
|
||||
that it is used. A better change would be to compare
|
||||
">=" but that might also change the selected keys and
|
||||
@@ -3829,12 +3838,12 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact,
|
||||
log_debug ("\tprimary key usage does not match: "
|
||||
"want=%x have=%x\n", req_usage, pk->pubkey_usage);
|
||||
}
|
||||
- else if (pk->flags.revoked)
|
||||
+ else if (!verify_mode && pk->flags.revoked)
|
||||
{
|
||||
if (DBG_LOOKUP)
|
||||
log_debug ("\tprimary key has been revoked\n");
|
||||
}
|
||||
- else if (pk->has_expired)
|
||||
+ else if (!verify_mode && pk->has_expired)
|
||||
{
|
||||
if (DBG_LOOKUP)
|
||||
log_debug ("\tprimary key has expired\n");
|
||||
@@ -3842,7 +3851,8 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact,
|
||||
else /* Okay. */
|
||||
{
|
||||
if (DBG_LOOKUP)
|
||||
- log_debug ("\tprimary key may be used\n");
|
||||
+ log_debug ("\tprimary key may be used%s\n",
|
||||
+ verify_mode? " for verification":"");
|
||||
latest_key = keyblock;
|
||||
}
|
||||
}
|
||||
diff --git a/g10/packet.h b/g10/packet.h
|
||||
index 669739a..061a9b1 100644
|
||||
--- a/g10/packet.h
|
||||
+++ b/g10/packet.h
|
||||
@@ -135,6 +135,7 @@ typedef struct {
|
||||
gcry_mpi_t data[PUBKEY_MAX_NENC];
|
||||
} PKT_pubkey_enc;
|
||||
|
||||
+#define PUBKEY_USAGE_VERIFY 16384 /* Verify only modifier. */
|
||||
|
||||
/* An object to build a list of public-key encrypted session key. */
|
||||
struct pubkey_enc_list
|
||||
@@ -385,8 +386,8 @@ typedef struct
|
||||
byte selfsigversion; /* highest version of all of the self-sigs */
|
||||
/* The public key algorithm. (Serialized.) */
|
||||
byte pubkey_algo;
|
||||
- byte pubkey_usage; /* for now only used to pass it to getkey() */
|
||||
- byte req_usage; /* hack to pass a request to getkey() */
|
||||
+ u16 pubkey_usage; /* for now only used to pass it to getkey() */
|
||||
+ u16 req_usage; /* hack to pass a request to getkey() */
|
||||
byte fprlen; /* 0 or length of FPR. */
|
||||
u32 has_expired; /* set to the expiration date if expired */
|
||||
/* keyid of the primary key. Never access this value directly.
|
||||
--
|
||||
2.40.0
|
||||
36
meta/recipes-support/gnupg/gnupg/CVE-2025-30258-0005.patch
Normal file
36
meta/recipes-support/gnupg/gnupg/CVE-2025-30258-0005.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
From 4be25979a6b3e2a79d7c9667b07db8b09fb046e9 Mon Sep 17 00:00:00 2001
|
||||
From: Werner Koch <wk@gnupg.org>
|
||||
Date: Thu, 13 Mar 2025 11:35:34 +0100
|
||||
Subject: [PATCH] gpg: Fix double free of internal data.
|
||||
|
||||
* g10/sig-check.c (check_signature_over_key_or_uid): Do not free in
|
||||
no-sig-cache mode if allocated by caller.
|
||||
--
|
||||
|
||||
GnuPG-bug-id: 7547
|
||||
Fixes-commit: 44cdb9d73f1a0b7d2c8483a119b9c4d6caabc1ec
|
||||
|
||||
CVE: CVE-2025-30258
|
||||
Upstream-Status: Backport [https://dev.gnupg.org/rG4be25979a6b3e2a79d7c9667b07db8b09fb046e9]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
g10/sig-check.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/g10/sig-check.c b/g10/sig-check.c
|
||||
index 11f3e0c..a8fbdc7 100644
|
||||
--- a/g10/sig-check.c
|
||||
+++ b/g10/sig-check.c
|
||||
@@ -1013,7 +1013,8 @@ check_signature_over_key_or_uid (ctrl_t ctrl, PKT_public_key *signer,
|
||||
rc = get_pubkey_for_sig (ctrl, signer, sig, NULL, NULL);
|
||||
if (rc)
|
||||
{
|
||||
- xfree (signer);
|
||||
+ if (signer_alloced != 1)
|
||||
+ xfree (signer);
|
||||
signer = NULL;
|
||||
signer_alloced = 0;
|
||||
goto leave;
|
||||
--
|
||||
2.40.0
|
||||
@@ -18,6 +18,11 @@ SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
|
||||
file://0002-use-pkgconfig-instead-of-npth-config.patch \
|
||||
file://0004-autogen.sh-fix-find-version-for-beta-checking.patch \
|
||||
file://0001-Woverride-init-is-not-needed-with-gcc-9.patch \
|
||||
file://CVE-2025-30258-0001.patch \
|
||||
file://CVE-2025-30258-0002.patch \
|
||||
file://CVE-2025-30258-0003.patch \
|
||||
file://CVE-2025-30258-0004.patch \
|
||||
file://CVE-2025-30258-0005.patch \
|
||||
"
|
||||
SRC_URI:append:class-native = " file://0001-configure.ac-use-a-custom-value-for-the-location-of-.patch \
|
||||
file://relocate.patch"
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From 208c6478d5c20b9d8a9f0a293e3808aa16ee091f Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Hamilton <adhamilt@gmail.com>
|
||||
Date: Mon, 7 Jul 2025 10:31:55 +0900
|
||||
Subject: [PATCH] psk: fix read buffer overrun in the "pre_shared_key"
|
||||
extension
|
||||
|
||||
While processing the "pre_shared_key" extension in TLS 1.3, if there
|
||||
are certain malformed data in the extension headers, then the code may
|
||||
read uninitialized memory (2 bytes) beyond the received TLS extension
|
||||
buffer. Spotted by oss-fuzz at:
|
||||
https://issues.oss-fuzz.com/issues/42513990
|
||||
|
||||
Signed-off-by: Andrew Hamilton <adhamilt@gmail.com>
|
||||
Signed-off-by: Daiki Ueno <ueno@gnu.org>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.com/gnutls/gnutls/-/commit/208c6478d5c20b9d8a9f0a293e3808aa16ee091f]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
lib/ext/pre_shared_key.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/lib/ext/pre_shared_key.c b/lib/ext/pre_shared_key.c
|
||||
index 51c4891d5..2cb83e670 100644
|
||||
--- a/lib/ext/pre_shared_key.c
|
||||
+++ b/lib/ext/pre_shared_key.c
|
||||
@@ -839,6 +839,8 @@ static int _gnutls_psk_recv_params(gnutls_session_t session,
|
||||
|
||||
if (session->security_parameters.entity == GNUTLS_CLIENT) {
|
||||
if (session->internals.hsk_flags & HSK_PSK_KE_MODES_SENT) {
|
||||
+ DECR_LEN(len, 2);
|
||||
+
|
||||
uint16_t selected_identity = _gnutls_read_uint16(data);
|
||||
|
||||
for (i=0;i<sizeof(session->key.binders)/sizeof(session->key.binders[0]);i++) {
|
||||
@@ -0,0 +1,37 @@
|
||||
From 61c0505634a6faacf9fa0723843408aa0d3fb90a Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Hamilton <adhamilt@gmail.com>
|
||||
Date: Mon, 7 Jul 2025 10:35:54 +0900
|
||||
Subject: [PATCH] x509: reject zero-length version in certificate request
|
||||
|
||||
Ensure zero size asn1 values are considered invalid in
|
||||
gnutls_x509_crq_get_version, this ensures crq version is not used
|
||||
uninitialized. Spotted by oss-fuzz at:
|
||||
https://issues.oss-fuzz.com/issues/42536706
|
||||
|
||||
Signed-off-by: Andrew Hamilton <adhamilt@gmail.com>
|
||||
Signed-off-by: Daiki Ueno <ueno@gnu.org>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.com/gnutls/gnutls/-/commit/61c0505634a6faacf9fa0723843408aa0d3fb90a]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
lib/x509/crq.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/lib/x509/crq.c b/lib/x509/crq.c
|
||||
index 19e13623c..9e9801d2b 100644
|
||||
--- a/lib/x509/crq.c
|
||||
+++ b/lib/x509/crq.c
|
||||
@@ -635,6 +635,13 @@ int gnutls_x509_crq_get_version(gnutls_x509_crq_t crq)
|
||||
return _gnutls_asn2err(result);
|
||||
}
|
||||
|
||||
+ /* Note that asn1_read_value can return success with */
|
||||
+ /* len set to zero (without setting the data) in some */
|
||||
+ /* conditions. */
|
||||
+ if (unlikely(len <= 0)) {
|
||||
+ return gnutls_assert_val(GNUTLS_E_ASN1_VALUE_NOT_VALID);
|
||||
+ }
|
||||
+
|
||||
return (int) version[0] + 1;
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
58
meta/recipes-support/gnutls/gnutls/CVE-2025-32988.patch
Normal file
58
meta/recipes-support/gnutls/gnutls/CVE-2025-32988.patch
Normal file
@@ -0,0 +1,58 @@
|
||||
From 608829769cbc247679ffe98841109fc73875e573 Mon Sep 17 00:00:00 2001
|
||||
From: Daiki Ueno <ueno@gnu.org>
|
||||
Date: Mon, 7 Jul 2025 10:44:12 +0900
|
||||
Subject: [PATCH] x509: avoid double free when exporting othernames in SAN
|
||||
|
||||
Previously, the _gnutls_write_new_othername function, called by
|
||||
gnutls_x509_ext_export_subject_alt_names to export "otherName" in a
|
||||
certificate's SAN extension, freed the caller allocated ASN.1
|
||||
structure upon error, resulting in a potential double-free.
|
||||
|
||||
Reported by OpenAI Security Research Team.
|
||||
|
||||
Signed-off-by: Daiki Ueno <ueno@gnu.org>
|
||||
|
||||
CVE: CVE-2025-32988
|
||||
Upstream-Status: Backport [https://gitlab.com/gnutls/gnutls/-/commit/608829769cbc247679ffe98841109fc73875e573]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
NEWS | 5 +++++
|
||||
lib/x509/extensions.c | 2 --
|
||||
2 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 025e05148..ff289fa75 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -10,6 +10,11 @@ See the end for copying conditions.
|
||||
and fix developed by Andrew Hamilton. [GNUTLS-SA-2025-07-07-1,
|
||||
CVSS: medium] [CVE-2025-32989]
|
||||
|
||||
+** libgnutls: Fix double-free upon error when exporting otherName in SAN
|
||||
+ Reported by OpenAI Security Research Team. [GNUTLS-SA-2025-07-07-2,
|
||||
+ CVSS: low] [CVE-2025-32988]
|
||||
+
|
||||
+
|
||||
* Version 3.7.4 (released 2022-03-17)
|
||||
|
||||
** libgnutls: Fixed double free during verification of pkcs7 signatures.
|
||||
diff --git a/lib/x509/extensions.c b/lib/x509/extensions.c
|
||||
index 6c2da8fd1..e8be12eaf 100644
|
||||
--- a/lib/x509/extensions.c
|
||||
+++ b/lib/x509/extensions.c
|
||||
@@ -805,7 +805,6 @@ _gnutls_write_new_othername(asn1_node ext, const char *ext_name,
|
||||
result = asn1_write_value(ext, name2, oid, 1);
|
||||
if (result != ASN1_SUCCESS) {
|
||||
gnutls_assert();
|
||||
- asn1_delete_structure(&ext);
|
||||
return _gnutls_asn2err(result);
|
||||
}
|
||||
|
||||
@@ -814,7 +813,6 @@ _gnutls_write_new_othername(asn1_node ext, const char *ext_name,
|
||||
result = asn1_write_value(ext, name2, data, data_size);
|
||||
if (result != ASN1_SUCCESS) {
|
||||
gnutls_assert();
|
||||
- asn1_delete_structure(&ext);
|
||||
return _gnutls_asn2err(result);
|
||||
}
|
||||
|
||||
50
meta/recipes-support/gnutls/gnutls/CVE-2025-32989.patch
Normal file
50
meta/recipes-support/gnutls/gnutls/CVE-2025-32989.patch
Normal file
@@ -0,0 +1,50 @@
|
||||
From 8e5ca951257202089246fa37e93a99d210ee5ca2 Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Hamilton <adhamilt@gmail.com>
|
||||
Date: Mon, 7 Jul 2025 10:23:59 +0900
|
||||
Subject: [PATCH] x509: fix read buffer overrun in SCT timestamps
|
||||
|
||||
Prevent reading beyond heap buffer in call to _gnutls_parse_ct_sct
|
||||
when processing x509 Signed Certificate Timestamps with certain
|
||||
malformed data. Spotted by oss-fuzz at:
|
||||
https://issues.oss-fuzz.com/issues/42530513
|
||||
|
||||
Signed-off-by: Andrew Hamilton <adhamilt@gmail.com>
|
||||
Signed-off-by: Daiki Ueno <ueno@gnu.org>
|
||||
|
||||
CVE: CVE-2025-32989
|
||||
Upstream-Status: Backport [https://gitlab.com/gnutls/gnutls/-/commit/8e5ca951257202089246fa37e93a99d210ee5ca2]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
NEWS | 5 +++++
|
||||
lib/x509/x509_ext.c | 2 +-
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 85efb5680..025e05148 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -5,6 +5,11 @@ Copyright (C) 2000-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2013-2019 Nikos Mavrogiannopoulos
|
||||
See the end for copying conditions.
|
||||
|
||||
+** libgnutls: Fix heap read buffer overrun in parsing X.509 SCTS timestamps
|
||||
+ Spotted by oss-fuzz and reported by OpenAI Security Research Team,
|
||||
+ and fix developed by Andrew Hamilton. [GNUTLS-SA-2025-07-07-1,
|
||||
+ CVSS: medium] [CVE-2025-32989]
|
||||
+
|
||||
* Version 3.7.4 (released 2022-03-17)
|
||||
|
||||
** libgnutls: Fixed double free during verification of pkcs7 signatures.
|
||||
diff --git a/lib/x509/x509_ext.c b/lib/x509/x509_ext.c
|
||||
index 064ca8357..05336a0c2 100644
|
||||
--- a/lib/x509/x509_ext.c
|
||||
+++ b/lib/x509/x509_ext.c
|
||||
@@ -3855,7 +3855,7 @@ int gnutls_x509_ext_ct_import_scts(const gnutls_datum_t *ext, gnutls_x509_ct_sct
|
||||
}
|
||||
|
||||
length = _gnutls_read_uint16(scts_content.data);
|
||||
- if (length < 4) {
|
||||
+ if (length < 4 || length > scts_content.size) {
|
||||
gnutls_free(scts_content.data);
|
||||
return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE;
|
||||
}
|
||||
2109
meta/recipes-support/gnutls/gnutls/CVE-2025-32990.patch
Normal file
2109
meta/recipes-support/gnutls/gnutls/CVE-2025-32990.patch
Normal file
File diff suppressed because it is too large
Load Diff
299
meta/recipes-support/gnutls/gnutls/CVE-2025-6395.patch
Normal file
299
meta/recipes-support/gnutls/gnutls/CVE-2025-6395.patch
Normal file
@@ -0,0 +1,299 @@
|
||||
From 23135619773e6ec087ff2abc65405bd4d5676bad Mon Sep 17 00:00:00 2001
|
||||
From: Daiki Ueno <ueno@gnu.org>
|
||||
Date: Mon, 7 Jul 2025 11:15:45 +0900
|
||||
Subject: [PATCH] handshake: clear HSK_PSK_SELECTED is when resetting
|
||||
binders
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When a TLS 1.3 handshake involves HRR and resumption or PSK, and the
|
||||
second Client Hello omits PSK, the server would result in a NULL
|
||||
pointer dereference as the PSK binder information is cleared while the
|
||||
HSK_PSK_SELECTED flag is still set. This makes sure that
|
||||
HSK_PSK_SELECTED flag is always cleared when the PSK binders are
|
||||
reset. This also makes it clear the HSK_PSK_SELECTED flag is valid
|
||||
only during a handshake; after that, whether PSK is used can be
|
||||
checked with gnutls_auth_client_get_type.
|
||||
|
||||
Reported by Stefan Bühler.
|
||||
|
||||
Signed-off-by: Daiki Ueno <ueno@gnu.org>
|
||||
|
||||
CVE: CVE-2025-6395
|
||||
Upstream-Status: Backport [https://gitlab.com/gnutls/gnutls/-/commit/23135619773e6ec087ff2abc65405bd4d5676bad]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
NEWS | 4 +
|
||||
lib/handshake.c | 25 +++-
|
||||
lib/state.c | 4 +-
|
||||
tests/Makefile.am | 2 +
|
||||
tests/tls13/hello_retry_request_psk.c | 173 ++++++++++++++++++++++++++
|
||||
5 files changed, 204 insertions(+), 4 deletions(-)
|
||||
create mode 100644 tests/tls13/hello_retry_request_psk.c
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 1334516c6..d800e83b0 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -5,6 +5,10 @@ Copyright (C) 2000-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2013-2019 Nikos Mavrogiannopoulos
|
||||
See the end for copying conditions.
|
||||
|
||||
+** libgnutls: Fix NULL pointer dereference when 2nd Client Hello omits PSK
|
||||
+ Reported by Stefan Bühler. [GNUTLS-SA-2025-07-07-4, CVSS: medium]
|
||||
+ [CVE-2025-6395]
|
||||
+
|
||||
** libgnutls: Fix heap read buffer overrun in parsing X.509 SCTS timestamps
|
||||
Spotted by oss-fuzz and reported by OpenAI Security Research Team,
|
||||
and fix developed by Andrew Hamilton. [GNUTLS-SA-2025-07-07-1,
|
||||
diff --git a/lib/handshake.c b/lib/handshake.c
|
||||
index 722307be7..489d02194 100644
|
||||
--- a/lib/handshake.c
|
||||
+++ b/lib/handshake.c
|
||||
@@ -590,9 +590,28 @@ static int set_auth_types(gnutls_session_t session)
|
||||
/* Under TLS1.3 this returns a KX which matches the negotiated
|
||||
* groups from the key shares; if we are resuming then the KX seen
|
||||
* here doesn't match the original session. */
|
||||
- if (!session->internals.resumed)
|
||||
- kx = gnutls_kx_get(session);
|
||||
- else
|
||||
+ if (!session->internals.resumed) {
|
||||
+ const gnutls_group_entry_st *group = get_group(session);
|
||||
+
|
||||
+ if (session->internals.hsk_flags & HSK_PSK_SELECTED) {
|
||||
+ if (group) {
|
||||
+ kx = group->pk == GNUTLS_PK_DH ?
|
||||
+ GNUTLS_KX_DHE_PSK :
|
||||
+ GNUTLS_KX_ECDHE_PSK;
|
||||
+ } else {
|
||||
+ kx = GNUTLS_KX_PSK;
|
||||
+ }
|
||||
+ } else if (group) {
|
||||
+ /* Not necessarily be RSA, but just to
|
||||
+ * make _gnutls_map_kx_get_cred below
|
||||
+ * work.
|
||||
+ */
|
||||
+ kx = group->pk == GNUTLS_PK_DH ?
|
||||
+ GNUTLS_KX_DHE_RSA :
|
||||
+ GNUTLS_KX_ECDHE_RSA;
|
||||
+ } else
|
||||
+ kx = GNUTLS_KX_UNKNOWN;
|
||||
+ } else
|
||||
kx = GNUTLS_KX_UNKNOWN;
|
||||
} else {
|
||||
/* TLS1.2 or earlier, kx is associated with ciphersuite */
|
||||
diff --git a/lib/state.c b/lib/state.c
|
||||
index ec514c0cd..10ec0eadb 100644
|
||||
--- a/lib/state.c
|
||||
+++ b/lib/state.c
|
||||
@@ -206,7 +206,8 @@ gnutls_kx_algorithm_t gnutls_kx_get(gnutls_session_t session)
|
||||
const gnutls_group_entry_st *group = get_group(session);
|
||||
|
||||
if (ver->tls13_sem) {
|
||||
- if (session->internals.hsk_flags & HSK_PSK_SELECTED) {
|
||||
+ if (gnutls_auth_client_get_type(session) ==
|
||||
+ GNUTLS_CRD_PSK) {
|
||||
if (group) {
|
||||
if (group->pk == GNUTLS_PK_DH)
|
||||
return GNUTLS_KX_DHE_PSK;
|
||||
@@ -357,6 +358,7 @@ void reset_binders(gnutls_session_t session)
|
||||
_gnutls_free_temp_key_datum(&session->key.binders[0].psk);
|
||||
_gnutls_free_temp_key_datum(&session->key.binders[1].psk);
|
||||
memset(session->key.binders, 0, sizeof(session->key.binders));
|
||||
+ session->internals.hsk_flags &= ~HSK_PSK_SELECTED;
|
||||
}
|
||||
|
||||
/* Check whether certificate credentials of type @cert_type are set
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index c2d226a00..e43faf10f 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -128,6 +128,8 @@ ctests += tls13/hello_retry_request
|
||||
|
||||
ctests += tls13/hello_retry_request_resume
|
||||
|
||||
+ctests += tls13/hello_retry_request_psk
|
||||
+
|
||||
ctests += tls13/psk-ext
|
||||
|
||||
ctests += tls13/key_update
|
||||
diff --git a/tests/tls13/hello_retry_request_psk.c b/tests/tls13/hello_retry_request_psk.c
|
||||
new file mode 100644
|
||||
index 000000000..a20cb0d96
|
||||
--- /dev/null
|
||||
+++ b/tests/tls13/hello_retry_request_psk.c
|
||||
@@ -0,0 +1,173 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2017-2025 Red Hat, Inc.
|
||||
+ *
|
||||
+ * Author: Nikos Mavrogiannopoulos, Daiki Ueno
|
||||
+ *
|
||||
+ * This file is part of GnuTLS.
|
||||
+ *
|
||||
+ * GnuTLS is free software; you can redistribute it and/or modify it
|
||||
+ * under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 3 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * GnuTLS is distributed in the hope that it will be useful, but
|
||||
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public License
|
||||
+ * along with this program. If not, see <https://www.gnu.org/licenses/>
|
||||
+ */
|
||||
+
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+#include "config.h"
|
||||
+#endif
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <stdint.h>
|
||||
+
|
||||
+#include <string.h>
|
||||
+#include <gnutls/gnutls.h>
|
||||
+#include <assert.h>
|
||||
+
|
||||
+#include "cert-common.h"
|
||||
+#include "utils.h"
|
||||
+#include "tls13/ext-parse.h"
|
||||
+#include "eagain-common.h"
|
||||
+
|
||||
+/* This program exercises the case where a TLS 1.3 handshake ends up
|
||||
+ * with HRR, and the first CH includes PSK while the 2nd CH omits
|
||||
+ * it */
|
||||
+
|
||||
+const char *testname = "hello entry request";
|
||||
+
|
||||
+const char *side = "";
|
||||
+
|
||||
+#define myfail(fmt, ...) fail("%s: " fmt, testname, ##__VA_ARGS__)
|
||||
+
|
||||
+static void tls_log_func(int level, const char *str)
|
||||
+{
|
||||
+ fprintf(stderr, "%s|<%d>| %s", side, level, str);
|
||||
+}
|
||||
+
|
||||
+struct ctx_st {
|
||||
+ unsigned hrr_seen;
|
||||
+ unsigned hello_counter;
|
||||
+};
|
||||
+
|
||||
+static int pskfunc(gnutls_session_t session, const char *username,
|
||||
+ gnutls_datum_t *key)
|
||||
+{
|
||||
+ if (debug)
|
||||
+ printf("psk: username %s\n", username);
|
||||
+ key->data = gnutls_malloc(4);
|
||||
+ key->data[0] = 0xDE;
|
||||
+ key->data[1] = 0xAD;
|
||||
+ key->data[2] = 0xBE;
|
||||
+ key->data[3] = 0xEF;
|
||||
+ key->size = 4;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int hello_callback(gnutls_session_t session, unsigned int htype,
|
||||
+ unsigned post, unsigned int incoming,
|
||||
+ const gnutls_datum_t *msg)
|
||||
+{
|
||||
+ struct ctx_st *ctx = gnutls_session_get_ptr(session);
|
||||
+ assert(ctx != NULL);
|
||||
+
|
||||
+ if (htype == GNUTLS_HANDSHAKE_HELLO_RETRY_REQUEST)
|
||||
+ ctx->hrr_seen = 1;
|
||||
+
|
||||
+ if (htype == GNUTLS_HANDSHAKE_CLIENT_HELLO) {
|
||||
+ if (post == GNUTLS_HOOK_POST)
|
||||
+ ctx->hello_counter++;
|
||||
+ else {
|
||||
+ /* Unset the PSK credential to omit the extension */
|
||||
+ gnutls_credentials_set(session, GNUTLS_CRD_PSK, NULL);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void doit(void)
|
||||
+{
|
||||
+ int sret, cret;
|
||||
+ gnutls_psk_server_credentials_t scred;
|
||||
+ gnutls_psk_client_credentials_t ccred;
|
||||
+ gnutls_certificate_credentials_t ccred2;
|
||||
+ gnutls_session_t server, client;
|
||||
+ /* Need to enable anonymous KX specifically. */
|
||||
+ const gnutls_datum_t key = { (void *)"DEADBEEF", 8 };
|
||||
+
|
||||
+ struct ctx_st ctx;
|
||||
+ memset(&ctx, 0, sizeof(ctx));
|
||||
+
|
||||
+ global_init();
|
||||
+
|
||||
+ gnutls_global_set_log_function(tls_log_func);
|
||||
+ if (debug)
|
||||
+ gnutls_global_set_log_level(9);
|
||||
+
|
||||
+ /* Init server */
|
||||
+ assert(gnutls_psk_allocate_server_credentials(&scred) >= 0);
|
||||
+ gnutls_psk_set_server_credentials_function(scred, pskfunc);
|
||||
+
|
||||
+ gnutls_init(&server, GNUTLS_SERVER);
|
||||
+
|
||||
+ assert(gnutls_priority_set_direct(
|
||||
+ server,
|
||||
+ "NORMAL:-VERS-ALL:+VERS-TLS1.3:-GROUP-ALL:+GROUP-X25519:+DHE-PSK",
|
||||
+ NULL) >= 0);
|
||||
+
|
||||
+ gnutls_credentials_set(server, GNUTLS_CRD_PSK, scred);
|
||||
+ gnutls_transport_set_push_function(server, server_push);
|
||||
+ gnutls_transport_set_pull_function(server, server_pull);
|
||||
+ gnutls_transport_set_ptr(server, server);
|
||||
+
|
||||
+ /* Init client */
|
||||
+ assert(gnutls_psk_allocate_client_credentials(&ccred) >= 0);
|
||||
+ gnutls_psk_set_client_credentials(ccred, "test", &key,
|
||||
+ GNUTLS_PSK_KEY_HEX);
|
||||
+ assert(gnutls_certificate_allocate_credentials(&ccred2) >= 0);
|
||||
+
|
||||
+ assert(gnutls_init(&client, GNUTLS_CLIENT | GNUTLS_KEY_SHARE_TOP) >= 0);
|
||||
+
|
||||
+ gnutls_session_set_ptr(client, &ctx);
|
||||
+
|
||||
+ cret = gnutls_priority_set_direct(
|
||||
+ client,
|
||||
+ "NORMAL:-VERS-ALL:+VERS-TLS1.3:-GROUP-ALL:+GROUP-SECP256R1:+GROUP-X25519:+DHE-PSK",
|
||||
+ NULL);
|
||||
+ if (cret < 0)
|
||||
+ myfail("cannot set TLS 1.3 priorities\n");
|
||||
+
|
||||
+ gnutls_credentials_set(client, GNUTLS_CRD_PSK, ccred);
|
||||
+ gnutls_credentials_set(client, GNUTLS_CRD_CERTIFICATE, ccred2);
|
||||
+ gnutls_transport_set_push_function(client, client_push);
|
||||
+ gnutls_transport_set_pull_function(client, client_pull);
|
||||
+ gnutls_transport_set_ptr(client, client);
|
||||
+
|
||||
+ gnutls_handshake_set_hook_function(client, GNUTLS_HANDSHAKE_ANY,
|
||||
+ GNUTLS_HOOK_BOTH, hello_callback);
|
||||
+
|
||||
+ HANDSHAKE_EXPECT(client, server, GNUTLS_E_AGAIN,
|
||||
+ GNUTLS_E_INSUFFICIENT_CREDENTIALS);
|
||||
+
|
||||
+ assert(ctx.hrr_seen != 0);
|
||||
+
|
||||
+ gnutls_bye(client, GNUTLS_SHUT_WR);
|
||||
+ gnutls_bye(server, GNUTLS_SHUT_WR);
|
||||
+
|
||||
+ gnutls_deinit(client);
|
||||
+ gnutls_deinit(server);
|
||||
+
|
||||
+ gnutls_psk_free_server_credentials(scred);
|
||||
+ gnutls_psk_free_client_credentials(ccred);
|
||||
+ gnutls_certificate_free_credentials(ccred2);
|
||||
+
|
||||
+ gnutls_global_deinit();
|
||||
+ reset_buffers();
|
||||
+}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user