mirror of
https://git.yoctoproject.org/poky
synced 2026-02-21 17:09:42 +01:00
Compare commits
71 Commits
scarthgap-
...
yocto-5.0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec220ae083 | ||
|
|
1df3fcb4a5 | ||
|
|
93c7e11457 | ||
|
|
fb9746b787 | ||
|
|
dcfcbb21c2 | ||
|
|
f1647fba72 | ||
|
|
19dd05ccc9 | ||
|
|
3318b5eb4d | ||
|
|
9c4fe6dac5 | ||
|
|
819f151bed | ||
|
|
40999c1bbd | ||
|
|
00ade479ef | ||
|
|
4d2729b88c | ||
|
|
c030f0e492 | ||
|
|
729f2a3d19 | ||
|
|
1a02f43617 | ||
|
|
0a71bd589c | ||
|
|
61545ac190 | ||
|
|
95bbe19b02 | ||
|
|
83fac1162d | ||
|
|
eb487bba3e | ||
|
|
1db6ffa609 | ||
|
|
ba10ae532a | ||
|
|
2cc9a0249b | ||
|
|
6d83b872af | ||
|
|
0263c3dfa4 | ||
|
|
6f7e929ea6 | ||
|
|
1fd82d514f | ||
|
|
7d110f9a94 | ||
|
|
c82f7a0577 | ||
|
|
f6b4415273 | ||
|
|
d9b992de0d | ||
|
|
2156b7931e | ||
|
|
664f26b3f0 | ||
|
|
114eddfaef | ||
|
|
f569a0f2d9 | ||
|
|
f5aab38227 | ||
|
|
bee76dfe7e | ||
|
|
5de981dd1c | ||
|
|
e9a35f720c | ||
|
|
511d3e23f5 | ||
|
|
bfb799ef2a | ||
|
|
e711b2f39a | ||
|
|
f578ce2a73 | ||
|
|
057c86df84 | ||
|
|
8721aab7af | ||
|
|
8b8f23e650 | ||
|
|
93663dc300 | ||
|
|
0bc339e2fc | ||
|
|
3327031e2b | ||
|
|
cf89d7b3bf | ||
|
|
99f48be958 | ||
|
|
ed5a1a7443 | ||
|
|
5f469434d3 | ||
|
|
d5613f0d2e | ||
|
|
76f88baf01 | ||
|
|
b162dfb492 | ||
|
|
6269788fef | ||
|
|
0efe19beef | ||
|
|
792d18b4cb | ||
|
|
15a4d0cfb1 | ||
|
|
f2a6317735 | ||
|
|
d06bc81271 | ||
|
|
a27ca8e3c0 | ||
|
|
38f0ee2ec7 | ||
|
|
9302874dda | ||
|
|
c172c46096 | ||
|
|
83ba977250 | ||
|
|
ef6f8d5f46 | ||
|
|
ae35f06bb1 | ||
|
|
6d2f2bd3f7 |
@@ -729,6 +729,8 @@ class RunQueueData:
|
||||
if mc == frommc:
|
||||
fn = taskData[mcdep].build_targets[pn][0]
|
||||
newdep = '%s:%s' % (fn,deptask)
|
||||
if newdep not in taskData[mcdep].taskentries:
|
||||
bb.fatal("Task mcdepends on non-existent task %s" % (newdep))
|
||||
taskData[mc].taskentries[tid].tdepends.append(newdep)
|
||||
|
||||
for mc in taskData:
|
||||
|
||||
@@ -1421,7 +1421,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", "", "")
|
||||
|
||||
2
bitbake/lib/bb/tests/runqueue-tests/recipes/g1.bb
Normal file
2
bitbake/lib/bb/tests/runqueue-tests/recipes/g1.bb
Normal file
@@ -0,0 +1,2 @@
|
||||
do_build[mcdepends] = "mc::mc-1:h1:do_invalid"
|
||||
|
||||
0
bitbake/lib/bb/tests/runqueue-tests/recipes/h1.bb
Normal file
0
bitbake/lib/bb/tests/runqueue-tests/recipes/h1.bb
Normal file
@@ -26,7 +26,7 @@ class RunQueueTests(unittest.TestCase):
|
||||
a1_sstatevalid = "a1:do_package a1:do_package_qa a1:do_packagedata a1:do_package_write_ipk a1:do_package_write_rpm a1:do_populate_lic a1:do_populate_sysroot"
|
||||
b1_sstatevalid = "b1:do_package b1:do_package_qa b1:do_packagedata b1:do_package_write_ipk b1:do_package_write_rpm b1:do_populate_lic b1:do_populate_sysroot"
|
||||
|
||||
def run_bitbakecmd(self, cmd, builddir, sstatevalid="", slowtasks="", extraenv=None, cleanup=False):
|
||||
def run_bitbakecmd(self, cmd, builddir, sstatevalid="", slowtasks="", extraenv=None, cleanup=False, allowfailure=False):
|
||||
env = os.environ.copy()
|
||||
env["BBPATH"] = os.path.realpath(os.path.join(os.path.dirname(__file__), "runqueue-tests"))
|
||||
env["BB_ENV_PASSTHROUGH_ADDITIONS"] = "SSTATEVALID SLOWTASKS TOPDIR"
|
||||
@@ -41,6 +41,8 @@ class RunQueueTests(unittest.TestCase):
|
||||
output = subprocess.check_output(cmd, env=env, stderr=subprocess.STDOUT,universal_newlines=True, cwd=builddir)
|
||||
print(output)
|
||||
except subprocess.CalledProcessError as e:
|
||||
if allowfailure:
|
||||
return e.output
|
||||
self.fail("Command %s failed with %s" % (cmd, e.output))
|
||||
tasks = []
|
||||
tasklog = builddir + "/task.log"
|
||||
@@ -314,6 +316,13 @@ class RunQueueTests(unittest.TestCase):
|
||||
["mc_2:a1:%s" % t for t in rerun_tasks]
|
||||
self.assertEqual(set(tasks), set(expected))
|
||||
|
||||
# Check that a multiconfig that doesn't exist rasies a correct error message
|
||||
error_output = self.run_bitbakecmd(["bitbake", "g1"], tempdir, "", extraenv=extraenv, cleanup=True, allowfailure=True)
|
||||
self.assertIn("non-existent task", error_output)
|
||||
# If the word 'Traceback' or 'KeyError' is in the output we've regressed
|
||||
self.assertNotIn("Traceback", error_output)
|
||||
self.assertNotIn("KeyError", error_output)
|
||||
|
||||
self.shutdown(tempdir)
|
||||
|
||||
def test_hashserv_single(self):
|
||||
|
||||
@@ -1854,6 +1854,15 @@ def path_is_descendant(descendant, ancestor):
|
||||
|
||||
return False
|
||||
|
||||
# Recomputing the sets in signal.py is expensive (bitbake -pP idle)
|
||||
# so try and use _signal directly to avoid it
|
||||
valid_signals = signal.valid_signals()
|
||||
try:
|
||||
import _signal
|
||||
sigmask = _signal.pthread_sigmask
|
||||
except ImportError:
|
||||
sigmask = signal.pthread_sigmask
|
||||
|
||||
# If we don't have a timeout of some kind and a process/thread exits badly (for example
|
||||
# OOM killed) and held a lock, we'd just hang in the lock futex forever. It is better
|
||||
# we exit at some point than hang. 5 minutes with no progress means we're probably deadlocked.
|
||||
@@ -1863,7 +1872,7 @@ def path_is_descendant(descendant, ancestor):
|
||||
@contextmanager
|
||||
def lock_timeout(lock):
|
||||
try:
|
||||
s = signal.pthread_sigmask(signal.SIG_BLOCK, signal.valid_signals())
|
||||
s = sigmask(signal.SIG_BLOCK, valid_signals)
|
||||
held = lock.acquire(timeout=5*60)
|
||||
if not held:
|
||||
bb.server.process.serverlog("Couldn't get the lock for 5 mins, timed out, exiting.\n%s" % traceback.format_stack())
|
||||
@@ -1871,16 +1880,16 @@ def lock_timeout(lock):
|
||||
yield held
|
||||
finally:
|
||||
lock.release()
|
||||
signal.pthread_sigmask(signal.SIG_SETMASK, s)
|
||||
sigmask(signal.SIG_SETMASK, s)
|
||||
|
||||
# A version of lock_timeout without the check that the lock was locked and a shorter timeout
|
||||
@contextmanager
|
||||
def lock_timeout_nocheck(lock):
|
||||
try:
|
||||
s = signal.pthread_sigmask(signal.SIG_BLOCK, signal.valid_signals())
|
||||
s = sigmask(signal.SIG_BLOCK, valid_signals)
|
||||
l = lock.acquire(timeout=10)
|
||||
yield l
|
||||
finally:
|
||||
if l:
|
||||
lock.release()
|
||||
signal.pthread_sigmask(signal.SIG_SETMASK, s)
|
||||
sigmask(signal.SIG_SETMASK, s)
|
||||
|
||||
@@ -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::
|
||||
|
||||
@@ -17,3 +17,4 @@ Release 5.0 (scarthgap)
|
||||
release-notes-5.0.8
|
||||
release-notes-5.0.9
|
||||
release-notes-5.0.10
|
||||
release-notes-5.0.11
|
||||
|
||||
219
documentation/migration-guides/release-notes-5.0.11.rst
Normal file
219
documentation/migration-guides/release-notes-5.0.11.rst
Normal file
@@ -0,0 +1,219 @@
|
||||
.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
|
||||
|
||||
Release notes for Yocto-5.0.11 (Scarthgap)
|
||||
------------------------------------------
|
||||
|
||||
Security Fixes in Yocto-5.0.11
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- binutils: Fix :cve_nist:`2025-5244` and :cve_nist:`2025-5245`
|
||||
- busybox: Fix :cve_nist:`2022-48174`
|
||||
- coreutils: Fix :cve_nist:`2025-5278`
|
||||
- curl: Ignore :cve_nist:`2025-5025` if :term:`PACKAGECONFIG` set with openssl
|
||||
- ffmpeg: Fix :cve_nist:`2025-1373`
|
||||
- glibc: fix :cve_nist:`2025-4802` and :cve_nist:`2025-5702`
|
||||
- gnupg: Fix :cve_nist:`2025-30258`
|
||||
- go: Fix :cve_nist:`2025-4673`
|
||||
- go: Ignore :cve_nist:`2024-3566`
|
||||
- icu: Fix :cve_nist:`2025-5222`
|
||||
- kea: Fix :cve_nist:`2025-32801`, :cve_nist:`2025-32802` and :cve_nist:`2025-32803`
|
||||
- libarchive: fix :cve_nist:`2025-5914`, :cve_nist:`2025-5915`, :cve_nist:`2025-5916`,
|
||||
:cve_nist:`2025-5917` and :cve_nist:`2025-5918`
|
||||
- libsoup-2.4: Fix :cve_nist:`2025-2784`, :cve_nist:`2025-4476`, :cve_nist:`2025-4945`,
|
||||
:cve_nist:`2025-4948`, :cve_nist:`2025-4969`, :cve_nist:`2025-32050`, :cve_nist:`2025-32052`,
|
||||
:cve_nist:`2025-32053`, :cve_nist:`2025-32907` and :cve_nist:`2025-46421`
|
||||
- libsoup-3.4: Fix :cve_nist:`2025-2784`, :cve_nist:`2025-4945`, :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-32908` and :cve_nist:`2025-46421`
|
||||
- libxml2: Fix :cve_nist:`2025-6021`
|
||||
- linux-yocto-6.6: Fix :cve_nist:`2025-21995`, :cve_nist:`2025-21996`, :cve_nist:`2025-21997`,
|
||||
:cve_nist:`2025-21999`, :cve_nist:`2025-22001`, :cve_nist:`2025-22003`, :cve_nist:`2025-22004`,
|
||||
:cve_nist:`2025-22005`, :cve_nist:`2025-22007`, :cve_nist:`2025-22009`, :cve_nist:`2025-22010`,
|
||||
:cve_nist:`2025-22014`, :cve_nist:`2025-22018`, :cve_nist:`2025-22020`, :cve_nist:`2025-22027`,
|
||||
:cve_nist:`2025-22033`, :cve_nist:`2025-22035`, :cve_nist:`2025-22038`, :cve_nist:`2025-22040`,
|
||||
:cve_nist:`2025-22041`, :cve_nist:`2025-22054`, :cve_nist:`2025-22056`, :cve_nist:`2025-22063`,
|
||||
:cve_nist:`2025-22066`, :cve_nist:`2025-22080`, :cve_nist:`2025-22081`, :cve_nist:`2025-22088`,
|
||||
:cve_nist:`2025-22097`, :cve_nist:`2025-23136`, :cve_nist:`2025-37785`, :cve_nist:`2025-37800`,
|
||||
:cve_nist:`2025-37801`, :cve_nist:`2025-37803`, :cve_nist:`2025-37805`, :cve_nist:`2025-37838`,
|
||||
:cve_nist:`2025-37893`, :cve_nist:`2025-38152`, :cve_nist:`2025-39728` and :cve_nist:`2025-39735`
|
||||
- net-tools: Fix :cve_nist:`2025-46836`
|
||||
- python3-setuptools: Fix :cve_nist:`2025-47273`
|
||||
- python3-requests: fix :cve_nist:`2024-47081`
|
||||
- python3-urllib3: Fix :cve_nist:`2025-50181`
|
||||
- python3: Fix CVE 2024-12718 CVE 2025-4138 CVE 2025-4330 CVE 2025-4435 :cve_nist:`2025-4516` CVE
|
||||
2025-4517
|
||||
- screen: fix :cve_nist:`2025-46802`, :cve_nist:`2025-46804` and :cve_nist:`2025-46805`
|
||||
- sudo: Fix :cve_nist:`2025-32462`
|
||||
- xwayland: Fix :cve_nist:`2025-49175`, :cve_nist:`2025-49176`, :cve_nist:`2025-49177`,
|
||||
:cve_nist:`2025-49178`, :cve_nist:`2025-49179` and :cve_nist:`2025-49180`
|
||||
|
||||
|
||||
Fixes in Yocto-5.0.11
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- bitbake: ast: Change deferred inherits to happen per recipe
|
||||
- bitbake: fetch2: Avoid deprecation warning
|
||||
- bitbake: gcp.py: remove slow calls to gsutil stat
|
||||
- bitbake: toaster/tests/buildtest: Switch to new CDN
|
||||
- brief-yoctoprojectqs/ref-manual: Switch to new CDN
|
||||
- bsp-guide: update kernel version example to 6.12
|
||||
- bsp-guide: update all of section 1.8.2 to reflect current beaglebone conf file
|
||||
- bsp-guide: update lonely "4.12" kernel reference to "6.12"
|
||||
- build-appliance-image: Update to scarthgap head revision
|
||||
- cmake: Correctly handle cost data of tests with arbitrary chars in name
|
||||
- conf.py: improve SearchEnglish to handle terms with dots
|
||||
- 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
|
||||
- gcc: Upgrade to GCC 13.4
|
||||
- ghostscript: upgrade to 10.05.1
|
||||
- glibc: stable 2.39 branch updates (06a70769fd...)
|
||||
- gnupg: update to 2.4.8
|
||||
- gtk+: add missing libdrm dependency
|
||||
- kea: upgrade to 2.4.2
|
||||
- libpng: Add ptest
|
||||
- libsoup-2.4: fix do_compile failure
|
||||
- linux-yocto/6.6: fix beaglebone ethernet
|
||||
- linux-yocto/6.6: update to v6.6.96
|
||||
- local.conf.sample: Switch to new CDN
|
||||
- ltp: backport patch to fix compilation error for x86_64
|
||||
- migration-guides: add release notes for 4.0.27, 4.0.28, 5.0.10
|
||||
- minicom: correct the :term:`SRC_URI`
|
||||
- nfs-utils: don't use signals to shut down nfs server.
|
||||
- overview-manual/concepts.rst: fix sayhello hardcoded bindir
|
||||
- overview-manual: small number of pedantic cleanups
|
||||
- package: export debugsources in :term:`PKGDESTWORK` as json
|
||||
- poky.conf: bump version for 5.0.11
|
||||
- python3-requests: upgrade to 2.32.4
|
||||
- python3: upgrade to 3.12.11
|
||||
- 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: document :term:`KERNEL_SPLIT_MODULES` variable
|
||||
- scripts/install-buildtools: Update to 5.0.10
|
||||
- spdx: add option to include only compiled sources
|
||||
- sstatetests: Switch to new CDN
|
||||
- systemd: Rename systemd_v255.21 to systemd_255.21
|
||||
- systemd: upgrade to 255.21
|
||||
- tcf-agent: correct the :term:`SRC_URI`
|
||||
- testimage: get real os-release file
|
||||
- tune-cortexr52: Remove aarch64 for ARM Cortex-R52
|
||||
- uboot: Allow for customizing installed/deployed file names
|
||||
|
||||
|
||||
Known Issues in Yocto-5.0.11
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- N/A
|
||||
|
||||
Contributors to Yocto-5.0.11
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Thanks to the following people who contributed to this release:
|
||||
- Aleksandar Nikolic
|
||||
- Andrew Fernandes
|
||||
- Antonin Godard
|
||||
- Archana Polampalli
|
||||
- Ashish Sharma
|
||||
- Bruce Ashfield
|
||||
- Carlos Sánchez de La Lama
|
||||
- Changqing Li
|
||||
- Chen Qi
|
||||
- Colin Pinnell McAllister
|
||||
- Daniel Turull
|
||||
- Deepesh Varatharajan
|
||||
- Divya Chellam
|
||||
- Dixit Parmar
|
||||
- Enrico Jörns
|
||||
- Etienne Cordonnier
|
||||
- Guocai He
|
||||
- Guðni Már Gilbert
|
||||
- Hitendra Prajapati
|
||||
- Jiaying Song
|
||||
- Lee Chee Yang
|
||||
- Moritz Haase
|
||||
- NeilBrown
|
||||
- Peter Marko
|
||||
- Poonam Jadhav
|
||||
- Praveen Kumar
|
||||
- Preeti Sachan
|
||||
- Quentin Schulz
|
||||
- Richard Purdie
|
||||
- Robert P. J. Day
|
||||
- Roland Kovacs
|
||||
- Ryan Eatmon
|
||||
- Sandeep Gundlupet Raju
|
||||
- Savvas Etairidis
|
||||
- Steve Sakoman
|
||||
- Victor Giraud
|
||||
- Vijay Anusuri
|
||||
- Virendra Thakur
|
||||
- Wang Mingyu
|
||||
- Yogita Urade
|
||||
|
||||
|
||||
Repositories / Downloads for Yocto-5.0.11
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
poky
|
||||
|
||||
- Repository Location: :yocto_git:`/poky`
|
||||
- Branch: :yocto_git:`scarthgap </poky/log/?h=scarthgap>`
|
||||
- Tag: :yocto_git:`yocto-5.0.11 </poky/log/?h=yocto-5.0.11>`
|
||||
- Git Revision: :yocto_git:`ae2d52758fc2fcb0ed996aa234430464ebf4b310 </poky/commit/?id=ae2d52758fc2fcb0ed996aa234430464ebf4b310>`
|
||||
- Release Artefact: poky-ae2d52758fc2fcb0ed996aa234430464ebf4b310
|
||||
- sha: 48dec434dd51e5c9c626abdccc334da300fa2b4975137d526f5df6703e5a930e
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-5.0.11/poky-ae2d52758fc2fcb0ed996aa234430464ebf4b310.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-5.0.11/poky-ae2d52758fc2fcb0ed996aa234430464ebf4b310.tar.bz2
|
||||
|
||||
openembedded-core
|
||||
|
||||
- Repository Location: :oe_git:`/openembedded-core`
|
||||
- Branch: :oe_git:`scarthgap </openembedded-core/log/?h=scarthgap>`
|
||||
- Tag: :oe_git:`yocto-5.0.11 </openembedded-core/log/?h=yocto-5.0.11>`
|
||||
- Git Revision: :oe_git:`7a59dc5ee6edd9596e87c2fbcd1f2594c06b3d1b </openembedded-core/commit/?id=7a59dc5ee6edd9596e87c2fbcd1f2594c06b3d1b>`
|
||||
- Release Artefact: oecore-7a59dc5ee6edd9596e87c2fbcd1f2594c06b3d1b
|
||||
- sha: fb50992a28298915fe195e327628d6d5872fd2dbc74189c2d840178cd860bb2e
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-5.0.11/oecore-7a59dc5ee6edd9596e87c2fbcd1f2594c06b3d1b.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-5.0.11/oecore-7a59dc5ee6edd9596e87c2fbcd1f2594c06b3d1b.tar.bz2
|
||||
|
||||
meta-mingw
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-mingw`
|
||||
- Branch: :yocto_git:`scarthgap </meta-mingw/log/?h=scarthgap>`
|
||||
- Tag: :yocto_git:`yocto-5.0.11 </meta-mingw/log/?h=yocto-5.0.11>`
|
||||
- Git Revision: :yocto_git:`bd9fef71ec005be3c3a6d7f8b99d8116daf70c4f </meta-mingw/commit/?id=bd9fef71ec005be3c3a6d7f8b99d8116daf70c4f>`
|
||||
- Release Artefact: meta-mingw-bd9fef71ec005be3c3a6d7f8b99d8116daf70c4f
|
||||
- sha: ab073def6487f237ac125d239b3739bf02415270959546b6b287778664f0ae65
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-5.0.11/meta-mingw-bd9fef71ec005be3c3a6d7f8b99d8116daf70c4f.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-5.0.11/meta-mingw-bd9fef71ec005be3c3a6d7f8b99d8116daf70c4f.tar.bz2
|
||||
|
||||
bitbake
|
||||
|
||||
- Repository Location: :oe_git:`/bitbake`
|
||||
- Branch: :oe_git:`2.8 </bitbake/log/?h=2.8>`
|
||||
- Tag: :oe_git:`yocto-5.0.11 </bitbake/log/?h=yocto-5.0.11>`
|
||||
- Git Revision: :oe_git:`139f61fe9eec221745184a14b3618d2dfa650b91 </bitbake/commit/?id=139f61fe9eec221745184a14b3618d2dfa650b91>`
|
||||
- Release Artefact: bitbake-139f61fe9eec221745184a14b3618d2dfa650b91
|
||||
- sha: 86669d4220c50d35c0703f151571954ad9c6285cc91a870afbb878d2e555d2ca
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-5.0.11/bitbake-139f61fe9eec221745184a14b3618d2dfa650b91.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-5.0.11/bitbake-139f61fe9eec221745184a14b3618d2dfa650b91.tar.bz2
|
||||
|
||||
meta-yocto
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-yocto`
|
||||
- Branch: :yocto_git:`scarthgap </meta-yocto/log/?h=scarthgap>`
|
||||
- Tag: :yocto_git:`yocto-5.0.11 </meta-yocto/log/?h=yocto-5.0.11>`
|
||||
- Git Revision: :yocto_git:`50e5c0d85d3775ac1294bdcd7f11deaa382c9d08 </meta-yocto/commit/?id=50e5c0d85d3775ac1294bdcd7f11deaa382c9d08>`
|
||||
|
||||
yocto-docs
|
||||
|
||||
- Repository Location: :yocto_git:`/yocto-docs`
|
||||
- Branch: :yocto_git:`scarthgap </yocto-docs/log/?h=scarthgap>`
|
||||
- Tag: :yocto_git:`yocto-5.0.11 </yocto-docs/log/?h=yocto-5.0.11>`
|
||||
- Git Revision: :yocto_git:`3f88cb85cca8f9128cfaab36882c4563457b03d9 </yocto-docs/commit/?id=3f88cb85cca8f9128cfaab36882c4563457b03d9>`
|
||||
|
||||
@@ -28,7 +28,7 @@ platforms as well as software stacks that can be maintained and scaled.
|
||||
|
||||
For further introductory information on the Yocto Project, you might be
|
||||
interested in this
|
||||
`article <https://www.embedded.com/electronics-blogs/say-what-/4458600/Why-the-Yocto-Project-for-my-IoT-Project->`__
|
||||
`article <https://www.embedded.com/why-the-yocto-project-for-my-iot-project/>`__
|
||||
by Drew Moseley and in this short introductory
|
||||
`video <https://www.youtube.com/watch?v=utZpKM7i5Z4>`__.
|
||||
|
||||
|
||||
@@ -3186,6 +3186,22 @@ class assuming :term:`PATCHRESOLVE` is set to "user", the
|
||||
:ref:`ref-classes-cml1` class, and the :ref:`ref-classes-devshell` class all
|
||||
use the :ref:`ref-classes-terminal` class.
|
||||
|
||||
.. _ref-classes-testexport:
|
||||
|
||||
``testexport``
|
||||
==============
|
||||
|
||||
Based on the :ref:`ref-classes-testimage` class, the
|
||||
:ref:`ref-classes-testexport` class can be used to export the test environment
|
||||
outside of the :term:`OpenEmbedded Build System`. This will generate the
|
||||
directory structure to execute the runtime tests using the
|
||||
:oe_git:`runexported.py </openembedded-core/tree/meta/lib/oeqa/runexported.py>`
|
||||
Python script.
|
||||
|
||||
For more details on how to use :ref:`ref-classes-testexport`, see
|
||||
the :ref:`test-manual/runtime-testing:Exporting Tests` section in the Yocto
|
||||
Project Test Environment Manual.
|
||||
|
||||
.. _ref-classes-testimage:
|
||||
|
||||
``testimage``
|
||||
@@ -3316,6 +3332,9 @@ The variables used by this class are:
|
||||
- :term:`SPL_SIGN_ENABLE`: enable signing the FIT image.
|
||||
- :term:`SPL_SIGN_KEYDIR`: directory containing the signing keys.
|
||||
- :term:`SPL_SIGN_KEYNAME`: base filename of the signing keys.
|
||||
- :term:`SPL_DTB_BINARY`: Name of the SPL device tree binary. Can be set to an
|
||||
empty string to indicate that no SPL should be created and added to the FIT
|
||||
image.
|
||||
- :term:`UBOOT_FIT_ADDRESS_CELLS`: ``#address-cells`` value for the FIT image.
|
||||
- :term:`UBOOT_FIT_DESC`: description string encoded into the FIT image.
|
||||
- :term:`UBOOT_FIT_GENERATE_KEYS`: generate the keys if they don't exist yet.
|
||||
|
||||
@@ -58,36 +58,35 @@ Supported Linux Distributions
|
||||
Currently, the &DISTRO; release ("&DISTRO_NAME;") of the Yocto Project is
|
||||
supported on the following distributions:
|
||||
|
||||
- Ubuntu 20.04 (LTS)
|
||||
|
||||
- Ubuntu 22.04 (LTS)
|
||||
|
||||
- Ubuntu 23.04
|
||||
|
||||
- Fedora 38
|
||||
|
||||
- Fedora 39
|
||||
|
||||
- CentOS Stream 8
|
||||
|
||||
- Debian GNU/Linux 11 (Bullseye)
|
||||
|
||||
- Debian GNU/Linux 12 (Bookworm)
|
||||
|
||||
- OpenSUSE Leap 15.4
|
||||
..
|
||||
Can be generated with yocto-autobuilder-helper's scripts/yocto-supported-distros:
|
||||
yocto-supported-distros --release scarthgap --config yocto-autobuilder2/config.py --output-format docs --poky-distros
|
||||
|
||||
- AlmaLinux 8
|
||||
|
||||
- AlmaLinux 9
|
||||
|
||||
- Rocky 9
|
||||
- Debian 11
|
||||
- Debian 12
|
||||
- Fedora 39
|
||||
- Fedora 40
|
||||
- Fedora 41
|
||||
- Rocky Linux 8
|
||||
- Rocky Linux 9
|
||||
- Ubuntu 20.04 (LTS)
|
||||
- Ubuntu 22.04 (LTS)
|
||||
- Ubuntu 24.04 (LTS)
|
||||
- Ubuntu 24.10
|
||||
|
||||
The following distribution versions are still tested, even though the
|
||||
organizations publishing them no longer make updates publicly available:
|
||||
|
||||
- Ubuntu 18.04 (LTS)
|
||||
..
|
||||
This list contains EOL distros that are still tested on the Autobuilder
|
||||
(meaning there are running workers).
|
||||
See https://endoflife.date for information of EOL releases.
|
||||
|
||||
- Ubuntu 23.04
|
||||
- Fedora 39
|
||||
- Fedora 40
|
||||
- Ubuntu 20.04 (LTS)
|
||||
|
||||
Note that the Yocto Project doesn't have access to private updates
|
||||
that some of these versions may have. Therefore, our testing has
|
||||
@@ -96,7 +95,15 @@ limited value if you have access to such updates.
|
||||
Finally, here are the distribution versions which were previously
|
||||
tested on former revisions of "&DISTRO_NAME;", but no longer are:
|
||||
|
||||
*This list is currently empty*
|
||||
..
|
||||
Can be generated with yocto-autobuilder-helper's scripts/yocto-supported-distros.
|
||||
yocto-supported-distros --release scarthgap --config yocto-autobuilder2/config.py --output-format docs --old-distros
|
||||
|
||||
- CentOS Stream 8
|
||||
- Fedora 38
|
||||
- OpenSUSE Leap 15.4
|
||||
- Ubuntu 18.04
|
||||
- Ubuntu 23.04
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@@ -3270,6 +3270,10 @@ system and gives an overview of their function and contents.
|
||||
|
||||
This variable is used in the :ref:`ref-classes-kernel-fitimage` class.
|
||||
|
||||
:term:`FIT_CONF_PREFIX`
|
||||
When using the :ref:`ref-classes-kernel-fitimage`, this is the prefix
|
||||
used for creating FIT configuration nodes. Its default value is "conf-".
|
||||
|
||||
:term:`FIT_DESC`
|
||||
Specifies the description string encoded into a FIT image. The
|
||||
default value is set by the :ref:`ref-classes-kernel-fitimage` class as
|
||||
@@ -4076,13 +4080,13 @@ system and gives an overview of their function and contents.
|
||||
variable.
|
||||
|
||||
:term:`IMAGE_PKGTYPE`
|
||||
Defines the package type (i.e. DEB, RPM, IPK, or TAR) used by the
|
||||
Defines the package type (i.e. DEB, RPM or IPK) used by the
|
||||
OpenEmbedded build system. The variable is defined appropriately by
|
||||
the :ref:`ref-classes-package_deb`, :ref:`ref-classes-package_rpm`,
|
||||
or :ref:`ref-classes-package_ipk` class.
|
||||
one of the :ref:`ref-classes-package_deb`, :ref:`ref-classes-package_rpm`,
|
||||
or :ref:`ref-classes-package_ipk` classes.
|
||||
|
||||
The :ref:`ref-classes-populate-sdk-*` and :ref:`ref-classes-image`
|
||||
classes use the :term:`IMAGE_PKGTYPE` for packaging up images and SDKs.
|
||||
classes use the :term:`IMAGE_PKGTYPE` for packaging images and SDKs.
|
||||
|
||||
You should not set the :term:`IMAGE_PKGTYPE` manually. Rather, the
|
||||
variable is set indirectly through the appropriate
|
||||
@@ -4091,12 +4095,6 @@ system and gives an overview of their function and contents.
|
||||
OpenEmbedded build system uses the first package type (e.g. DEB, RPM,
|
||||
or IPK) that appears with the variable
|
||||
|
||||
.. note::
|
||||
|
||||
Files using the ``.tar`` format are never used as a substitute
|
||||
packaging format for DEB, RPM, and IPK formatted files for your image
|
||||
or SDK.
|
||||
|
||||
:term:`IMAGE_POSTPROCESS_COMMAND`
|
||||
Specifies a list of functions to call once the OpenEmbedded build
|
||||
system creates the final image output files. You can specify
|
||||
@@ -8451,6 +8449,11 @@ system and gives an overview of their function and contents.
|
||||
section in the Yocto Project Board Support Package Developer's Guide
|
||||
for additional information.
|
||||
|
||||
:term:`SPL_DTB_BINARY`
|
||||
When inheriting the :ref:`ref-classes-uboot-sign` class, the
|
||||
:term:`SPL_DTB_BINARY` variable contains the name of the SPL binary to be
|
||||
compiled.
|
||||
|
||||
:term:`SPL_MKIMAGE_DTCOPTS`
|
||||
Options for the device tree compiler passed to ``mkimage -D`` feature
|
||||
while creating a FIT image with the :ref:`ref-classes-uboot-sign`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
DISTRO_VERSION = "5.0.11"
|
||||
DISTRO_VERSION = "5.0.12"
|
||||
DISTRO_CODENAME = "scarthgap"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${METADATA_REVISION}', 'snapshot')}"
|
||||
|
||||
@@ -196,6 +196,7 @@ python do_cve_check () {
|
||||
else:
|
||||
bb.note("No CVE database found, skipping CVE check")
|
||||
|
||||
oe.qa.exit_if_errors(d)
|
||||
}
|
||||
|
||||
addtask cve_check before do_build
|
||||
|
||||
@@ -36,6 +36,7 @@ SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/avahi-${PV}.tar.gz \
|
||||
file://CVE-2023-38472.patch \
|
||||
file://CVE-2023-38473.patch \
|
||||
file://CVE-2024-52616.patch \
|
||||
file://CVE-2024-52615.patch \
|
||||
"
|
||||
|
||||
GITHUB_BASE_URI = "https://github.com/avahi/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);
|
||||
@@ -6,6 +6,7 @@ After=time-sync.target
|
||||
|
||||
[Service]
|
||||
ExecStartPre=@BASE_BINDIR@/mkdir -p @LOCALSTATEDIR@/run/kea/
|
||||
ExecStartPre=@BASE_BINDIR@/chmod 750 @LOCALSTATEDIR@/run/kea/
|
||||
ExecStart=@SBINDIR@/kea-dhcp-ddns -c @SYSCONFDIR@/kea/kea-dhcp-ddns.conf
|
||||
|
||||
[Install]
|
||||
|
||||
@@ -6,6 +6,7 @@ After=time-sync.target
|
||||
|
||||
[Service]
|
||||
ExecStartPre=@BASE_BINDIR@/mkdir -p @LOCALSTATEDIR@/run/kea/
|
||||
ExecStartPre=@BASE_BINDIR@/chmod 750 @LOCALSTATEDIR@/run/kea/
|
||||
ExecStartPre=@BASE_BINDIR@/mkdir -p @LOCALSTATEDIR@/lib/kea
|
||||
ExecStart=@SBINDIR@/kea-dhcp4 -c @SYSCONFDIR@/kea/kea-dhcp4.conf
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ After=time-sync.target
|
||||
|
||||
[Service]
|
||||
ExecStartPre=@BASE_BINDIR@/mkdir -p @LOCALSTATEDIR@/run/kea/
|
||||
ExecStartPre=@BASE_BINDIR@/chmod 750 @LOCALSTATEDIR@/run/kea/
|
||||
ExecStartPre=@BASE_BINDIR@/mkdir -p @LOCALSTATEDIR@/lib/kea
|
||||
ExecStart=@SBINDIR@/kea-dhcp6 -c @SYSCONFDIR@/kea/kea-dhcp6.conf
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
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: Peter Marko <peter.marko@siemens.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 82c3093b12..ebdce76710 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);
|
||||
1918
meta/recipes-connectivity/openssl/openssl/CVE-2025-27587-1.patch
Normal file
1918
meta/recipes-connectivity/openssl/openssl/CVE-2025-27587-1.patch
Normal file
File diff suppressed because it is too large
Load Diff
129
meta/recipes-connectivity/openssl/openssl/CVE-2025-27587-2.patch
Normal file
129
meta/recipes-connectivity/openssl/openssl/CVE-2025-27587-2.patch
Normal file
@@ -0,0 +1,129 @@
|
||||
From 6b1646e472c9e8c08bb14066ba2a7c3eed45f84a Mon Sep 17 00:00:00 2001
|
||||
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
|
||||
Date: Thu, 17 Apr 2025 08:51:53 -0500
|
||||
Subject: [PATCH] Fix P-384 curve on lower-than-P9 PPC64 targets
|
||||
|
||||
The change adding an asm implementation of p384_felem_reduce incorrectly
|
||||
uses the accelerated version on both targets that support the intrinsics
|
||||
*and* targets that don't, instead of falling back to the generics on older
|
||||
targets. This results in crashes when trying to use P-384 on < Power9.
|
||||
|
||||
Signed-off-by: Anna Wilcox <AWilcox@Wilcox-Tech.com>
|
||||
Closes: #27350
|
||||
Fixes: 85cabd94 ("Fix Minerva timing side-channel signal for P-384 curve on PPC")
|
||||
|
||||
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/27429)
|
||||
|
||||
(cherry picked from commit 29864f2b0f1046177e8048a5b17440893d3f9425)
|
||||
|
||||
CVE: CVE-2025-27587
|
||||
Upstream-Status: Backport [https://github.com/openssl/openssl/commit/6b1646e472c9e8c08bb14066ba2a7c3eed45f84a]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
crypto/ec/ecp_nistp384.c | 54 ++++++++++++++++++++++++----------------
|
||||
1 file changed, 33 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/crypto/ec/ecp_nistp384.c b/crypto/ec/ecp_nistp384.c
|
||||
index e0b5786bc1..439b4d03a3 100644
|
||||
--- a/crypto/ec/ecp_nistp384.c
|
||||
+++ b/crypto/ec/ecp_nistp384.c
|
||||
@@ -684,6 +684,22 @@ static void felem_reduce_ref(felem out, const widefelem in)
|
||||
out[i] = acc[i];
|
||||
}
|
||||
|
||||
+static ossl_inline void felem_square_reduce_ref(felem out, const felem in)
|
||||
+{
|
||||
+ widefelem tmp;
|
||||
+
|
||||
+ felem_square_ref(tmp, in);
|
||||
+ felem_reduce_ref(out, tmp);
|
||||
+}
|
||||
+
|
||||
+static ossl_inline void felem_mul_reduce_ref(felem out, const felem in1, const felem in2)
|
||||
+{
|
||||
+ widefelem tmp;
|
||||
+
|
||||
+ felem_mul_ref(tmp, in1, in2);
|
||||
+ felem_reduce_ref(out, tmp);
|
||||
+}
|
||||
+
|
||||
#if defined(ECP_NISTP384_ASM)
|
||||
static void felem_square_wrapper(widefelem out, const felem in);
|
||||
static void felem_mul_wrapper(widefelem out, const felem in1, const felem in2);
|
||||
@@ -695,10 +711,18 @@ static void (*felem_mul_p)(widefelem out, const felem in1, const felem in2) =
|
||||
|
||||
static void (*felem_reduce_p)(felem out, const widefelem in) = felem_reduce_ref;
|
||||
|
||||
+static void (*felem_square_reduce_p)(felem out, const felem in) =
|
||||
+ felem_square_reduce_ref;
|
||||
+static void (*felem_mul_reduce_p)(felem out, const felem in1, const felem in2) =
|
||||
+ felem_mul_reduce_ref;
|
||||
+
|
||||
void p384_felem_square(widefelem out, const felem in);
|
||||
void p384_felem_mul(widefelem out, const felem in1, const felem in2);
|
||||
void p384_felem_reduce(felem out, const widefelem in);
|
||||
|
||||
+void p384_felem_square_reduce(felem out, const felem in);
|
||||
+void p384_felem_mul_reduce(felem out, const felem in1, const felem in2);
|
||||
+
|
||||
# if defined(_ARCH_PPC64)
|
||||
# include "crypto/ppc_arch.h"
|
||||
# endif
|
||||
@@ -710,6 +734,8 @@ static void felem_select(void)
|
||||
felem_square_p = p384_felem_square;
|
||||
felem_mul_p = p384_felem_mul;
|
||||
felem_reduce_p = p384_felem_reduce;
|
||||
+ felem_square_reduce_p = p384_felem_square_reduce;
|
||||
+ felem_mul_reduce_p = p384_felem_mul_reduce;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -718,7 +744,9 @@ static void felem_select(void)
|
||||
/* Default */
|
||||
felem_square_p = felem_square_ref;
|
||||
felem_mul_p = felem_mul_ref;
|
||||
- felem_reduce_p = p384_felem_reduce;
|
||||
+ felem_reduce_p = felem_reduce_ref;
|
||||
+ felem_square_reduce_p = felem_square_reduce_ref;
|
||||
+ felem_mul_reduce_p = felem_mul_reduce_ref;
|
||||
}
|
||||
|
||||
static void felem_square_wrapper(widefelem out, const felem in)
|
||||
@@ -737,31 +765,15 @@ static void felem_mul_wrapper(widefelem out, const felem in1, const felem in2)
|
||||
# define felem_mul felem_mul_p
|
||||
# define felem_reduce felem_reduce_p
|
||||
|
||||
-void p384_felem_square_reduce(felem out, const felem in);
|
||||
-void p384_felem_mul_reduce(felem out, const felem in1, const felem in2);
|
||||
-
|
||||
-# define felem_square_reduce p384_felem_square_reduce
|
||||
-# define felem_mul_reduce p384_felem_mul_reduce
|
||||
+# define felem_square_reduce felem_square_reduce_p
|
||||
+# define felem_mul_reduce felem_mul_reduce_p
|
||||
#else
|
||||
# define felem_square felem_square_ref
|
||||
# define felem_mul felem_mul_ref
|
||||
# define felem_reduce felem_reduce_ref
|
||||
|
||||
-static ossl_inline void felem_square_reduce(felem out, const felem in)
|
||||
-{
|
||||
- widefelem tmp;
|
||||
-
|
||||
- felem_square(tmp, in);
|
||||
- felem_reduce(out, tmp);
|
||||
-}
|
||||
-
|
||||
-static ossl_inline void felem_mul_reduce(felem out, const felem in1, const felem in2)
|
||||
-{
|
||||
- widefelem tmp;
|
||||
-
|
||||
- felem_mul(tmp, in1, in2);
|
||||
- felem_reduce(out, tmp);
|
||||
-}
|
||||
+# define felem_square_reduce felem_square_reduce_ref
|
||||
+# define felem_mul_reduce felem_mul_reduce_ref
|
||||
#endif
|
||||
|
||||
/*-
|
||||
@@ -12,6 +12,9 @@ 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://0001-Configure-do-not-tweak-mips-cflags.patch \
|
||||
file://0001-Added-handshake-history-reporting-when-test-fails.patch \
|
||||
file://CVE-2024-41996.patch \
|
||||
file://CVE-2025-27587-1.patch \
|
||||
file://CVE-2025-27587-2.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:class-nativesdk = " \
|
||||
|
||||
136
meta/recipes-core/busybox/busybox/CVE-2023-39810.patch
Normal file
136
meta/recipes-core/busybox/busybox/CVE-2023-39810.patch
Normal file
@@ -0,0 +1,136 @@
|
||||
From 9a8796436b9b0641e13480811902ea2ac57881d3 Mon Sep 17 00:00:00 2001
|
||||
From: Denys Vlasenko <vda.linux@googlemail.com>
|
||||
Date: Wed, 2 Oct 2024 10:12:05 +0200
|
||||
Subject: [PATCH] archival: disallow path traversals (CVE-2023-39810)
|
||||
|
||||
Create new configure option for archival/libarchive based extractions to
|
||||
disallow path traversals.
|
||||
As this is a paranoid option and might introduce backward
|
||||
incompatibility, default it to no.
|
||||
|
||||
Fixes: CVE-2023-39810
|
||||
|
||||
Based on the patch by Peter Kaestle <peter.kaestle@nokia.com>
|
||||
|
||||
function old new delta
|
||||
data_extract_all 921 945 +24
|
||||
strip_unsafe_prefix 101 102 +1
|
||||
------------------------------------------------------------------------------
|
||||
(add/remove: 0/0 grow/shrink: 2/0 up/down: 25/0) Total: 25 bytes
|
||||
|
||||
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
||||
|
||||
CVE: CVE-2023-39810
|
||||
Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=9a8796436b9b0641e13480811902ea2ac57881d3]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
archival/Config.src | 11 +++++++++++
|
||||
archival/libarchive/data_extract_all.c | 8 ++++++++
|
||||
archival/libarchive/unsafe_prefix.c | 6 +++++-
|
||||
scripts/kconfig/lxdialog/check-lxdialog.sh | 2 +-
|
||||
testsuite/cpio.tests | 23 ++++++++++++++++++++++
|
||||
5 files changed, 48 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/archival/Config.src b/archival/Config.src
|
||||
index 6f4f30c43..cbcd7217c 100644
|
||||
--- a/archival/Config.src
|
||||
+++ b/archival/Config.src
|
||||
@@ -35,4 +35,15 @@ config FEATURE_LZMA_FAST
|
||||
This option reduces decompression time by about 25% at the cost of
|
||||
a 1K bigger binary.
|
||||
|
||||
+config FEATURE_PATH_TRAVERSAL_PROTECTION
|
||||
+ bool "Prevent extraction of filenames with /../ path component"
|
||||
+ default n
|
||||
+ help
|
||||
+ busybox tar and unzip remove "PREFIX/../" (if it exists)
|
||||
+ from extracted names.
|
||||
+ This option enables this behavior for all other unpacking applets,
|
||||
+ such as cpio, ar, rpm.
|
||||
+ GNU cpio 2.15 has NO such sanity check.
|
||||
+# try other archivers and document their behavior?
|
||||
+
|
||||
endmenu
|
||||
diff --git a/archival/libarchive/data_extract_all.c b/archival/libarchive/data_extract_all.c
|
||||
index 049c2c156..8a69711c1 100644
|
||||
--- a/archival/libarchive/data_extract_all.c
|
||||
+++ b/archival/libarchive/data_extract_all.c
|
||||
@@ -65,6 +65,14 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
|
||||
} while (--n != 0);
|
||||
}
|
||||
#endif
|
||||
+#if ENABLE_FEATURE_PATH_TRAVERSAL_PROTECTION
|
||||
+ /* Strip leading "/" and up to last "/../" path component */
|
||||
+ dst_name = (char *)strip_unsafe_prefix(dst_name);
|
||||
+#endif
|
||||
+// ^^^ This may be a problem if some applets do need to extract absolute names.
|
||||
+// (Probably will need to invent ARCHIVE_ALLOW_UNSAFE_NAME flag).
|
||||
+// You might think that rpm needs it, but in my tests rpm's internal cpio
|
||||
+// archive has names like "./usr/bin/FOO", not "/usr/bin/FOO".
|
||||
|
||||
if (archive_handle->ah_flags & ARCHIVE_CREATE_LEADING_DIRS) {
|
||||
char *slash = strrchr(dst_name, '/');
|
||||
diff --git a/archival/libarchive/unsafe_prefix.c b/archival/libarchive/unsafe_prefix.c
|
||||
index 33e487bf9..667081195 100644
|
||||
--- a/archival/libarchive/unsafe_prefix.c
|
||||
+++ b/archival/libarchive/unsafe_prefix.c
|
||||
@@ -14,7 +14,11 @@ const char* FAST_FUNC strip_unsafe_prefix(const char *str)
|
||||
cp++;
|
||||
continue;
|
||||
}
|
||||
- if (is_prefixed_with(cp, "/../"+1)) {
|
||||
+ /* We are called lots of times.
|
||||
+ * is_prefixed_with(cp, "../") is slower than open-coding it,
|
||||
+ * with minimal code growth (~few bytes).
|
||||
+ */
|
||||
+ if (cp[0] == '.' && cp[1] == '.' && cp[2] == '/') {
|
||||
cp += 3;
|
||||
continue;
|
||||
}
|
||||
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
|
||||
index 5075ebf2d..910ca1f7c 100755
|
||||
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
|
||||
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
|
||||
@@ -55,7 +55,7 @@ trap "rm -f $tmp" 0 1 2 3 15
|
||||
check() {
|
||||
$cc -x c - -o $tmp 2>/dev/null <<'EOF'
|
||||
#include CURSES_LOC
|
||||
-main() {}
|
||||
+int main() { return 0; }
|
||||
EOF
|
||||
if [ $? != 0 ]; then
|
||||
echo " *** Unable to find the ncurses libraries or the" 1>&2
|
||||
diff --git a/testsuite/cpio.tests b/testsuite/cpio.tests
|
||||
index 85e746589..a4462c53e 100755
|
||||
--- a/testsuite/cpio.tests
|
||||
+++ b/testsuite/cpio.tests
|
||||
@@ -154,6 +154,29 @@ testing "cpio -R with extract" \
|
||||
" "" ""
|
||||
SKIP=
|
||||
|
||||
+# Create an archive containing a file with "../dont_write" filename.
|
||||
+# See that it will not be allowed to unpack.
|
||||
+# NB: GNU cpio 2.15 DOES NOT do such checks.
|
||||
+optional FEATURE_PATH_TRAVERSAL_PROTECTION
|
||||
+rm -rf cpio.testdir
|
||||
+mkdir -p cpio.testdir/prepare/inner
|
||||
+echo "file outside of destination was written" > cpio.testdir/prepare/dont_write
|
||||
+echo "data" > cpio.testdir/prepare/inner/to_extract
|
||||
+mkdir -p cpio.testdir/extract
|
||||
+testing "cpio extract file outside of destination" "\
|
||||
+(cd cpio.testdir/prepare/inner && echo -e '../dont_write\nto_extract' | cpio -o -H newc) | (cd cpio.testdir/extract && cpio -vi 2>&1)
|
||||
+echo \$?
|
||||
+ls cpio.testdir/dont_write 2>&1" \
|
||||
+"\
|
||||
+cpio: removing leading '../' from member names
|
||||
+../dont_write
|
||||
+to_extract
|
||||
+1 blocks
|
||||
+0
|
||||
+ls: cpio.testdir/dont_write: No such file or directory
|
||||
+" "" ""
|
||||
+SKIP=
|
||||
+
|
||||
# Clean up
|
||||
rm -rf cpio.testdir cpio.testdir2 2>/dev/null
|
||||
|
||||
@@ -58,6 +58,7 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
|
||||
file://0001-awk.c-fix-CVE-2023-42366-bug-15874.patch \
|
||||
file://0001-cut-Fix-s-flag-to-omit-blank-lines.patch \
|
||||
file://CVE-2022-48174.patch \
|
||||
file://CVE-2023-39810.patch \
|
||||
"
|
||||
SRC_URI:append:libc-musl = " file://musl.cfg "
|
||||
# TODO http://lists.busybox.net/pipermail/busybox/2023-January/090078.html
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From d59436a4d56de58b856142a5d489a4a8fc7382ed Mon Sep 17 00:00:00 2001
|
||||
From: Matt Johnston <matt@ucc.asn.au>
|
||||
Date: Mon, 8 Apr 2024 22:01:21 +0800
|
||||
Subject: [PATCH] Avoid unused variable with DROPBEAR_CLI_PUBKEY_AUTH 0
|
||||
|
||||
Fixes PR #291
|
||||
|
||||
Upstream-Status: Backport [https://github.com/mkj/dropbear/commit/d59436a4d56de58b856142a5d489a4a8fc7382ed]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
cli-runopts.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/cli-runopts.c b/cli-runopts.c
|
||||
index b853a13..6668aee 100644
|
||||
--- a/cli-runopts.c
|
||||
+++ b/cli-runopts.c
|
||||
@@ -533,7 +533,9 @@ static void loadidentityfile(const char* filename, int warnfail) {
|
||||
static char* multihop_passthrough_args(void) {
|
||||
char *args = NULL;
|
||||
unsigned int len, total;
|
||||
+#if DROPBEAR_CLI_PUBKEY_AUTH
|
||||
m_list_elem *iter;
|
||||
+#endif
|
||||
/* Sufficient space for non-string args */
|
||||
len = 100;
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
From 697b1f86c0b2b0caf12e9e32bab29161093ab5d4 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()
|
||||
|
||||
Upstream-Status: Backport [https://github.com/mkj/dropbear/commit/697b1f86c0b2b0caf12e9e32bab29161093ab5d4]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
cli-runopts.c | 30 +++++++++++++++++++++---------
|
||||
1 file changed, 21 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/cli-runopts.c b/cli-runopts.c
|
||||
index 37ea61d..219fc53 100644
|
||||
--- a/cli-runopts.c
|
||||
+++ b/cli-runopts.c
|
||||
@@ -528,15 +528,29 @@ static void loadidentityfile(const char* filename, int warnfail) {
|
||||
|
||||
#if DROPBEAR_CLI_MULTIHOP
|
||||
|
||||
-static char*
|
||||
-multihop_passthrough_args() {
|
||||
- char *ret, args[256];
|
||||
+/* 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;
|
||||
m_list_elem *iter;
|
||||
- /* Fill out -i, -y, -W options that make sense for all
|
||||
- * the intermediate processes */
|
||||
+ /* Sufficient space for non-string args */
|
||||
+ len = 100;
|
||||
+
|
||||
+ /* String arguments have arbitrary length, so determine space required */
|
||||
+ if (cli_opts.proxycmd) {
|
||||
+ len += strlen(cli_opts.proxycmd);
|
||||
+ }
|
||||
+ for (iter = cli_opts.privkeys->first; iter; iter = iter->next)
|
||||
+ {
|
||||
+ sign_key * key = (sign_key*)iter->item;
|
||||
+ len += 4 + strlen(key->filename);
|
||||
+ }
|
||||
+
|
||||
+ args = m_malloc(len);
|
||||
total = 0;
|
||||
- len = 255;
|
||||
+
|
||||
+ /* Create new argument string */
|
||||
|
||||
if (cli_opts.quiet) {
|
||||
total += m_snprintf(args+total, len-total, "-q ");
|
||||
@@ -564,9 +578,7 @@ multihop_passthrough_args() {
|
||||
}
|
||||
#endif /* DROPBEAR_CLI_PUBKEY_AUTH */
|
||||
|
||||
- ret = m_malloc(total + 1);
|
||||
- strcpy(ret,args);
|
||||
- return ret;
|
||||
+ return args;
|
||||
}
|
||||
|
||||
/* Sets up 'onion-forwarding' connections. This will spawn
|
||||
@@ -0,0 +1,81 @@
|
||||
From 2f1177e55f33afd676e08c9449ab7ab517fc3b30 Mon Sep 17 00:00:00 2001
|
||||
From: HansH111 <hans@atbas.org>
|
||||
Date: Sat, 24 Feb 2024 08:29:30 +0000
|
||||
Subject: [PATCH] add -o BatchMode and also forward this when multihop
|
||||
destination is used
|
||||
|
||||
Upstream-Status: Backport [https://github.com/mkj/dropbear/commit/2f1177e55f33afd676e08c9449ab7ab517fc3b30]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
cli-runopts.c | 33 +++++++++++----------------------
|
||||
1 file changed, 11 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/cli-runopts.c b/cli-runopts.c
|
||||
index 38a73f7..37ea61d 100644
|
||||
--- a/cli-runopts.c
|
||||
+++ b/cli-runopts.c
|
||||
@@ -530,53 +530,42 @@ static void loadidentityfile(const char* filename, int warnfail) {
|
||||
|
||||
static char*
|
||||
multihop_passthrough_args() {
|
||||
- char *ret;
|
||||
+ char *ret, args[256];
|
||||
unsigned int len, total;
|
||||
m_list_elem *iter;
|
||||
/* Fill out -i, -y, -W options that make sense for all
|
||||
- * the intermediate processes */
|
||||
- len = 30; /* space for "-q -y -y -W <size>\0" */
|
||||
-#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);
|
||||
- }
|
||||
-#endif /* DROPBEAR_CLI_PUBKEY_AUTH */
|
||||
- if (cli_opts.proxycmd) {
|
||||
- /* "-J 'cmd'" */
|
||||
- len += 6 + strlen(cli_opts.proxycmd);
|
||||
- }
|
||||
-
|
||||
- ret = m_malloc(len);
|
||||
+ * the intermediate processes */
|
||||
total = 0;
|
||||
+ len = 255;
|
||||
|
||||
if (cli_opts.quiet) {
|
||||
- total += m_snprintf(ret+total, len-total, "-q ");
|
||||
+ total += m_snprintf(args+total, len-total, "-q ");
|
||||
}
|
||||
|
||||
if (cli_opts.no_hostkey_check) {
|
||||
- total += m_snprintf(ret+total, len-total, "-y -y ");
|
||||
+ total += m_snprintf(args+total, len-total, "-y -y ");
|
||||
} else if (cli_opts.always_accept_key) {
|
||||
- total += m_snprintf(ret+total, len-total, "-y ");
|
||||
+ total += m_snprintf(args+total, len-total, "-y ");
|
||||
}
|
||||
|
||||
if (cli_opts.proxycmd) {
|
||||
- total += m_snprintf(ret+total, len-total, "-J '%s' ", cli_opts.proxycmd);
|
||||
+ total += m_snprintf(args+total, len-total, "-J '%s' ", cli_opts.proxycmd);
|
||||
}
|
||||
|
||||
if (opts.recv_window != DEFAULT_RECV_WINDOW) {
|
||||
- total += m_snprintf(ret+total, len-total, "-W %u ", opts.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;
|
||||
- total += m_snprintf(ret+total, len-total, "-i %s ", key->filename);
|
||||
+ total += m_snprintf(args+total, len-total, "-i %s ", key->filename);
|
||||
}
|
||||
#endif /* DROPBEAR_CLI_PUBKEY_AUTH */
|
||||
|
||||
+ ret = m_malloc(total + 1);
|
||||
+ strcpy(ret,args);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From dd03da772bfad6174425066ff9752b60e25ed183 Mon Sep 17 00:00:00 2001
|
||||
From: Sergey Ponomarev <stokito@gmail.com>
|
||||
Date: Sun, 7 Apr 2024 21:16:50 +0300
|
||||
Subject: [PATCH] cli-runopts.c add missing DROPBEAR_CLI_PUBKEY_AUTH
|
||||
|
||||
Upstream-Status: Backport [https://github.com/mkj/dropbear/commit/dd03da772bfad6174425066ff9752b60e25ed183]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
cli-runopts.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/cli-runopts.c b/cli-runopts.c
|
||||
index 219fc53..b853a13 100644
|
||||
--- a/cli-runopts.c
|
||||
+++ b/cli-runopts.c
|
||||
@@ -541,11 +541,13 @@ static char* multihop_passthrough_args(void) {
|
||||
if (cli_opts.proxycmd) {
|
||||
len += strlen(cli_opts.proxycmd);
|
||||
}
|
||||
+#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);
|
||||
}
|
||||
+#endif
|
||||
|
||||
args = m_malloc(len);
|
||||
total = 0;
|
||||
367
meta/recipes-core/dropbear/dropbear/CVE-2025-47203.patch
Normal file
367
meta/recipes-core/dropbear/dropbear/CVE-2025-47203.patch
Normal file
@@ -0,0 +1,367 @@
|
||||
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.
|
||||
|
||||
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 | 59 +++++++++++++++++++----------
|
||||
cli-runopts.c | 100 +++++++++++++++++++++++++++++---------------------
|
||||
dbutil.c | 9 ++++-
|
||||
dbutil.h | 1 +
|
||||
runopts.h | 5 +++
|
||||
5 files changed, 112 insertions(+), 62 deletions(-)
|
||||
|
||||
diff --git a/cli-main.c b/cli-main.c
|
||||
index 065fd76..2fafa88 100644
|
||||
--- a/cli-main.c
|
||||
+++ b/cli-main.c
|
||||
@@ -77,9 +77,8 @@ int main(int argc, char ** argv) {
|
||||
}
|
||||
|
||||
#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) {
|
||||
@@ -101,7 +100,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;
|
||||
|
||||
@@ -110,41 +110,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 */
|
||||
+ 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);
|
||||
|
||||
- /* 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;
|
||||
+ }
|
||||
|
||||
- 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);
|
||||
-
|
||||
- ret = spawn_command(exec_proxy_cmd, ex_cmd,
|
||||
- sock_out, sock_in, NULL, pid_out);
|
||||
- DEBUG1(("cmd: %s pid=%d", ex_cmd,*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 6668aee..b9add84 100644
|
||||
--- a/cli-runopts.c
|
||||
+++ b/cli-runopts.c
|
||||
@@ -530,58 +530,81 @@ 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 (cli_opts.proxycmd) {
|
||||
- len += strlen(cli_opts.proxycmd);
|
||||
- }
|
||||
#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.quiet) {
|
||||
- total += m_snprintf(args+total, len-total, "-q ");
|
||||
+ args[pos] = m_strdup("-q");
|
||||
+ 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 (cli_opts.proxycmd) {
|
||||
- total += m_snprintf(args+total, len-total, "-J '%s' ", cli_opts.proxycmd);
|
||||
+ args[pos] = m_strdup("-J");
|
||||
+ pos++;
|
||||
+ args[pos] = m_strdup(cli_opts.proxycmd);
|
||||
+ 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;
|
||||
}
|
||||
|
||||
@@ -596,7 +619,7 @@ static char* multihop_passthrough_args(void) {
|
||||
* etc for as many hosts as we want.
|
||||
*
|
||||
* Note that "-J" arguments aren't actually used, instead
|
||||
- * below sets cli_opts.proxycmd directly.
|
||||
+ * below sets cli_opts.proxyexec directly.
|
||||
*
|
||||
* Ports for hosts can be specified as host/port.
|
||||
*/
|
||||
@@ -604,7 +627,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
|
||||
@@ -622,6 +645,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) {
|
||||
@@ -629,35 +654,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();
|
||||
- if (cli_opts.remoteport == NULL) {
|
||||
- cli_opts.remoteport = "22";
|
||||
+ /* 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) {
|
||||
+ m_free(cli_opts.proxycmd);
|
||||
}
|
||||
- cmd_len = strlen(argv0) + strlen(remainder)
|
||||
- + strlen(cli_opts.remotehost) + strlen(cli_opts.remoteport)
|
||||
- + strlen(passthrough_args)
|
||||
- + 30;
|
||||
- /* replace proxycmd. old -J arguments have been copied
|
||||
- to passthrough_args */
|
||||
- cli_opts.proxycmd = m_realloc(cli_opts.proxycmd, 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 bd66454..910fa27 100644
|
||||
--- a/dbutil.c
|
||||
+++ b/dbutil.c
|
||||
@@ -371,7 +371,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);
|
||||
|
||||
@@ -393,6 +392,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");
|
||||
@@ -404,7 +409,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 64af170..bfc1f1f 100644
|
||||
--- a/dbutil.h
|
||||
+++ b/dbutil.h
|
||||
@@ -63,6 +63,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 1675836..11c3ef2 100644
|
||||
--- a/runopts.h
|
||||
+++ b/runopts.h
|
||||
@@ -188,7 +188,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;
|
||||
@@ -24,6 +24,11 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} \
|
||||
file://CVE-2023-36328.patch \
|
||||
file://CVE-2023-48795.patch \
|
||||
file://0001-add-o-BatchMode-and-also-forward-this-when-multihop-.patch \
|
||||
file://0001-Handle-arbitrary-length-paths-and-commands-in-multih.patch \
|
||||
file://0001-cli-runopts.c-add-missing-DROPBEAR_CLI_PUBKEY_AUTH.patch \
|
||||
file://0001-Avoid-unused-variable-with-DROPBEAR_CLI_PUBKEY_AUTH-.patch \
|
||||
file://CVE-2025-47203.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "bc5a121ffbc94b5171ad5ebe01be42746d50aa797c9549a4639894a16749443b"
|
||||
|
||||
@@ -66,3 +66,5 @@ def find_meson_cross_files(d):
|
||||
python () {
|
||||
find_meson_cross_files(d)
|
||||
}
|
||||
|
||||
CVE_STATUS[CVE-2025-4056] = "not-applicable-platform: Issue only applies on Windows"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
SRCBRANCH ?= "release/2.39/master"
|
||||
PV = "2.39+git"
|
||||
SRCREV_glibc ?= "06a70769fd0b2e1f2a3085ad50ab620282bd77b3"
|
||||
SRCREV_glibc ?= "b027d5b145f1b2908f370bdb96dfe40180d0fcb6"
|
||||
SRCREV_localedef ?= "fab74f31b3811df543e24b6de47efdf45b538abc"
|
||||
|
||||
GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git;protocol=https"
|
||||
|
||||
@@ -18,7 +18,7 @@ easier access for another. 'ASLR bypass itself is not a vulnerability.'"
|
||||
|
||||
CVE_STATUS_GROUPS += "CVE_STATUS_STABLE_BACKPORTS"
|
||||
CVE_STATUS_STABLE_BACKPORTS = "CVE-2024-2961 CVE-2024-33599 CVE-2024-33600 CVE-2024-33601 CVE-2024-33602 CVE-2025-0395 \
|
||||
CVE-2025-4802 CVE-2025-5702"
|
||||
CVE-2025-4802 CVE-2025-5702 CVE-2025-8058"
|
||||
CVE_STATUS_STABLE_BACKPORTS[status] = "cpe-stable-backport: fix available in used git hash"
|
||||
|
||||
DEPENDS += "gperf-native bison-native"
|
||||
|
||||
@@ -26,7 +26,7 @@ inherit core-image setuptools3 features_check
|
||||
|
||||
REQUIRED_DISTRO_FEATURES += "xattr"
|
||||
|
||||
SRCREV ?= "e5c05018e042e762c886c2f5476f2277a787b9c6"
|
||||
SRCREV ?= "1df3fcb4a50be33b71ad1252672b930a288d3f5b"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=scarthgap \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
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 | 49 ++++++++++++++------------
|
||||
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, 58 insertions(+), 23 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 a825920..411a515 100644
|
||||
--- a/schematron.c
|
||||
+++ b/schematron.c
|
||||
@@ -1389,27 +1389,15 @@ 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));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1455,25 +1443,40 @@ 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);
|
||||
}
|
||||
|
||||
- if ((node->ns == NULL) || (node->ns->prefix == NULL))
|
||||
- ret = xmlStrcat(ret, node->name);
|
||||
- else {
|
||||
- ret = xmlStrcat(ret, node->ns->prefix);
|
||||
- ret = xmlStrcat(ret, BAD_CAST ":");
|
||||
- ret = xmlStrcat(ret, node->name);
|
||||
+ 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 {
|
||||
+ ret = xmlStrcat(ret, node->ns->prefix);
|
||||
+ ret = xmlStrcat(ret, BAD_CAST ":");
|
||||
+ ret = xmlStrcat(ret, node->name);
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ /* TODO: handle other node types */
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
+
|
||||
+ xmlXPathFreeObject(obj);
|
||||
} else if (IS_SCHEMATRON(child, "value-of")) {
|
||||
xmlChar *select;
|
||||
xmlXPathObjectPtr eval;
|
||||
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
|
||||
|
||||
92
meta/recipes-core/libxml/libxml2/CVE-2025-49795.patch
Normal file
92
meta/recipes-core/libxml/libxml2/CVE-2025-49795.patch
Normal file
@@ -0,0 +1,92 @@
|
||||
From 19e0a3ed092085a4d6689397d4f08cf5d86267af Mon Sep 17 00:00:00 2001
|
||||
From: Michael Mann <mmann78@netscape.net>
|
||||
Date: Sat, 21 Jun 2025 12:11:30 -0400
|
||||
Subject: [PATCH] Schematron: Fix null pointer dereference leading to DoS
|
||||
|
||||
(CVE-2025-49795)
|
||||
|
||||
Fixes #932
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/c24909ba2601848825b49a60f988222da3019667]
|
||||
CVE: CVE-2025-49795
|
||||
|
||||
(cherry picked from commit c24909ba2601848825b49a60f988222da3019667)
|
||||
Signed-off-by: Roland Kovacs <roland.kovacs@est.tech>
|
||||
---
|
||||
result/schematron/zvon16_0 | 6 ++++++
|
||||
result/schematron/zvon16_0.err | 5 +++++
|
||||
schematron.c | 5 +++++
|
||||
test/schematron/zvon16.sct | 7 +++++++
|
||||
test/schematron/zvon16_0.xml | 5 +++++
|
||||
5 files changed, 28 insertions(+)
|
||||
create mode 100644 result/schematron/zvon16_0
|
||||
create mode 100644 result/schematron/zvon16_0.err
|
||||
create mode 100644 test/schematron/zvon16.sct
|
||||
create mode 100644 test/schematron/zvon16_0.xml
|
||||
|
||||
diff --git a/result/schematron/zvon16_0 b/result/schematron/zvon16_0
|
||||
new file mode 100644
|
||||
index 00000000..768cf6f5
|
||||
--- /dev/null
|
||||
+++ b/result/schematron/zvon16_0
|
||||
@@ -0,0 +1,6 @@
|
||||
+<?xml version="1.0"?>
|
||||
+<library>
|
||||
+ <book title="Test Book" id="bk101">
|
||||
+ <author>Test Author</author>
|
||||
+ </book>
|
||||
+</library>
|
||||
diff --git a/result/schematron/zvon16_0.err b/result/schematron/zvon16_0.err
|
||||
new file mode 100644
|
||||
index 00000000..a4fab4c8
|
||||
--- /dev/null
|
||||
+++ b/result/schematron/zvon16_0.err
|
||||
@@ -0,0 +1,5 @@
|
||||
+Pattern: TestPattern
|
||||
+xmlXPathCompOpEval: function falae not found
|
||||
+XPath error : Unregistered function
|
||||
+/library/book line 2: Book
|
||||
+./test/schematron/zvon16_0.xml fails to validate
|
||||
diff --git a/schematron.c b/schematron.c
|
||||
index a8259201..86c63e64 100644
|
||||
--- a/schematron.c
|
||||
+++ b/schematron.c
|
||||
@@ -1481,6 +1481,11 @@ xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ctxt,
|
||||
select = xmlGetNoNsProp(child, BAD_CAST "select");
|
||||
comp = xmlXPathCtxtCompile(ctxt->xctxt, select);
|
||||
eval = xmlXPathCompiledEval(comp, ctxt->xctxt);
|
||||
+ if (eval == NULL) {
|
||||
+ xmlXPathFreeCompExpr(comp);
|
||||
+ xmlFree(select);
|
||||
+ return ret;
|
||||
+ }
|
||||
|
||||
switch (eval->type) {
|
||||
case XPATH_NODESET: {
|
||||
diff --git a/test/schematron/zvon16.sct b/test/schematron/zvon16.sct
|
||||
new file mode 100644
|
||||
index 00000000..f03848aa
|
||||
--- /dev/null
|
||||
+++ b/test/schematron/zvon16.sct
|
||||
@@ -0,0 +1,7 @@
|
||||
+<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
|
||||
+ <sch:pattern id="TestPattern">
|
||||
+ <sch:rule context="book">
|
||||
+ <sch:report test="not(@available)">Book <sch:value-of select="falae()"/> test</sch:report>
|
||||
+ </sch:rule>
|
||||
+ </sch:pattern>
|
||||
+</sch:schema>
|
||||
diff --git a/test/schematron/zvon16_0.xml b/test/schematron/zvon16_0.xml
|
||||
new file mode 100644
|
||||
index 00000000..551e2d65
|
||||
--- /dev/null
|
||||
+++ b/test/schematron/zvon16_0.xml
|
||||
@@ -0,0 +1,5 @@
|
||||
+<library>
|
||||
+ <book title="Test Book" id="bk101">
|
||||
+ <author>Test Author</author>
|
||||
+ </book>
|
||||
+</library>
|
||||
--
|
||||
2.34.1
|
||||
|
||||
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
|
||||
@@ -1043,6 +1043,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
|
||||
@@ -2794,10 +2798,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;
|
||||
@@ -2855,7 +2859,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++;
|
||||
@@ -2870,7 +2875,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>
|
||||
@@ -21,6 +21,9 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20130923.tar;subdir=${BP};name=testt
|
||||
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-49795.patch \
|
||||
file://CVE-2025-6170.patch \
|
||||
"
|
||||
|
||||
SRC_URI[archive.sha256sum] = "c3d8c0c34aa39098f66576fe51969db12a5100b956233dc56506f7a8679be995"
|
||||
@@ -29,6 +32,10 @@ SRC_URI[testtar.sha256sum] = "c6b2d42ee50b8b236e711a97d68e6c4b5c8d83e69a2be47223
|
||||
# Disputed as a security issue, but fixed in d39f780
|
||||
CVE_STATUS[CVE-2023-45322] = "disputed: issue requires memory allocation to fail"
|
||||
|
||||
# Disputed as a security issue, if attempts to process an invalid file, it fails
|
||||
# https://gitlab.gnome.org/GNOME/libxml2/-/issues/958
|
||||
CVE_STATUS[CVE-2025-8732] = "disputed: the code maintainer explains, that the issue can only be triggered with untrusted SGML catalogs and it makes absolutely no sense to use untrusted catalogs. The issue triggers a crash if an invalid file is provided. https://gitlab.gnome.org/GNOME/libxml2/-/issues/958"
|
||||
|
||||
BINCONFIG = "${bindir}/xml2-config"
|
||||
|
||||
PACKAGECONFIG ??= "python \
|
||||
|
||||
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
|
||||
@@ -985,6 +985,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;
|
||||
@@ -8,6 +8,7 @@ SRC_URI += "file://0001-tic-hang.patch \
|
||||
file://0001-Updating-reset-code-ncurses-6.4-patch-20231104.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 = "1003914e200fd622a27237abca155ce6bf2e6030"
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
From 3a51e31be9f626cf772733cb289ed64739fab0e4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michal=20Koutn=C3=BD?= <mkoutny@suse.com>
|
||||
Date: Tue, 20 Feb 2024 19:26:16 +0100
|
||||
Subject: [PATCH] timedated: Respond on org.freedesktop.timedate1.SetNTP only
|
||||
when really finished
|
||||
|
||||
The method returns prematurely (before jobs it triggers terminate). This
|
||||
is externally visible because other methods may fail if jobs did not
|
||||
finish.
|
||||
Postpone the DBus method response until we collect all signals for
|
||||
finished jobs.
|
||||
systemd-timedated keeps track of in-flight DBus requests and answers
|
||||
them all in unspecified order when jobs finish. The capacity of requests
|
||||
in systemd-timedated is limited.
|
||||
|
||||
Fixes: #17739
|
||||
|
||||
Upstream-Status: Backport [https://github.com/systemd/systemd/commit/3a51e31be9f626cf772733cb289ed64739fab0e4]
|
||||
Signed-off-by: Michal Seben <michal.seben@siemens.com>
|
||||
---
|
||||
src/timedate/timedated.c | 21 ++++++++++++++++++---
|
||||
1 file changed, 18 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: git/src/timedate/timedated.c
|
||||
===================================================================
|
||||
--- git.orig/src/timedate/timedated.c
|
||||
+++ git/src/timedate/timedated.c
|
||||
@@ -45,6 +45,7 @@
|
||||
#define NULL_ADJTIME_LOCAL "0.0 0 0\n0\nLOCAL\n"
|
||||
|
||||
#define UNIT_LIST_DIRS (const char* const*) CONF_PATHS_STRV("systemd/ntp-units.d")
|
||||
+#define SET_NTP_IN_FLIGHT_MAX 16
|
||||
|
||||
typedef struct UnitStatusInfo {
|
||||
char *name;
|
||||
@@ -61,6 +62,7 @@ typedef struct Context {
|
||||
bool local_rtc;
|
||||
Hashmap *polkit_registry;
|
||||
sd_bus_message *cache;
|
||||
+ Set *set_ntp_calls;
|
||||
|
||||
sd_bus_slot *slot_job_removed;
|
||||
|
||||
@@ -121,6 +123,7 @@ static void context_clear(Context *c) {
|
||||
free(c->zone);
|
||||
bus_verify_polkit_async_registry_free(c->polkit_registry);
|
||||
sd_bus_message_unref(c->cache);
|
||||
+ set_free(c->set_ntp_calls);
|
||||
|
||||
sd_bus_slot_unref(c->slot_job_removed);
|
||||
|
||||
@@ -461,11 +464,19 @@ static int match_job_removed(sd_bus_mess
|
||||
n += !!u->path;
|
||||
|
||||
if (n == 0) {
|
||||
+ sd_bus_message *cm;
|
||||
+
|
||||
c->slot_job_removed = sd_bus_slot_unref(c->slot_job_removed);
|
||||
|
||||
(void) sd_bus_emit_properties_changed(sd_bus_message_get_bus(m),
|
||||
"/org/freedesktop/timedate1", "org.freedesktop.timedate1", "NTP",
|
||||
NULL);
|
||||
+ while ((cm = set_steal_first(c->set_ntp_calls))) {
|
||||
+ r = sd_bus_reply_method_return(cm, NULL);
|
||||
+ if (r < 0)
|
||||
+ log_debug_errno(r, "Failed to reply to SetNTP method call, ignoring: %m");
|
||||
+ sd_bus_message_unref(cm);
|
||||
+ }
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -944,6 +955,9 @@ static int method_set_ntp(sd_bus_message
|
||||
LIST_FOREACH(units, u, c->units)
|
||||
u->path = mfree(u->path);
|
||||
|
||||
+ if (set_size(c->set_ntp_calls) >= SET_NTP_IN_FLIGHT_MAX)
|
||||
+ return sd_bus_error_set_errnof(error, EAGAIN, "Too many calls in flight.");
|
||||
+
|
||||
if (!c->slot_job_removed) {
|
||||
r = bus_match_signal_async(
|
||||
bus,
|
||||
@@ -998,11 +1012,12 @@ static int method_set_ntp(sd_bus_message
|
||||
c->slot_job_removed = TAKE_PTR(slot);
|
||||
|
||||
if (selected)
|
||||
- log_info("Set NTP to enabled (%s).", selected->name);
|
||||
+ log_info("Set NTP to be enabled (%s).", selected->name);
|
||||
else
|
||||
- log_info("Set NTP to disabled.");
|
||||
+ log_info("Set NTP to be disabled.");
|
||||
|
||||
- return sd_bus_reply_method_return(m, NULL);
|
||||
+ /* Asynchrounous reply to m in match_job_removed() */
|
||||
+ return set_ensure_consume(&c->set_ntp_calls, &bus_message_hash_ops, sd_bus_message_ref(m));
|
||||
}
|
||||
|
||||
static int method_list_timezones(sd_bus_message *m, void *userdata, sd_bus_error *error) {
|
||||
@@ -27,6 +27,7 @@ SRC_URI += " \
|
||||
file://99-default.preset \
|
||||
file://systemd-pager.sh \
|
||||
file://0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
|
||||
file://0003-timedated-Respond-on-org.freedesktop.timedate1.SetNT.patch \
|
||||
file://0008-implment-systemd-sysv-install-for-OE.patch \
|
||||
"
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)"
|
||||
CVE_STATUS[CVE-2023-25584] = "cpe-incorrect: Applies only for version 2.40 and earlier"
|
||||
CVE_STATUS[CVE-2025-1180] = "patched: fixed by patch for CVE-2025-1176"
|
||||
|
||||
SRCREV ?= "6558f9f5f0ccc107a083ae7fbf106ebcb5efa817"
|
||||
SRCREV ?= "f9488b0d92b591bdf3ff8cce485cb0e1b3727cc0"
|
||||
BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=${SRCBRANCH};protocol=https"
|
||||
SRC_URI = "\
|
||||
${BINUTILS_GIT_URI} \
|
||||
@@ -53,5 +53,7 @@ SRC_URI = "\
|
||||
file://CVE-2025-1179.patch \
|
||||
file://0022-CVE-2025-5245.patch \
|
||||
file://0022-CVE-2025-5244.patch \
|
||||
file://0023-CVE-2025-7546.patch \
|
||||
file://0023-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 a85d2620..18cd1bfd 100644
|
||||
--- a/binutils/objcopy.c
|
||||
+++ b/binutils/objcopy.c
|
||||
@@ -4547,6 +4547,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
|
||||
@@ -4566,6 +4567,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,58 @@
|
||||
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
|
||||
@@ -3971,20 +3971,17 @@ bfd_elf_set_group_contents (bfd *abfd, asection *sec, void *failedptrarg)
|
||||
break;
|
||||
}
|
||||
|
||||
- /* We should always get here with loc == sec->contents + 4, but it is
|
||||
- possible to craft bogus SHT_GROUP sections that will cause segfaults
|
||||
- in objcopy without checking loc here and in the loop above. */
|
||||
- if (loc == sec->contents)
|
||||
- BFD_ASSERT (0);
|
||||
- else
|
||||
+ /* We should always get here with loc == sec->contents + 4. Return
|
||||
+ an error for bogus SHT_GROUP sections. */
|
||||
+ loc -= 4;
|
||||
+ if (loc != sec->contents)
|
||||
{
|
||||
- loc -= 4;
|
||||
- if (loc != sec->contents)
|
||||
- {
|
||||
- BFD_ASSERT (0);
|
||||
- memset (sec->contents + 4, 0, loc - sec->contents);
|
||||
- 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);
|
||||
--
|
||||
2.43.5
|
||||
|
||||
@@ -44,9 +44,11 @@ EXTRA_OECMAKE=" \
|
||||
-DKWSYS_CHAR_IS_SIGNED=1 \
|
||||
-DBUILD_CursesDialog=0 \
|
||||
-DKWSYS_LFS_WORKS=1 \
|
||||
-DCMake_ENABLE_DEBUGGER=0 \
|
||||
"
|
||||
|
||||
PACKAGECONFIG ??= ""
|
||||
PACKAGECONFIG[debugger] = "-DCMake_ENABLE_DEBUGGER=1,-DCMake_ENABLE_DEBUGGER=0,"
|
||||
|
||||
do_install:append:class-nativesdk() {
|
||||
mkdir -p ${D}${datadir}/cmake
|
||||
install -m 644 ${WORKDIR}/OEToolchainConfig.cmake ${D}${datadir}/cmake/
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
From 72dcef02bee9924c4d5b3dc6e7ef4d07becebcc6 Mon Sep 17 00:00:00 2001
|
||||
From: Rudi Heitbaum <rudi@heitbaum.com>
|
||||
Date: Fri, 22 Nov 2024 12:36:32 +0000
|
||||
Subject: [PATCH] libext2fs: fix -std=c23 build failure
|
||||
|
||||
gcc-15 switched to -std=c23 by default:
|
||||
|
||||
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212
|
||||
|
||||
As a result `e2fsprogs` fails the build so only typedef int bool
|
||||
for __STDC_VERSION__ <= 201710L (C17)
|
||||
|
||||
../../../lib/ext2fs/tdb.c:113:13: error: two or more data types in declaration specifiers
|
||||
../../../lib/ext2fs/tdb.c:113:1: warning: useless type name in empty declaration
|
||||
113 | typedef int bool;
|
||||
| ^~~~~~~
|
||||
|
||||
https://github.com/tytso/e2fsprogs/issues/202
|
||||
|
||||
Upstream-Status: Backport [https://github.com/tytso/e2fsprogs/commit/49fd04d77b3244c6c6990be41142168eef373aef]
|
||||
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
|
||||
Link: https://lore.kernel.org/r/Z0B60JhdvT9bpSQ6@6f91903e89da
|
||||
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
lib/ext2fs/tdb.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/lib/ext2fs/tdb.c b/lib/ext2fs/tdb.c
|
||||
index b07b2917..98dc95d8 100644
|
||||
--- a/lib/ext2fs/tdb.c
|
||||
+++ b/lib/ext2fs/tdb.c
|
||||
@@ -110,7 +110,9 @@ static char *rep_strdup(const char *s)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+#if defined __STDC__ && defined __STDC_VERSION__ && __STDC_VERSION__ <= 201710L
|
||||
typedef int bool;
|
||||
+#endif
|
||||
|
||||
#include "tdb.h"
|
||||
|
||||
@@ -4,6 +4,7 @@ SRC_URI += "file://remove.ldconfig.call.patch \
|
||||
file://run-ptest \
|
||||
file://ptest.patch \
|
||||
file://mkdir_p.patch \
|
||||
file://0001-libext2fs-fix-std-c23-build-failure.patch \
|
||||
"
|
||||
SRC_URI:append:class-native = " \
|
||||
file://e2fsprogs-fix-missing-check-for-permission-denied.patch \
|
||||
|
||||
@@ -172,4 +172,4 @@ EXTRA_OECONF += "ac_cv_snprintf_returns_bogus=no \
|
||||
"
|
||||
EXTRA_OEMAKE += "NO_GETTEXT=1"
|
||||
|
||||
SRC_URI[tarball.sha256sum] = "4237c37cdf7b3d38102117b22993b2f761a4c02758dfbe33f7b7423c0b096ca9"
|
||||
SRC_URI[tarball.sha256sum] = "302ebe0f4b1c5d1ee477b5ee74f7f2f69efd8fa7f27481e45087ba9a4bb4851c"
|
||||
@@ -19,3 +19,5 @@ SRC_URI += "\
|
||||
file://CVE-2025-4673.patch \
|
||||
"
|
||||
SRC_URI[main.sha256sum] = "012a7e1f37f362c0918c1dfa3334458ac2da1628c4b9cf4d9ca02db986e17d71"
|
||||
|
||||
CVE_STATUS[CVE-2025-0913] = "not-applicable-platform: Issue only applies on Windows"
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
Undefine UNUSED macros with clang
|
||||
From 6914c6e15cd15daf1dae81458e5346958c9d5449 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 19 Sep 2018 11:55:41 -0700
|
||||
Subject: [PATCH] Undefine UNUSED macros with clang
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Index: mtools-4.0.18/sysincludes.h
|
||||
===================================================================
|
||||
--- mtools-4.0.18.orig/sysincludes.h
|
||||
+++ mtools-4.0.18/sysincludes.h
|
||||
@@ -101,7 +101,7 @@ typedef void *caddr_t;
|
||||
---
|
||||
sysincludes.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sysincludes.h b/sysincludes.h
|
||||
index 272b316..49ee5ae 100644
|
||||
--- a/sysincludes.h
|
||||
+++ b/sysincludes.h
|
||||
@@ -98,7 +98,7 @@ ac_cv_func_setpgrp_void=yes ../mtools/configure --build=i386-linux-gnu --host=i3
|
||||
#if defined __GNUC__ && defined __STDC__
|
||||
/* gcc -traditional doesn't have PACKED, UNUSED and NORETURN */
|
||||
# define PACKED __attribute__ ((packed))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 2ef9b371a5cc44e730143e694d71665831fac216 Mon Sep 17 00:00:00 2001
|
||||
From 16969d42ec6514883bcee87cc89b3e7864481d7e Mon Sep 17 00:00:00 2001
|
||||
From: Ed Bartosh <ed.bartosh@linux.intel.com>
|
||||
Date: Tue, 13 Jun 2017 14:55:52 +0300
|
||||
Subject: [PATCH] Disabled reading host configs.
|
||||
@@ -6,16 +6,15 @@ Subject: [PATCH] Disabled reading host configs.
|
||||
Upstream-Status: Inappropriate [native]
|
||||
|
||||
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
||||
|
||||
---
|
||||
config.c | 8 --------
|
||||
1 file changed, 8 deletions(-)
|
||||
|
||||
diff --git a/config.c b/config.c
|
||||
index 2f6a297..3181ed7 100644
|
||||
index 2433457..3972150 100644
|
||||
--- a/config.c
|
||||
+++ b/config.c
|
||||
@@ -844,14 +844,6 @@ void read_config(void)
|
||||
@@ -849,14 +849,6 @@ void read_config(void)
|
||||
memcpy(devices, const_devices,
|
||||
nr_const_devices*sizeof(struct device));
|
||||
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
From 3cf56b36db78679273f61ba78fbbf7f3fab52f68 Mon Sep 17 00:00:00 2001
|
||||
From b517158e8ffc6a665506007b20708d6c2589cec1 Mon Sep 17 00:00:00 2001
|
||||
From: Marcin Juszkiewicz <hrw@openedhand.com>
|
||||
Date: Fri, 8 Jun 2007 08:35:12 +0000
|
||||
Subject: [PATCH] mtools: imported from OE
|
||||
|
||||
Upstream-Status: Inappropriate [licensing]
|
||||
|
||||
---
|
||||
Makefile.in | 11 ++++++-----
|
||||
configure.in | 27 +++++++++++++++++++++++++++
|
||||
configure.ac | 27 +++++++++++++++++++++++++++
|
||||
2 files changed, 33 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index 616d59f..85b5b1d 100644
|
||||
index 7b305b0..70c8c74 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -26,10 +26,11 @@ USERCFLAGS =
|
||||
@@ -30,7 +29,7 @@ index 616d59f..85b5b1d 100644
|
||||
|
||||
|
||||
# do not edit below this line
|
||||
@@ -199,7 +200,7 @@ dvi: mtools.dvi
|
||||
@@ -185,7 +186,7 @@ dvi: mtools.dvi
|
||||
|
||||
ps: mtools.ps
|
||||
%.ps: %.dvi
|
||||
@@ -39,11 +38,11 @@ index 616d59f..85b5b1d 100644
|
||||
|
||||
pdf: mtools.pdf
|
||||
%.pdf: %.texi sysconfdir.texi
|
||||
diff --git a/configure.in b/configure.in
|
||||
index 5ff75c1..c0f7440 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -35,6 +35,33 @@ AC_CANONICAL_SYSTEM
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 37f0d00..c93cfb5 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -36,6 +36,33 @@ AC_PATH_PROG(INSTALL_INFO, install-info, "")
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ RRECOMMENDS:${PN}:libc-glibc = "\
|
||||
glibc-gconv-ibm866 \
|
||||
glibc-gconv-ibm869 \
|
||||
"
|
||||
SRC_URI[sha256sum] = "541e179665dc4e272b9602f2074243591a157da89cc47064da8c5829dbd2b339"
|
||||
SRC_URI[sha256sum] = "6fe5193583d6e7c59da75e63d7234f76c0b07caf33b103894f46f66a871ffc9f"
|
||||
|
||||
SRC_URI = "${GNU_MIRROR}/mtools/mtools-${PV}.tar.bz2 \
|
||||
file://mtools-makeinfo.patch \
|
||||
@@ -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"
|
||||
|
||||
219
meta/recipes-devtools/python/python3/CVE-2025-8194.patch
Normal file
219
meta/recipes-devtools/python/python3/CVE-2025-8194.patch
Normal file
@@ -0,0 +1,219 @@
|
||||
From c9d9f78feb1467e73fd29356c040bde1c104f29f Mon Sep 17 00:00:00 2001
|
||||
From: "Miss Islington (bot)"
|
||||
<31488909+miss-islington@users.noreply.github.com>
|
||||
Date: Mon, 4 Aug 2025 13:45:06 +0200
|
||||
Subject: [PATCH] [3.12] gh-130577: tarfile now validates archives to ensure
|
||||
member offsets are non-negative (GH-137027) (#137171)
|
||||
|
||||
(cherry picked from commit 7040aa54f14676938970e10c5f74ea93cd56aa38)
|
||||
|
||||
Co-authored-by: Alexander Urieles <aeurielesn@users.noreply.github.com>
|
||||
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
||||
|
||||
CVE: CVE-2025-8194
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/c9d9f78feb1467e73fd29356c040bde1c104f29f]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
Lib/tarfile.py | 3 +
|
||||
Lib/test/test_tarfile.py | 156 ++++++++++++++++++
|
||||
...-07-23-00-35-29.gh-issue-130577.c7EITy.rst | 3 +
|
||||
3 files changed, 162 insertions(+)
|
||||
create mode 100644 Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst
|
||||
|
||||
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
|
||||
index 9999a99d54..59d3f6e5cc 100755
|
||||
--- a/Lib/tarfile.py
|
||||
+++ b/Lib/tarfile.py
|
||||
@@ -1615,6 +1615,9 @@ class TarInfo(object):
|
||||
"""Round up a byte count by BLOCKSIZE and return it,
|
||||
e.g. _block(834) => 1024.
|
||||
"""
|
||||
+ # Only non-negative offsets are allowed
|
||||
+ if count < 0:
|
||||
+ raise InvalidHeaderError("invalid offset")
|
||||
blocks, remainder = divmod(count, BLOCKSIZE)
|
||||
if remainder:
|
||||
blocks += 1
|
||||
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
|
||||
index a184ba75a8..759fa03ead 100644
|
||||
--- a/Lib/test/test_tarfile.py
|
||||
+++ b/Lib/test/test_tarfile.py
|
||||
@@ -50,6 +50,7 @@ bz2name = os.path.join(TEMPDIR, "testtar.tar.bz2")
|
||||
xzname = os.path.join(TEMPDIR, "testtar.tar.xz")
|
||||
tmpname = os.path.join(TEMPDIR, "tmp.tar")
|
||||
dotlessname = os.path.join(TEMPDIR, "testtar")
|
||||
+SPACE = b" "
|
||||
|
||||
sha256_regtype = (
|
||||
"e09e4bc8b3c9d9177e77256353b36c159f5f040531bbd4b024a8f9b9196c71ce"
|
||||
@@ -4488,6 +4489,161 @@ class OverwriteTests(archiver_tests.OverwriteTests, unittest.TestCase):
|
||||
ar.extractall(self.testdir, filter='fully_trusted')
|
||||
|
||||
|
||||
+class OffsetValidationTests(unittest.TestCase):
|
||||
+ tarname = tmpname
|
||||
+ invalid_posix_header = (
|
||||
+ # name: 100 bytes
|
||||
+ tarfile.NUL * tarfile.LENGTH_NAME
|
||||
+ # mode, space, null terminator: 8 bytes
|
||||
+ + b"000755" + SPACE + tarfile.NUL
|
||||
+ # uid, space, null terminator: 8 bytes
|
||||
+ + b"000001" + SPACE + tarfile.NUL
|
||||
+ # gid, space, null terminator: 8 bytes
|
||||
+ + b"000001" + SPACE + tarfile.NUL
|
||||
+ # size, space: 12 bytes
|
||||
+ + b"\xff" * 11 + SPACE
|
||||
+ # mtime, space: 12 bytes
|
||||
+ + tarfile.NUL * 11 + SPACE
|
||||
+ # chksum: 8 bytes
|
||||
+ + b"0011407" + tarfile.NUL
|
||||
+ # type: 1 byte
|
||||
+ + tarfile.REGTYPE
|
||||
+ # linkname: 100 bytes
|
||||
+ + tarfile.NUL * tarfile.LENGTH_LINK
|
||||
+ # magic: 6 bytes, version: 2 bytes
|
||||
+ + tarfile.POSIX_MAGIC
|
||||
+ # uname: 32 bytes
|
||||
+ + tarfile.NUL * 32
|
||||
+ # gname: 32 bytes
|
||||
+ + tarfile.NUL * 32
|
||||
+ # devmajor, space, null terminator: 8 bytes
|
||||
+ + tarfile.NUL * 6 + SPACE + tarfile.NUL
|
||||
+ # devminor, space, null terminator: 8 bytes
|
||||
+ + tarfile.NUL * 6 + SPACE + tarfile.NUL
|
||||
+ # prefix: 155 bytes
|
||||
+ + tarfile.NUL * tarfile.LENGTH_PREFIX
|
||||
+ # padding: 12 bytes
|
||||
+ + tarfile.NUL * 12
|
||||
+ )
|
||||
+ invalid_gnu_header = (
|
||||
+ # name: 100 bytes
|
||||
+ tarfile.NUL * tarfile.LENGTH_NAME
|
||||
+ # mode, null terminator: 8 bytes
|
||||
+ + b"0000755" + tarfile.NUL
|
||||
+ # uid, null terminator: 8 bytes
|
||||
+ + b"0000001" + tarfile.NUL
|
||||
+ # gid, space, null terminator: 8 bytes
|
||||
+ + b"0000001" + tarfile.NUL
|
||||
+ # size, space: 12 bytes
|
||||
+ + b"\xff" * 11 + SPACE
|
||||
+ # mtime, space: 12 bytes
|
||||
+ + tarfile.NUL * 11 + SPACE
|
||||
+ # chksum: 8 bytes
|
||||
+ + b"0011327" + tarfile.NUL
|
||||
+ # type: 1 byte
|
||||
+ + tarfile.REGTYPE
|
||||
+ # linkname: 100 bytes
|
||||
+ + tarfile.NUL * tarfile.LENGTH_LINK
|
||||
+ # magic: 8 bytes
|
||||
+ + tarfile.GNU_MAGIC
|
||||
+ # uname: 32 bytes
|
||||
+ + tarfile.NUL * 32
|
||||
+ # gname: 32 bytes
|
||||
+ + tarfile.NUL * 32
|
||||
+ # devmajor, null terminator: 8 bytes
|
||||
+ + tarfile.NUL * 8
|
||||
+ # devminor, null terminator: 8 bytes
|
||||
+ + tarfile.NUL * 8
|
||||
+ # padding: 167 bytes
|
||||
+ + tarfile.NUL * 167
|
||||
+ )
|
||||
+ invalid_v7_header = (
|
||||
+ # name: 100 bytes
|
||||
+ tarfile.NUL * tarfile.LENGTH_NAME
|
||||
+ # mode, space, null terminator: 8 bytes
|
||||
+ + b"000755" + SPACE + tarfile.NUL
|
||||
+ # uid, space, null terminator: 8 bytes
|
||||
+ + b"000001" + SPACE + tarfile.NUL
|
||||
+ # gid, space, null terminator: 8 bytes
|
||||
+ + b"000001" + SPACE + tarfile.NUL
|
||||
+ # size, space: 12 bytes
|
||||
+ + b"\xff" * 11 + SPACE
|
||||
+ # mtime, space: 12 bytes
|
||||
+ + tarfile.NUL * 11 + SPACE
|
||||
+ # chksum: 8 bytes
|
||||
+ + b"0010070" + tarfile.NUL
|
||||
+ # type: 1 byte
|
||||
+ + tarfile.REGTYPE
|
||||
+ # linkname: 100 bytes
|
||||
+ + tarfile.NUL * tarfile.LENGTH_LINK
|
||||
+ # padding: 255 bytes
|
||||
+ + tarfile.NUL * 255
|
||||
+ )
|
||||
+ valid_gnu_header = tarfile.TarInfo("filename").tobuf(tarfile.GNU_FORMAT)
|
||||
+ data_block = b"\xff" * tarfile.BLOCKSIZE
|
||||
+
|
||||
+ def _write_buffer(self, buffer):
|
||||
+ with open(self.tarname, "wb") as f:
|
||||
+ f.write(buffer)
|
||||
+
|
||||
+ def _get_members(self, ignore_zeros=None):
|
||||
+ with open(self.tarname, "rb") as f:
|
||||
+ with tarfile.open(
|
||||
+ mode="r", fileobj=f, ignore_zeros=ignore_zeros
|
||||
+ ) as tar:
|
||||
+ return tar.getmembers()
|
||||
+
|
||||
+ def _assert_raises_read_error_exception(self):
|
||||
+ with self.assertRaisesRegex(
|
||||
+ tarfile.ReadError, "file could not be opened successfully"
|
||||
+ ):
|
||||
+ self._get_members()
|
||||
+
|
||||
+ def test_invalid_offset_header_validations(self):
|
||||
+ for tar_format, invalid_header in (
|
||||
+ ("posix", self.invalid_posix_header),
|
||||
+ ("gnu", self.invalid_gnu_header),
|
||||
+ ("v7", self.invalid_v7_header),
|
||||
+ ):
|
||||
+ with self.subTest(format=tar_format):
|
||||
+ self._write_buffer(invalid_header)
|
||||
+ self._assert_raises_read_error_exception()
|
||||
+
|
||||
+ def test_early_stop_at_invalid_offset_header(self):
|
||||
+ buffer = self.valid_gnu_header + self.invalid_gnu_header + self.valid_gnu_header
|
||||
+ self._write_buffer(buffer)
|
||||
+ members = self._get_members()
|
||||
+ self.assertEqual(len(members), 1)
|
||||
+ self.assertEqual(members[0].name, "filename")
|
||||
+ self.assertEqual(members[0].offset, 0)
|
||||
+
|
||||
+ def test_ignore_invalid_archive(self):
|
||||
+ # 3 invalid headers with their respective data
|
||||
+ buffer = (self.invalid_gnu_header + self.data_block) * 3
|
||||
+ self._write_buffer(buffer)
|
||||
+ members = self._get_members(ignore_zeros=True)
|
||||
+ self.assertEqual(len(members), 0)
|
||||
+
|
||||
+ def test_ignore_invalid_offset_headers(self):
|
||||
+ for first_block, second_block, expected_offset in (
|
||||
+ (
|
||||
+ (self.valid_gnu_header),
|
||||
+ (self.invalid_gnu_header + self.data_block),
|
||||
+ 0,
|
||||
+ ),
|
||||
+ (
|
||||
+ (self.invalid_gnu_header + self.data_block),
|
||||
+ (self.valid_gnu_header),
|
||||
+ 1024,
|
||||
+ ),
|
||||
+ ):
|
||||
+ self._write_buffer(first_block + second_block)
|
||||
+ members = self._get_members(ignore_zeros=True)
|
||||
+ self.assertEqual(len(members), 1)
|
||||
+ self.assertEqual(members[0].name, "filename")
|
||||
+ self.assertEqual(members[0].offset, expected_offset)
|
||||
+
|
||||
+
|
||||
def setUpModule():
|
||||
os_helper.unlink(TEMPDIR)
|
||||
os.makedirs(TEMPDIR)
|
||||
diff --git a/Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst b/Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst
|
||||
new file mode 100644
|
||||
index 0000000000..342cabbc86
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst
|
||||
@@ -0,0 +1,3 @@
|
||||
+:mod:`tarfile` now validates archives to ensure member offsets are
|
||||
+non-negative. (Contributed by Alexander Enrique Urieles Nieto in
|
||||
+:gh:`130577`.)
|
||||
@@ -34,6 +34,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
|
||||
file://0001-test_deadlock-skip-problematic-test.patch \
|
||||
file://0001-test_active_children-skip-problematic-test.patch \
|
||||
file://0001-test_readline-skip-limited-history-test.patch \
|
||||
file://CVE-2025-8194.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:class-native = " \
|
||||
@@ -45,7 +46,7 @@ SRC_URI[sha256sum] = "c30bb24b7f1e9a19b11b55a546434f74e739bb4c271a3e3a80ff4380d4
|
||||
# exclude pre-releases for both python 2.x and 3.x
|
||||
UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
|
||||
|
||||
CVE_PRODUCT = "python cpython"
|
||||
CVE_PRODUCT = "python:python python_software_foundation:python cpython"
|
||||
|
||||
CVE_STATUS[CVE-2007-4559] = "disputed: Upstream consider this expected behaviour"
|
||||
CVE_STATUS[CVE-2019-18348] = "not-applicable-config: This is not exploitable when glibc has CVE-2016-10739 fixed"
|
||||
@@ -184,14 +185,14 @@ do_install:append:class-native() {
|
||||
# when they're only used for python called with -O or -OO.
|
||||
#find ${D} -name *opt-*.pyc -delete
|
||||
# Remove all pyc files. There are a ton of them and it is probably faster to let
|
||||
# python create the ones it wants at runtime rather than manage in the sstate
|
||||
# python create the ones it wants at runtime rather than manage in the sstate
|
||||
# tarballs and sysroot creation.
|
||||
find ${D} -name *.pyc -delete
|
||||
|
||||
# Nothing should be looking into ${B} for python3-native
|
||||
sed -i -e 's:${B}:/build/path/unavailable/:g' \
|
||||
${D}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}*/Makefile
|
||||
|
||||
|
||||
# disable the lookup in user's site-packages globally
|
||||
sed -i 's#ENABLE_USER_SITE = None#ENABLE_USER_SITE = False#' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py
|
||||
|
||||
@@ -226,7 +227,7 @@ do_install:append() {
|
||||
rm -f ${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_range.cpython*
|
||||
rm -f ${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_xml_etree.cpython*
|
||||
|
||||
# Similar to the above, we're getting reproducibility issues with
|
||||
# Similar to the above, we're getting reproducibility issues with
|
||||
# /usr/lib/python3.10/__pycache__/traceback.cpython-310.pyc
|
||||
# so remove it too
|
||||
rm -f ${D}${libdir}/python${PYTHON_MAJMIN}/__pycache__/traceback.cpython*
|
||||
@@ -303,7 +304,7 @@ py_package_preprocess () {
|
||||
cd -
|
||||
|
||||
mv ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config-${MULTILIB_SUFFIX}
|
||||
|
||||
|
||||
#Remove the unneeded copy of target sysconfig data
|
||||
rm -rf ${PKGD}/${libdir}/python-sysconfigdata
|
||||
}
|
||||
|
||||
@@ -22,4 +22,9 @@ SRC_URI[tarball.sha256sum] = "c8e31bdc59b69aaffc5b36509905ba3e5cbb12747091d27b4b
|
||||
DEBUG_OPTIMIZATION:append:armv4 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
|
||||
DEBUG_OPTIMIZATION:append:armv5 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
|
||||
|
||||
CFLAGS += "-std=gnu17"
|
||||
# mkbuiltins.c is built with native toolchain and needs gnu17 as well:
|
||||
# http://errors.yoctoproject.org/Errors/Details/853016/
|
||||
BUILD_CFLAGS += "-std=gnu17"
|
||||
|
||||
BBCLASSEXTEND = "nativesdk"
|
||||
|
||||
@@ -2,8 +2,8 @@ SUMMARY = "This is a simple example recipe that cross-compiles a Go program."
|
||||
SECTION = "examples"
|
||||
HOMEPAGE = "https://golang.org/"
|
||||
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
LICENSE = "BSD-3-Clause"
|
||||
LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
|
||||
|
||||
SRC_URI = "git://go.googlesource.com/example;branch=master;protocol=https"
|
||||
SRCREV = "d9923f6970e9ba7e0d23aa9448ead71ea57235ae"
|
||||
|
||||
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
|
||||
@@ -191,7 +191,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
|
||||
@@ -282,7 +282,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 < MIN_USER_INTERVAL_MS)
|
||||
@@ -778,7 +778,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)
|
||||
@@ -948,7 +948,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));
|
||||
@@ -973,7 +973,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");
|
||||
}
|
||||
@@ -12,6 +12,7 @@ DEPENDS = "gnutls"
|
||||
|
||||
SRC_URI = "git://github.com/iputils/iputils;branch=master;protocol=https \
|
||||
file://CVE-2025-47268.patch \
|
||||
file://CVE-2025-48964.patch \
|
||||
"
|
||||
SRCREV = "8372f355bdf7a9b0c79338dd8ef8464c00a5c4e2"
|
||||
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
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 | 36 ++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 42 insertions(+)
|
||||
|
||||
diff --git a/libpam/include/pam_cc_compat.h b/libpam/include/pam_cc_compat.h
|
||||
index 0a6e32d..af05428 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 7721c0b..ec0497c 100644
|
||||
--- a/libpam/include/pam_inline.h
|
||||
+++ b/libpam/include/pam_inline.h
|
||||
@@ -9,6 +9,8 @@
|
||||
#define PAM_INLINE_H
|
||||
|
||||
#include "pam_cc_compat.h"
|
||||
+#include <stdarg.h>
|
||||
+#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
@@ -126,6 +128,40 @@ pam_drop_response(struct pam_response *reply, int replies)
|
||||
}
|
||||
|
||||
|
||||
+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.49.0
|
||||
|
||||
750
meta/recipes-extended/pam/libpam/0002-pam-namespace-rebase.patch
Normal file
750
meta/recipes-extended/pam/libpam/0002-pam-namespace-rebase.patch
Normal file
@@ -0,0 +1,750 @@
|
||||
From df1dab1a1a7900650ad4be157fea1a002048cc49 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-rebase
|
||||
|
||||
Refresh the pam-namespace.
|
||||
|
||||
Upstream-Status: Backport [https://github.com/linux-pam/linux-pam/commit/a8b4dce7b53d73de372e150028c970ee0a2a2e97]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
modules/pam_namespace/pam_namespace.c | 444 +++++++++++++-------------
|
||||
modules/pam_namespace/pam_namespace.h | 7 +-
|
||||
2 files changed, 224 insertions(+), 227 deletions(-)
|
||||
|
||||
diff --git a/modules/pam_namespace/pam_namespace.c b/modules/pam_namespace/pam_namespace.c
|
||||
index b026861..166bfce 100644
|
||||
--- a/modules/pam_namespace/pam_namespace.c
|
||||
+++ b/modules/pam_namespace/pam_namespace.c
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "pam_namespace.h"
|
||||
#include "argv_parse.h"
|
||||
|
||||
-/* --- evaluting all files in VENDORDIR/security/namespace.d and /etc/security/namespace.d --- */
|
||||
+/* --- evaluating all files in VENDORDIR/security/namespace.d and /etc/security/namespace.d --- */
|
||||
static const char *base_name(const char *path)
|
||||
{
|
||||
const char *base = strrchr(path, '/');
|
||||
@@ -55,6 +55,155 @@ compare_filename(const void *a, const void *b)
|
||||
base_name(* (char * const *) b));
|
||||
}
|
||||
|
||||
+static void close_fds_pre_exec(struct instance_data *idata)
|
||||
+{
|
||||
+ if (pam_modutil_sanitize_helper_fds(idata->pamh, PAM_MODUTIL_IGNORE_FD,
|
||||
+ PAM_MODUTIL_IGNORE_FD, PAM_MODUTIL_IGNORE_FD) < 0) {
|
||||
+ _exit(1);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+strip_trailing_slashes(char *str)
|
||||
+{
|
||||
+ char *p = str + strlen(str);
|
||||
+
|
||||
+ while (--p > str && *p == '/')
|
||||
+ *p = '\0';
|
||||
+}
|
||||
+
|
||||
+static int protect_mount(int dfd, const char *path, struct instance_data *idata)
|
||||
+{
|
||||
+ struct protect_dir_s *dir = idata->protect_dirs;
|
||||
+ char tmpbuf[64];
|
||||
+
|
||||
+ while (dir != NULL) {
|
||||
+ if (strcmp(path, dir->dir) == 0) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ dir = dir->next;
|
||||
+ }
|
||||
+
|
||||
+ if (pam_sprintf(tmpbuf, "/proc/self/fd/%d", dfd) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ dir = calloc(1, sizeof(*dir));
|
||||
+
|
||||
+ if (dir == NULL) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ dir->dir = strdup(path);
|
||||
+
|
||||
+ if (dir->dir == NULL) {
|
||||
+ free(dir);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (idata->flags & PAMNS_DEBUG) {
|
||||
+ pam_syslog(idata->pamh, LOG_INFO,
|
||||
+ "Protect mount of %s over itself", path);
|
||||
+ }
|
||||
+
|
||||
+ if (mount(tmpbuf, tmpbuf, NULL, MS_BIND, NULL) != 0) {
|
||||
+ int save_errno = errno;
|
||||
+ pam_syslog(idata->pamh, LOG_ERR,
|
||||
+ "Protect mount of %s failed: %m", tmpbuf);
|
||||
+ free(dir->dir);
|
||||
+ free(dir);
|
||||
+ errno = save_errno;
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ dir->next = idata->protect_dirs;
|
||||
+ idata->protect_dirs = dir;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int protect_dir(const char *path, mode_t mode, int do_mkdir,
|
||||
+ struct instance_data *idata)
|
||||
+{
|
||||
+ char *p = strdup(path);
|
||||
+ char *d;
|
||||
+ char *dir = p;
|
||||
+ int dfd = AT_FDCWD;
|
||||
+ int dfd_next;
|
||||
+ int save_errno;
|
||||
+ int flags = O_RDONLY | O_DIRECTORY;
|
||||
+ int rv = -1;
|
||||
+ struct stat st;
|
||||
+
|
||||
+ if (p == NULL) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (*dir == '/') {
|
||||
+ dfd = open("/", flags);
|
||||
+ if (dfd == -1) {
|
||||
+ goto error;
|
||||
+ }
|
||||
+ dir++; /* assume / is safe */
|
||||
+ }
|
||||
+
|
||||
+ while ((d=strchr(dir, '/')) != NULL) {
|
||||
+ *d = '\0';
|
||||
+ dfd_next = openat(dfd, dir, flags);
|
||||
+ if (dfd_next == -1) {
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ if (dfd != AT_FDCWD)
|
||||
+ close(dfd);
|
||||
+ dfd = dfd_next;
|
||||
+
|
||||
+ if (fstat(dfd, &st) != 0) {
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ if (flags & O_NOFOLLOW) {
|
||||
+ /* we are inside user-owned dir - protect */
|
||||
+ if (protect_mount(dfd, p, idata) == -1)
|
||||
+ goto error;
|
||||
+ } else if (st.st_uid != 0 || st.st_gid != 0 ||
|
||||
+ (st.st_mode & S_IWOTH)) {
|
||||
+ /* do not follow symlinks on subdirectories */
|
||||
+ flags |= O_NOFOLLOW;
|
||||
+ }
|
||||
+
|
||||
+ *d = '/';
|
||||
+ dir = d + 1;
|
||||
+ }
|
||||
+
|
||||
+ rv = openat(dfd, dir, flags);
|
||||
+
|
||||
+ if (rv == -1) {
|
||||
+ if (!do_mkdir || mkdirat(dfd, dir, mode) != 0) {
|
||||
+ goto error;
|
||||
+ }
|
||||
+ rv = openat(dfd, dir, flags);
|
||||
+ }
|
||||
+
|
||||
+ if (flags & O_NOFOLLOW) {
|
||||
+ /* we are inside user-owned dir - protect */
|
||||
+ if (protect_mount(rv, p, idata) == -1) {
|
||||
+ save_errno = errno;
|
||||
+ close(rv);
|
||||
+ rv = -1;
|
||||
+ errno = save_errno;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+error:
|
||||
+ save_errno = errno;
|
||||
+ free(p);
|
||||
+ if (dfd != AT_FDCWD && dfd >= 0)
|
||||
+ close(dfd);
|
||||
+ errno = save_errno;
|
||||
+
|
||||
+ return rv;
|
||||
+}
|
||||
+
|
||||
/* Evaluating a list of files which have to be parsed in the right order:
|
||||
*
|
||||
* - If etc/security/namespace.d/@filename@.conf exists, then
|
||||
@@ -129,6 +278,7 @@ static char **read_namespace_dir(struct instance_data *idata)
|
||||
return file_list;
|
||||
}
|
||||
|
||||
+
|
||||
/*
|
||||
* Adds an entry for a polyinstantiated directory to the linked list of
|
||||
* polyinstantiated directories. It is called from process_line() while
|
||||
@@ -198,7 +348,7 @@ static void cleanup_protect_data(pam_handle_t *pamh UNUSED , void *data, int err
|
||||
unprotect_dirs(data);
|
||||
}
|
||||
|
||||
-static char *expand_variables(const char *orig, const char *var_names[], const char *var_values[])
|
||||
+static char *expand_variables(const char *orig, const char *const var_names[], const char *var_values[])
|
||||
{
|
||||
const char *src = orig;
|
||||
char *dst;
|
||||
@@ -209,7 +359,7 @@ static char *expand_variables(const char *orig, const char *var_names[], const c
|
||||
if (*src == '$') {
|
||||
int i;
|
||||
for (i = 0; var_names[i]; i++) {
|
||||
- int namelen = strlen(var_names[i]);
|
||||
+ size_t namelen = strlen(var_names[i]);
|
||||
if (strncmp(var_names[i], src+1, namelen) == 0) {
|
||||
dstlen += strlen(var_values[i]) - 1; /* $ */
|
||||
src += namelen;
|
||||
@@ -227,7 +377,7 @@ static char *expand_variables(const char *orig, const char *var_names[], const c
|
||||
if (c == '$') {
|
||||
int i;
|
||||
for (i = 0; var_names[i]; i++) {
|
||||
- int namelen = strlen(var_names[i]);
|
||||
+ size_t namelen = strlen(var_names[i]);
|
||||
if (strncmp(var_names[i], src+1, namelen) == 0) {
|
||||
dst = stpcpy(dst, var_values[i]);
|
||||
--dst;
|
||||
@@ -311,8 +461,7 @@ static int parse_iscript_params(char *params, struct polydir_s *poly)
|
||||
|
||||
if (*params != '\0') {
|
||||
if (*params != '/') { /* path is relative to NAMESPACE_D_DIR */
|
||||
- if (asprintf(&poly->init_script, "%s%s", NAMESPACE_D_DIR, params) == -1)
|
||||
- return -1;
|
||||
+ poly->init_script = pam_asprintf("%s%s", NAMESPACE_D_DIR, params);
|
||||
} else {
|
||||
poly->init_script = strdup(params);
|
||||
}
|
||||
@@ -394,9 +543,9 @@ static int parse_method(char *method, struct polydir_s *poly,
|
||||
{
|
||||
enum polymethod pm;
|
||||
char *sptr = NULL;
|
||||
- static const char *method_names[] = { "user", "context", "level", "tmpdir",
|
||||
+ static const char *const method_names[] = { "user", "context", "level", "tmpdir",
|
||||
"tmpfs", NULL };
|
||||
- static const char *flag_names[] = { "create", "noinit", "iscript",
|
||||
+ static const char *const flag_names[] = { "create", "noinit", "iscript",
|
||||
"shared", "mntopts", NULL };
|
||||
static const unsigned int flag_values[] = { POLYDIR_CREATE, POLYDIR_NOINIT,
|
||||
POLYDIR_ISCRIPT, POLYDIR_SHARED, POLYDIR_MNTOPTS };
|
||||
@@ -421,7 +570,7 @@ static int parse_method(char *method, struct polydir_s *poly,
|
||||
|
||||
while ((flag=strtok_r(NULL, ":", &sptr)) != NULL) {
|
||||
for (i = 0; flag_names[i]; i++) {
|
||||
- int namelen = strlen(flag_names[i]);
|
||||
+ size_t namelen = strlen(flag_names[i]);
|
||||
|
||||
if (strncmp(flag, flag_names[i], namelen) == 0) {
|
||||
poly->flags |= flag_values[i];
|
||||
@@ -467,27 +616,27 @@ static int parse_method(char *method, struct polydir_s *poly,
|
||||
* of the namespace configuration file. It skips over comments and incomplete
|
||||
* or malformed lines. It processes a valid line with information on
|
||||
* polyinstantiating a directory by populating appropriate fields of a
|
||||
- * polyinstatiated directory structure and then calling add_polydir_entry to
|
||||
+ * polyinstantiated directory structure and then calling add_polydir_entry to
|
||||
* add that entry to the linked list of polyinstantiated directories.
|
||||
*/
|
||||
static int process_line(char *line, const char *home, const char *rhome,
|
||||
struct instance_data *idata)
|
||||
{
|
||||
char *dir = NULL, *instance_prefix = NULL, *rdir = NULL;
|
||||
+ const char *config_dir, *config_instance_prefix;
|
||||
char *method, *uids;
|
||||
char *tptr;
|
||||
struct polydir_s *poly;
|
||||
int retval = 0;
|
||||
char **config_options = NULL;
|
||||
- static const char *var_names[] = {"HOME", "USER", NULL};
|
||||
+ static const char *const var_names[] = {"HOME", "USER", NULL};
|
||||
const char *var_values[] = {home, idata->user};
|
||||
const char *rvar_values[] = {rhome, idata->ruser};
|
||||
- int len;
|
||||
|
||||
/*
|
||||
* skip the leading white space
|
||||
*/
|
||||
- while (*line && isspace(*line))
|
||||
+ while (*line && isspace((unsigned char)*line))
|
||||
line++;
|
||||
|
||||
/*
|
||||
@@ -523,22 +672,19 @@ static int process_line(char *line, const char *home, const char *rhome,
|
||||
goto erralloc;
|
||||
}
|
||||
|
||||
- dir = config_options[0];
|
||||
- if (dir == NULL) {
|
||||
+ config_dir = config_options[0];
|
||||
+ if (config_dir == NULL) {
|
||||
pam_syslog(idata->pamh, LOG_NOTICE, "Invalid line missing polydir");
|
||||
goto skipping;
|
||||
}
|
||||
- instance_prefix = config_options[1];
|
||||
- if (instance_prefix == NULL) {
|
||||
+ config_instance_prefix = config_options[1];
|
||||
+ if (config_instance_prefix == NULL) {
|
||||
pam_syslog(idata->pamh, LOG_NOTICE, "Invalid line missing instance_prefix");
|
||||
- instance_prefix = NULL;
|
||||
goto skipping;
|
||||
}
|
||||
method = config_options[2];
|
||||
if (method == NULL) {
|
||||
pam_syslog(idata->pamh, LOG_NOTICE, "Invalid line missing method");
|
||||
- instance_prefix = NULL;
|
||||
- dir = NULL;
|
||||
goto skipping;
|
||||
}
|
||||
|
||||
@@ -553,19 +699,16 @@ static int process_line(char *line, const char *home, const char *rhome,
|
||||
/*
|
||||
* Expand $HOME and $USER in poly dir and instance dir prefix
|
||||
*/
|
||||
- if ((rdir=expand_variables(dir, var_names, rvar_values)) == NULL) {
|
||||
- instance_prefix = NULL;
|
||||
- dir = NULL;
|
||||
+ if ((rdir = expand_variables(config_dir, var_names, rvar_values)) == NULL) {
|
||||
goto erralloc;
|
||||
}
|
||||
|
||||
- if ((dir=expand_variables(dir, var_names, var_values)) == NULL) {
|
||||
- instance_prefix = NULL;
|
||||
+ if ((dir = expand_variables(config_dir, var_names, var_values)) == NULL) {
|
||||
goto erralloc;
|
||||
}
|
||||
|
||||
- if ((instance_prefix=expand_variables(instance_prefix, var_names, var_values))
|
||||
- == NULL) {
|
||||
+ if ((instance_prefix = expand_variables(config_instance_prefix,
|
||||
+ var_names, var_values)) == NULL) {
|
||||
goto erralloc;
|
||||
}
|
||||
|
||||
@@ -575,15 +718,8 @@ static int process_line(char *line, const char *home, const char *rhome,
|
||||
pam_syslog(idata->pamh, LOG_DEBUG, "Expanded instance prefix: '%s'", instance_prefix);
|
||||
}
|
||||
|
||||
- len = strlen(dir);
|
||||
- if (len > 0 && dir[len-1] == '/') {
|
||||
- dir[len-1] = '\0';
|
||||
- }
|
||||
-
|
||||
- len = strlen(rdir);
|
||||
- if (len > 0 && rdir[len-1] == '/') {
|
||||
- rdir[len-1] = '\0';
|
||||
- }
|
||||
+ strip_trailing_slashes(dir);
|
||||
+ strip_trailing_slashes(rdir);
|
||||
|
||||
if (dir[0] == '\0' || rdir[0] == '\0') {
|
||||
pam_syslog(idata->pamh, LOG_NOTICE, "Invalid polydir");
|
||||
@@ -594,26 +730,19 @@ static int process_line(char *line, const char *home, const char *rhome,
|
||||
* Populate polyinstantiated directory structure with appropriate
|
||||
* pathnames and the method with which to polyinstantiate.
|
||||
*/
|
||||
- if (strlen(dir) >= sizeof(poly->dir)
|
||||
- || strlen(rdir) >= sizeof(poly->rdir)
|
||||
- || strlen(instance_prefix) >= sizeof(poly->instance_prefix)) {
|
||||
- pam_syslog(idata->pamh, LOG_NOTICE, "Pathnames too long");
|
||||
- goto skipping;
|
||||
- }
|
||||
- strcpy(poly->dir, dir);
|
||||
- strcpy(poly->rdir, rdir);
|
||||
- strcpy(poly->instance_prefix, instance_prefix);
|
||||
-
|
||||
if (parse_method(method, poly, idata) != 0) {
|
||||
goto skipping;
|
||||
}
|
||||
|
||||
- if (poly->method == TMPDIR) {
|
||||
- if (sizeof(poly->instance_prefix) - strlen(poly->instance_prefix) < 7) {
|
||||
- pam_syslog(idata->pamh, LOG_NOTICE, "Pathnames too long");
|
||||
- goto skipping;
|
||||
- }
|
||||
- strcat(poly->instance_prefix, "XXXXXX");
|
||||
+#define COPY_STR(dst, src, apd) \
|
||||
+ pam_sprintf((dst), "%s%s", (src), (apd))
|
||||
+
|
||||
+ if (COPY_STR(poly->dir, dir, "") < 0
|
||||
+ || COPY_STR(poly->rdir, rdir, "") < 0
|
||||
+ || COPY_STR(poly->instance_prefix, instance_prefix,
|
||||
+ poly->method == TMPDIR ? "XXXXXX" : "") < 0) {
|
||||
+ pam_syslog(idata->pamh, LOG_NOTICE, "Pathnames too long");
|
||||
+ goto skipping;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -637,7 +766,7 @@ static int process_line(char *line, const char *home, const char *rhome,
|
||||
if (uids) {
|
||||
uid_t *uidptr;
|
||||
const char *ustr, *sstr;
|
||||
- int count, i;
|
||||
+ size_t count, i;
|
||||
|
||||
if (*uids == '~') {
|
||||
poly->flags |= POLYDIR_EXCLUSIVE;
|
||||
@@ -646,8 +775,13 @@ static int process_line(char *line, const char *home, const char *rhome,
|
||||
for (count = 0, ustr = sstr = uids; sstr; ustr = sstr + 1, count++)
|
||||
sstr = strchr(ustr, ',');
|
||||
|
||||
+ if (count > UINT_MAX || count > SIZE_MAX / sizeof(uid_t)) {
|
||||
+ pam_syslog(idata->pamh, LOG_ERR, "Too many uids encountered in configuration");
|
||||
+ goto skipping;
|
||||
+ }
|
||||
+
|
||||
poly->num_uids = count;
|
||||
- poly->uid = (uid_t *) malloc(count * sizeof (uid_t));
|
||||
+ poly->uid = malloc(count * sizeof (uid_t));
|
||||
uidptr = poly->uid;
|
||||
if (uidptr == NULL) {
|
||||
goto erralloc;
|
||||
@@ -996,6 +1130,7 @@ static int form_context(const struct polydir_s *polyptr,
|
||||
return rc;
|
||||
}
|
||||
/* Should never get here */
|
||||
+ freecon(scon);
|
||||
return PAM_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
@@ -1057,10 +1192,8 @@ static int poly_name(const struct polydir_s *polyptr, char **i_name,
|
||||
|
||||
switch (pm) {
|
||||
case USER:
|
||||
- if (asprintf(i_name, "%s", idata->user) < 0) {
|
||||
- *i_name = NULL;
|
||||
+ if ((*i_name = strdup(idata->user)) == NULL)
|
||||
goto fail;
|
||||
- }
|
||||
break;
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
@@ -1070,17 +1203,12 @@ static int poly_name(const struct polydir_s *polyptr, char **i_name,
|
||||
pam_syslog(idata->pamh, LOG_ERR, "Error translating directory context");
|
||||
goto fail;
|
||||
}
|
||||
- if (polyptr->flags & POLYDIR_SHARED) {
|
||||
- if (asprintf(i_name, "%s", rawcon) < 0) {
|
||||
- *i_name = NULL;
|
||||
- goto fail;
|
||||
- }
|
||||
- } else {
|
||||
- if (asprintf(i_name, "%s_%s", rawcon, idata->user) < 0) {
|
||||
- *i_name = NULL;
|
||||
- goto fail;
|
||||
- }
|
||||
- }
|
||||
+ if (polyptr->flags & POLYDIR_SHARED)
|
||||
+ *i_name = strdup(rawcon);
|
||||
+ else
|
||||
+ *i_name = pam_asprintf("%s_%s", rawcon, idata->user);
|
||||
+ if (*i_name == NULL)
|
||||
+ goto fail;
|
||||
break;
|
||||
|
||||
#endif /* WITH_SELINUX */
|
||||
@@ -1110,11 +1238,12 @@ static int poly_name(const struct polydir_s *polyptr, char **i_name,
|
||||
*i_name = hash;
|
||||
hash = NULL;
|
||||
} else {
|
||||
- char *newname;
|
||||
- if (asprintf(&newname, "%.*s_%s", NAMESPACE_MAX_DIR_LEN-1-(int)strlen(hash),
|
||||
- *i_name, hash) < 0) {
|
||||
+ char *newname =
|
||||
+ pam_asprintf("%.*s_%s",
|
||||
+ NAMESPACE_MAX_DIR_LEN - 1 - (int)strlen(hash),
|
||||
+ *i_name, hash);
|
||||
+ if (newname == NULL)
|
||||
goto fail;
|
||||
- }
|
||||
free(*i_name);
|
||||
*i_name = newname;
|
||||
}
|
||||
@@ -1139,137 +1268,6 @@ fail:
|
||||
return rc;
|
||||
}
|
||||
|
||||
-static int protect_mount(int dfd, const char *path, struct instance_data *idata)
|
||||
-{
|
||||
- struct protect_dir_s *dir = idata->protect_dirs;
|
||||
- char tmpbuf[64];
|
||||
-
|
||||
- while (dir != NULL) {
|
||||
- if (strcmp(path, dir->dir) == 0) {
|
||||
- return 0;
|
||||
- }
|
||||
- dir = dir->next;
|
||||
- }
|
||||
-
|
||||
- dir = calloc(1, sizeof(*dir));
|
||||
-
|
||||
- if (dir == NULL) {
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- dir->dir = strdup(path);
|
||||
-
|
||||
- if (dir->dir == NULL) {
|
||||
- free(dir);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- snprintf(tmpbuf, sizeof(tmpbuf), "/proc/self/fd/%d", dfd);
|
||||
-
|
||||
- if (idata->flags & PAMNS_DEBUG) {
|
||||
- pam_syslog(idata->pamh, LOG_INFO,
|
||||
- "Protect mount of %s over itself", path);
|
||||
- }
|
||||
-
|
||||
- if (mount(tmpbuf, tmpbuf, NULL, MS_BIND, NULL) != 0) {
|
||||
- int save_errno = errno;
|
||||
- pam_syslog(idata->pamh, LOG_ERR,
|
||||
- "Protect mount of %s failed: %m", tmpbuf);
|
||||
- free(dir->dir);
|
||||
- free(dir);
|
||||
- errno = save_errno;
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- dir->next = idata->protect_dirs;
|
||||
- idata->protect_dirs = dir;
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static int protect_dir(const char *path, mode_t mode, int do_mkdir,
|
||||
- struct instance_data *idata)
|
||||
-{
|
||||
- char *p = strdup(path);
|
||||
- char *d;
|
||||
- char *dir = p;
|
||||
- int dfd = AT_FDCWD;
|
||||
- int dfd_next;
|
||||
- int save_errno;
|
||||
- int flags = O_RDONLY | O_DIRECTORY;
|
||||
- int rv = -1;
|
||||
- struct stat st;
|
||||
-
|
||||
- if (p == NULL) {
|
||||
- goto error;
|
||||
- }
|
||||
-
|
||||
- if (*dir == '/') {
|
||||
- dfd = open("/", flags);
|
||||
- if (dfd == -1) {
|
||||
- goto error;
|
||||
- }
|
||||
- dir++; /* assume / is safe */
|
||||
- }
|
||||
-
|
||||
- while ((d=strchr(dir, '/')) != NULL) {
|
||||
- *d = '\0';
|
||||
- dfd_next = openat(dfd, dir, flags);
|
||||
- if (dfd_next == -1) {
|
||||
- goto error;
|
||||
- }
|
||||
-
|
||||
- if (dfd != AT_FDCWD)
|
||||
- close(dfd);
|
||||
- dfd = dfd_next;
|
||||
-
|
||||
- if (fstat(dfd, &st) != 0) {
|
||||
- goto error;
|
||||
- }
|
||||
-
|
||||
- if (flags & O_NOFOLLOW) {
|
||||
- /* we are inside user-owned dir - protect */
|
||||
- if (protect_mount(dfd, p, idata) == -1)
|
||||
- goto error;
|
||||
- } else if (st.st_uid != 0 || st.st_gid != 0 ||
|
||||
- (st.st_mode & S_IWOTH)) {
|
||||
- /* do not follow symlinks on subdirectories */
|
||||
- flags |= O_NOFOLLOW;
|
||||
- }
|
||||
-
|
||||
- *d = '/';
|
||||
- dir = d + 1;
|
||||
- }
|
||||
-
|
||||
- rv = openat(dfd, dir, flags);
|
||||
-
|
||||
- if (rv == -1) {
|
||||
- if (!do_mkdir || mkdirat(dfd, dir, mode) != 0) {
|
||||
- goto error;
|
||||
- }
|
||||
- rv = openat(dfd, dir, flags);
|
||||
- }
|
||||
-
|
||||
- if (flags & O_NOFOLLOW) {
|
||||
- /* we are inside user-owned dir - protect */
|
||||
- if (protect_mount(rv, p, idata) == -1) {
|
||||
- save_errno = errno;
|
||||
- close(rv);
|
||||
- rv = -1;
|
||||
- errno = save_errno;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
-error:
|
||||
- save_errno = errno;
|
||||
- free(p);
|
||||
- if (dfd != AT_FDCWD && dfd >= 0)
|
||||
- close(dfd);
|
||||
- errno = save_errno;
|
||||
-
|
||||
- return rv;
|
||||
-}
|
||||
-
|
||||
static int check_inst_parent(char *ipath, struct instance_data *idata)
|
||||
{
|
||||
struct stat instpbuf;
|
||||
@@ -1281,13 +1279,12 @@ static int check_inst_parent(char *ipath, struct instance_data *idata)
|
||||
* admin explicitly instructs to ignore the instance parent
|
||||
* mode by the "ignore_instance_parent_mode" argument).
|
||||
*/
|
||||
- inst_parent = (char *) malloc(strlen(ipath)+1);
|
||||
+ inst_parent = strdup(ipath);
|
||||
if (!inst_parent) {
|
||||
pam_syslog(idata->pamh, LOG_CRIT, "Error allocating pathname string");
|
||||
return PAM_SESSION_ERR;
|
||||
}
|
||||
|
||||
- strcpy(inst_parent, ipath);
|
||||
trailing_slash = strrchr(inst_parent, '/');
|
||||
if (trailing_slash)
|
||||
*trailing_slash = '\0';
|
||||
@@ -1371,9 +1368,10 @@ static int inst_init(const struct polydir_s *polyptr, const char *ipath,
|
||||
if (setuid(geteuid()) < 0) {
|
||||
/* ignore failures, they don't matter */
|
||||
}
|
||||
+ close_fds_pre_exec(idata);
|
||||
|
||||
- if (execle(init_script, init_script,
|
||||
- polyptr->dir, ipath, newdir?"1":"0", idata->user, NULL, envp) < 0)
|
||||
+ execle(init_script, init_script,
|
||||
+ polyptr->dir, ipath, newdir?"1":"0", idata->user, NULL, envp);
|
||||
_exit(1);
|
||||
} else if (pid > 0) {
|
||||
while (((rc = waitpid(pid, &status, 0)) == (pid_t)-1) &&
|
||||
@@ -1424,7 +1422,9 @@ static int create_polydir(struct polydir_s *polyptr,
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
if (idata->flags & PAMNS_SELINUX_ENABLED) {
|
||||
- getfscreatecon_raw(&oldcon_raw);
|
||||
+ if (getfscreatecon_raw(&oldcon_raw) != 0)
|
||||
+ pam_syslog(idata->pamh, LOG_NOTICE,
|
||||
+ "Error retrieving fs create context: %m");
|
||||
|
||||
label_handle = selabel_open(SELABEL_CTX_FILE, NULL, 0);
|
||||
if (!label_handle) {
|
||||
@@ -1453,6 +1453,9 @@ static int create_polydir(struct polydir_s *polyptr,
|
||||
if (rc == -1) {
|
||||
pam_syslog(idata->pamh, LOG_ERR,
|
||||
"Error creating directory %s: %m", dir);
|
||||
+#ifdef WITH_SELINUX
|
||||
+ freecon(oldcon_raw);
|
||||
+#endif
|
||||
return PAM_SESSION_ERR;
|
||||
}
|
||||
|
||||
@@ -1640,16 +1643,14 @@ static int ns_setup(struct polydir_s *polyptr,
|
||||
|
||||
retval = protect_dir(polyptr->dir, 0, 0, idata);
|
||||
|
||||
- if (retval < 0 && errno != ENOENT) {
|
||||
- pam_syslog(idata->pamh, LOG_ERR, "Polydir %s access error: %m",
|
||||
- polyptr->dir);
|
||||
- return PAM_SESSION_ERR;
|
||||
- }
|
||||
-
|
||||
if (retval < 0) {
|
||||
- if ((polyptr->flags & POLYDIR_CREATE) &&
|
||||
- create_polydir(polyptr, idata) != PAM_SUCCESS)
|
||||
- return PAM_SESSION_ERR;
|
||||
+ if (errno != ENOENT || !(polyptr->flags & POLYDIR_CREATE)) {
|
||||
+ pam_syslog(idata->pamh, LOG_ERR, "Polydir %s access error: %m",
|
||||
+ polyptr->dir);
|
||||
+ return PAM_SESSION_ERR;
|
||||
+ }
|
||||
+ if (create_polydir(polyptr, idata) != PAM_SUCCESS)
|
||||
+ return PAM_SESSION_ERR;
|
||||
} else {
|
||||
close(retval);
|
||||
}
|
||||
@@ -1698,7 +1699,7 @@ static int ns_setup(struct polydir_s *polyptr,
|
||||
#endif
|
||||
}
|
||||
|
||||
- if (asprintf(&inst_dir, "%s%s", polyptr->instance_prefix, instname) < 0)
|
||||
+ if ((inst_dir = pam_asprintf("%s%s", polyptr->instance_prefix, instname)) == NULL)
|
||||
goto error_out;
|
||||
|
||||
if (idata->flags & PAMNS_DEBUG)
|
||||
@@ -1810,8 +1811,9 @@ static int cleanup_tmpdirs(struct instance_data *idata)
|
||||
_exit(1);
|
||||
}
|
||||
#endif
|
||||
- if (execle("/bin/rm", "/bin/rm", "-rf", pptr->instance_prefix, NULL, envp) < 0)
|
||||
- _exit(1);
|
||||
+ close_fds_pre_exec(idata);
|
||||
+ execle("/bin/rm", "/bin/rm", "-rf", pptr->instance_prefix, NULL, envp);
|
||||
+ _exit(1);
|
||||
} else if (pid > 0) {
|
||||
while (((rc = waitpid(pid, &status, 0)) == (pid_t)-1) &&
|
||||
(errno == EINTR));
|
||||
@@ -1826,7 +1828,7 @@ static int cleanup_tmpdirs(struct instance_data *idata)
|
||||
}
|
||||
} else if (pid < 0) {
|
||||
pam_syslog(idata->pamh, LOG_ERR,
|
||||
- "Cannot fork to run namespace init script, %m");
|
||||
+ "Cannot fork to cleanup temporary directory, %m");
|
||||
rc = PAM_SESSION_ERR;
|
||||
goto out;
|
||||
}
|
||||
diff --git a/modules/pam_namespace/pam_namespace.h b/modules/pam_namespace/pam_namespace.h
|
||||
index a991b4c..180e042 100644
|
||||
--- a/modules/pam_namespace/pam_namespace.h
|
||||
+++ b/modules/pam_namespace/pam_namespace.h
|
||||
@@ -44,21 +44,17 @@
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <syslog.h>
|
||||
-#include <dlfcn.h>
|
||||
-#include <stdarg.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include <limits.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
-#include <sys/resource.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/wait.h>
|
||||
#include <libgen.h>
|
||||
#include <fcntl.h>
|
||||
#include <sched.h>
|
||||
#include <glob.h>
|
||||
-#include <locale.h>
|
||||
#include "security/pam_modules.h"
|
||||
#include "security/pam_modutil.h"
|
||||
#include "security/pam_ext.h"
|
||||
@@ -114,7 +109,7 @@
|
||||
#define PAMNS_MOUNT_PRIVATE 0x00080000 /* Make the polydir mounts private */
|
||||
|
||||
/* polydir flags */
|
||||
-#define POLYDIR_EXCLUSIVE 0x00000001 /* polyinstatiate exclusively for override uids */
|
||||
+#define POLYDIR_EXCLUSIVE 0x00000001 /* polyinstantiate exclusively for override uids */
|
||||
#define POLYDIR_CREATE 0x00000002 /* create the polydir */
|
||||
#define POLYDIR_NOINIT 0x00000004 /* no init script */
|
||||
#define POLYDIR_SHARED 0x00000008 /* share context/level instances among users */
|
||||
--
|
||||
2.49.0
|
||||
|
||||
1128
meta/recipes-extended/pam/libpam/CVE-2025-6020-01.patch
Normal file
1128
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 d9053a1..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 9d993d4..4c8153b 100644
|
||||
--- a/modules/pam_namespace/pam_namespace.c
|
||||
+++ b/modules/pam_namespace/pam_namespace.c
|
||||
@@ -1467,6 +1467,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
|
||||
@@ -1524,7 +1597,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.49.0
|
||||
|
||||
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 4c8153b..791dd07 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.49.0
|
||||
|
||||
@@ -29,6 +29,11 @@ SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/Linux-PAM-${PV}.tar.xz \
|
||||
file://CVE-2024-22365.patch \
|
||||
file://CVE-2024-10041-1.patch \
|
||||
file://CVE-2024-10041-2.patch \
|
||||
file://0001-pam-inline-pam-asprintf.patch \
|
||||
file://0002-pam-namespace-rebase.patch \
|
||||
file://CVE-2025-6020-01.patch \
|
||||
file://CVE-2025-6020-02.patch \
|
||||
file://CVE-2025-6020-03.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "7ac4b50feee004a9fa88f1dfd2d2fa738a82896763050cd773b3c54b0a818283"
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From eb6bb2e8dfc78ca1a187d07ea29b23a805c61794 Mon Sep 17 00:00:00 2001
|
||||
From: Rudi Heitbaum <rudi@heitbaum.com>
|
||||
Date: Wed, 20 Nov 2024 12:22:22 +0000
|
||||
Subject: [PATCH] bug#74444: [PATCH] parted: fix do_version declaration
|
||||
|
||||
With gcc 15-20241117 compile fails with the below error, update the
|
||||
do_version declaration to match the header in command.h
|
||||
|
||||
../../parted/parted.c: In function '_init_commands':
|
||||
../../parted/parted.c:2469:9: error: passing argument 2 of 'command_create' from incompatible pointer type [-Wincompatible-pointer-types]
|
||||
2469 | do_version,
|
||||
| ^~~~~~~~~~
|
||||
| |
|
||||
| int (*)(void)
|
||||
In file included from ../../parted/parted.c:28:
|
||||
../../parted/command.h:35:39: note: expected 'int (*)(PedDevice **, PedDisk **)' {aka 'int (*)(struct _PedDevice **, struct _PedDisk **)'} but argument is of type 'int (*)(void)'
|
||||
35 | int (*method) (PedDevice** dev, PedDisk** diskp),
|
||||
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/parted.git/commit/?id=16343bda6ce0d41edf43f8dac368db3bbb63d271]
|
||||
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
|
||||
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
parted/parted.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/parted/parted.c b/parted/parted.c
|
||||
index 3abb52f..fc2aeba 100644
|
||||
--- a/parted/parted.c
|
||||
+++ b/parted/parted.c
|
||||
@@ -2172,7 +2172,7 @@ do_unit (PedDevice** dev, PedDisk** diskp)
|
||||
}
|
||||
|
||||
static int
|
||||
-do_version ()
|
||||
+do_version (PedDevice** dev, PedDisk** diskp)
|
||||
{
|
||||
printf ("\n%s\n%s",
|
||||
prog_name,
|
||||
@@ -10,6 +10,7 @@ SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \
|
||||
file://fix-doc-mandir.patch \
|
||||
file://0001-fs-Add-libuuid-to-linker-flags-for-libparted-fs-resi.patch \
|
||||
file://autoconf-2.73.patch \
|
||||
file://0001-bug-74444-PATCH-parted-fix-do_version-declaration.patch \
|
||||
file://run-ptest \
|
||||
"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
From d530367828e3713d09489872743eb92d31fb11ff Mon Sep 17 00:00:00 2001
|
||||
From: "Todd C. Miller" <Todd.Miller@sudo.ws>
|
||||
Date: Tue, 1 Apr 2025 09:24:51 -0600
|
||||
Subject: [PATCH] Only allow a remote host to be specified when listing
|
||||
privileges.
|
||||
|
||||
This fixes a bug where a user with sudoers privileges on a different
|
||||
host could execute a command on the local host, even if the sudoers
|
||||
file would not otherwise allow this. CVE-2025-32462
|
||||
|
||||
Reported by Rich Mirch @ Stratascale Cyber Research Unit (CRU).
|
||||
|
||||
Upstream-Status: Backport [https://github.com/sudo-project/sudo/commit/d530367828e3713d09489872743eb92d31fb11ff]
|
||||
CVE: CVE-2025-32462
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
plugins/sudoers/sudoers.c | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c
|
||||
index 70a0c1a528..ad2fa2f61c 100644
|
||||
--- a/plugins/sudoers/sudoers.c
|
||||
+++ b/plugins/sudoers/sudoers.c
|
||||
@@ -350,6 +350,18 @@ sudoers_check_common(struct sudoers_context *ctx, int pwflag)
|
||||
time_t now;
|
||||
debug_decl(sudoers_check_common, SUDOERS_DEBUG_PLUGIN);
|
||||
|
||||
+ /* The user may only specify a host for "sudo -l". */
|
||||
+ if (!ISSET(ctx->mode, MODE_LIST|MODE_CHECK)) {
|
||||
+ if (strcmp(ctx->runas.host, ctx->user.host) != 0) {
|
||||
+ log_warningx(ctx, SLOG_NO_STDERR|SLOG_AUDIT,
|
||||
+ N_("user not allowed to set remote host for command"));
|
||||
+ sudo_warnx("%s",
|
||||
+ U_("a remote host may only be specified when listing privileges."));
|
||||
+ ret = false;
|
||||
+ goto done;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* If given the -P option, set the "preserve_groups" flag. */
|
||||
if (ISSET(ctx->mode, MODE_PRESERVE_GROUPS))
|
||||
def_preserve_groups = true;
|
||||
@@ -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,14 +1,65 @@
|
||||
# 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 \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
|
||||
file://0001-sudo.conf.in-fix-conflict-with-multilib.patch \
|
||||
file://CVE-2025-32462.patch \
|
||||
"
|
||||
|
||||
PAM_SRC_URI = "file://sudo.pam"
|
||||
|
||||
SRC_URI[sha256sum] = "558d10b9a1991fb3b9fa7fa7b07ec4405b7aefb5b3cb0b0871dbc81e3a88e558"
|
||||
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)}"
|
||||
@@ -35,6 +35,8 @@ SRC_URI[sha256sum] = "8db6664c48ca07908b92baedcfe7f3ba23f49ef2476864518ab5db6723
|
||||
UPSTREAM_CHECK_REGEX = "releases/tag/v(?P<pver>\d+(\.\d+)+)"
|
||||
UPSTREAM_CHECK_URI = "https://github.com/tukaani-project/xz/releases/"
|
||||
|
||||
CVE_STATUS[CVE-2024-47611] = "not-applicable-platform: Issue only applies on Windows"
|
||||
|
||||
CACHED_CONFIGUREVARS += "gl_cv_posix_shell=/bin/sh"
|
||||
|
||||
inherit autotools gettext ptest
|
||||
|
||||
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] = "b9505b3445b9a7e48ced34760c3bcb73e966df3ac94c95a148cb669ab748e3c7"
|
||||
|
||||
26
meta/recipes-graphics/cairo/cairo/0001-Require-C11.patch
Normal file
26
meta/recipes-graphics/cairo/cairo/0001-Require-C11.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
From de2452228814e804b103dfa7c2d37b3a216c6155 Mon Sep 17 00:00:00 2001
|
||||
From: Adrian Johnson <ajohnson@redneon.com>
|
||||
Date: Sun, 28 Apr 2024 21:31:41 +0930
|
||||
Subject: [PATCH] Require C11
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/cairo/cairo/-/commit/b60f47dfd5bbe98aec43f6c356ba3be9a1b7989e]
|
||||
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
|
||||
---
|
||||
meson.build | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 9100152..f8432fd 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -1,7 +1,8 @@
|
||||
project('cairo', 'c', 'cpp',
|
||||
- meson_version: '>= 0.59.0',
|
||||
+ meson_version: '>= 1.3.0',
|
||||
version: run_command(find_program('version.py'), check: true).stdout().strip(),
|
||||
- default_options: ['warning_level=2'],
|
||||
+ default_options: ['c_std=gnu11,c11',
|
||||
+ 'warning_level=2'],
|
||||
)
|
||||
|
||||
freetype_required_version = '>= 9.7.3'
|
||||
@@ -0,0 +1,23 @@
|
||||
From d9cc95b94b2bb1e67f2095cda484d4a8a63aba10 Mon Sep 17 00:00:00 2001
|
||||
From: Luca Bacci <luca.bacci982@gmail.com>
|
||||
Date: Thu, 16 Jan 2025 16:48:12 +0100
|
||||
Subject: [PATCH] Meson: Require C++11
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/cairo/cairo/-/commit/dfd06ab3884d79de3b5bac782d1e8b2a0bd791ab]
|
||||
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
|
||||
---
|
||||
meson.build | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index f8432fd..85434d2 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -2,6 +2,7 @@ project('cairo', 'c', 'cpp',
|
||||
meson_version: '>= 1.3.0',
|
||||
version: run_command(find_program('version.py'), check: true).stdout().strip(),
|
||||
default_options: ['c_std=gnu11,c11',
|
||||
+ 'cpp_std=gnu++11,c++11',
|
||||
'warning_level=2'],
|
||||
)
|
||||
|
||||
@@ -30,6 +30,8 @@ DEPENDS = "fontconfig freetype glib-2.0 libpng pixman zlib"
|
||||
|
||||
SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.xz \
|
||||
file://cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff \
|
||||
file://0001-Require-C11.patch \
|
||||
file://0002-Meson-Require-C-11.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "243a0736b978a33dee29f9cca7521733b78a65b5418206fef7bd1c3d4cf10b64"
|
||||
|
||||
@@ -3,7 +3,7 @@ require xserver-xorg.inc
|
||||
SRC_URI += "file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch \
|
||||
file://0001-Avoid-duplicate-definitions-of-IOPortBase.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "b14a116d2d805debc5b5b2aac505a279e69b217dae2fae2dfcb62400471a9970"
|
||||
SRC_URI[sha256sum] = "c878d1930d87725d4a5bf498c24f4be8130d5b2646a9fd0f2994deff90116352"
|
||||
|
||||
# These extensions are now integrated into the server, so declare the migration
|
||||
# path for in-place upgrades.
|
||||
@@ -0,0 +1,40 @@
|
||||
From 06e785aeb9ea8a43d0a3967c1ba6e69d758e82d4 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Jan <zoo868e@gmail.com>
|
||||
Date: Tue, 14 May 2024 12:10:46 +0800
|
||||
Subject: [PATCH] connector: Fix invalid conversion in cn_proc.h
|
||||
|
||||
The implicit conversion from unsigned int to enum
|
||||
proc_cn_event is invalid, so explicitly cast it
|
||||
for compilation in a C++ compiler.
|
||||
/usr/include/linux/cn_proc.h: In function 'proc_cn_event valid_event(proc_cn_event)':
|
||||
/usr/include/linux/cn_proc.h:72:17: error: invalid conversion from 'unsigned int' to 'proc_cn_event' [-fpermissive]
|
||||
72 | ev_type &= PROC_EVENT_ALL;
|
||||
| ^
|
||||
| |
|
||||
| unsigned int
|
||||
|
||||
Signed-off-by: Matt Jan <zoo868e@gmail.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
Upstream-Status: Backport [https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9258d795978f398ecf2d222a8388cff81d37d34d]
|
||||
---
|
||||
include/uapi/linux/cn_proc.h | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/include/uapi/linux/cn_proc.h b/include/uapi/linux/cn_proc.h
|
||||
index f2afb7cc4926..18e3745b86cd 100644
|
||||
--- a/include/uapi/linux/cn_proc.h
|
||||
+++ b/include/uapi/linux/cn_proc.h
|
||||
@@ -69,8 +69,7 @@ struct proc_input {
|
||||
|
||||
static inline enum proc_cn_event valid_event(enum proc_cn_event ev_type)
|
||||
{
|
||||
- ev_type &= PROC_EVENT_ALL;
|
||||
- return ev_type;
|
||||
+ return (enum proc_cn_event)(ev_type & PROC_EVENT_ALL);
|
||||
}
|
||||
|
||||
/*
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -8,6 +8,7 @@ SRC_URI:append:libc-musl = "\
|
||||
|
||||
SRC_URI += "\
|
||||
file://0001-kbuild-install_headers.sh-Strip-_UAPI-from-if-define.patch \
|
||||
file://0001-connector-Fix-invalid-conversion-in-cn_proc.h.patch \
|
||||
"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
From da4380c4df0e00f8d0bad569927bfc7ea35ec37d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
|
||||
Date: Thu, 8 May 2025 12:46:40 +0300
|
||||
Subject: [PATCH] subparse: Make sure that subrip time string is not too long
|
||||
before zero-padding
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4419
|
||||
Fixes CVE-2025-47806
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9135>
|
||||
|
||||
CVE: CVE-2025-47806
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/da4380c4df0e00f8d0bad569927bfc7ea35ec37d]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
gst/subparse/gstsubparse.c | 11 ++++++++++-
|
||||
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c
|
||||
index 4ea4ec6..035068d 100644
|
||||
--- a/gst/subparse/gstsubparse.c
|
||||
+++ b/gst/subparse/gstsubparse.c
|
||||
@@ -850,7 +850,7 @@ parse_subrip_time (const gchar * ts_string, GstClockTime * t)
|
||||
g_strdelimit (s, " ", '0');
|
||||
g_strdelimit (s, ".", ',');
|
||||
|
||||
- /* make sure we have exactly three digits after he comma */
|
||||
+ /* make sure we have exactly three digits after the comma */
|
||||
p = strchr (s, ',');
|
||||
if (p == NULL) {
|
||||
/* If there isn't a ',' the timestamp is broken */
|
||||
@@ -859,6 +859,15 @@ parse_subrip_time (const gchar * ts_string, GstClockTime * t)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+ /* Check if the comma is too far into the string to avoid
|
||||
+ * stack overflow when zero-padding the sub-second part.
|
||||
+ *
|
||||
+ * Allow for 3 digits of hours just in case. */
|
||||
+ if ((p - s) > sizeof ("hhh:mm:ss,")) {
|
||||
+ GST_WARNING ("failed to parse subrip timestamp string '%s'", s);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
++p;
|
||||
len = strlen (p);
|
||||
if (len > 3) {
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From 6b19f117518a765a25c99d1c4b09f2838a8ed0c9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
|
||||
Date: Thu, 8 May 2025 09:04:52 +0300
|
||||
Subject: [PATCH] tmplayer: Don't append NULL + 1 to the string buffer when
|
||||
parsing lines without text
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4417
|
||||
Fixes CVE-2025-47808
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9132>
|
||||
|
||||
CVE: CVE-2025-47808
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/6b19f117518a765a25c99d1c4b09f2838a8ed0c9]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
gst/subparse/tmplayerparse.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gst/subparse/tmplayerparse.c b/gst/subparse/tmplayerparse.c
|
||||
index 807e332..a9225d3 100644
|
||||
--- a/gst/subparse/tmplayerparse.c
|
||||
+++ b/gst/subparse/tmplayerparse.c
|
||||
@@ -125,7 +125,9 @@ tmplayer_parse_line (ParserState * state, const gchar * line, guint line_num)
|
||||
* durations from the start times anyway, so as long as the parser just
|
||||
* forwards state->start_time by duration after it pushes the line we
|
||||
* are about to return it will all be good. */
|
||||
- g_string_append (state->buf, text_start + 1);
|
||||
+ if (text_start) {
|
||||
+ g_string_append (state->buf, text_start + 1);
|
||||
+ }
|
||||
} else if (line_num > 0) {
|
||||
GST_WARNING ("end of subtitle unit but no valid start time?!");
|
||||
}
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -19,6 +19,8 @@ SRC_URI = "https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-ba
|
||||
file://0010-id3v2-Don-t-try-parsing-extended-header-if-not-enoug.patch \
|
||||
file://0011-discoverer-Don-t-print-channel-layout-for-more-than-.patch \
|
||||
file://0012-subparse-Check-for-NULL-return-of-strchr-when-parsin.patch \
|
||||
file://CVE-2025-47808.patch \
|
||||
file://CVE-2025-47806.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "73cfadc3a6ffe77ed974cfd6fb391c605e4531f48db21dd6b9f42b8cb69bd8c1"
|
||||
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
From c4d0f4bbd9a8e97f119a4528b9f4662a6b80922c Mon Sep 17 00:00:00 2001
|
||||
From: Jochen Henneberg <jochen@centricular.com>
|
||||
Date: Tue, 10 Dec 2024 21:34:48 +0100
|
||||
Subject: [PATCH] qtdemux: Use mvhd transform matrix and support for flipping
|
||||
|
||||
The mvhd matrix is now combined with the tkhd matrix. The combined
|
||||
matrix is then checked if it matches one of the standard values for
|
||||
GST_TAG_IMAGE_ORIENTATION.
|
||||
This check now includes matrices with flipping.
|
||||
|
||||
Fixes #4064
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8127>
|
||||
|
||||
CVE: CVE-2025-47183
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/c4d0f4bbd9a8e97f119a4528b9f4662a6b80922c]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
gst/isomp4/qtdemux.c | 53 ++++++++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 49 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
|
||||
index 10b21a6..e708ef4 100644
|
||||
--- a/gst/isomp4/qtdemux.c
|
||||
+++ b/gst/isomp4/qtdemux.c
|
||||
@@ -10861,6 +10861,23 @@ qtdemux_parse_transformation_matrix (GstQTDemux * qtdemux,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+static void
|
||||
+qtdemux_mul_transformation_matrix (GstQTDemux * qtdemux,
|
||||
+ guint32 * a, guint32 * b, guint32 * c)
|
||||
+{
|
||||
+#define QTMUL_MATRIX(_a,_b) (((_a) == 0 || (_b) == 0) ? 0 : \
|
||||
+ ((_a) == (_b) ? 1 : -1))
|
||||
+#define QTADD_MATRIX(_a,_b) ((_a) + (_b) > 0 ? (1U << 16) : \
|
||||
+ ((_a) + (_b) < 0) ? (G_MAXUINT16 << 16) : 0u)
|
||||
+
|
||||
+ c[2] = c[5] = c[6] = c[7] = 0;
|
||||
+ c[0] = QTADD_MATRIX (QTMUL_MATRIX (a[0], b[0]), QTMUL_MATRIX (a[1], b[3]));
|
||||
+ c[1] = QTADD_MATRIX (QTMUL_MATRIX (a[0], b[1]), QTMUL_MATRIX (a[1], b[4]));
|
||||
+ c[3] = QTADD_MATRIX (QTMUL_MATRIX (a[3], b[0]), QTMUL_MATRIX (a[4], b[3]));
|
||||
+ c[4] = QTADD_MATRIX (QTMUL_MATRIX (a[3], b[1]), QTMUL_MATRIX (a[4], b[4]));
|
||||
+ c[8] = a[8];
|
||||
+}
|
||||
+
|
||||
static void
|
||||
qtdemux_inspect_transformation_matrix (GstQTDemux * qtdemux,
|
||||
QtDemuxStream * stream, guint32 * matrix, GstTagList ** taglist)
|
||||
@@ -10889,6 +10906,14 @@ qtdemux_inspect_transformation_matrix (GstQTDemux * qtdemux,
|
||||
rotation_tag = "rotate-180";
|
||||
} else if (QTCHECK_MATRIX (matrix, 0, G_MAXUINT16, 1, 0)) {
|
||||
rotation_tag = "rotate-270";
|
||||
+ } else if (QTCHECK_MATRIX (matrix, G_MAXUINT16, 0, 0, 1)) {
|
||||
+ rotation_tag = "flip-rotate-0";
|
||||
+ } else if (QTCHECK_MATRIX (matrix, 0, G_MAXUINT16, 1, 0)) {
|
||||
+ rotation_tag = "flip-rotate-90";
|
||||
+ } else if (QTCHECK_MATRIX (matrix, 1, 0, 0, G_MAXUINT16)) {
|
||||
+ rotation_tag = "flip-rotate-180";
|
||||
+ } else if (QTCHECK_MATRIX (matrix, 0, 1, 1, 0)) {
|
||||
+ rotation_tag = "flip-rotate-270";
|
||||
} else {
|
||||
GST_FIXME_OBJECT (qtdemux, "Unhandled transformation matrix values");
|
||||
}
|
||||
@@ -11175,7 +11200,7 @@ qtdemux_parse_stereo_svmi_atom (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
||||
* traks that do not decode to something (like strm traks) will not have a pad.
|
||||
*/
|
||||
static gboolean
|
||||
-qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
||||
+qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak, guint32 * mvhd_matrix)
|
||||
{
|
||||
GstByteReader tkhd;
|
||||
int offset;
|
||||
@@ -11347,15 +11372,21 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
||||
|
||||
/* parse rest of tkhd */
|
||||
if (stream->subtype == FOURCC_vide) {
|
||||
+ guint32 tkhd_matrix[9];
|
||||
guint32 matrix[9];
|
||||
|
||||
/* version 1 uses some 64-bit ints */
|
||||
if (!gst_byte_reader_skip (&tkhd, 20 + value_size))
|
||||
goto corrupt_file;
|
||||
|
||||
- if (!qtdemux_parse_transformation_matrix (qtdemux, &tkhd, matrix, "tkhd"))
|
||||
+ if (!qtdemux_parse_transformation_matrix (qtdemux, &tkhd, tkhd_matrix,
|
||||
+ "tkhd"))
|
||||
goto corrupt_file;
|
||||
|
||||
+ /* calculate the final matrix from the mvhd_matrix and the tkhd matrix */
|
||||
+ qtdemux_mul_transformation_matrix (qtdemux, mvhd_matrix, tkhd_matrix,
|
||||
+ matrix);
|
||||
+
|
||||
if (!gst_byte_reader_get_uint32_be (&tkhd, &w)
|
||||
|| !gst_byte_reader_get_uint32_be (&tkhd, &h))
|
||||
goto corrupt_file;
|
||||
@@ -14198,11 +14229,14 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
|
||||
guint64 creation_time;
|
||||
GstDateTime *datetime = NULL;
|
||||
gint version;
|
||||
+ GstByteReader mvhd_reader;
|
||||
+ guint32 matrix[9];
|
||||
|
||||
/* make sure we have a usable taglist */
|
||||
qtdemux->tag_list = gst_tag_list_make_writable (qtdemux->tag_list);
|
||||
|
||||
- mvhd = qtdemux_tree_get_child_by_type (qtdemux->moov_node, FOURCC_mvhd);
|
||||
+ mvhd = qtdemux_tree_get_child_by_type_full (qtdemux->moov_node,
|
||||
+ FOURCC_mvhd, &mvhd_reader);
|
||||
if (mvhd == NULL) {
|
||||
GST_LOG_OBJECT (qtdemux, "No mvhd node found, looking for redirects.");
|
||||
return qtdemux_parse_redirects (qtdemux);
|
||||
@@ -14213,15 +14247,26 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
|
||||
creation_time = QT_UINT64 ((guint8 *) mvhd->data + 12);
|
||||
qtdemux->timescale = QT_UINT32 ((guint8 *) mvhd->data + 28);
|
||||
qtdemux->duration = QT_UINT64 ((guint8 *) mvhd->data + 32);
|
||||
+ if (!gst_byte_reader_skip (&mvhd_reader, 4 + 8 + 8 + 4 + 8))
|
||||
+ return FALSE;
|
||||
} else if (version == 0) {
|
||||
creation_time = QT_UINT32 ((guint8 *) mvhd->data + 12);
|
||||
qtdemux->timescale = QT_UINT32 ((guint8 *) mvhd->data + 20);
|
||||
qtdemux->duration = QT_UINT32 ((guint8 *) mvhd->data + 24);
|
||||
+ if (!gst_byte_reader_skip (&mvhd_reader, 4 + 4 + 4 + 4 + 4))
|
||||
+ return FALSE;
|
||||
} else {
|
||||
GST_WARNING_OBJECT (qtdemux, "Unhandled mvhd version %d", version);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+ if (!gst_byte_reader_skip (&mvhd_reader, 4 + 2 + 2 + 2 * 4))
|
||||
+ return FALSE;
|
||||
+
|
||||
+ if (!qtdemux_parse_transformation_matrix (qtdemux, &mvhd_reader, matrix,
|
||||
+ "mvhd"))
|
||||
+ return FALSE;
|
||||
+
|
||||
/* Moving qt creation time (secs since 1904) to unix time */
|
||||
if (creation_time != 0) {
|
||||
/* Try to use epoch first as it should be faster and more commonly found */
|
||||
@@ -14290,7 +14335,7 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
|
||||
/* parse all traks */
|
||||
trak = qtdemux_tree_get_child_by_type (qtdemux->moov_node, FOURCC_trak);
|
||||
while (trak) {
|
||||
- qtdemux_parse_trak (qtdemux, trak);
|
||||
+ qtdemux_parse_trak (qtdemux, trak, matrix);
|
||||
/* iterate all siblings */
|
||||
trak = qtdemux_tree_get_sibling_by_type (trak, FOURCC_trak);
|
||||
}
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From d76cae74dad89994bfcdad83da6ef1ad69074332 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
|
||||
Date: Tue, 29 Apr 2025 09:43:58 +0300
|
||||
Subject: [PATCH] qtdemux: Use byte reader to parse mvhd box
|
||||
|
||||
This avoids OOB reads.
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4394
|
||||
Fixes CVE-2025-47183
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9133>
|
||||
|
||||
CVE: CVE-2025-47183
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/d76cae74dad89994bfcdad83da6ef1ad69074332]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
gst/isomp4/qtdemux.c | 36 ++++++++++++++++++++++++++----------
|
||||
1 file changed, 26 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
|
||||
index e708ef4..0d29869 100644
|
||||
--- a/gst/isomp4/qtdemux.c
|
||||
+++ b/gst/isomp4/qtdemux.c
|
||||
@@ -14228,7 +14228,7 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
|
||||
GNode *pssh;
|
||||
guint64 creation_time;
|
||||
GstDateTime *datetime = NULL;
|
||||
- gint version;
|
||||
+ guint8 version;
|
||||
GstByteReader mvhd_reader;
|
||||
guint32 matrix[9];
|
||||
|
||||
@@ -14242,19 +14242,35 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
|
||||
return qtdemux_parse_redirects (qtdemux);
|
||||
}
|
||||
|
||||
- version = QT_UINT8 ((guint8 *) mvhd->data + 8);
|
||||
+ if (!gst_byte_reader_get_uint8 (&mvhd_reader, &version))
|
||||
+ return FALSE;
|
||||
+ /* flags */
|
||||
+ if (!gst_byte_reader_skip (&mvhd_reader, 3))
|
||||
+ return FALSE;
|
||||
if (version == 1) {
|
||||
- creation_time = QT_UINT64 ((guint8 *) mvhd->data + 12);
|
||||
- qtdemux->timescale = QT_UINT32 ((guint8 *) mvhd->data + 28);
|
||||
- qtdemux->duration = QT_UINT64 ((guint8 *) mvhd->data + 32);
|
||||
- if (!gst_byte_reader_skip (&mvhd_reader, 4 + 8 + 8 + 4 + 8))
|
||||
+ if (!gst_byte_reader_get_uint64_be (&mvhd_reader, &creation_time))
|
||||
+ return FALSE;
|
||||
+ /* modification time */
|
||||
+ if (!gst_byte_reader_skip (&mvhd_reader, 8))
|
||||
+ return FALSE;
|
||||
+ if (!gst_byte_reader_get_uint32_be (&mvhd_reader, &qtdemux->timescale))
|
||||
+ return FALSE;
|
||||
+ if (!gst_byte_reader_get_uint64_be (&mvhd_reader, &qtdemux->duration))
|
||||
return FALSE;
|
||||
} else if (version == 0) {
|
||||
- creation_time = QT_UINT32 ((guint8 *) mvhd->data + 12);
|
||||
- qtdemux->timescale = QT_UINT32 ((guint8 *) mvhd->data + 20);
|
||||
- qtdemux->duration = QT_UINT32 ((guint8 *) mvhd->data + 24);
|
||||
- if (!gst_byte_reader_skip (&mvhd_reader, 4 + 4 + 4 + 4 + 4))
|
||||
+ guint32 tmp;
|
||||
+
|
||||
+ if (!gst_byte_reader_get_uint32_be (&mvhd_reader, &tmp))
|
||||
+ return FALSE;
|
||||
+ creation_time = tmp;
|
||||
+ /* modification time */
|
||||
+ if (!gst_byte_reader_skip (&mvhd_reader, 4))
|
||||
+ return FALSE;
|
||||
+ if (!gst_byte_reader_get_uint32_be (&mvhd_reader, &qtdemux->timescale))
|
||||
+ return FALSE;
|
||||
+ if (!gst_byte_reader_get_uint32_be (&mvhd_reader, &tmp))
|
||||
return FALSE;
|
||||
+ qtdemux->duration = tmp;
|
||||
} else {
|
||||
GST_WARNING_OBJECT (qtdemux, "Unhandled mvhd version %d", version);
|
||||
return FALSE;
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From b80803943388050cb870c95934fc52feeffb94ac Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
|
||||
Date: Sat, 3 May 2025 09:43:32 +0300
|
||||
Subject: [PATCH] qtdemux: Check if enough bytes are available for each stsd
|
||||
entry
|
||||
|
||||
There must be at least 8 bytes for the length / fourcc of each entry. After
|
||||
reading those, the length is already validated against the remaining available
|
||||
bytes.
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4407
|
||||
Fixes CVE-2025-47219
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9137>
|
||||
|
||||
CVE: CVE-2025-47219
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/b80803943388050cb870c95934fc52feeffb94ac]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
gst/isomp4/qtdemux.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
|
||||
index 10b21a6..b40aa81 100644
|
||||
--- a/gst/isomp4/qtdemux.c
|
||||
+++ b/gst/isomp4/qtdemux.c
|
||||
@@ -11399,6 +11399,10 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
||||
gchar *codec = NULL;
|
||||
QtDemuxStreamStsdEntry *entry = &stream->stsd_entries[stsd_index];
|
||||
|
||||
+ /* needs at least length and fourcc */
|
||||
+ if (remaining_stsd_len < 8)
|
||||
+ goto corrupt_file;
|
||||
+
|
||||
/* and that entry should fit within stsd */
|
||||
len = QT_UINT32 (stsd_entry_data);
|
||||
if (len > remaining_stsd_len)
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -38,6 +38,9 @@ SRC_URI = "https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-go
|
||||
file://0029-wavparse-Check-that-at-least-32-bytes-are-available-.patch \
|
||||
file://0030-wavparse-Fix-clipping-of-size-to-the-file-size.patch \
|
||||
file://0031-wavparse-Check-size-before-reading-ds64-chunk.patch \
|
||||
file://CVE-2025-47183-001.patch \
|
||||
file://CVE-2025-47183-002.patch \
|
||||
file://CVE-2025-47219.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "9c1913f981900bd8867182639b20907b28ed78ef7a222cfbf2d8ba9dab992fa7"
|
||||
|
||||
@@ -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
|
||||
@@ -1170,6 +1170,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) /
|
||||
@@ -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
|
||||
@@ -615,6 +615,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.8.4 (released 2024-03-18)
|
||||
|
||||
** libgnutls: RSA-OAEP encryption scheme is now supported
|
||||
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
|
||||
@@ -754,7 +754,6 @@ int _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);
|
||||
}
|
||||
|
||||
@@ -763,7 +762,6 @@ int _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.8.4 (released 2024-03-18)
|
||||
|
||||
** libgnutls: RSA-OAEP encryption scheme is now supported
|
||||
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
|
||||
@@ -3757,7 +3757,7 @@ int gnutls_x509_ext_ct_import_scts(const gnutls_datum_t *ext,
|
||||
}
|
||||
|
||||
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
|
||||
@@ -589,9 +589,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
|
||||
@@ -202,7 +202,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;
|
||||
@@ -349,6 +350,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