mirror of
https://git.yoctoproject.org/poky
synced 2026-02-21 00:49:41 +01:00
Compare commits
146 Commits
yocto-4.0.
...
kirkstone-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bd3969d32 | ||
|
|
75ff26ce99 | ||
|
|
be9285cbd9 | ||
|
|
945b58b5ba | ||
|
|
b5381de5ba | ||
|
|
979f68bad0 | ||
|
|
9170d3f0f3 | ||
|
|
14065a801b | ||
|
|
6635675a68 | ||
|
|
cbac0f1bfc | ||
|
|
7c5fc9fedc | ||
|
|
af50c9154c | ||
|
|
940a24ab8b | ||
|
|
14fe1f1319 | ||
|
|
52f1435174 | ||
|
|
064e000b18 | ||
|
|
e2366b9d09 | ||
|
|
f27a1997b6 | ||
|
|
35a517b7bd | ||
|
|
4374c6dfab | ||
|
|
e139e9d0ce | ||
|
|
4cf40d4608 | ||
|
|
d08e8d726d | ||
|
|
ec87d3ca28 | ||
|
|
b0b5da10e1 | ||
|
|
2db6158ba5 | ||
|
|
c44a4b4958 | ||
|
|
acf74d7113 | ||
|
|
f60be736e6 | ||
|
|
db3cb6f113 | ||
|
|
95d2f8cf15 | ||
|
|
96242e3146 | ||
|
|
6ae41f83ca | ||
|
|
04b2e68c4f | ||
|
|
8d93dec85f | ||
|
|
22e55c047c | ||
|
|
6d2a4fcdba | ||
|
|
2af7a635be | ||
|
|
e575d02196 | ||
|
|
3b038cab56 | ||
|
|
bb39884146 | ||
|
|
688f3725d2 | ||
|
|
0eea8a2194 | ||
|
|
e0fdd6f40a | ||
|
|
445c60a484 | ||
|
|
9a7f9a95ca | ||
|
|
6169212f74 | ||
|
|
5c841acbab | ||
|
|
8e81c67e12 | ||
|
|
5479d5c70a | ||
|
|
b049cef243 | ||
|
|
894f506635 | ||
|
|
6024b7be01 | ||
|
|
59d099b690 | ||
|
|
e44b0a798e | ||
|
|
de2e7f617e | ||
|
|
c24960e133 | ||
|
|
affef9de9f | ||
|
|
1f9aa7874a | ||
|
|
ea08276b46 | ||
|
|
7bcb5213be | ||
|
|
a871df9e3e | ||
|
|
94ad2c81e0 | ||
|
|
779b489229 | ||
|
|
bd0795ed5a | ||
|
|
f90f4e8d92 | ||
|
|
f1ad013a29 | ||
|
|
197002083a | ||
|
|
049e890f7a | ||
|
|
c0acd30703 | ||
|
|
c4612ee606 | ||
|
|
645aff93b3 | ||
|
|
88287ba521 | ||
|
|
2b21c6009a | ||
|
|
d7906b39ef | ||
|
|
966777e0a4 | ||
|
|
43b8c2ab9f | ||
|
|
65303b3236 | ||
|
|
31751bba1c | ||
|
|
700eac59a6 | ||
|
|
dc98af7cab | ||
|
|
19e8261a85 | ||
|
|
9babd9f028 | ||
|
|
0f437fb0f2 | ||
|
|
70c869275a | ||
|
|
888ea24812 | ||
|
|
364c5c906e | ||
|
|
9f0fd0ad0e | ||
|
|
3656b0f473 | ||
|
|
fac2a5eff5 | ||
|
|
a6fdddf8c4 | ||
|
|
ccbfa27d19 | ||
|
|
c243b5649b | ||
|
|
9d7485f8bf | ||
|
|
73955d9954 | ||
|
|
3c2f809933 | ||
|
|
ab958d6589 | ||
|
|
f3e5f706b4 | ||
|
|
ca3bb1f53e | ||
|
|
71267466e9 | ||
|
|
9d9c54071e | ||
|
|
0603438c81 | ||
|
|
a095c9e6a3 | ||
|
|
f2bfbbdcea | ||
|
|
9627817bff | ||
|
|
1e0d58c53b | ||
|
|
77e76a23c4 | ||
|
|
2b4a64396e | ||
|
|
28cd826b57 | ||
|
|
be6f929830 | ||
|
|
3004d3e2eb | ||
|
|
832975f59d | ||
|
|
8b7e9c67e3 | ||
|
|
15034b32a5 | ||
|
|
85da954465 | ||
|
|
de3d966d73 | ||
|
|
3eb39d2618 | ||
|
|
1921c27946 | ||
|
|
ebebf9d948 | ||
|
|
418e54ce5c | ||
|
|
f9653f1118 | ||
|
|
65e2df5990 | ||
|
|
cf1c9d3daa | ||
|
|
b6f6c72945 | ||
|
|
ccb4e6abb4 | ||
|
|
5b75b5cbcf | ||
|
|
3b7e326704 | ||
|
|
d51c7e990b | ||
|
|
48bd3888df | ||
|
|
0b59f7efc6 | ||
|
|
59b33ce497 | ||
|
|
e8d1874bf0 | ||
|
|
1ca3aed8af | ||
|
|
529c7c30e6 | ||
|
|
f0645d6efc | ||
|
|
e011bb9e8d | ||
|
|
5325ae0e06 | ||
|
|
4b6fc4f642 | ||
|
|
ab504237a5 | ||
|
|
ea0af985cb | ||
|
|
0c780cd9c8 | ||
|
|
bcd26a2342 | ||
|
|
a2271ac5a9 | ||
|
|
6269fbcd4f | ||
|
|
9fce626d58 | ||
|
|
fe9d4cb613 |
@@ -49,20 +49,23 @@ class SkipPackage(SkipRecipe):
|
||||
__mtime_cache = {}
|
||||
def cached_mtime(f):
|
||||
if f not in __mtime_cache:
|
||||
__mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
|
||||
res = os.stat(f)
|
||||
__mtime_cache[f] = (res.st_mtime_ns, res.st_size, res.st_ino)
|
||||
return __mtime_cache[f]
|
||||
|
||||
def cached_mtime_noerror(f):
|
||||
if f not in __mtime_cache:
|
||||
try:
|
||||
__mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
|
||||
res = os.stat(f)
|
||||
__mtime_cache[f] = (res.st_mtime_ns, res.st_size, res.st_ino)
|
||||
except OSError:
|
||||
return 0
|
||||
return __mtime_cache[f]
|
||||
|
||||
def update_mtime(f):
|
||||
try:
|
||||
__mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
|
||||
res = os.stat(f)
|
||||
__mtime_cache[f] = (res.st_mtime_ns, res.st_size, res.st_ino)
|
||||
except OSError:
|
||||
if f in __mtime_cache:
|
||||
del __mtime_cache[f]
|
||||
|
||||
@@ -1335,7 +1335,7 @@ class FetchLatestVersionTest(FetcherTest):
|
||||
# combination version pattern
|
||||
("sysprof", "git://gitlab.gnome.org/GNOME/sysprof.git;protocol=https;branch=master", "cd44ee6644c3641507fb53b8a2a69137f2971219", "")
|
||||
: "1.2.0",
|
||||
("u-boot-mkimage", "git://git.denx.de/u-boot.git;branch=master;protocol=git", "62c175fbb8a0f9a926c88294ea9f7e88eb898f6c", "")
|
||||
("u-boot-mkimage", "git://source.denx.de/u-boot/u-boot.git;branch=master;protocol=https", "62c175fbb8a0f9a926c88294ea9f7e88eb898f6c", "")
|
||||
: "2014.01",
|
||||
# version pattern "yyyymmdd"
|
||||
("mobile-broadband-provider-info", "git://gitlab.gnome.org/GNOME/mobile-broadband-provider-info.git;protocol=https;branch=master", "4ed19e11c2975105b71b956440acdb25d46a347d", "")
|
||||
|
||||
2
documentation/.gitignore
vendored
2
documentation/.gitignore
vendored
@@ -5,3 +5,5 @@ sphinx-static/switchers.js
|
||||
.vscode/
|
||||
*/svg/*.png
|
||||
*/svg/*.pdf
|
||||
styles/*
|
||||
!styles/config
|
||||
|
||||
7
documentation/.vale.ini
Normal file
7
documentation/.vale.ini
Normal file
@@ -0,0 +1,7 @@
|
||||
StylesPath = styles
|
||||
MinAlertLevel = suggestion
|
||||
Packages = RedHat, proselint, write-good, alex, Readability, Joblint
|
||||
Vocab = Yocto, OpenSource
|
||||
[*.rst]
|
||||
BasedOnStyles = Vale, RedHat, proselint, write-good, alex, Readability, Joblint
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
# from the environment for the first two.
|
||||
SPHINXOPTS ?= -W --keep-going -j auto
|
||||
SPHINXBUILD ?= sphinx-build
|
||||
# Release notes are excluded because they contain contributor names and commit messages which can't be modified
|
||||
VALEOPTS ?= --no-wrap --glob '!migration-guides/release-notes-*.rst'
|
||||
VALEDOCS ?= .
|
||||
SOURCEDIR = .
|
||||
IMAGEDIRS = */svg
|
||||
BUILDDIR = _build
|
||||
@@ -20,7 +23,7 @@ endif
|
||||
help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
.PHONY: all help Makefile clean publish epub latexpdf
|
||||
.PHONY: all help Makefile clean stylecheck publish epub latexpdf
|
||||
|
||||
publish: Makefile html singlehtml
|
||||
rm -rf $(BUILDDIR)/$(DESTDIR)/
|
||||
@@ -46,6 +49,13 @@ PNGs := $(foreach dir, $(IMAGEDIRS), $(patsubst %.svg,%.png,$(wildcard $(SOURCED
|
||||
clean:
|
||||
@rm -rf $(BUILDDIR) $(PNGs) $(PDFs) poky.yaml sphinx-static/switchers.js
|
||||
|
||||
stylecheck:
|
||||
vale sync
|
||||
vale $(VALEOPTS) $(VALEDOCS)
|
||||
|
||||
sphinx-lint:
|
||||
sphinx-lint $(SOURCEDIR)
|
||||
|
||||
epub: $(PNGs)
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
|
||||
@@ -151,6 +151,34 @@ dependencies in a virtual environment:
|
||||
$ pipenv install
|
||||
$ pipenv run make html
|
||||
|
||||
Style checking the Yocto Project documentation
|
||||
==============================================
|
||||
|
||||
The project is starting to use Vale (https://vale.sh/)
|
||||
to validate the text style.
|
||||
|
||||
To install Vale:
|
||||
|
||||
$ pip install vale
|
||||
|
||||
To run Vale:
|
||||
|
||||
$ make stylecheck
|
||||
|
||||
Link checking the Yocto Project documentation
|
||||
=============================================
|
||||
|
||||
To fix errors which are not reported by Sphinx itself,
|
||||
the project uses sphinx-lint (https://github.com/sphinx-contrib/sphinx-lint).
|
||||
|
||||
To install sphinx-lint:
|
||||
|
||||
$ pip install sphinx-lint
|
||||
|
||||
To run sphinx-lint:
|
||||
|
||||
$ make sphinx-lint
|
||||
|
||||
Sphinx theme and CSS customization
|
||||
==================================
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
|
||||
|
||||
************************************************
|
||||
Board Support Packages (BSP) - Developer's Guide
|
||||
************************************************
|
||||
**************************************************
|
||||
Board Support Packages (BSP) --- Developer's Guide
|
||||
**************************************************
|
||||
|
||||
A Board Support Package (BSP) is a collection of information that
|
||||
defines how to support a particular hardware device, set of devices, or
|
||||
|
||||
@@ -159,8 +159,8 @@ html_last_updated_fmt = '%b %d, %Y'
|
||||
html_secnumber_suffix = " "
|
||||
|
||||
latex_elements = {
|
||||
'passoptionstopackages': '\PassOptionsToPackage{bookmarksdepth=5}{hyperref}',
|
||||
'preamble': '\setcounter{tocdepth}{2}',
|
||||
'passoptionstopackages': '\\PassOptionsToPackage{bookmarksdepth=5}{hyperref}',
|
||||
'preamble': '\\setcounter{tocdepth}{2}',
|
||||
}
|
||||
|
||||
# Make the EPUB builder prefer PNG to SVG because of issues rendering Inkscape SVG
|
||||
|
||||
@@ -221,6 +221,38 @@ to add the upgraded version.
|
||||
<https://www.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes>`__
|
||||
in the Linux kernel documentation.
|
||||
|
||||
Test your changes
|
||||
-----------------
|
||||
|
||||
For each contributions you make, you should test your changes as well.
|
||||
For this the Yocto Project offers several types of tests. Those tests cover
|
||||
different areas and it depends on your changes which are feasible. For example run:
|
||||
|
||||
- For changes that affect the build environment:
|
||||
|
||||
- ``bitbake-selftest``: for changes within BitBake
|
||||
|
||||
- ``oe-selftest``: to test combinations of BitBake runs
|
||||
|
||||
- ``oe-build-perf-test``: to test the performance of common build scenarios
|
||||
|
||||
- For changes in a recipe:
|
||||
|
||||
- ``ptest``: run package specific tests, if they exist
|
||||
|
||||
- ``testimage``: build an image, boot it and run testcases on it
|
||||
|
||||
- If applicable, ensure also the ``native`` and ``nativesdk`` variants builds
|
||||
|
||||
- For changes relating to the SDK:
|
||||
|
||||
- ``testsdk``: to build, install and run tests against a SDK
|
||||
|
||||
- ``testsdk_ext``: to build, install and run tests against an extended SDK
|
||||
|
||||
Note that this list just gives suggestions and is not exhaustive. More details can
|
||||
be found here: :ref:`test-manual/intro:Yocto Project Tests --- Types of Testing Overview`.
|
||||
|
||||
Creating Patches
|
||||
================
|
||||
|
||||
@@ -359,7 +391,7 @@ varies by component:
|
||||
:oe_lists:`bitbake-devel </g/bitbake-devel>`
|
||||
mailing list.
|
||||
|
||||
- *"meta-\*" trees:* These trees contain Metadata. Use the
|
||||
- *meta-poky* and *meta-yocto-bsp* trees: These trees contain Metadata. Use the
|
||||
:yocto_lists:`poky </g/poky>` mailing list.
|
||||
|
||||
- *Documentation*: For changes to the Yocto Project documentation, use the
|
||||
@@ -367,7 +399,7 @@ varies by component:
|
||||
|
||||
For changes to other layers and tools hosted in the Yocto Project source
|
||||
repositories (i.e. :yocto_git:`git.yoctoproject.org <>`), use the
|
||||
:yocto_lists:`yocto </g/yocto/>` general mailing list.
|
||||
:yocto_lists:`yocto-patches </g/yocto-patches/>` general mailing list.
|
||||
|
||||
For changes to other layers hosted in the OpenEmbedded source
|
||||
repositories (i.e. :oe_git:`git.openembedded.org <>`), use
|
||||
|
||||
@@ -775,10 +775,9 @@ your tunings to best consider build times and package feed maintenance.
|
||||
in the script for information on how to use the tool.
|
||||
|
||||
- *BitBake's "-S printdiff" Option:* Using this option causes
|
||||
BitBake to try to establish the closest signature match it can
|
||||
(e.g. in the shared state cache) and then run ``bitbake-diffsigs``
|
||||
over the matches to determine the stamps and delta where these two
|
||||
stamp trees diverge.
|
||||
BitBake to try to establish the most recent signature match
|
||||
(e.g. in the shared state cache) and then compare matched signatures
|
||||
to determine the stamps and delta where these two stamp trees diverge.
|
||||
|
||||
Building Software from an External Source
|
||||
=========================================
|
||||
|
||||
@@ -4,10 +4,16 @@ Creating Your Own Distribution
|
||||
******************************
|
||||
|
||||
When you build an image using the Yocto Project and do not alter any
|
||||
distribution :term:`Metadata`, you are
|
||||
creating a Poky distribution. If you wish to gain more control over
|
||||
package alternative selections, compile-time options, and other
|
||||
low-level configurations, you can create your own distribution.
|
||||
distribution :term:`Metadata`, you are using the Poky distribution.
|
||||
Poky is explicitly a *reference* distribution for testing and
|
||||
development purposes. It enables most hardware and software features
|
||||
so that they can be tested, but this also means that from a security
|
||||
point of view the attack surface is very large. Additionally, at some
|
||||
point it is likely that you will want to gain more control over package
|
||||
alternative selections, compile-time options, and other low-level
|
||||
configurations. For both of these reasons, if you are using the Yocto
|
||||
Project for production use then you are strongly encouraged to create
|
||||
your own distribution.
|
||||
|
||||
To create your own distribution, the basic steps consist of creating
|
||||
your own distribution layer, creating your own distribution
|
||||
@@ -107,3 +113,23 @@ layer. The following steps provide some more detail:
|
||||
For information on append files, see the
|
||||
":ref:`dev-manual/layers:appending other layers metadata with your layer`"
|
||||
section.
|
||||
|
||||
Copying and modifying the Poky distribution
|
||||
===========================================
|
||||
|
||||
Instead of creating a custom distribution from scratch as per above, you may
|
||||
wish to start your custom distribution configuration by copying the Poky
|
||||
distribution provided within the ``meta-poky`` layer and then modifying it.
|
||||
This is fine, however if you do this you should keep the following in mind:
|
||||
|
||||
- Every reference to Poky needs to be updated in your copy so that it
|
||||
will still apply. This includes override usage within files (e.g. ``:poky``)
|
||||
and in directory names. This is a good opportunity to evaluate each one of
|
||||
these customizations to see if they are needed for your use case.
|
||||
|
||||
- Unless you also intend to use them, the ``poky-tiny``, ``poky-altcfg`` and
|
||||
``poky-bleeding`` variants and any references to them can be removed.
|
||||
|
||||
- More generally, the Poky distribution configuration enables a lot more
|
||||
than you likely need for your production use case. You should evaluate *every*
|
||||
configuration choice made in your copy to determine if it is needed.
|
||||
|
||||
@@ -339,7 +339,10 @@ BitBake has determined by doing the following:
|
||||
:term:`BB_BASEHASH_IGNORE_VARS`
|
||||
information.
|
||||
|
||||
There is also a ``bitbake-diffsigs`` command for comparing two
|
||||
Debugging signature construction and unexpected task executions
|
||||
===============================================================
|
||||
|
||||
There is a ``bitbake-diffsigs`` command for comparing two
|
||||
``siginfo`` or ``sigdata`` files. This command can be helpful when
|
||||
trying to figure out what changed between two versions of a task. If you
|
||||
call ``bitbake-diffsigs`` with just one file, the command behaves like
|
||||
@@ -356,8 +359,12 @@ BitBake command-line options::
|
||||
.. note::
|
||||
|
||||
Two common values for `SIGNATURE_HANDLER` are "none" and "printdiff", which
|
||||
dump only the signature or compare the dumped signature with the cached one,
|
||||
respectively.
|
||||
dump only the signature or compare the dumped signature with the most recent one,
|
||||
respectively. "printdiff" will try to establish the most recent
|
||||
signature match (e.g. in the sstate cache) and then
|
||||
compare the matched signatures to determine the stamps and delta
|
||||
where these two stamp trees diverge. This can be used to determine why
|
||||
tasks need to be re-run in situations where that is not expected.
|
||||
|
||||
Using BitBake with either of these options causes BitBake to dump out
|
||||
``sigdata`` files in the ``stamps`` directory for every task it would
|
||||
|
||||
@@ -60,10 +60,10 @@ kernel.
|
||||
All devices created by ``devtmpfs`` will be owned by ``root`` and have
|
||||
permissions ``0600``.
|
||||
|
||||
To have more control over the device nodes, you can use a device manager
|
||||
like ``udev`` or ``busybox-mdev``. You choose the device manager by
|
||||
defining the ``VIRTUAL-RUNTIME_dev_manager`` variable in your machine or
|
||||
distro configuration file. Alternatively, you can set this variable in
|
||||
To have more control over the device nodes, you can use a device manager like
|
||||
``udev`` or ``busybox-mdev``. You choose the device manager by defining the
|
||||
:term:`VIRTUAL-RUNTIME_dev_manager <VIRTUAL-RUNTIME>` variable in your machine
|
||||
or distro configuration file. Alternatively, you can set this variable in
|
||||
your ``local.conf`` configuration file::
|
||||
|
||||
VIRTUAL-RUNTIME_dev_manager = "udev"
|
||||
|
||||
@@ -121,7 +121,7 @@ increasing levels of complexity and functionality:
|
||||
:widths: 40 20 20 20
|
||||
:header-rows: 1
|
||||
|
||||
* -
|
||||
* -
|
||||
- BusyBox init
|
||||
- SysVinit
|
||||
- systemd
|
||||
|
||||
@@ -501,12 +501,12 @@ the "meta" layer at ``meta/recipes-bsp/formfactor``::
|
||||
INHIBIT_DEFAULT_DEPS = "1"
|
||||
|
||||
do_install() {
|
||||
# Install file only if it has contents
|
||||
# Install file only if it has contents
|
||||
install -d ${D}${sysconfdir}/formfactor/
|
||||
install -m 0644 ${S}/config ${D}${sysconfdir}/formfactor/
|
||||
if [ -s "${S}/machconfig" ]; then
|
||||
install -m 0644 ${S}/machconfig ${D}${sysconfdir}/formfactor/
|
||||
fi
|
||||
if [ -s "${S}/machconfig" ]; then
|
||||
install -m 0644 ${S}/machconfig ${D}${sysconfdir}/formfactor/
|
||||
fi
|
||||
}
|
||||
|
||||
In the main recipe, note the :term:`SRC_URI`
|
||||
@@ -582,10 +582,10 @@ Directory`. Here is the main ``xserver-xf86-config`` recipe, which is named
|
||||
ALLOW_EMPTY:${PN} = "1"
|
||||
|
||||
do_install () {
|
||||
if test -s ${WORKDIR}/xorg.conf; then
|
||||
install -d ${D}/${sysconfdir}/X11
|
||||
install -m 0644 ${WORKDIR}/xorg.conf ${D}/${sysconfdir}/X11/
|
||||
fi
|
||||
if test -s ${WORKDIR}/xorg.conf; then
|
||||
install -d ${D}/${sysconfdir}/X11
|
||||
install -m 0644 ${WORKDIR}/xorg.conf ${D}/${sysconfdir}/X11/
|
||||
fi
|
||||
}
|
||||
|
||||
Here is the append file, which is named ``xserver-xf86-config_%.bbappend``
|
||||
|
||||
@@ -206,7 +206,7 @@ history, see the
|
||||
part of the shared state (sstate) packages. If you maintain an sstate
|
||||
feed, it's expected that either all your building systems that
|
||||
contribute to the sstate feed use a shared PR service, or you do not
|
||||
run a PR Service on any of your building systems.
|
||||
run a PR service on any of your building systems.
|
||||
|
||||
That's because if you had multiple machines sharing a PR service but
|
||||
not their sstate feed, you could end up with "diverging" hashes for
|
||||
|
||||
@@ -612,10 +612,14 @@ Use the following procedure to locate the latest upstream copy of the
|
||||
Accessing Index of Releases
|
||||
---------------------------
|
||||
|
||||
Yocto Project maintains an Index of Releases area that contains related
|
||||
files that contribute to the Yocto Project. Rather than Git
|
||||
repositories, these files are tarballs that represent snapshots in time
|
||||
of a given component.
|
||||
The Yocto Project also provides source archives of its releases, which
|
||||
are available on :yocto_dl:`/releases/yocto/`. Then, choose the subdirectory
|
||||
containing the release you wish to use, for example
|
||||
:yocto_dl:`yocto-&DISTRO; </releases/yocto/yocto-&DISTRO;/>`.
|
||||
|
||||
You will find there source archives of individual components (if you wish
|
||||
to use them individually), and of the corresponding Poky release bundling
|
||||
a selection of these components.
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@@ -139,20 +139,20 @@ individual images through the ``list`` command. You can use the ``list``
|
||||
command to return the available Wic images as follows::
|
||||
|
||||
$ wic list images
|
||||
genericx86 Create an EFI disk image for genericx86*
|
||||
edgerouter Create SD card image for Edgerouter
|
||||
beaglebone-yocto Create SD card image for Beaglebone
|
||||
qemuriscv Create qcow2 image for RISC-V QEMU machines
|
||||
mkefidisk Create an EFI disk image
|
||||
directdisk-multi-rootfs Create multi rootfs image using rootfs plugin
|
||||
directdisk Create a 'pcbios' direct disk image
|
||||
efi-bootdisk
|
||||
mkhybridiso Create a hybrid ISO image
|
||||
directdisk-gpt Create a 'pcbios' direct disk image
|
||||
systemd-bootdisk Create an EFI disk image with systemd-boot
|
||||
sdimage-bootpart Create SD card image with a boot partition
|
||||
qemux86-directdisk Create a qemu machine 'pcbios' direct disk image
|
||||
directdisk-bootloader-config Create a 'pcbios' direct disk image with custom bootloader config
|
||||
genericx86 Create an EFI disk image for genericx86*
|
||||
edgerouter Create SD card image for Edgerouter
|
||||
beaglebone-yocto Create SD card image for Beaglebone
|
||||
qemuriscv Create qcow2 image for RISC-V QEMU machines
|
||||
mkefidisk Create an EFI disk image
|
||||
directdisk-multi-rootfs Create multi rootfs image using rootfs plugin
|
||||
directdisk Create a 'pcbios' direct disk image
|
||||
efi-bootdisk
|
||||
mkhybridiso Create a hybrid ISO image
|
||||
directdisk-gpt Create a 'pcbios' direct disk image
|
||||
systemd-bootdisk Create an EFI disk image with systemd-boot
|
||||
sdimage-bootpart Create SD card image with a boot partition
|
||||
qemux86-directdisk Create a qemu machine 'pcbios' direct disk image
|
||||
directdisk-bootloader-config Create a 'pcbios' direct disk image with custom bootloader config
|
||||
|
||||
|
||||
Once you know the list of available
|
||||
@@ -283,20 +283,20 @@ following two locations::
|
||||
Use the following command to list the available kickstart files::
|
||||
|
||||
$ wic list images
|
||||
genericx86 Create an EFI disk image for genericx86*
|
||||
edgerouter Create SD card image for Edgerouter
|
||||
beaglebone-yocto Create SD card image for Beaglebone
|
||||
qemuriscv Create qcow2 image for RISC-V QEMU machines
|
||||
mkefidisk Create an EFI disk image
|
||||
directdisk-multi-rootfs Create multi rootfs image using rootfs plugin
|
||||
directdisk Create a 'pcbios' direct disk image
|
||||
efi-bootdisk
|
||||
mkhybridiso Create a hybrid ISO image
|
||||
directdisk-gpt Create a 'pcbios' direct disk image
|
||||
systemd-bootdisk Create an EFI disk image with systemd-boot
|
||||
sdimage-bootpart Create SD card image with a boot partition
|
||||
qemux86-directdisk Create a qemu machine 'pcbios' direct disk image
|
||||
directdisk-bootloader-config Create a 'pcbios' direct disk image with custom bootloader config
|
||||
genericx86 Create an EFI disk image for genericx86*
|
||||
edgerouter Create SD card image for Edgerouter
|
||||
beaglebone-yocto Create SD card image for Beaglebone
|
||||
qemuriscv Create qcow2 image for RISC-V QEMU machines
|
||||
mkefidisk Create an EFI disk image
|
||||
directdisk-multi-rootfs Create multi rootfs image using rootfs plugin
|
||||
directdisk Create a 'pcbios' direct disk image
|
||||
efi-bootdisk
|
||||
mkhybridiso Create a hybrid ISO image
|
||||
directdisk-gpt Create a 'pcbios' direct disk image
|
||||
systemd-bootdisk Create an EFI disk image with systemd-boot
|
||||
sdimage-bootpart Create SD card image with a boot partition
|
||||
qemux86-directdisk Create a qemu machine 'pcbios' direct disk image
|
||||
directdisk-bootloader-config Create a 'pcbios' direct disk image with custom bootloader config
|
||||
|
||||
When you use an existing file, you
|
||||
do not have to use the ``.wks`` extension. Here is an example in Raw
|
||||
|
||||
@@ -182,7 +182,7 @@ the structure:
|
||||
order to define a base kernel policy or major kernel type to be
|
||||
reused across multiple BSPs, place the file in ``ktypes`` directory.
|
||||
|
||||
These distinctions can easily become blurred - especially as out-of-tree
|
||||
These distinctions can easily become blurred --- especially as out-of-tree
|
||||
features slowly merge upstream over time. Also, remember that how the
|
||||
description files are placed is a purely logical organization and has no
|
||||
impact on the functionality of the kernel Metadata. There is no impact
|
||||
@@ -303,8 +303,8 @@ The following listings show the ``build.scc`` file and part of the
|
||||
.
|
||||
.
|
||||
.
|
||||
char *dump_write = NULL, *files_source = NULL;
|
||||
int opt;
|
||||
char *dump_write = NULL, *files_source = NULL;
|
||||
int opt;
|
||||
--
|
||||
2.10.1
|
||||
|
||||
|
||||
@@ -383,11 +383,7 @@ home directory:
|
||||
|
||||
1. *Create Structure*: Create the layer's structure::
|
||||
|
||||
$ mkdir meta-mylayer
|
||||
$ mkdir meta-mylayer/conf
|
||||
$ mkdir meta-mylayer/recipes-kernel
|
||||
$ mkdir meta-mylayer/recipes-kernel/linux
|
||||
$ mkdir meta-mylayer/recipes-kernel/linux/linux-yocto
|
||||
$ mkdir -p meta-mylayer/conf meta-mylayer/recipes-kernel/linux/linux-yocto
|
||||
|
||||
The ``conf`` directory holds your configuration files, while the
|
||||
``recipes-kernel`` directory holds your append file and eventual
|
||||
@@ -1044,9 +1040,7 @@ Section.
|
||||
additional structure to your layer using the following commands::
|
||||
|
||||
$ cd ~/meta-mylayer
|
||||
$ mkdir recipes-kernel
|
||||
$ mkdir recipes-kernel/linux
|
||||
$ mkdir recipes-kernel/linux/linux-yocto
|
||||
$ mkdir -p recipes-kernel recipes-kernel/linux/linux-yocto
|
||||
|
||||
Once you have created this
|
||||
hierarchy in your layer, you can move the patch file using the
|
||||
@@ -1755,10 +1749,10 @@ looks much like the one provided with the ``hello-mod`` template::
|
||||
SRC := $(shell pwd)
|
||||
|
||||
all:
|
||||
$(MAKE) -C $(KERNEL_SRC) M=$(SRC)
|
||||
$(MAKE) -C $(KERNEL_SRC) M=$(SRC)
|
||||
|
||||
modules_install:
|
||||
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
|
||||
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
|
||||
...
|
||||
|
||||
The important point to note here is the :term:`KERNEL_SRC` variable. The
|
||||
|
||||
@@ -117,7 +117,7 @@ upstream Linux kernel development and are managed by the Yocto Project
|
||||
team's Yocto Linux kernel development strategy. It is the Yocto Project
|
||||
team's policy to not back-port minor features to the released Yocto
|
||||
Linux kernel. They only consider back-porting significant technological
|
||||
jumps - and, that is done after a complete gap analysis. The reason
|
||||
jumps --- and, that is done after a complete gap analysis. The reason
|
||||
for this policy is that back-porting any small to medium sized change
|
||||
from an evolving Linux kernel can easily create mismatches,
|
||||
incompatibilities and very subtle errors.
|
||||
|
||||
@@ -341,39 +341,39 @@ Removed and Renamed Recipes
|
||||
|
||||
The following recipes have been removed:
|
||||
|
||||
- ``packagegroup-toolset-native`` - This recipe is largely unused.
|
||||
- ``packagegroup-toolset-native`` --- this recipe is largely unused.
|
||||
|
||||
- ``linux-yocto-3.8`` - Support for the Linux yocto 3.8 kernel has been
|
||||
- ``linux-yocto-3.8`` --- support for the Linux yocto 3.8 kernel has been
|
||||
dropped. Support for the 3.10 and 3.14 kernels have been added with
|
||||
the ``linux-yocto-3.10`` and ``linux-yocto-3.14`` recipes.
|
||||
|
||||
- ``ocf-linux`` - This recipe has been functionally replaced using
|
||||
- ``ocf-linux`` --- this recipe has been functionally replaced using
|
||||
``cryptodev-linux``.
|
||||
|
||||
- ``genext2fs`` - ``genext2fs`` is no longer used by the build system
|
||||
- ``genext2fs`` --- ``genext2fs`` is no longer used by the build system
|
||||
and is unmaintained upstream.
|
||||
|
||||
- ``js`` - This provided an ancient version of Mozilla's javascript
|
||||
- ``js`` --- this provided an ancient version of Mozilla's javascript
|
||||
engine that is no longer needed.
|
||||
|
||||
- ``zaurusd`` - The recipe has been moved to the ``meta-handheld``
|
||||
- ``zaurusd`` --- the recipe has been moved to the ``meta-handheld``
|
||||
layer.
|
||||
|
||||
- ``eglibc 2.17`` - Replaced by the ``eglibc 2.19`` recipe.
|
||||
- ``eglibc 2.17`` --- replaced by the ``eglibc 2.19`` recipe.
|
||||
|
||||
- ``gcc 4.7.2`` - Replaced by the now stable ``gcc 4.8.2``.
|
||||
- ``gcc 4.7.2`` --- replaced by the now stable ``gcc 4.8.2``.
|
||||
|
||||
- ``external-sourcery-toolchain`` - this recipe is now maintained in
|
||||
- ``external-sourcery-toolchain`` --- this recipe is now maintained in
|
||||
the ``meta-sourcery`` layer.
|
||||
|
||||
- ``linux-libc-headers-yocto 3.4+git`` - Now using version 3.10 of the
|
||||
- ``linux-libc-headers-yocto 3.4+git`` --- now using version 3.10 of the
|
||||
``linux-libc-headers`` by default.
|
||||
|
||||
- ``meta-toolchain-gmae`` - This recipe is obsolete.
|
||||
- ``meta-toolchain-gmae`` --- this recipe is obsolete.
|
||||
|
||||
- ``packagegroup-core-sdk-gmae`` - This recipe is obsolete.
|
||||
- ``packagegroup-core-sdk-gmae`` --- this recipe is obsolete.
|
||||
|
||||
- ``packagegroup-core-standalone-gmae-sdk-target`` - This recipe is
|
||||
- ``packagegroup-core-standalone-gmae-sdk-target`` --- this recipe is
|
||||
obsolete.
|
||||
|
||||
.. _migration-1.6-removed-classes:
|
||||
|
||||
@@ -216,11 +216,11 @@ The following sanity check changes occurred.
|
||||
- :term:`SRC_URI` is now checked for usage of two
|
||||
problematic items:
|
||||
|
||||
- "${PN}" prefix/suffix use - Warnings always appear if ${PN} is
|
||||
- "${PN}" prefix/suffix use --- warnings always appear if ${PN} is
|
||||
used. You must fix the issue regardless of whether multiconfig or
|
||||
anything else that would cause prefixing/suffixing to happen.
|
||||
|
||||
- Github archive tarballs - these are not guaranteed to be stable.
|
||||
- Github archive tarballs --- these are not guaranteed to be stable.
|
||||
Consequently, it is likely that the tarballs will be refreshed and
|
||||
thus the SRC_URI checksums will fail to apply. It is recommended
|
||||
that you fetch either an official release tarball or a specific
|
||||
|
||||
@@ -200,7 +200,7 @@ Packaging changes
|
||||
-----------------
|
||||
|
||||
- ``intltool`` has been removed from ``packagegroup-core-sdk`` as it is
|
||||
rarely needed to build modern software - gettext can do most of the
|
||||
rarely needed to build modern software --- gettext can do most of the
|
||||
things it used to be needed for. ``intltool`` has also been removed
|
||||
from ``packagegroup-core-self-hosted`` as it is not needed to for
|
||||
standard builds.
|
||||
|
||||
@@ -23,7 +23,7 @@ Removed recipes
|
||||
The following recipes have been removed:
|
||||
|
||||
- ``bjam-native``: replaced by ``boost-build-native``
|
||||
- ``avahi-ui``: folded into the main ``avahi`` recipe - the GTK UI can be disabled using :term:`PACKAGECONFIG` for ``avahi``.
|
||||
- ``avahi-ui``: folded into the main ``avahi`` recipe --- the GTK UI can be disabled using :term:`PACKAGECONFIG` for ``avahi``.
|
||||
- ``build-compare``: no longer needed with the removal of the ``packagefeed-stability`` class
|
||||
- ``dhcp``: obsolete, functionally replaced by ``dhcpcd`` and ``kea``
|
||||
- ``libmodulemd-v1``: replaced by ``libmodulemd``
|
||||
@@ -37,7 +37,7 @@ Removed classes
|
||||
|
||||
The following classes (.bbclass files) have been removed:
|
||||
|
||||
- ``spdx``: obsolete - the Yocto Project is a strong supporter of SPDX, but this class was old code using a dated approach and had the potential to be misleading. The ``meta-sdpxscanner`` layer is a much more modern and active approach to handling this and is recommended as a replacement.
|
||||
- ``spdx``: obsolete --- the Yocto Project is a strong supporter of SPDX, but this class was old code using a dated approach and had the potential to be misleading. The ``meta-sdpxscanner`` layer is a much more modern and active approach to handling this and is recommended as a replacement.
|
||||
|
||||
- ``packagefeed-stability``: this class had become obsolete with the advent of hash equivalence and reproducible builds.
|
||||
|
||||
@@ -46,7 +46,7 @@ pseudo path filtering and mismatch behaviour
|
||||
--------------------------------------------
|
||||
|
||||
pseudo now operates on a filtered subset of files. This is a significant change
|
||||
to the way pseudo operates within OpenEmbedded - by default, pseudo monitors and
|
||||
to the way pseudo operates within OpenEmbedded --- by default, pseudo monitors and
|
||||
logs (adds to its database) any file created or modified whilst in a ``fakeroot``
|
||||
environment. However, there are large numbers of files that we simply don't care
|
||||
about the permissions of whilst in that ``fakeroot`` context, for example ${:term:`S`}, ${:term:`B`}, ${:term:`T`},
|
||||
@@ -68,7 +68,7 @@ structure above that subdirectory. For these types of cases in your own recipes,
|
||||
extend :term:`PSEUDO_IGNORE_PATHS` to cover additional paths that pseudo should not
|
||||
be monitoring.
|
||||
|
||||
In addition, pseudo's behaviour on mismatches has now been changed - rather
|
||||
In addition, pseudo's behaviour on mismatches has now been changed --- rather
|
||||
than doing what turns out to be a rather dangerous "fixup" if it sees a file
|
||||
with a different path but the same inode as another file it has previously seen,
|
||||
pseudo will throw an ``abort()`` and direct you to a :yocto_wiki:`wiki page </Pseudo_Abort>`
|
||||
@@ -137,10 +137,10 @@ DHCP server/client replaced
|
||||
|
||||
The ``dhcp`` software package has become unmaintained and thus has been
|
||||
functionally replaced by ``dhcpcd`` (client) and ``kea`` (server). You will
|
||||
need to replace references to the recipe/package names as appropriate - most
|
||||
need to replace references to the recipe/package names as appropriate --- most
|
||||
commonly, at the package level ``dhcp-client`` should be replaced by
|
||||
``dhcpcd`` and ``dhcp-server`` should be replaced by ``kea``. If you have any
|
||||
custom configuration files for these they will need to be adapted - refer to
|
||||
custom configuration files for these they will need to be adapted --- refer to
|
||||
the upstream documentation for ``dhcpcd`` and ``kea`` for further details.
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ In addition, the following new checks were added and default to triggering an er
|
||||
|
||||
- :ref:`missing-update-alternatives <qa-check-missing-update-alternatives>`: Check if the recipe sets the :term:`ALTERNATIVE` variable for any of its packages, and does not inherit the :ref:`update-alternatives <ref-classes-update-alternatives>` class.
|
||||
|
||||
- A trailing slash or duplicated slashes in the value of :term:`S` or :term:`B` will now trigger a warning so that they can be removed and path comparisons can be more reliable - remove any instances of these in your recipes if the warning is displayed.
|
||||
- A trailing slash or duplicated slashes in the value of :term:`S` or :term:`B` will now trigger a warning so that they can be removed and path comparisons can be more reliable --- remove any instances of these in your recipes if the warning is displayed.
|
||||
|
||||
|
||||
.. _migration-3.2-src-uri-file-globbing:
|
||||
@@ -209,7 +209,7 @@ deploy class now cleans ``DEPLOYDIR`` before ``do_deploy``
|
||||
|
||||
``do_deploy`` as implemented in the :ref:`deploy <ref-classes-deploy>` class now cleans up ${:term:`DEPLOYDIR`} before running, just as ``do_install`` cleans up ${:term:`D`} before running. This reduces the risk of :term:`DEPLOYDIR` being accidentally contaminated by files from previous runs, possibly even with different config, in case of incremental builds.
|
||||
|
||||
Most recipes and classes that inherit the :ref:`deploy <ref-classes-deploy>` class or interact with ``do_deploy`` are unlikely to be affected by this unless they add ``prefuncs`` to ``do_deploy`` *which also* put files into ``${DEPLOYDIR}`` - these should be refactored to use ``do_deploy_prepend`` instead.
|
||||
Most recipes and classes that inherit the :ref:`deploy <ref-classes-deploy>` class or interact with ``do_deploy`` are unlikely to be affected by this unless they add ``prefuncs`` to ``do_deploy`` *which also* put files into ``${DEPLOYDIR}`` --- these should be refactored to use ``do_deploy_prepend`` instead.
|
||||
|
||||
|
||||
.. _migration-3.2-nativesdk-sdk-provides-dummy:
|
||||
@@ -303,7 +303,7 @@ now need to be changed to ``inherit image-artifact-names``.
|
||||
Miscellaneous changes
|
||||
---------------------
|
||||
|
||||
- Support for the long-deprecated ``PACKAGE_GROUP`` variable has now been removed - replace any remaining instances with :term:`FEATURE_PACKAGES`.
|
||||
- Support for the long-deprecated ``PACKAGE_GROUP`` variable has now been removed --- replace any remaining instances with :term:`FEATURE_PACKAGES`.
|
||||
- The ``FILESPATHPKG`` variable, having been previously deprecated, has now been removed. Replace any remaining references with appropriate use of :term:`FILESEXTRAPATHS`.
|
||||
- Erroneous use of ``inherit +=`` (instead of ``INHERIT +=``) in a configuration file now triggers an error instead of silently being ignored.
|
||||
- ptest support has been removed from the ``kbd`` recipe, as upstream has moved to autotest which is difficult to work with in a cross-compilation environment.
|
||||
|
||||
@@ -17,7 +17,6 @@ using ``scripts/install-buildtools``) --- see
|
||||
:ref:`ref-manual/system-requirements:required git, tar, python, make and gcc versions`
|
||||
for details.
|
||||
|
||||
|
||||
.. _migration-3.3-removed-recipes:
|
||||
|
||||
Removed recipes
|
||||
|
||||
@@ -146,7 +146,7 @@ Virtual runtime provides
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Recipes shouldn't use the ``virtual/`` string in :term:`RPROVIDES` and
|
||||
:term:`RDEPENDS` - it is confusing because ``virtual/`` has no special
|
||||
:term:`RDEPENDS` --- it is confusing because ``virtual/`` has no special
|
||||
meaning in :term:`RPROVIDES` and :term:`RDEPENDS` (unlike in the
|
||||
corresponding build-time :term:`PROVIDES` and :term:`DEPENDS`).
|
||||
|
||||
@@ -171,7 +171,7 @@ Extensible SDK host extension
|
||||
For a normal SDK, some layers append to :term:`TOOLCHAIN_HOST_TASK`
|
||||
unconditionally which is fine, until the eSDK tries to override the
|
||||
variable to its own values. Instead of installing packages specified
|
||||
in this variable it uses native recipes instead - a very different
|
||||
in this variable it uses native recipes instead --- a very different
|
||||
approach. This has led to confusing errors when binaries are added
|
||||
to the SDK but not relocated.
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ changes and you need to review them before committing. An example warning
|
||||
looks like::
|
||||
|
||||
poky/scripts/lib/devtool/upgrade.py needs further work at line 275 since it contains abort
|
||||
|
||||
|
||||
Fetching changes
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -109,7 +109,7 @@ License changes
|
||||
If they do not, by default a warning will be shown. A
|
||||
:oe_git:`convert-spdx-licenses.py </openembedded-core/tree/scripts/contrib/convert-spdx-licenses.py>`
|
||||
script can be used to update your recipes.
|
||||
|
||||
|
||||
- :term:`INCOMPATIBLE_LICENSE` should now use `SPDX identifiers <https://spdx.org/licenses/>`__.
|
||||
Additionally, wildcarding is now limited to specifically supported values -
|
||||
see the :term:`INCOMPATIBLE_LICENSE` documentation for further information.
|
||||
@@ -119,7 +119,7 @@ License changes
|
||||
which can cause signature issues for users. In addition the ``available_licenses()``
|
||||
function has been removed from the :ref:`license <ref-classes-license>` class as
|
||||
it is no longer needed.
|
||||
|
||||
|
||||
Removed recipes
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -134,11 +134,11 @@ The following recipes have been removed in this release:
|
||||
|
||||
Python changes
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
- ``distutils`` has been deprecated upstream in Python 3.10 and thus the ``distutils*``
|
||||
classes have been moved to ``meta-python``. Recipes that inherit the ``distutils*``
|
||||
classes should be updated to inherit ``setuptools*`` equivalents instead.
|
||||
|
||||
|
||||
- The Python package build process is now based on `wheels <https://pythonwheels.com/>`__.
|
||||
The new Python packaging classes that should be used are
|
||||
:ref:`python_flit_core <ref-classes-python_flit_core>`,
|
||||
@@ -158,7 +158,7 @@ Prelink removed
|
||||
Prelink has been dropped by ``glibc`` upstream in 2.36. It already caused issues with
|
||||
binary corruption, has a number of open bugs and is of questionable benefit
|
||||
without disabling load address randomization and PIE executables.
|
||||
|
||||
|
||||
We disabled prelinking by default in the honister (3.4) release, but left it able
|
||||
to be enabled if desired. However, without glibc support it cannot be maintained
|
||||
any further, so all of the prelinking functionality has been removed in this release.
|
||||
@@ -169,7 +169,7 @@ reference(s).
|
||||
Reproducible as standard
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Reproducibility is now considered as standard functionality, thus the
|
||||
Reproducibility is now considered as standard functionality, thus the
|
||||
``reproducible`` class has been removed and its previous contents merged into the
|
||||
:ref:`base <ref-classes-base>` class. If you have references in your configuration to
|
||||
``reproducible`` in :term:`INHERIT`, :term:`USER_CLASSES` etc. then they should be
|
||||
@@ -211,7 +211,7 @@ and :ref:`bitbake:bitbake-user-manual/bitbake-user-manual-metadata:removal (over
|
||||
|
||||
Miscellaneous changes
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
- ``blacklist.bbclass`` is removed and the functionality moved to the
|
||||
:ref:`base <ref-classes-base>` class with a more descriptive
|
||||
``varflag`` variable named :term:`SKIP_RECIPE` which will use the `bb.parse.SkipRecipe()`
|
||||
@@ -251,7 +251,7 @@ Miscellaneous changes
|
||||
- The ``cortexa72-crc`` and ``cortexa72-crc-crypto`` tunes have been removed since
|
||||
the crc extension is now enabled by default for cortexa72. Replace any references to
|
||||
these with ``cortexa72`` and ``cortexa72-crypto`` respectively.
|
||||
|
||||
|
||||
- The Python development shell (previously known as ``devpyshell``) feature has been
|
||||
renamed to ``pydevshell``. To start it you should now run::
|
||||
|
||||
@@ -260,7 +260,7 @@ Miscellaneous changes
|
||||
- The ``packagegroups-core-full-cmdline-libs`` packagegroup is no longer produced, as
|
||||
libraries should normally be brought in via dependencies. If you have any references
|
||||
to this then remove them.
|
||||
|
||||
|
||||
- The :term:`TOPDIR` variable and the current working directory are no longer modified
|
||||
when parsing recipes. Any code depending on the previous behaviour will no longer
|
||||
work - change any such code to explicitly use appropriate path variables instead.
|
||||
|
||||
@@ -23,3 +23,6 @@ Release 4.0 (kirkstone)
|
||||
release-notes-4.0.14
|
||||
release-notes-4.0.15
|
||||
release-notes-4.0.16
|
||||
release-notes-4.0.17
|
||||
release-notes-4.0.18
|
||||
release-notes-4.0.19
|
||||
|
||||
@@ -5,7 +5,7 @@ New Features / Enhancements in 3.4
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Linux kernel 5.14, glibc 2.34 and ~280 other recipe upgrades
|
||||
- Switched override character to ':' (replacing '_') for more robust parsing and improved performance - see the above migration guide for help
|
||||
- Switched override character to ':' (replacing '_') for more robust parsing and improved performance --- see the above migration guide for help
|
||||
- Rust integrated into core, providing rust support for cross-compilation and SDK
|
||||
- New create-spdx class for creating SPDX SBoM documents
|
||||
- New recipes: cargo, core-image-ptest-all, core-image-ptest-fast, core-image-weston-sdk, erofs-utils, gcompat, gi-docgen, libmicrohttpd, libseccomp, libstd-rs, perlcross, python3-markdown, python3-pyyaml, python3-smartypants, python3-typogrify, rust, rust-cross, rust-cross-canadian, rust-hello-world, rust-llvm, rust-tools-cross-canadian, rustfmt, xwayland
|
||||
|
||||
238
documentation/migration-guides/release-notes-4.0.17.rst
Normal file
238
documentation/migration-guides/release-notes-4.0.17.rst
Normal file
@@ -0,0 +1,238 @@
|
||||
.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
|
||||
|
||||
Release notes for Yocto-4.0.17 (Kirkstone)
|
||||
------------------------------------------
|
||||
|
||||
Security Fixes in Yocto-4.0.17
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- bind: Fix :cve:`2023-4408`, :cve:`2023-5517`, :cve:`2023-5679`, :cve:`2023-50868` and :cve:`2023-50387`
|
||||
- binutils: Fix :cve:`2023-39129` and :cve:`2023-39130`
|
||||
- curl: Fix :cve:`2023-46219`
|
||||
- curl: Ignore :cve:`2023-42915`
|
||||
- gcc: Ignore :cve:`2023-4039`
|
||||
- gdb: Fix :cve:`2023-39129` and :cve:`2023-39130`
|
||||
- glibc: Ignore :cve:`2023-0687`
|
||||
- go: Fix :cve:`2023-29406`, :cve:`2023-45285`, :cve:`2023-45287`, :cve:`2023-45289`, :cve:`2023-45290`, :cve:`2024-24784` and :cve:`2024-24785`
|
||||
- less: Fix :cve:`2022-48624`
|
||||
- libgit2: Fix :cve:`2024-24575` and :cve:`2024-24577`
|
||||
- libuv: fix :cve:`2024-24806`
|
||||
- libxml2: Fix for :cve:`2024-25062`
|
||||
- linux-yocto/5.15: Fix :cve:`2022-36402`, :cve:`2022-40982`, :cve:`2022-47940`, :cve:`2023-1193`, :cve:`2023-1194`, :cve:`2023-3772`, :cve_mitre:`2023-3867`, :cve:`2023-4128`, :cve:`2023-4206`, :cve:`2023-4207`, :cve:`2023-4208`, :cve:`2023-4244`, :cve:`2023-4273`, :cve:`2023-4563`, :cve:`2023-4569`, :cve:`2023-4623`, :cve:`2023-4881`, :cve:`2023-4921`, :cve:`2023-5158`, :cve:`2023-5717`, :cve:`2023-6040`, :cve:`2023-6121`, :cve:`2023-6176`, :cve:`2023-6546`, :cve:`2023-6606`, :cve:`2023-6622`, :cve:`2023-6817`, :cve:`2023-6915`, :cve:`2023-6931`, :cve:`2023-6932`, :cve:`2023-20569`, :cve:`2023-20588`, :cve:`2023-25775`, :cve:`2023-31085`, :cve:`2023-32247`, :cve:`2023-32250`, :cve:`2023-32252`, :cve:`2023-32254`, :cve:`2023-32257`, :cve:`2023-32258`, :cve:`2023-34324`, :cve:`2023-35827`, :cve:`2023-38427`, :cve:`2023-38430`, :cve:`2023-38431`, :cve:`2023-39189`, :cve:`2023-39192`, :cve:`2023-39193`, :cve:`2023-39194`, :cve:`2023-39198`, :cve:`2023-40283`, :cve:`2023-42752`, :cve:`2023-42753`, :cve:`2023-42754`, :cve:`2023-42755`, :cve:`2023-45871`, :cve:`2023-46343`, :cve:`2023-46813`, :cve:`2023-46838`, :cve:`2023-46862`, :cve:`2023-51042`, :cve:`2023-51779`, :cve_mitre:`2023-52340`, :cve:`2023-52429`, :cve:`2023-52435`, :cve:`2023-52436`, :cve:`2023-52438`, :cve:`2023-52439`, :cve:`2023-52441`, :cve:`2023-52442`, :cve:`2023-52443`, :cve:`2023-52444`, :cve:`2023-52445`, :cve:`2023-52448`, :cve:`2023-52449`, :cve:`2023-52451`, :cve:`2023-52454`, :cve:`2023-52456`, :cve:`2023-52457`, :cve:`2023-52458`, :cve:`2023-52463`, :cve:`2023-52464`, :cve:`2024-0340`, :cve:`2024-0584`, :cve:`2024-0607`, :cve:`2024-0641`, :cve:`2024-0646`, :cve:`2024-1085`, :cve:`2024-1086`, :cve:`2024-1151`, :cve:`2024-22705`, :cve:`2024-23849`, :cve:`2024-23850`, :cve:`2024-23851`, :cve:`2024-24860`, :cve:`2024-26586`, :cve:`2024-26589`, :cve:`2024-26591`, :cve:`2024-26592`, :cve:`2024-26593`, :cve:`2024-26594`, :cve:`2024-26597` and :cve:`2024-26598`
|
||||
- linux-yocto/5.15: Ignore :cve:`2020-27418`, :cve:`2020-36766`, :cve:`2021-33630`, :cve:`2021-33631`, :cve:`2022-48619`, :cve:`2023-2430`, :cve:`2023-4610`, :cve:`2023-4732`, :cve:`2023-5090`, :cve:`2023-5178`, :cve:`2023-5197`, :cve:`2023-5345`, :cve:`2023-5633`, :cve:`2023-5972`, :cve:`2023-6111`, :cve:`2023-6200`, :cve:`2023-6531`, :cve:`2023-6679`, :cve:`2023-7192`, :cve:`2023-40791`, :cve:`2023-42756`, :cve:`2023-44466`, :cve:`2023-45862`, :cve:`2023-45863`, :cve:`2023-45898`, :cve:`2023-51043`, :cve:`2023-51780`, :cve:`2023-51781`, :cve:`2023-51782`, :cve:`2023-52433`, :cve:`2023-52440`, :cve:`2023-52446`, :cve:`2023-52450`, :cve:`2023-52453`, :cve:`2023-52455`, :cve:`2023-52459`, :cve:`2023-52460`, :cve:`2023-52461`, :cve:`2023-52462`, :cve:`2024-0193`, :cve:`2024-0443`, :cve:`2024-0562`, :cve:`2024-0582`, :cve:`2024-0639`, :cve:`2024-0775`, :cve:`2024-26581`, :cve:`2024-26582`, :cve:`2024-26590`, :cve:`2024-26596` and :cve:`2024-26599`
|
||||
- linux-yocto/5.10: Fix :cve:`2023-6040`, :cve:`2023-6121`, :cve:`2023-6606`, :cve:`2023-6817`, :cve:`2023-6915`, :cve:`2023-6931`, :cve:`2023-6932`, :cve:`2023-39198`, :cve:`2023-46838`, :cve:`2023-51779`, :cve:`2023-51780`, :cve:`2023-51781`, :cve:`2023-51782`, :cve_mitre:`2023-52340`, :cve:`2024-0584` and :cve:`2024-0646`
|
||||
- linux-yocto/5.10: Ignore :cve:`2021-33630`, :cve:`2021-33631`, :cve:`2022-1508`, :cve:`2022-36402`, :cve:`2022-48619`, :cve:`2023-2430`, :cve:`2023-4610`, :cve:`2023-5972`, :cve:`2023-6039`, :cve:`2023-6200`, :cve:`2023-6531`, :cve:`2023-6546`, :cve:`2023-6622`, :cve:`2023-6679`, :cve:`2023-7192`, :cve:`2023-46343`, :cve:`2023-51042`, :cve:`2023-51043`, :cve:`2024-0193`, :cve:`2024-0443`, :cve:`2024-0562`, :cve:`2024-0582`, :cve:`2024-0639`, :cve:`2024-0641`, :cve:`2024-0775`, :cve:`2024-1085` and :cve:`2024-22705`
|
||||
- openssl: Fix :cve:`2024-0727`
|
||||
- python3-pycryptodome: Fix :cve:`2023-52323`
|
||||
- qemu: Fix :cve:`2023-6693`, :cve:`2023-42467` and :cve:`2024-24474`
|
||||
- vim: Fix :cve:`2024-22667`
|
||||
- xwayland: Fix :cve:`2023-6377` and :cve:`2023-6478`
|
||||
|
||||
|
||||
Fixes in Yocto-4.0.17
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- bind: Upgrade to 9.18.24
|
||||
- bitbake: bitbake/codeparser.py: address ast module deprecations in py 3.12
|
||||
- bitbake: bitbake/lib/bs4/tests/test_tree.py: python 3.12 regex
|
||||
- bitbake: codeparser: replace deprecated ast.Str and 's'
|
||||
- bitbake: fetch2: Ensure that git LFS objects are available
|
||||
- bitbake: tests/fetch: Add real git lfs tests and decorator
|
||||
- bitbake: tests/fetch: git-lfs restore _find_git_lfs
|
||||
- bitbake: toaster/toastergui: Bug-fix verify given layer path only if import/add local layer
|
||||
- build-appliance-image: Update to kirkstone head revision
|
||||
- cmake: Unset CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
|
||||
- contributor-guide: fix lore URL
|
||||
- curl: don't enable debug builds
|
||||
- cve_check: cleanup logging
|
||||
- dbus: Add missing :term:`CVE_PRODUCT`
|
||||
- dev-manual: sbom: Rephrase spdx creation
|
||||
- dev-manual: runtime-testing: gen-tapdevs need iptables installed
|
||||
- dev-manual: packages: clarify shared :term:`PR` service constraint
|
||||
- dev-manual: packages: need enough free space
|
||||
- dev-manual: start: remove idle line
|
||||
- feature-microblaze-versions.inc: python 3.12 regex
|
||||
- ghostscript: correct :term:`LICENSE` with AGPLv3
|
||||
- image-live.bbclass: LIVE_ROOTFS_TYPE support compression
|
||||
- kernel.bbclass: Set pkg-config variables for building modules
|
||||
- kernel.bbclass: introduce KERNEL_LOCALVERSION
|
||||
- kernel: fix localversion in v6.3+
|
||||
- kernel: make LOCALVERSION consistent between recipes
|
||||
- ldconfig-native: Fix to point correctly on the DT_NEEDED entries in an ELF file
|
||||
- librsvg: Fix do_package_qa error for librsvg
|
||||
- linux-firmware: upgrade to 20231211
|
||||
- linux-yocto/5.10: update to v5.10.210
|
||||
- linux-yocto/5.15: update to v5.15.150
|
||||
- manuals: add minimum RAM requirements
|
||||
- manuals: suppress excess use of "following" word
|
||||
- manuals: update disk space requirements
|
||||
- manuals: update references to buildtools
|
||||
- manuals: updates for building on Windows (WSL 2)
|
||||
- meta/lib/oeqa: python 3.12 regex
|
||||
- meta/recipes: python 3.12 regex
|
||||
- migration-guide: add release notes for 4.0.16
|
||||
- oeqa/selftest/oelib/buildhistory: git default branch
|
||||
- oeqa/selftest/recipetool: downgrade meson version to not use pyproject.toml
|
||||
- oeqa/selftest/recipetool: expect meson.bb
|
||||
- oeqa/selftest/recipetool: fix for python 3.12
|
||||
- oeqa/selftest/runtime_test: only run the virgl tests on qemux86-64
|
||||
- oeqa: replace deprecated assertEquals
|
||||
- openssl: Upgrade to 3.0.13
|
||||
- poky.conf: bump version for 4.0.17
|
||||
- populate_sdk_ext: use ConfigParser instead of SafeConfigParser
|
||||
- python3-jinja2: upgrade to 3.1.3
|
||||
- recipetool/create_buildsys_python: use importlib instead of imp
|
||||
- ref-manual: system-requirements: recommend buildtools for not supported distros
|
||||
- ref-manual: system-requirements: add info on buildtools-make-tarball
|
||||
- ref-manual: release-process: grammar fix
|
||||
- ref-manual: system-requirements: fix AlmaLinux variable name
|
||||
- ref-manual: system-requirements: modify anchor
|
||||
- ref-manual: system-requirements: remove outdated note
|
||||
- ref-manual: system-requirements: simplify supported distro requirements
|
||||
- ref-manual: system-requirements: update packages to build docs
|
||||
- scripts/runqemu: add qmp socket support
|
||||
- scripts/runqemu: direct mesa to use its own drivers, rather than ones provided by host distro
|
||||
- scripts/runqemu: fix regex escape sequences
|
||||
- scripts: python 3.12 regex
|
||||
- selftest: skip virgl gtk/sdl test on ubuntu 18.04
|
||||
- systemd: Only add myhostname to nsswitch.conf if in :term:`PACKAGECONFIG`
|
||||
- tzdata : Upgrade to 2024a
|
||||
- u-boot: Move UBOOT_INITIAL_ENV back to u-boot.inc
|
||||
- useradd-example: do not use unsupported clear text password
|
||||
- vim: upgrade to v9.0.2190
|
||||
- yocto-bsp: update to v5.15.150
|
||||
|
||||
|
||||
Known Issues in Yocto-4.0.17
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- N/A
|
||||
|
||||
|
||||
Contributors to Yocto-4.0.17
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Adrian Freihofer
|
||||
- Alassane Yattara
|
||||
- Alexander Kanavin
|
||||
- Alexander Sverdlin
|
||||
- Archana Polampalli
|
||||
- Baruch Siach
|
||||
- Bruce Ashfield
|
||||
- Chen Qi
|
||||
- Chris Laplante
|
||||
- Deepthi Hemraj
|
||||
- Dhairya Nagodra
|
||||
- Fabien Mahot
|
||||
- Fabio Estevam
|
||||
- Hitendra Prajapati
|
||||
- Hugo SIMELIERE
|
||||
- Jermain Horsman
|
||||
- Kai Kang
|
||||
- Lee Chee Yang
|
||||
- Ludovic Jozeau
|
||||
- Michael Opdenacker
|
||||
- Ming Liu
|
||||
- Munehisa Kamata
|
||||
- Narpat Mali
|
||||
- Nikhil R
|
||||
- Paul Eggleton
|
||||
- Paulo Neves
|
||||
- Peter Marko
|
||||
- Philip Lorenz
|
||||
- Poonam Jadhav
|
||||
- Priyal Doshi
|
||||
- Ross Burton
|
||||
- Simone Weiß
|
||||
- Soumya Sambu
|
||||
- Steve Sakoman
|
||||
- Tim Orling
|
||||
- Trevor Gamblin
|
||||
- Vijay Anusuri
|
||||
- Vivek Kumbhar
|
||||
- Wang Mingyu
|
||||
- Zahir Hussain
|
||||
|
||||
|
||||
Repositories / Downloads for Yocto-4.0.17
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
poky
|
||||
|
||||
- Repository Location: :yocto_git:`/poky`
|
||||
- Branch: :yocto_git:`kirkstone </poky/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.17 </poky/log/?h=yocto-4.0.17>`
|
||||
- Git Revision: :yocto_git:`6d1a878bbf24c66f7186b270f823fcdf82e35383 </poky/commit/?id=6d1a878bbf24c66f7186b270f823fcdf82e35383>`
|
||||
- Release Artefact: poky-6d1a878bbf24c66f7186b270f823fcdf82e35383
|
||||
- sha: 3bc3010340b674f7b0dd0a7997f0167b2240b794fbd4aa28c0c4217bddd15e30
|
||||
- Download Locations:
|
||||
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.17/poky-6d1a878bbf24c66f7186b270f823fcdf82e35383.tar.bz2
|
||||
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.17/poky-6d1a878bbf24c66f7186b270f823fcdf82e35383.tar.bz2
|
||||
|
||||
openembedded-core
|
||||
|
||||
- Repository Location: :oe_git:`/openembedded-core`
|
||||
- Branch: :oe_git:`kirkstone </openembedded-core/log/?h=kirkstone>`
|
||||
- Tag: :oe_git:`yocto-4.0.17 </openembedded-core/log/?h=yocto-4.0.17>`
|
||||
- Git Revision: :oe_git:`2501534c9581c6c3439f525d630be11554a57d24 </openembedded-core/commit/?id=2501534c9581c6c3439f525d630be11554a57d24>`
|
||||
- Release Artefact: oecore-2501534c9581c6c3439f525d630be11554a57d24
|
||||
- sha: 52cc6cce9e920bdce078584b89136e81cc01e0c55616fab5fca6c3e04264c88e
|
||||
- Download Locations:
|
||||
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.17/oecore-2501534c9581c6c3439f525d630be11554a57d24.tar.bz2
|
||||
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.17/oecore-2501534c9581c6c3439f525d630be11554a57d24.tar.bz2
|
||||
|
||||
meta-mingw
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-mingw`
|
||||
- Branch: :yocto_git:`kirkstone </meta-mingw/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.17 </meta-mingw/log/?h=yocto-4.0.17>`
|
||||
- Git Revision: :yocto_git:`f6b38ce3c90e1600d41c2ebb41e152936a0357d7 </meta-mingw/commit/?id=f6b38ce3c90e1600d41c2ebb41e152936a0357d7>`
|
||||
- Release Artefact: meta-mingw-f6b38ce3c90e1600d41c2ebb41e152936a0357d7
|
||||
- sha: 7d57167c19077f4ab95623d55a24c2267a3a3fb5ed83688659b4c03586373b25
|
||||
- Download Locations:
|
||||
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.17/meta-mingw-f6b38ce3c90e1600d41c2ebb41e152936a0357d7.tar.bz2
|
||||
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.17/meta-mingw-f6b38ce3c90e1600d41c2ebb41e152936a0357d7.tar.bz2
|
||||
|
||||
meta-gplv2
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-gplv2`
|
||||
- Branch: :yocto_git:`kirkstone </meta-gplv2/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.17 </meta-gplv2/log/?h=yocto-4.0.17>`
|
||||
- Git Revision: :yocto_git:`d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a </meta-gplv2/commit/?id=d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a>`
|
||||
- Release Artefact: meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a
|
||||
- sha: c386f59f8a672747dc3d0be1d4234b6039273d0e57933eb87caa20f56b9cca6d
|
||||
- Download Locations:
|
||||
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.17/meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a.tar.bz2
|
||||
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.17/meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a.tar.bz2
|
||||
|
||||
meta-clang
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-clang`
|
||||
- Branch: :yocto_git:`kirkstone </meta-clang/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.17 </meta-clang/log/?h=yocto-4.0.17>`
|
||||
- Git Revision: :yocto_git:`eebe4ff2e539f3ffb01c5060cc4ca8b226ea8b52 </meta-clang/commit/?id=eebe4ff2e539f3ffb01c5060cc4ca8b226ea8b52>`
|
||||
- Release Artefact: meta-clang-eebe4ff2e539f3ffb01c5060cc4ca8b226ea8b52
|
||||
- sha: 3299e96e069a22c0971e903fbc191f2427efffc83d910ac51bf0237caad01d17
|
||||
- Download Locations:
|
||||
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.17/meta-clang-eebe4ff2e539f3ffb01c5060cc4ca8b226ea8b52.tar.bz2
|
||||
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.17/meta-clang-eebe4ff2e539f3ffb01c5060cc4ca8b226ea8b52.tar.bz2
|
||||
|
||||
bitbake
|
||||
|
||||
- Repository Location: :oe_git:`/bitbake`
|
||||
- Branch: :oe_git:`2.0 </bitbake/log/?h=2.0>`
|
||||
- Tag: :oe_git:`yocto-4.0.17 </bitbake/log/?h=yocto-4.0.17>`
|
||||
- Git Revision: :oe_git:`40fd5f4eef7460ca67f32cfce8e229e67e1ff607 </bitbake/commit/?id=40fd5f4eef7460ca67f32cfce8e229e67e1ff607>`
|
||||
- Release Artefact: bitbake-40fd5f4eef7460ca67f32cfce8e229e67e1ff607
|
||||
- sha: 5d20a0e4c5d0fce44bd84778168714a261a30a4b83f67c88df3b8a7e7115e444
|
||||
- Download Locations:
|
||||
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.17/bitbake-40fd5f4eef7460ca67f32cfce8e229e67e1ff607.tar.bz2
|
||||
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.17/bitbake-40fd5f4eef7460ca67f32cfce8e229e67e1ff607.tar.bz2
|
||||
|
||||
yocto-docs
|
||||
|
||||
- Repository Location: :yocto_git:`/yocto-docs`
|
||||
- Branch: :yocto_git:`kirkstone </yocto-docs/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.17 </yocto-docs/log/?h=yocto-4.0.17>`
|
||||
- Git Revision: :yocto_git:`08ce7db2aa3a38deb8f5aa59bafc78542986babb </yocto-docs/commit/?id=08ce7db2aa3a38deb8f5aa59bafc78542986babb>`
|
||||
|
||||
191
documentation/migration-guides/release-notes-4.0.18.rst
Normal file
191
documentation/migration-guides/release-notes-4.0.18.rst
Normal file
@@ -0,0 +1,191 @@
|
||||
.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
|
||||
|
||||
Release notes for Yocto-4.0.18 (Kirkstone)
|
||||
------------------------------------------
|
||||
|
||||
Security Fixes in Yocto-4.0.18
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- curl: Fix :cve:`2024-2398`
|
||||
- expat: fix :cve:`2023-52426` and :cve:`2024-28757`
|
||||
- libssh2: fix :cve:`2023-48795`
|
||||
- ncurses: Fix :cve:`2023-50495`
|
||||
- nghttp2: Fix :cve:`2024-28182` and :cve:`2023-44487`
|
||||
- openssh: Ignore :cve:`2023-51767`
|
||||
- openssl: Fix :cve:`2024-2511`
|
||||
- perl: Ignore :cve:`2023-47100`
|
||||
- python3-cryptography: Fix :cve:`2024-26130`
|
||||
- python3-urllib3: Fix :cve:`2023-45803`
|
||||
- qemu: Fix :cve:`2023-6683`
|
||||
- ruby: fix :cve_mitre:`2024-27281`
|
||||
- rust: Ignore :cve:`2024-24576`
|
||||
- tiff: Fix :cve:`2023-52356` and :cve:`2023-6277`
|
||||
- xserver-xorg: Fix :cve:`2024-31080` and :cve:`2024-31081`
|
||||
- xwayland: Fix :cve:`2023-6816`, :cve:`2024-0408` and :cve:`2024-0409`
|
||||
|
||||
|
||||
Fixes in Yocto-4.0.18
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- build-appliance-image: Update to kirkstone head revision
|
||||
- common-licenses: Backport missing license
|
||||
- contributor-guide: add notes for tests
|
||||
- contributor-guide: be more specific about meta-* trees
|
||||
- cups: fix typo in :cve:`2023-32360` backport patch
|
||||
- cve-update-nvd2-native: Add an age threshold for incremental update
|
||||
- cve-update-nvd2-native: Fix CVE configuration update
|
||||
- cve-update-nvd2-native: Fix typo in comment
|
||||
- cve-update-nvd2-native: Remove duplicated CVE_CHECK_DB_FILE definition
|
||||
- cve-update-nvd2-native: Remove rejected CVE from database
|
||||
- cve-update-nvd2-native: nvd_request_next: Improve comment
|
||||
- dev-manual: improve descriptions of 'bitbake -S printdiff'
|
||||
- dev-manual: packages: fix capitalization
|
||||
- docs: conf.py: properly escape backslashes for latex_elements
|
||||
- gcc: Backport sanitizer fix for 32-bit ALSR
|
||||
- glibc: Fix subscript typos for get_nscd_addresses
|
||||
- kernel-dev: join mkdir commands with -p
|
||||
- linux-firmware: Upgrade to 20240220
|
||||
- manuals: add initial sphinx-lint support
|
||||
- manuals: add initial stylechecks with Vale
|
||||
- manuals: document VIRTUAL-RUNTIME variables
|
||||
- manuals: fix duplicate "stylecheck" target
|
||||
- manuals: fix incorrect double backticks
|
||||
- manuals: fix trailing spaces
|
||||
- manuals: refer to new yocto-patches mailing list wherever appropriate
|
||||
- manuals: remove tab characters
|
||||
- manuals: replace hyphens with em dashes
|
||||
- manuals: use "manual page(s)"
|
||||
- migration-guides: add release notes for 4.0.17
|
||||
- poky.conf: bump version for 4.0.18
|
||||
- profile-manual: usage.rst: fix reference to bug report
|
||||
- profile-manual: usage.rst: formatting fixes
|
||||
- profile-manual: usage.rst: further style improvements
|
||||
- python3-urllib3: Upgrade to v1.26.18
|
||||
- ref-manual: add documentation of the variable :term:`SPDX_NAMESPACE_PREFIX`
|
||||
- ref-manual: tasks: do_cleanall: recommend using '-f' instead
|
||||
- ref-manual: tasks: do_cleansstate: recommend using '-f' instead for a shared sstate
|
||||
- ref-manual: variables: adding multiple groups in :term:`GROUPADD_PARAM`
|
||||
- ref-manual: variables: correct sdk installation default path
|
||||
- stress-ng: avoid calling sync during do_compile
|
||||
- systemd: Fix vlan qos mapping
|
||||
- tcl: Add a way to skip ptests
|
||||
- tcl: skip async and event tests in run-ptest
|
||||
- tcl: skip timing-dependent tests in run-ptest
|
||||
- valgrind: skip intermittently failing ptest
|
||||
- wireless-regdb: Upgrade to 2024.01.23
|
||||
- yocto-uninative: Update to 4.4 for glibc 2.39
|
||||
|
||||
|
||||
Known Issues in Yocto-4.0.18
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- N/A
|
||||
|
||||
|
||||
Contributors to Yocto-4.0.18
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Alex Kiernan
|
||||
- Alex Stewart
|
||||
- Alexander Kanavin
|
||||
- BELOUARGA Mohamed
|
||||
- Claus Stovgaard
|
||||
- Colin McAllister
|
||||
- Geoff Parker
|
||||
- Haitao Liu
|
||||
- Harish Sadineni
|
||||
- Johan Bezem
|
||||
- Jonathan GUILLOT
|
||||
- Jörg Sommer
|
||||
- Khem Raj
|
||||
- Lee Chee Yang
|
||||
- Luca Ceresoli
|
||||
- Martin Jansa
|
||||
- Meenali Gupta
|
||||
- Michael Halstead
|
||||
- Michael Opdenacker
|
||||
- Peter Marko
|
||||
- Quentin Schulz
|
||||
- Ross Burton
|
||||
- Sana Kazi
|
||||
- Simone Weiß
|
||||
- Soumya Sambu
|
||||
- Steve Sakoman
|
||||
- Tan Wen Yan
|
||||
- Vijay Anusuri
|
||||
- Wang Mingyu
|
||||
- Yoann Congal
|
||||
- Yogita Urade
|
||||
- Zahir Hussain
|
||||
|
||||
|
||||
Repositories / Downloads for Yocto-4.0.18
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
poky
|
||||
|
||||
- Repository Location: :yocto_git:`/poky`
|
||||
- Branch: :yocto_git:`kirkstone </poky/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.18 </poky/log/?h=yocto-4.0.18>`
|
||||
- Git Revision: :yocto_git:`31751bba1c789f15f574773a659b8017d7bcf440 </poky/commit/?id=31751bba1c789f15f574773a659b8017d7bcf440>`
|
||||
- Release Artefact: poky-31751bba1c789f15f574773a659b8017d7bcf440
|
||||
- sha: 72d5aa65c3c37766ebc24b212740272c1d52342468548f9c070241d3522ad2ca
|
||||
- Download Locations:
|
||||
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.18/poky-31751bba1c789f15f574773a659b8017d7bcf440.tar.bz2
|
||||
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.18/poky-31751bba1c789f15f574773a659b8017d7bcf440.tar.bz2
|
||||
|
||||
openembedded-core
|
||||
|
||||
- Repository Location: :oe_git:`/openembedded-core`
|
||||
- Branch: :oe_git:`kirkstone </openembedded-core/log/?h=kirkstone>`
|
||||
- Tag: :oe_git:`yocto-4.0.18 </openembedded-core/log/?h=yocto-4.0.18>`
|
||||
- Git Revision: :oe_git:`b7182571242dc4e23e5250a449d90348e62a6abc </openembedded-core/commit/?id=b7182571242dc4e23e5250a449d90348e62a6abc>`
|
||||
- Release Artefact: oecore-b7182571242dc4e23e5250a449d90348e62a6abc
|
||||
- sha: 6f257e50c10ebae673dcf61a833b3270db6d22781f02f6794a370aac839f1020
|
||||
- Download Locations:
|
||||
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.18/oecore-b7182571242dc4e23e5250a449d90348e62a6abc.tar.bz2
|
||||
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.18/oecore-b7182571242dc4e23e5250a449d90348e62a6abc.tar.bz2
|
||||
|
||||
meta-mingw
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-mingw`
|
||||
- Branch: :yocto_git:`kirkstone </meta-mingw/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.18 </meta-mingw/log/?h=yocto-4.0.18>`
|
||||
- Git Revision: :yocto_git:`f6b38ce3c90e1600d41c2ebb41e152936a0357d7 </meta-mingw/commit/?id=f6b38ce3c90e1600d41c2ebb41e152936a0357d7>`
|
||||
- Release Artefact: meta-mingw-f6b38ce3c90e1600d41c2ebb41e152936a0357d7
|
||||
- sha: 7d57167c19077f4ab95623d55a24c2267a3a3fb5ed83688659b4c03586373b25
|
||||
- Download Locations:
|
||||
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.18/meta-mingw-f6b38ce3c90e1600d41c2ebb41e152936a0357d7.tar.bz2
|
||||
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.18/meta-mingw-f6b38ce3c90e1600d41c2ebb41e152936a0357d7.tar.bz2
|
||||
|
||||
meta-gplv2
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-gplv2`
|
||||
- Branch: :yocto_git:`kirkstone </meta-gplv2/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.18 </meta-gplv2/log/?h=yocto-4.0.18>`
|
||||
- Git Revision: :yocto_git:`d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a </meta-gplv2/commit/?id=d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a>`
|
||||
- Release Artefact: meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a
|
||||
- sha: c386f59f8a672747dc3d0be1d4234b6039273d0e57933eb87caa20f56b9cca6d
|
||||
- Download Locations:
|
||||
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.18/meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a.tar.bz2
|
||||
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.18/meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a.tar.bz2
|
||||
|
||||
bitbake
|
||||
|
||||
- Repository Location: :oe_git:`/bitbake`
|
||||
- Branch: :oe_git:`2.0 </bitbake/log/?h=2.0>`
|
||||
- Tag: :oe_git:`yocto-4.0.18 </bitbake/log/?h=yocto-4.0.18>`
|
||||
- Git Revision: :oe_git:`40fd5f4eef7460ca67f32cfce8e229e67e1ff607 </bitbake/commit/?id=40fd5f4eef7460ca67f32cfce8e229e67e1ff607>`
|
||||
- Release Artefact: bitbake-40fd5f4eef7460ca67f32cfce8e229e67e1ff607
|
||||
- sha: 5d20a0e4c5d0fce44bd84778168714a261a30a4b83f67c88df3b8a7e7115e444
|
||||
- Download Locations:
|
||||
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.18/bitbake-40fd5f4eef7460ca67f32cfce8e229e67e1ff607.tar.bz2
|
||||
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.18/bitbake-40fd5f4eef7460ca67f32cfce8e229e67e1ff607.tar.bz2
|
||||
|
||||
yocto-docs
|
||||
|
||||
- Repository Location: :yocto_git:`/yocto-docs`
|
||||
- Branch: :yocto_git:`kirkstone </yocto-docs/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.18 </yocto-docs/log/?h=yocto-4.0.18>`
|
||||
- Git Revision: :yocto_git:`fd1423141e7458ba557db465c171b0b4e9063987 </yocto-docs/commit/?id=fd1423141e7458ba557db465c171b0b4e9063987>`
|
||||
|
||||
159
documentation/migration-guides/release-notes-4.0.19.rst
Normal file
159
documentation/migration-guides/release-notes-4.0.19.rst
Normal file
File diff suppressed because one or more lines are too long
@@ -81,7 +81,7 @@ Fixes in Yocto-4.0.5
|
||||
Known Issues in Yocto-4.0.5
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- There are recent CVEs in key components such as openssl. They are not included in this release as it was built before the issues were known and fixes were available but these are now available on the kirkstone branch.
|
||||
- There are recent CVEs in key components such as openssl. They are not included in this release as it was built before the issues were known and fixes were available but these are now available on the kirkstone branch.
|
||||
|
||||
|
||||
Contributors to Yocto-4.0.5
|
||||
|
||||
@@ -36,7 +36,7 @@ New Features / Enhancements in 4.0
|
||||
|
||||
- Inclusive language adjustments to some variable names - see the
|
||||
:ref:`4.0 migration guide <migration-4.0-inclusive-language>` for details.
|
||||
|
||||
|
||||
- New recipes:
|
||||
|
||||
- ``buildtools-docs-tarball``
|
||||
@@ -112,8 +112,7 @@ New Features / Enhancements in 4.0
|
||||
- BitBake enhancements:
|
||||
|
||||
- Fetcher enhancements:
|
||||
|
||||
- New :ref:`bitbake:bitbake-user-manual/bitbake-user-manual-fetching:crate fetcher (\`\`crate://\`\`)` for Rust packages
|
||||
- New :ref:`bitbake-user-manual/bitbake-user-manual-fetching:crate fetcher (\`\`crate://\`\`)` for Rust packages
|
||||
- Added striplevel support to unpack
|
||||
- git: Add a warning asking users to set a branch in git urls
|
||||
- git: Allow git fetcher to support subdir param
|
||||
@@ -125,7 +124,7 @@ New Features / Enhancements in 4.0
|
||||
- ssh: now supports checkstatus, allows : in URLs (both required for use with sstate) and no longer requires username
|
||||
- wget: add redirectauth parameter
|
||||
- wget: add 30s timeout for checkstatus calls
|
||||
|
||||
|
||||
- Show warnings for append/prepend/remove operators combined with +=/.=
|
||||
- Add bb.warnonce() and bb.erroronce() log methods
|
||||
- Improved setscene task display
|
||||
@@ -138,7 +137,7 @@ New Features / Enhancements in 4.0
|
||||
- Architecture-specific enhancements:
|
||||
|
||||
- ARM:
|
||||
|
||||
|
||||
- tune-cortexa72: Enable the crc extension by default for cortexa72
|
||||
- qemuarm64: Add tiny ktype to qemuarm64 bsp
|
||||
- armv9a/tune: Add the support for the Neoverse N2 core
|
||||
@@ -161,7 +160,7 @@ New Features / Enhancements in 4.0
|
||||
- linux-yocto-dev: add qemuriscv32
|
||||
- packagegroup-core-tools-profile: Enable systemtap for riscv64
|
||||
- qemuriscv: Use virtio-tablet-pci for mouse
|
||||
|
||||
|
||||
- x86:
|
||||
|
||||
- kernel-yocto: conditionally enable stack protection checking on x86-64
|
||||
@@ -197,7 +196,7 @@ New Features / Enhancements in 4.0
|
||||
- yocto-check-layer: improved README checks
|
||||
- cve-check: add json output format
|
||||
- cve-check: add coverage statistics on recipes with/without CVEs
|
||||
- Added mirrors for kernel sources and uninative binaries on kernel.org
|
||||
- Added mirrors for kernel sources and uninative binaries on kernel.org
|
||||
- glibc and binutils recipes now use shallow mirror tarballs for faster fetching
|
||||
- When patching fails, show more information on the fatal error
|
||||
|
||||
@@ -232,7 +231,7 @@ New Features / Enhancements in 4.0
|
||||
- Detect more known licenses in Python code
|
||||
- Move license md5sums data into CSV files
|
||||
- npm: Use README as license fallback
|
||||
|
||||
|
||||
- SDK-related enhancements:
|
||||
|
||||
- Extended recipes to ``nativesdk``: ``cargo``, ``librsvg``, ``libstd-rs``, ``libva``, ``python3-docutil``, ``python3-packaging``
|
||||
@@ -240,7 +239,7 @@ New Features / Enhancements in 4.0
|
||||
- Support creating per-toolchain cmake file in SDK
|
||||
|
||||
- Rust enhancements:
|
||||
|
||||
|
||||
- New python_setuptools3_rust class to enable building python extensions in Rust
|
||||
- classes/meson: Add optional rust definitions
|
||||
|
||||
|
||||
@@ -565,7 +565,7 @@ Local Projects
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Local projects are custom bits of software the user provides. These bits
|
||||
reside somewhere local to a project - perhaps a directory into which the
|
||||
reside somewhere local to a project --- perhaps a directory into which the
|
||||
user checks in items (e.g. a local directory containing a development
|
||||
source tree used by the group).
|
||||
|
||||
@@ -1407,7 +1407,7 @@ This next list, shows the variables associated with a standard SDK:
|
||||
Lists packages that make up the target part of the SDK (i.e. the part
|
||||
built for the target hardware).
|
||||
|
||||
- :term:`SDKPATH`: Defines the
|
||||
- :term:`SDKPATHINSTALL`: Defines the
|
||||
default SDK installation path offered by the installation script.
|
||||
|
||||
- :term:`SDK_HOST_MANIFEST`:
|
||||
@@ -1647,7 +1647,7 @@ you a good idea of when the task's data changes.
|
||||
|
||||
To complicate the problem, there are things that should not be included
|
||||
in the checksum. First, there is the actual specific build path of a
|
||||
given task - the :term:`WORKDIR`. It
|
||||
given task --- the :term:`WORKDIR`. It
|
||||
does not matter if the work directory changes because it should not
|
||||
affect the output for target packages. Also, the build process has the
|
||||
objective of making native or cross packages relocatable.
|
||||
@@ -1706,7 +1706,7 @@ need to fix this situation.
|
||||
Thus far, this section has limited discussion to the direct inputs into
|
||||
a task. Information based on direct inputs is referred to as the
|
||||
"basehash" in the code. However, the question of a task's indirect
|
||||
inputs still exits - items already built and present in the
|
||||
inputs still exits --- items already built and present in the
|
||||
:term:`Build Directory`. The checksum (or
|
||||
signature) for a particular task needs to add the hashes of all the
|
||||
tasks on which the particular task depends. Choosing which dependencies
|
||||
|
||||
@@ -52,7 +52,7 @@ A development host or :term:`Build Host` is key to
|
||||
using the Yocto Project. Because the goal of the Yocto Project is to
|
||||
develop images or applications that run on embedded hardware,
|
||||
development of those images and applications generally takes place on a
|
||||
system not intended to run the software - the development host.
|
||||
system not intended to run the software --- the development host.
|
||||
|
||||
You need to set up a development host in order to use it with the Yocto
|
||||
Project. Most find that it is best to have a native Linux machine
|
||||
|
||||
@@ -38,7 +38,7 @@ This manual does not give you the following:
|
||||
procedures reside in other manuals within the Yocto Project
|
||||
documentation set. For example, the :doc:`/dev-manual/index`
|
||||
provides examples on how to perform
|
||||
various development tasks. As another example, the
|
||||
various development tasks. As another example, the
|
||||
:doc:`/sdk-manual/index` manual contains detailed
|
||||
instructions on how to install an SDK, which is used to develop
|
||||
applications for target hardware.
|
||||
|
||||
@@ -857,7 +857,7 @@ helpful for getting started:
|
||||
distribution.
|
||||
|
||||
Another point worth noting is that historically within the Yocto
|
||||
Project, recipes were referred to as packages - thus, the existence
|
||||
Project, recipes were referred to as packages --- thus, the existence
|
||||
of several BitBake variables that are seemingly mis-named, (e.g.
|
||||
:term:`PR`,
|
||||
:term:`PV`, and
|
||||
|
||||
@@ -12,19 +12,19 @@ YOCTO_AB_URL : "https://autobuilder.yoctoproject.org"
|
||||
YOCTO_RELEASE_DL_URL : "&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;"
|
||||
UBUNTU_HOST_PACKAGES_ESSENTIAL : "gawk wget git diffstat unzip texinfo gcc \
|
||||
build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
|
||||
xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
|
||||
python3-subunit mesa-common-dev zstd liblz4-tool file locales
|
||||
xz-utils debianutils iputils-ping python3-git python3-jinja2 \
|
||||
python3-subunit zstd liblz4-tool file locales libacl1
|
||||
\n\ $ sudo locale-gen en_US.UTF-8"
|
||||
FEDORA_HOST_PACKAGES_ESSENTIAL : "gawk make wget tar bzip2 gzip python3 unzip perl patch \
|
||||
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
|
||||
ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-bignum socat \
|
||||
python3-pexpect findutils which file cpio python python3-pip xz python3-GitPython \
|
||||
python3-jinja2 SDL-devel xterm rpcgen mesa-libGL-devel perl-FindBin perl-File-Compare \
|
||||
perl-File-Copy perl-locale zstd lz4"
|
||||
python3-jinja2 rpcgen perl-FindBin perl-File-Compare \
|
||||
perl-File-Copy perl-locale zstd lz4 hostname glibc-langpack-en libacl"
|
||||
OPENSUSE_HOST_PACKAGES_ESSENTIAL : "python gcc gcc-c++ git chrpath make wget python-xml \
|
||||
diffstat makeinfo python-curses patch socat python3 python3-curses tar python3-pip \
|
||||
python3-pexpect xz which python3-Jinja2 Mesa-libEGL1 libSDL-devel rpcgen Mesa-dri-devel \
|
||||
zstd lz4 bzip2 gzip hostname
|
||||
python3-pexpect xz which python3-Jinja2 rpcgen \
|
||||
zstd lz4 bzip2 gzip hostname libacl1
|
||||
\n\ $ sudo pip3 install GitPython"
|
||||
ALMALINUX_HOST_PACKAGES_ESSENTIAL : "-y epel-release
|
||||
\n\ $ sudo yum install dnf-plugins-core
|
||||
@@ -33,8 +33,8 @@ ALMALINUX_HOST_PACKAGES_ESSENTIAL : "-y epel-release
|
||||
\n\ $ sudo dnf install gawk make wget tar bzip2 gzip python3 unzip perl patch \
|
||||
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath ccache \
|
||||
socat perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python3-pip \
|
||||
python3-GitPython python3-jinja2 python3-pexpect xz which SDL-devel xterm \
|
||||
rpcgen mesa-libGL-devel zstd lz4"
|
||||
python3-GitPython python3-jinja2 python3-pexpect xz which \
|
||||
rpcgen zstd lz4 cpio glibc-langpack-en libacl"
|
||||
PIP3_HOST_PACKAGES_DOC : "$ sudo pip3 install sphinx sphinx_rtd_theme pyyaml"
|
||||
MIN_PYTHON_VERSION : "3.6.0"
|
||||
MIN_TAR_VERSION : "1.28"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -346,7 +346,7 @@ and BusyBox. It could have been called "kconfig" too.
|
||||
``compress_doc``
|
||||
================
|
||||
|
||||
Enables compression for man pages and info pages. This class is intended
|
||||
Enables compression for manual and info pages. This class is intended
|
||||
to be inherited globally. The default compression mechanism is gz (gzip)
|
||||
but you can select an alternative mechanism by setting the
|
||||
:term:`DOC_COMPRESS` variable.
|
||||
@@ -588,7 +588,7 @@ The padding size can be modified by setting :term:`DT_PADDING_SIZE`
|
||||
to the desired size, in bytes.
|
||||
|
||||
See :oe_git:`devicetree.bbclass sources
|
||||
</openembedded-core/tree/meta/classes-recipe/devicetree.bbclass>`
|
||||
</openembedded-core/tree/meta/classes-recipe/devicetree.bbclass>`
|
||||
for further variables controlling this class.
|
||||
|
||||
Here is an excerpt of an example ``recipes-kernel/linux/devicetree-acme.bb``
|
||||
|
||||
@@ -165,7 +165,7 @@ Adding a New Recipe to the Workspace Layer
|
||||
==========================================
|
||||
|
||||
Use the ``devtool add`` command to add a new recipe to the workspace
|
||||
layer. The recipe you add should not exist - ``devtool`` creates it for
|
||||
layer. The recipe you add should not exist --- ``devtool`` creates it for
|
||||
you. The source files the recipe uses should exist in an external area.
|
||||
|
||||
The following example creates and adds a new recipe named ``jackson`` to
|
||||
|
||||
@@ -364,7 +364,7 @@ redirect requests through proxy servers.
|
||||
|
||||
**Q:** Can I get rid of build output so I can start over?
|
||||
|
||||
**A:** Yes - you can easily do this. When you use BitBake to build an
|
||||
**A:** Yes --- you can easily do this. When you use BitBake to build an
|
||||
image, all the build output goes into the directory created when you run
|
||||
the build environment setup script (i.e.
|
||||
:ref:`structure-core-script`). By default, this :term:`Build Directory`
|
||||
@@ -428,7 +428,7 @@ relatively normal and the second is not:
|
||||
build/tmp/sysroots/x86_64-linux/usr/bin
|
||||
|
||||
Even if the paths look unusual,
|
||||
they both are correct - the first for a target and the second for a
|
||||
they both are correct --- the first for a target and the second for a
|
||||
native recipe. These paths are a consequence of the ``DESTDIR``
|
||||
mechanism and while they appear strange, they are correct and in
|
||||
practice very effective.
|
||||
|
||||
@@ -66,6 +66,9 @@ instructions:
|
||||
- :yocto_lists:`/g/yocto` --- general Yocto Project
|
||||
discussion mailing list.
|
||||
|
||||
- :yocto_lists:`/g/yocto-patches` --- patch contribution mailing list for Yocto
|
||||
Project-related layers which do not have their own mailing list.
|
||||
|
||||
- :oe_lists:`/g/openembedded-core` --- discussion mailing
|
||||
list about OpenEmbedded-Core (the core metadata).
|
||||
|
||||
|
||||
@@ -213,8 +213,8 @@ These files are standard top-level files.
|
||||
|
||||
.. _structure-build:
|
||||
|
||||
The Build Directory - ``build/``
|
||||
================================
|
||||
The Build Directory --- ``build/``
|
||||
==================================
|
||||
|
||||
The OpenEmbedded build system creates the :term:`Build Directory`
|
||||
when you run the build environment setup
|
||||
@@ -589,7 +589,7 @@ install" places its output that is then split into sub-packages within
|
||||
``build/tmp/work/tunearch/recipename/version/``
|
||||
-----------------------------------------------
|
||||
|
||||
The recipe work directory - ``${WORKDIR}``.
|
||||
The recipe work directory --- ``${WORKDIR}``.
|
||||
|
||||
As described earlier in the
|
||||
":ref:`structure-build-tmp-sysroots`" section,
|
||||
@@ -654,8 +654,8 @@ recipes. In practice, this is only used for ``gcc`` and its variants
|
||||
|
||||
.. _structure-meta:
|
||||
|
||||
The Metadata - ``meta/``
|
||||
========================
|
||||
The Metadata --- ``meta/``
|
||||
==========================
|
||||
|
||||
As mentioned previously, :term:`Metadata` is the core of the
|
||||
Yocto Project. Metadata has several important subdivisions:
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
width="2040.0006"
|
||||
height="624.30518"
|
||||
viewBox="0 0 2040.0006 624.30515"
|
||||
height="669.30511"
|
||||
viewBox="0 0 2040.0006 669.30509"
|
||||
sodipodi:docname="releases.svg"
|
||||
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
@@ -409,8 +409,8 @@
|
||||
id="namedview4"
|
||||
showgrid="true"
|
||||
inkscape:zoom="1.4472045"
|
||||
inkscape:cx="736.24703"
|
||||
inkscape:cy="312.32629"
|
||||
inkscape:cx="987.76641"
|
||||
inkscape:cy="357.93145"
|
||||
inkscape:window-x="1728"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
@@ -427,13 +427,13 @@
|
||||
type="xygrid"
|
||||
id="grid1257"
|
||||
originx="-289.99936"
|
||||
originy="325" />
|
||||
originy="369.99998" />
|
||||
</sodipodi:namedview>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
inkscape:label="Image"
|
||||
id="g10"
|
||||
transform="translate(-289.99936,325.00004)">
|
||||
transform="translate(-289.99936,370.00003)">
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 1080,220.00003 v -515.00007 0 0"
|
||||
@@ -669,11 +669,11 @@
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:13.3333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';text-align:center;text-anchor:middle;fill:#fffefe;fill-opacity:1;stroke:none"
|
||||
id="tspan10317-2-9-1-4">4.2</tspan></text>
|
||||
<g
|
||||
id="g1379">
|
||||
id="g1258">
|
||||
<rect
|
||||
style="fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-opacity:1"
|
||||
id="rect917-0-0-4-4-9-4-5-38"
|
||||
width="140.00003"
|
||||
width="120.00002"
|
||||
height="45.000004"
|
||||
x="1220"
|
||||
y="-230.00005"
|
||||
@@ -696,53 +696,76 @@
|
||||
id="tspan10317-2-9-1-4-6">4.3</tspan></text>
|
||||
</g>
|
||||
<rect
|
||||
style="opacity:0.75;fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-opacity:1"
|
||||
id="rect917-0-0-4-4-9-4-5-3-9"
|
||||
width="979.99994"
|
||||
style="opacity:0.75;fill:#241f31;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-opacity:1"
|
||||
id="rect917-0-0-4-4-9-4-5-3-9-2"
|
||||
width="140"
|
||||
height="45.000004"
|
||||
x="1320"
|
||||
y="-285.00003"
|
||||
x="1440"
|
||||
y="-340.00003"
|
||||
ry="2.2558987" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-weight:bold;font-size:13.3333px;line-height:125%;font-family:'Nimbus Roman';-inkscape-font-specification:'Nimbus Roman, Bold';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;fill:#fffefe;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="1373.233"
|
||||
y="-265.32928"
|
||||
id="text1185-3-55-4-0-0-0-1-1-6"><tspan
|
||||
x="1487.233"
|
||||
y="-320.32928"
|
||||
id="text1185-3-55-4-0-0-0-1-1-6-4"><tspan
|
||||
sodipodi:role="line"
|
||||
x="1373.233"
|
||||
y="-265.32928"
|
||||
x="1487.233"
|
||||
y="-320.32928"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:13.3333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';text-align:center;text-anchor:middle;fill:#fffefe;fill-opacity:1;stroke:none"
|
||||
id="tspan957-2-8-6-3-9-7-4-2">Scarthgap</tspan><tspan
|
||||
id="tspan957-2-8-6-3-9-7-4-2-0">Styhead</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="1373.233"
|
||||
y="-247.33261"
|
||||
x="1487.233"
|
||||
y="-302.33261"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:13.3333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';text-align:center;text-anchor:middle;fill:#fffefe;fill-opacity:1;stroke:none"
|
||||
id="tspan10317-2-9-1-4-6-5">5.0</tspan></text>
|
||||
<rect
|
||||
style="fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-opacity:1"
|
||||
id="rect917-0-0-4-4-9-9"
|
||||
width="960.00012"
|
||||
height="45.000004"
|
||||
x="859.99994"
|
||||
y="-64.999992"
|
||||
ry="2.2558987" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-weight:bold;font-size:13.3333px;line-height:125%;font-family:'Nimbus Roman';-inkscape-font-specification:'Nimbus Roman, Bold';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;fill:#fffefe;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="928.49872"
|
||||
y="-45.648258"
|
||||
id="text1185-3-55-4-0-0-9"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan10317-2-9-1-4-6-5-6">5.1</tspan></text>
|
||||
<g
|
||||
id="g1591">
|
||||
<rect
|
||||
style="fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-opacity:1"
|
||||
id="rect917-0-0-4-4-9-9"
|
||||
width="960.00012"
|
||||
height="45.000004"
|
||||
x="859.99994"
|
||||
y="-64.999992"
|
||||
ry="2.2558987" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-weight:bold;font-size:13.3333px;line-height:125%;font-family:'Nimbus Roman';-inkscape-font-specification:'Nimbus Roman, Bold';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;fill:#fffefe;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="928.49872"
|
||||
y="-45.648258"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:13.3333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';text-align:center;text-anchor:middle;fill:#fffefe;fill-opacity:1;stroke:none"
|
||||
id="tspan957-2-8-6-3-6">Kirkstone (LTS)</tspan><tspan
|
||||
id="text1185-3-55-4-0-0-9"><tspan
|
||||
sodipodi:role="line"
|
||||
x="928.49872"
|
||||
y="-45.648258"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:13.3333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';text-align:center;text-anchor:middle;fill:#fffefe;fill-opacity:1;stroke:none"
|
||||
id="tspan957-2-8-6-3-6">Kirkstone (LTS)</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="928.49872"
|
||||
y="-27.651579"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:13.3333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';text-align:center;text-anchor:middle;fill:#fffefe;fill-opacity:1;stroke:none"
|
||||
id="tspan10317-2-9-0">4.0</tspan></text>
|
||||
</g>
|
||||
<path
|
||||
id="rect917-0-0-4-4-9-9-9"
|
||||
style="fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-opacity:1"
|
||||
d="m 1322.3015,-285.00003 c -1.2753,0 -2.302,1.00609 -2.302,2.25586 v 40.48828 c 0,1.24977 1.0267,2.25586 2.302,2.25586 h 975.0412 c 1.2754,0 2.302,-1.00609 2.302,-2.25586 v -40.48828 c 0,-1.24977 -1.0266,-2.25586 -2.302,-2.25586 z" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-weight:bold;font-size:13.3333px;line-height:125%;font-family:'Nimbus Roman';-inkscape-font-specification:'Nimbus Roman, Bold';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;fill:#fffefe;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="1390.4988"
|
||||
y="-265.64832"
|
||||
id="text1185-3-55-4-0-0-9-0"><tspan
|
||||
sodipodi:role="line"
|
||||
x="928.49872"
|
||||
y="-27.651579"
|
||||
x="1390.4988"
|
||||
y="-265.64832"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:13.3333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';text-align:center;text-anchor:middle;fill:#fffefe;fill-opacity:1;stroke:none"
|
||||
id="tspan10317-2-9-0">4.0</tspan></text>
|
||||
id="tspan957-2-8-6-3-6-8">Scarthgap (LTS)</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="1390.4988"
|
||||
y="-247.65164"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:13.3333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';text-align:center;text-anchor:middle;fill:#fffefe;fill-opacity:1;stroke:none"
|
||||
id="tspan10317-2-9-0-1">5.0</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-weight:bold;font-size:13.3333px;line-height:125%;font-family:'Nimbus Roman';-inkscape-font-specification:'Nimbus Roman, Bold';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;fill:#fffefe;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
|
||||
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 108 KiB |
@@ -369,7 +369,7 @@ information.
|
||||
``do_populate_sdk_ext``
|
||||
-----------------------
|
||||
|
||||
Creates the file and directory structure for an installable extensible
|
||||
Creates the file and directory structure for an installable extensible
|
||||
SDK (eSDK). See the ":ref:`overview-manual/concepts:sdk generation`"
|
||||
section in the Yocto Project Overview and Concepts Manual for more
|
||||
information.
|
||||
@@ -481,9 +481,29 @@ You can run this task using BitBake as follows::
|
||||
|
||||
$ bitbake -c cleanall recipe
|
||||
|
||||
Typically, you would not normally use the ``cleanall`` task. Do so only
|
||||
if you want to start fresh with the :ref:`ref-tasks-fetch`
|
||||
task.
|
||||
You should never use the :ref:`ref-tasks-cleanall` task in a normal
|
||||
scenario. If you want to start fresh with the :ref:`ref-tasks-fetch` task,
|
||||
use instead::
|
||||
|
||||
$ bitbake -f -c fetch recipe
|
||||
|
||||
.. note::
|
||||
|
||||
The reason to prefer ``bitbake -f -c fetch`` is that the
|
||||
:ref:`ref-tasks-cleanall` task would break in some cases, such as::
|
||||
|
||||
$ bitbake -c fetch recipe
|
||||
$ bitbake -c cleanall recipe-native
|
||||
$ bitbake -c unpack recipe
|
||||
|
||||
because after step 1 there is a stamp file for the
|
||||
:ref:`ref-tasks-fetch` task of ``recipe``, and it won't be removed at
|
||||
step 2 because step 2 uses a different work directory. So the unpack task
|
||||
at step 3 will try to extract the downloaded archive and fail as it has
|
||||
been deleted in step 2.
|
||||
|
||||
Note that this also applies to BitBake from concurrent processes when a
|
||||
shared download directory (:term:`DL_DIR`) is setup.
|
||||
|
||||
.. _ref-tasks-cleansstate:
|
||||
|
||||
@@ -507,7 +527,19 @@ scratch is guaranteed.
|
||||
|
||||
.. note::
|
||||
|
||||
The ``do_cleansstate`` task cannot remove sstate from a remote sstate
|
||||
Using :ref:`ref-tasks-cleansstate` with a shared :term:`SSTATE_DIR` is
|
||||
not recommended because it could trigger an error during the build of a
|
||||
separate BitBake instance. This is because the builds check sstate "up
|
||||
front" but download the files later, so it if is deleted in the
|
||||
meantime, it will cause an error but not a total failure as it will
|
||||
rebuild it.
|
||||
|
||||
The reliable and preferred way to force a new build is to use ``bitbake
|
||||
-f`` instead.
|
||||
|
||||
.. note::
|
||||
|
||||
The :ref:`ref-tasks-cleansstate` task cannot remove sstate from a remote sstate
|
||||
mirror. If you need to build a target from scratch using remote mirrors, use
|
||||
the "-f" option as follows::
|
||||
|
||||
|
||||
@@ -226,23 +226,23 @@ universal, the list includes them just in case:
|
||||
|
||||
As far as bootloaders are concerned, :term:`Initramfs` and "initrd"
|
||||
images are still copied to RAM in the same way. That's why most
|
||||
most bootloaders refer to :term:`Initramfs` images as "initrd"
|
||||
or "init RAM disk".
|
||||
most bootloaders refer to :term:`Initramfs` images as "initrd"
|
||||
or "init RAM disk".
|
||||
|
||||
This kind of mechanism is typically used for two reasons:
|
||||
|
||||
- For booting the same kernel binary on multiple systems requiring
|
||||
different device drivers. The :term:`Initramfs` image is then customized
|
||||
for each type of system, to include the specific kernel modules
|
||||
for each type of system, to include the specific kernel modules
|
||||
necessary to access the final root filesystem. This technique
|
||||
is used on all GNU / Linux distributions for desktops and servers.
|
||||
is used on all GNU / Linux distributions for desktops and servers.
|
||||
|
||||
- For booting faster. As the root filesystem is extracted into RAM,
|
||||
accessing the first user-space applications is very fast, compared
|
||||
to having to initialize a block device, to access multiple blocks
|
||||
from it, and to go through a filesystem having its own overhead.
|
||||
For example, this allows to display a splashscreen very early,
|
||||
and to later take care of mounting the final root filesystem and
|
||||
and to later take care of mounting the final root filesystem and
|
||||
loading less time-critical kernel drivers.
|
||||
|
||||
This cpio archive can either be loaded to RAM by the bootloader,
|
||||
@@ -342,7 +342,7 @@ universal, the list includes them just in case:
|
||||
your Linux distribution.
|
||||
|
||||
Another point worth noting is that historically within the Yocto
|
||||
Project, recipes were referred to as packages - thus, the existence
|
||||
Project, recipes were referred to as packages --- thus, the existence
|
||||
of several BitBake variables that are seemingly mis-named, (e.g.
|
||||
:term:`PR`, :term:`PV`, and
|
||||
:term:`PE`).
|
||||
@@ -458,7 +458,7 @@ universal, the list includes them just in case:
|
||||
Directory created by unpacking a released tarball as compared to
|
||||
cloning ``git://git.yoctoproject.org/poky``. When you unpack a
|
||||
tarball, you have an exact copy of the files based on the time of
|
||||
release - a fixed release point. Any changes you make to your local
|
||||
release --- a fixed release point. Any changes you make to your local
|
||||
files in the Source Directory are on top of the release and will
|
||||
remain local only. On the other hand, when you clone the ``poky`` Git
|
||||
repository, you have an active development repository with access to
|
||||
|
||||
@@ -591,7 +591,7 @@ system and gives an overview of their function and contents.
|
||||
This variable is useful in situations where the same recipe appears
|
||||
in more than one layer. Setting this variable allows you to
|
||||
prioritize a layer against other layers that contain the same recipe
|
||||
- effectively letting you control the precedence for the multiple
|
||||
--- effectively letting you control the precedence for the multiple
|
||||
layers. The precedence established through this variable stands
|
||||
regardless of a recipe's version (:term:`PV` variable). For
|
||||
example, a layer that has a recipe with a higher :term:`PV` value but for
|
||||
@@ -888,7 +888,7 @@ system and gives an overview of their function and contents.
|
||||
:term:`BUILD_OS`
|
||||
Specifies the operating system in use on the build host (e.g.
|
||||
"linux"). The OpenEmbedded build system sets the value of
|
||||
:term:`BUILD_OS` from the OS reported by the ``uname`` command - the
|
||||
:term:`BUILD_OS` from the OS reported by the ``uname`` command --- the
|
||||
first word, converted to lower-case characters.
|
||||
|
||||
:term:`BUILD_PREFIX`
|
||||
@@ -1775,7 +1775,7 @@ system and gives an overview of their function and contents.
|
||||
``${TMPDIR}/deploy``.
|
||||
|
||||
For more information on the structure of the Build Directory, see
|
||||
":ref:`ref-manual/structure:the build directory - \`\`build/\`\``" section.
|
||||
":ref:`ref-manual/structure:the build directory --- \`\`build/\`\``" section.
|
||||
For more detail on the contents of the ``deploy`` directory, see the
|
||||
":ref:`overview-manual/concepts:images`",
|
||||
":ref:`overview-manual/concepts:package feeds`", and
|
||||
@@ -1819,7 +1819,7 @@ system and gives an overview of their function and contents.
|
||||
<ref-classes-image>` class.
|
||||
|
||||
For more information on the structure of the Build Directory, see
|
||||
":ref:`ref-manual/structure:the build directory - \`\`build/\`\``" section.
|
||||
":ref:`ref-manual/structure:the build directory --- \`\`build/\`\``" section.
|
||||
For more detail on the contents of the ``deploy`` directory, see the
|
||||
":ref:`overview-manual/concepts:images`" and
|
||||
":ref:`overview-manual/concepts:application development sdk`" sections both in
|
||||
@@ -2107,7 +2107,7 @@ system and gives an overview of their function and contents.
|
||||
:term:`DOC_COMPRESS`
|
||||
When inheriting the :ref:`compress_doc <ref-classes-compress_doc>`
|
||||
class, this variable sets the compression policy used when the
|
||||
OpenEmbedded build system compresses man pages and info pages. By
|
||||
OpenEmbedded build system compresses manual and info pages. By
|
||||
default, the compression method used is gz (gzip). Other policies
|
||||
available are xz and bz2.
|
||||
|
||||
@@ -2348,24 +2348,24 @@ system and gives an overview of their function and contents.
|
||||
|
||||
Here are some examples of features you can add:
|
||||
|
||||
- "dbg-pkgs" - Adds -dbg packages for all installed packages including
|
||||
- "dbg-pkgs" --- adds -dbg packages for all installed packages including
|
||||
symbol information for debugging and profiling.
|
||||
|
||||
- "debug-tweaks" - Makes an image suitable for debugging. For example, allows root logins without passwords and
|
||||
- "debug-tweaks" --- makes an image suitable for debugging. For example, allows root logins without passwords and
|
||||
enables post-installation logging. See the 'allow-empty-password' and
|
||||
'post-install-logging' features in the ":ref:`ref-features-image`"
|
||||
section for more information.
|
||||
- "dev-pkgs" - Adds -dev packages for all installed packages. This is
|
||||
- "dev-pkgs" --- adds -dev packages for all installed packages. This is
|
||||
useful if you want to develop against the libraries in the image.
|
||||
- "read-only-rootfs" - Creates an image whose root filesystem is
|
||||
- "read-only-rootfs" --- creates an image whose root filesystem is
|
||||
read-only. See the
|
||||
":ref:`dev-manual/read-only-rootfs:creating a read-only root filesystem`"
|
||||
section in the Yocto Project Development Tasks Manual for more
|
||||
information
|
||||
- "tools-debug" - Adds debugging tools such as gdb and strace.
|
||||
- "tools-sdk" - Adds development tools such as gcc, make,
|
||||
- "tools-debug" --- adds debugging tools such as gdb and strace.
|
||||
- "tools-sdk" --- adds development tools such as gcc, make,
|
||||
pkgconfig and so forth.
|
||||
- "tools-testapps" - Adds useful testing tools
|
||||
- "tools-testapps" --- adds useful testing tools
|
||||
such as ts_print, aplay, arecord and so forth.
|
||||
|
||||
For a complete list of image features that ships with the Yocto
|
||||
@@ -2962,6 +2962,14 @@ system and gives an overview of their function and contents.
|
||||
|
||||
GROUPADD_PARAM:${PN} = "-r netdev"
|
||||
|
||||
More than one group can be added by separating each set of different
|
||||
groups' parameters with a semicolon.
|
||||
|
||||
Here is an example adding multiple groups from the ``useradd-example.bb``
|
||||
file in the ``meta-skeleton`` layer::
|
||||
|
||||
GROUPADD_PARAM:${PN} = "-g 880 group1; -g 890 group2"
|
||||
|
||||
For information on the standard Linux shell command
|
||||
``groupadd``, see https://linux.die.net/man/8/groupadd.
|
||||
|
||||
@@ -3446,7 +3454,7 @@ system and gives an overview of their function and contents.
|
||||
IMAGE_NAME ?= "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
|
||||
|
||||
:term:`IMAGE_NAME_SUFFIX`
|
||||
Suffix used for the image output filename - defaults to ``".rootfs"``
|
||||
Suffix used for the image output filename --- defaults to ``".rootfs"``
|
||||
to distinguish the image file from other files created during image
|
||||
building; however if this suffix is redundant or not desired you can
|
||||
clear the value of this variable (set the value to ""). For example,
|
||||
@@ -3760,7 +3768,7 @@ system and gives an overview of their function and contents.
|
||||
The default value of the variable is set as follows in the
|
||||
``meta/conf/distro/defaultsetup.conf`` file::
|
||||
|
||||
INHERIT_DISTRO ?= "debian devshell sstate license"
|
||||
INHERIT_DISTRO ?= "debian devshell sstate license remove-libtool"
|
||||
|
||||
:term:`INHIBIT_DEFAULT_DEPS`
|
||||
Prevents the default dependencies, namely the C compiler and standard
|
||||
@@ -6356,11 +6364,11 @@ system and gives an overview of their function and contents.
|
||||
|
||||
.. note::
|
||||
|
||||
A corresponding mechanism for virtual runtime dependencies
|
||||
(packages) exists. However, the mechanism does not depend on any
|
||||
special functionality beyond ordinary variable assignments. For
|
||||
example, ``VIRTUAL-RUNTIME_dev_manager`` refers to the package of
|
||||
the component that manages the ``/dev`` directory.
|
||||
A corresponding mechanism for virtual runtime dependencies (packages)
|
||||
exists. However, the mechanism does not depend on any special
|
||||
functionality beyond ordinary variable assignments. For example,
|
||||
:term:`VIRTUAL-RUNTIME_dev_manager <VIRTUAL-RUNTIME>` refers to the
|
||||
package of the component that manages the ``/dev`` directory.
|
||||
|
||||
Setting the "preferred provider" for runtime dependencies is as
|
||||
simple as using the following assignment in a configuration file::
|
||||
@@ -6533,7 +6541,7 @@ system and gives an overview of their function and contents.
|
||||
``baz``.
|
||||
|
||||
The names of the packages you list within :term:`RDEPENDS` must be the
|
||||
names of other packages - they cannot be recipe names. Although
|
||||
names of other packages --- they cannot be recipe names. Although
|
||||
package names and recipe names usually match, the important point
|
||||
here is that you are providing package names within the :term:`RDEPENDS`
|
||||
variable. For an example of the default list of packages created from
|
||||
@@ -7201,6 +7209,10 @@ system and gives an overview of their function and contents.
|
||||
configuration will not take effect.
|
||||
|
||||
:term:`SDKPATH`
|
||||
Defines the path used to collect the SDK components and build the
|
||||
installer.
|
||||
|
||||
:term:`SDKPATHINSTALL`
|
||||
Defines the path offered to the user for installation of the SDK that
|
||||
is generated by the OpenEmbedded build system. The path appears as
|
||||
the default location for installing the SDK when you run the SDK's
|
||||
@@ -7210,7 +7222,7 @@ system and gives an overview of their function and contents.
|
||||
:term:`SDKTARGETSYSROOT`
|
||||
The full path to the sysroot used for cross-compilation within an SDK
|
||||
as it will be when installed into the default
|
||||
:term:`SDKPATH`.
|
||||
:term:`SDKPATHINSTALL`.
|
||||
|
||||
:term:`SECTION`
|
||||
The section in which packages should be categorized. Package
|
||||
@@ -7509,6 +7521,11 @@ system and gives an overview of their function and contents.
|
||||
image), compared to just using the
|
||||
:ref:`create-spdx <ref-classes-create-spdx>` class with no option.
|
||||
|
||||
:term:`SPDX_NAMESPACE_PREFIX`
|
||||
This option could be used in order to change the prefix of ``spdxDocument``
|
||||
and the prefix of ``documentNamespace``. It is set by default to
|
||||
``http://spdx.org/spdxdoc``.
|
||||
|
||||
:term:`SPDX_PRETTY`
|
||||
This option makes the SPDX output more human-readable, using
|
||||
identation and newlines, instead of the default output in a
|
||||
@@ -7584,7 +7601,7 @@ system and gives an overview of their function and contents.
|
||||
The name of keys used by the :ref:`ref-classes-kernel-fitimage` class
|
||||
for signing U-Boot FIT image stored in the :term:`SPL_SIGN_KEYDIR`
|
||||
directory. If we have for example a ``dev.key`` key and a ``dev.crt``
|
||||
certificate stored in the :term:`SPL_SIGN_KEYDIR` directory, you will
|
||||
certificate stored in the :term:`SPL_SIGN_KEYDIR` directory, you will
|
||||
have to set :term:`SPL_SIGN_KEYNAME` to ``dev``.
|
||||
|
||||
:term:`SPLASH`
|
||||
@@ -7634,35 +7651,35 @@ system and gives an overview of their function and contents.
|
||||
|
||||
There are standard and recipe-specific options. Here are standard ones:
|
||||
|
||||
- ``apply`` - Whether to apply the patch or not. The default
|
||||
- ``apply`` --- whether to apply the patch or not. The default
|
||||
action is to apply the patch.
|
||||
|
||||
- ``striplevel`` - Which striplevel to use when applying the
|
||||
- ``striplevel`` --- which striplevel to use when applying the
|
||||
patch. The default level is 1.
|
||||
|
||||
- ``patchdir`` - Specifies the directory in which the patch should
|
||||
- ``patchdir`` --- specifies the directory in which the patch should
|
||||
be applied. The default is ``${``\ :term:`S`\ ``}``.
|
||||
|
||||
Here are options specific to recipes building code from a revision
|
||||
control system:
|
||||
|
||||
- ``mindate`` - Apply the patch only if
|
||||
- ``mindate`` --- apply the patch only if
|
||||
:term:`SRCDATE` is equal to or greater than
|
||||
``mindate``.
|
||||
|
||||
- ``maxdate`` - Apply the patch only if :term:`SRCDATE` is not later
|
||||
- ``maxdate`` --- apply the patch only if :term:`SRCDATE` is not later
|
||||
than ``maxdate``.
|
||||
|
||||
- ``minrev`` - Apply the patch only if :term:`SRCREV` is equal to or
|
||||
- ``minrev`` --- apply the patch only if :term:`SRCREV` is equal to or
|
||||
greater than ``minrev``.
|
||||
|
||||
- ``maxrev`` - Apply the patch only if :term:`SRCREV` is not later
|
||||
- ``maxrev`` --- apply the patch only if :term:`SRCREV` is not later
|
||||
than ``maxrev``.
|
||||
|
||||
- ``rev`` - Apply the patch only if :term:`SRCREV` is equal to
|
||||
- ``rev`` --- apply the patch only if :term:`SRCREV` is equal to
|
||||
``rev``.
|
||||
|
||||
- ``notrev`` - Apply the patch only if :term:`SRCREV` is not equal to
|
||||
- ``notrev`` --- apply the patch only if :term:`SRCREV` is not equal to
|
||||
``rev``.
|
||||
|
||||
.. note::
|
||||
@@ -9373,6 +9390,33 @@ system and gives an overview of their function and contents.
|
||||
Additionally, you should also set the
|
||||
:term:`USERADD_ERROR_DYNAMIC` variable.
|
||||
|
||||
:term:`VIRTUAL-RUNTIME`
|
||||
:term:`VIRTUAL-RUNTIME` is a commonly used prefix for defining virtual
|
||||
packages for runtime usage, typically for use in :term:`RDEPENDS`
|
||||
or in image definitions.
|
||||
|
||||
An example is ``VIRTUAL-RUNTIME_base-utils`` that makes it possible
|
||||
to either use BusyBox based utilities::
|
||||
|
||||
VIRTUAL-RUNTIME_base-utils = "busybox"
|
||||
|
||||
or their full featured implementations from GNU Coreutils
|
||||
and other projects::
|
||||
|
||||
VIRTUAL-RUNTIME_base-utils = "packagegroup-core-base-utils"
|
||||
|
||||
Here are two examples using this virtual runtime package. The
|
||||
first one is in :yocto_git:`initramfs-framework_1.0.bb
|
||||
</poky/tree/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb?h=scarthgap>`::
|
||||
|
||||
RDEPENDS:${PN} += "${VIRTUAL-RUNTIME_base-utils}"
|
||||
|
||||
The second example is in the :yocto_git:`core-image-initramfs-boot
|
||||
</poky/tree/meta/recipes-core/images/core-image-initramfs-boot.bb?h=scarthgap>`
|
||||
image definition::
|
||||
|
||||
PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} base-passwd"
|
||||
|
||||
:term:`VOLATILE_LOG_DIR`
|
||||
Specifies the persistence of the target's ``/var/log`` directory,
|
||||
which is used to house postinstall target log files.
|
||||
@@ -9449,8 +9493,8 @@ system and gives an overview of their function and contents.
|
||||
- :term:`TMPDIR`: The top-level build output directory
|
||||
- :term:`MULTIMACH_TARGET_SYS`: The target system identifier
|
||||
- :term:`PN`: The recipe name
|
||||
- :term:`EXTENDPE`: The epoch - (if :term:`PE` is not specified, which
|
||||
is usually the case for most recipes, then `EXTENDPE` is blank)
|
||||
- :term:`EXTENDPE`: The epoch --- if :term:`PE` is not specified, which
|
||||
is usually the case for most recipes, then `EXTENDPE` is blank.
|
||||
- :term:`PV`: The recipe version
|
||||
- :term:`PR`: The recipe revision
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ This section lists variables that are required for recipes.
|
||||
|
||||
- :term:`LIC_FILES_CHKSUM`
|
||||
|
||||
- :term:`SRC_URI` - used in recipes that fetch local or remote files.
|
||||
- :term:`SRC_URI` --- used in recipes that fetch local or remote files.
|
||||
|
||||
.. _ref-varlocality-recipe-dependencies:
|
||||
|
||||
|
||||
@@ -172,19 +172,19 @@ variables and Makefile variables during development.
|
||||
The main point of this section is to explain the following three cases
|
||||
regarding variable behavior:
|
||||
|
||||
- *Case 1 - No Variables Set in the Makefile Map to Equivalent
|
||||
- *Case 1 --- No Variables Set in the Makefile Map to Equivalent
|
||||
Environment Variables Set in the SDK Setup Script:* Because matching
|
||||
variables are not specifically set in the ``Makefile``, the variables
|
||||
retain their values based on the environment setup script.
|
||||
|
||||
- *Case 2 - Variables Are Set in the Makefile that Map to Equivalent
|
||||
- *Case 2 --- Variables Are Set in the Makefile that Map to Equivalent
|
||||
Environment Variables from the SDK Setup Script:* Specifically
|
||||
setting matching variables in the ``Makefile`` during the build
|
||||
results in the environment settings of the variables being
|
||||
overwritten. In this case, the variables you set in the ``Makefile``
|
||||
are used.
|
||||
|
||||
- *Case 3 - Variables Are Set Using the Command Line that Map to
|
||||
- *Case 3 --- Variables Are Set Using the Command Line that Map to
|
||||
Equivalent Environment Variables from the SDK Setup Script:*
|
||||
Executing the ``Makefile`` from the command line results in the
|
||||
environment variables being overwritten. In this case, the
|
||||
@@ -286,14 +286,14 @@ example:
|
||||
# CC=i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux
|
||||
# CC="gcc"
|
||||
all: main.o module.o
|
||||
${CC} main.o module.o -o target_bin
|
||||
${CC} main.o module.o -o target_bin
|
||||
main.o: main.c module.h
|
||||
${CC} -I . -c main.c
|
||||
${CC} -I . -c main.c
|
||||
module.o: module.c
|
||||
module.h ${CC} -I . -c module.c
|
||||
module.h ${CC} -I . -c module.c
|
||||
clean:
|
||||
rm -rf *.o
|
||||
rm target_bin
|
||||
rm -rf *.o
|
||||
rm target_bin
|
||||
|
||||
4. *Make the Project:* Use the ``make`` command to create the binary
|
||||
output file. Because variables are commented out in the Makefile, the
|
||||
|
||||
@@ -5,9 +5,109 @@ documentation is created.
|
||||
|
||||
It is currently a work in progress.
|
||||
|
||||
## Automatic style validation
|
||||
|
||||
There is an ongoing effort to automate style validation
|
||||
through the [Vale](https://vale.sh/). To try it, run:
|
||||
|
||||
$ make stylecheck
|
||||
|
||||
Note that this just applies to text. Therefore, the syntax
|
||||
conventions described below still apply.
|
||||
|
||||
If you wish to add a new word to an "accept.txt" file
|
||||
(./styles/config/vocabularies/<Vocab>/accept.txt),
|
||||
make sure the spelling and capitalization matches
|
||||
what Wikipedia or the project defining this word uses.
|
||||
|
||||
## Text standards
|
||||
|
||||
This section has not been filled yet
|
||||
### Bulleted lists
|
||||
|
||||
Though Sphinx supports both the ``*`` and ``-`` characters
|
||||
for introducing bulleted lists, we have chosen to use
|
||||
only ``-`` for this purpose.
|
||||
|
||||
Though not strictly required by Sphinx, we have also chosen
|
||||
to use two space characters after ``-`` to introduce each
|
||||
list item:
|
||||
|
||||
- Paragraph 1
|
||||
|
||||
- Paragraph 2
|
||||
|
||||
As shown in the above example, there should also be an empty
|
||||
line between each list item.
|
||||
|
||||
An exception to this rule is when the list items are just made
|
||||
of a few words, instead of entire paragraphs:
|
||||
|
||||
- Item 1
|
||||
- Item 2
|
||||
|
||||
This is again a matter of style, not syntax.
|
||||
|
||||
### Line wrapping
|
||||
|
||||
Source code for the documentation shouldn't have lines
|
||||
wider than 80 characters. This makes patch lines more
|
||||
readable and code easier to quote in e-mail clients.
|
||||
|
||||
If you have to include long commands or lines in configuration
|
||||
files, provided the syntax makes this possible, split them
|
||||
into multiple lines, using the ``\`` character.
|
||||
|
||||
Here is an example:
|
||||
|
||||
$ scripts/install-buildtools \
|
||||
--without-extended-buildtools \
|
||||
--base-url https://downloads.yoctoproject.org/releases/yocto \
|
||||
--release yocto-4.0.1 \
|
||||
--installer-version 4.0.1
|
||||
|
||||
Exceptions are granted for file contents whose lines
|
||||
cannot be split without infringing syntactic rules
|
||||
or reducing readability, as well as for command output
|
||||
which should be kept unmodified.
|
||||
|
||||
### File, tool and command names
|
||||
|
||||
File, tool, command and package names should be double tick-quoted.
|
||||
For example, ``` ``conf/local.conf`` ``` is preferred over
|
||||
`"conf/local.conf"`.
|
||||
|
||||
### Project names
|
||||
|
||||
Project names should be introduced with single quotes, to have them rendered
|
||||
with an italic font and make them easier to distinguish from command names
|
||||
(double tick-quoted) and from regular English words.
|
||||
|
||||
An exception is when project names appear in hyperlinks, as nested markup
|
||||
is not supported by Sphinx yet.
|
||||
|
||||
Project names should also be capitalized (or not) in the same way they are on
|
||||
Wikipedia, or on their own project pages if they are not described on
|
||||
Wikipedia. If a project name isn't capitalized, it should remain so even
|
||||
at the beginning of a sentence.
|
||||
|
||||
For example:
|
||||
|
||||
* ``` `BitBake` ```
|
||||
* ``` `ftrace` ```
|
||||
|
||||
### Variables
|
||||
|
||||
Every variable should be mentioned with:
|
||||
|
||||
:term:`VARIABLE`
|
||||
|
||||
This assumes that `VARIABLE` is described either
|
||||
in the Yocto Project documentation variable index (`ref-manual/variables.rst`)
|
||||
or in the BitBake User Manual
|
||||
(`doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst`)
|
||||
|
||||
If it is not described yet, the variable should be added to the
|
||||
glossary before or in the same patch it is used, so that `:term:` can be used.
|
||||
|
||||
## ReStructured Text Syntax standards
|
||||
|
||||
@@ -26,8 +126,14 @@ To include a screenshot in PNG format:
|
||||
.. image:: figures/user-configuration.png
|
||||
:align: center
|
||||
|
||||
Depending on the size of the image, you may also shrink it
|
||||
to prevent it from filling the whole page width:
|
||||
A diagram with many details usually needs to use
|
||||
the whole page width to be readable on all media.
|
||||
In this case, the `:align:` directive is unnecessary:
|
||||
|
||||
:scale: 100%
|
||||
|
||||
Conversely, you may also shrink some images to
|
||||
to prevent them from filling the whole page width:
|
||||
|
||||
:scale: 50%
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
autovivification
|
||||
blkparse
|
||||
blktrace
|
||||
callee
|
||||
debugfs
|
||||
ftrace
|
||||
KernelShark
|
||||
Kprobe
|
||||
LTTng
|
||||
perf
|
||||
profiler
|
||||
subcommand
|
||||
subnode
|
||||
superset
|
||||
Sysprof
|
||||
systemd
|
||||
toolchain
|
||||
tracepoint
|
||||
Uprobe
|
||||
wget
|
||||
@@ -0,0 +1,5 @@
|
||||
BitBake
|
||||
BSP
|
||||
crosstap
|
||||
OpenEmbedded
|
||||
Yocto
|
||||
@@ -82,8 +82,8 @@ topology that includes a controller and a cluster of workers:
|
||||
.. image:: figures/ab-test-cluster.png
|
||||
:align: center
|
||||
|
||||
Yocto Project Tests - Types of Testing Overview
|
||||
===============================================
|
||||
Yocto Project Tests --- Types of Testing Overview
|
||||
=================================================
|
||||
|
||||
The Autobuilder tests different elements of the project by using
|
||||
the following types of tests:
|
||||
|
||||
@@ -84,7 +84,7 @@ Transitioning to a custom environment for systems development
|
||||
|
||||
#. **Now you're ready to create an image recipe**.
|
||||
There are a number of ways to do this. However, it is strongly recommended
|
||||
that you have your own image recipe - don't try appending to existing image
|
||||
that you have your own image recipe --- don't try appending to existing image
|
||||
recipes. Recipes for images are trivial to create and you usually want to
|
||||
fully customize their contents.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
#DISTRO_VERSION = "3.4+snapshot-${METADATA_REVISION}"
|
||||
DISTRO_VERSION = "4.0.17"
|
||||
DISTRO_VERSION = "4.0.20"
|
||||
DISTRO_CODENAME = "kirkstone"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${METADATA_REVISION}', 'snapshot')}"
|
||||
|
||||
@@ -18,3 +18,7 @@ inherit go
|
||||
|
||||
GO_WORKDIR ?= "${GO_IMPORT}"
|
||||
do_compile[dirs] += "${B}/src/${GO_WORKDIR}"
|
||||
|
||||
export GOMODCACHE = "${B}/.mod"
|
||||
|
||||
do_compile[cleandirs] += "${B}/.mod"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
inherit goarch
|
||||
inherit linuxloader
|
||||
|
||||
GO_PARALLEL_BUILD ?= "${@oe.utils.parallel_make_argument(d, '-p %d')}"
|
||||
|
||||
@@ -44,7 +45,10 @@ GO_LINKMODE ?= ""
|
||||
GO_LINKMODE:class-nativesdk = "--linkmode=external"
|
||||
GO_LINKMODE:class-native = "--linkmode=external"
|
||||
GO_EXTRA_LDFLAGS ?= ""
|
||||
GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} ${GO_EXTRA_LDFLAGS} -extldflags '${GO_EXTLDFLAGS}'"'
|
||||
GO_LINUXLOADER ?= "-I ${@get_linuxloader(d)}"
|
||||
# Use system loader. If uninative is used, the uninative loader will be patched automatically
|
||||
GO_LINUXLOADER:class-native = ""
|
||||
GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} ${GO_LINUXLOADER} ${GO_EXTRA_LDFLAGS} -extldflags '${GO_EXTLDFLAGS}'"'
|
||||
export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS} -trimpath"
|
||||
export GOPATH_OMIT_IN_ACTIONID ?= "1"
|
||||
export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c"
|
||||
|
||||
@@ -452,7 +452,7 @@ kernel_do_install() {
|
||||
rm -f "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
|
||||
rm -f "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source"
|
||||
# Remove empty module directories to prevent QA issues
|
||||
find "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel" -type d -empty -delete
|
||||
[ -d "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel" ] && find "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel" -type d -empty -delete
|
||||
else
|
||||
bbnote "no modules to install"
|
||||
fi
|
||||
|
||||
@@ -49,7 +49,7 @@ def get_glibc_loader(d):
|
||||
elif re.search("i.86", targetarch):
|
||||
dynamic_loader = "${base_libdir}/ld-linux.so.2"
|
||||
elif targetarch == "arm":
|
||||
dynamic_loader = "${base_libdir}/ld-linux${@['-armhf', ''][d.getVar('TARGET_FPU') == 'soft']}.so.3"
|
||||
dynamic_loader = "${base_libdir}/ld-linux${@['', '-armhf'][d.getVar('TARGET_FPU') == 'hard']}.so.3"
|
||||
elif targetarch.startswith("aarch64"):
|
||||
dynamic_loader = "${base_libdir}/ld-linux-aarch64${ARMPKGSFX_ENDIAN_64}.so.1"
|
||||
elif targetarch.startswith("riscv64"):
|
||||
|
||||
@@ -119,7 +119,9 @@ read_only_rootfs_hook () {
|
||||
# Also tweak the key location for dropbear in the same way.
|
||||
if [ -d ${IMAGE_ROOTFS}/etc/dropbear ]; then
|
||||
if [ ! -e ${IMAGE_ROOTFS}/etc/dropbear/dropbear_rsa_host_key ]; then
|
||||
echo "DROPBEAR_RSAKEY_DIR=/var/lib/dropbear" >> ${IMAGE_ROOTFS}/etc/default/dropbear
|
||||
if ! grep -q "^DROPBEAR_RSAKEY_DIR=" ${IMAGE_ROOTFS}/etc/default/dropbear ; then
|
||||
echo "DROPBEAR_RSAKEY_DIR=/var/lib/dropbear" >> ${IMAGE_ROOTFS}/etc/default/dropbear
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
# to the distro running on the build machine.
|
||||
#
|
||||
|
||||
UNINATIVE_MAXGLIBCVERSION = "2.38"
|
||||
UNINATIVE_VERSION = "4.3"
|
||||
UNINATIVE_MAXGLIBCVERSION = "2.39"
|
||||
UNINATIVE_VERSION = "4.4"
|
||||
|
||||
UNINATIVE_URL ?= "http://downloads.yoctoproject.org/releases/uninative/${UNINATIVE_VERSION}/"
|
||||
UNINATIVE_CHECKSUM[aarch64] ?= "8df05f4a41455018b4303b2e0ea4eac5c960b5a13713f6dbb33dfdb3e32753ec"
|
||||
UNINATIVE_CHECKSUM[i686] ?= "bea76b4a97c9ba0077c0dd1295f519cd599dbf71f0ca1c964471c4cdb043addd"
|
||||
UNINATIVE_CHECKSUM[x86_64] ?= "1c35f09a75c4096749bbe1e009df4e3968cde151424062cf4aa3ed89db22b030"
|
||||
UNINATIVE_CHECKSUM[aarch64] ?= "b61876130f494f75092f21086b4a64ea5fb064045769bf1d32e9cb6af17ea8ec"
|
||||
UNINATIVE_CHECKSUM[i686] ?= "9f28627828f0082cc0344eede4d9a861a9a064bfa8f36e072e46212f0fe45fcc"
|
||||
UNINATIVE_CHECKSUM[x86_64] ?= "d81c54284be2bb886931fc87281d58177a2cd381cf99d1981f8923039a72a302"
|
||||
|
||||
181
meta/files/common-licenses/LGPL-3.0-with-zeromq-exception
Normal file
181
meta/files/common-licenses/LGPL-3.0-with-zeromq-exception
Normal file
@@ -0,0 +1,181 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
SPECIAL EXCEPTION GRANTED BY COPYRIGHT HOLDERS
|
||||
|
||||
As a special exception, copyright holders give you permission to link this
|
||||
library with independent modules to produce an executable, regardless of
|
||||
the license terms of these independent modules, and to copy and distribute
|
||||
the resulting executable under terms of your choice, provided that you also
|
||||
meet, for each linked independent module, the terms and conditions of
|
||||
the license of that module. An independent module is a module which is not
|
||||
derived from or based on this library. If you modify this library, you must
|
||||
extend this exception to your version of the library.
|
||||
|
||||
Note: this exception relieves you of any obligations under sections 4 and 5
|
||||
of this license, and section 6 of the GNU General Public License.
|
||||
@@ -55,6 +55,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
|
||||
file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
|
||||
file://0001-test-gatt-Fix-hung-issue.patch \
|
||||
file://CVE-2023-45866.patch \
|
||||
file://CVE-2023-27349.patch \
|
||||
file://CVE-2023-50229_CVE-2023-50230.patch \
|
||||
"
|
||||
S = "${WORKDIR}/bluez-${PV}"
|
||||
|
||||
|
||||
48
meta/recipes-connectivity/bluez5/bluez5/CVE-2023-27349.patch
Normal file
48
meta/recipes-connectivity/bluez5/bluez5/CVE-2023-27349.patch
Normal file
@@ -0,0 +1,48 @@
|
||||
From f54299a850676d92c3dafd83e9174fcfe420ccc9 Mon Sep 17 00:00:00 2001
|
||||
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
|
||||
Date: Wed, 22 Mar 2023 11:34:24 -0700
|
||||
Subject: [PATCH] avrcp: Fix crash while handling unsupported events
|
||||
|
||||
The following crash can be observed if the remote peer send and
|
||||
unsupported event:
|
||||
|
||||
ERROR: AddressSanitizer: heap-use-after-free on address 0x60b000148f11
|
||||
at pc 0x559644552088 bp 0x7ffe28b3c7b0 sp 0x7ffe28b3c7a0
|
||||
WRITE of size 1 at 0x60b000148f11 thread T0
|
||||
#0 0x559644552087 in avrcp_handle_event profiles/audio/avrcp.c:3907
|
||||
#1 0x559644536c22 in control_response profiles/audio/avctp.c:939
|
||||
#2 0x5596445379ab in session_cb profiles/audio/avctp.c:1108
|
||||
#3 0x7fbcb3e51c43 in g_main_context_dispatch (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55c43)
|
||||
#4 0x7fbcb3ea66c7 (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0xaa6c7)
|
||||
#5 0x7fbcb3e512b2 in g_main_loop_run (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x552b2)
|
||||
#6 0x559644754ab6 in mainloop_run src/shared/mainloop-glib.c:66
|
||||
#7 0x559644755606 in mainloop_run_with_signal src/shared/mainloop-notify.c:188
|
||||
#8 0x5596445bb963 in main src/main.c:1289
|
||||
#9 0x7fbcb3bafd8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
|
||||
#10 0x7fbcb3bafe3f in __libc_start_main_impl ../csu/libc-start.c:392
|
||||
#11 0x5596444e8224 in _start (/usr/local/libexec/bluetooth/bluetoothd+0xf0224)
|
||||
|
||||
Upstream-Status: Backport [https://github.com/bluez/bluez/commit/f54299a850676d92c3dafd83e9174fcfe420ccc9]
|
||||
CVE: CVE-2023-27349
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
profiles/audio/avrcp.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
|
||||
index 80f34c7a77..dda9a303fb 100644
|
||||
--- a/profiles/audio/avrcp.c
|
||||
+++ b/profiles/audio/avrcp.c
|
||||
@@ -3901,6 +3901,12 @@ static gboolean avrcp_handle_event(struct avctp *conn, uint8_t code,
|
||||
case AVRCP_EVENT_UIDS_CHANGED:
|
||||
avrcp_uids_changed(session, pdu);
|
||||
break;
|
||||
+ default:
|
||||
+ if (event > AVRCP_EVENT_LAST) {
|
||||
+ warn("Unsupported event: %u", event);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ break;
|
||||
}
|
||||
|
||||
session->registered_events |= (1 << event);
|
||||
@@ -0,0 +1,67 @@
|
||||
From 5ab5352531a9cc7058cce569607f3a6831464443 Mon Sep 17 00:00:00 2001
|
||||
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
|
||||
Date: Tue, 19 Sep 2023 12:14:01 -0700
|
||||
Subject: [PATCH] pbap: Fix not checking Primary/Secundary Counter length
|
||||
|
||||
Primary/Secundary Counters are supposed to be 16 bytes values, if the
|
||||
server has implemented them incorrectly it may lead to the following
|
||||
crash:
|
||||
|
||||
=================================================================
|
||||
==31860==ERROR: AddressSanitizer: heap-buffer-overflow on address
|
||||
0x607000001878 at pc 0x7f95a1575638 bp 0x7fff58c6bb80 sp 0x7fff58c6b328
|
||||
|
||||
READ of size 48 at 0x607000001878 thread T0
|
||||
#0 0x7f95a1575637 in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long) ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:860
|
||||
#1 0x7f95a1575ba6 in __interceptor_memcmp ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:892
|
||||
#2 0x7f95a1575ba6 in __interceptor_memcmp ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:887
|
||||
#3 0x564df69c77a0 in read_version obexd/client/pbap.c:288
|
||||
#4 0x564df69c77a0 in read_return_apparam obexd/client/pbap.c:352
|
||||
#5 0x564df69c77a0 in phonebook_size_callback obexd/client/pbap.c:374
|
||||
#6 0x564df69bea3c in session_terminate_transfer obexd/client/session.c:921
|
||||
#7 0x564df69d56b0 in get_xfer_progress_first obexd/client/transfer.c:729
|
||||
#8 0x564df698b9ee in handle_response gobex/gobex.c:1140
|
||||
#9 0x564df698cdea in incoming_data gobex/gobex.c:1385
|
||||
#10 0x7f95a12fdc43 in g_main_context_dispatch (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55c43)
|
||||
#11 0x7f95a13526c7 (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0xaa6c7)
|
||||
#12 0x7f95a12fd2b2 in g_main_loop_run (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x552b2)
|
||||
#13 0x564df6977d41 in main obexd/src/main.c:307
|
||||
#14 0x7f95a10a7d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
|
||||
#15 0x7f95a10a7e3f in __libc_start_main_impl ../csu/libc-start.c:392
|
||||
#16 0x564df6978704 in _start (/usr/local/libexec/bluetooth/obexd+0x8b704)
|
||||
0x607000001878 is located 0 bytes to the right of 72-byte region [0x607000001830,0x607000001878)
|
||||
|
||||
allocated by thread T0 here:
|
||||
#0 0x7f95a1595a37 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
|
||||
#1 0x564df69c8b6a in pbap_probe obexd/client/pbap.c:1259
|
||||
|
||||
Upstream-Status: Backport [https://github.com/bluez/bluez/commit/5ab5352531a9cc7058cce569607f3a6831464443]
|
||||
CVE: CVE-2023-50229 CVE-2023-50230
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
obexd/client/pbap.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c
|
||||
index 1ed8c68ecc..2d2aa95089 100644
|
||||
--- a/obexd/client/pbap.c
|
||||
+++ b/obexd/client/pbap.c
|
||||
@@ -285,7 +285,7 @@ static void read_version(struct pbap_data *pbap, GObexApparam *apparam)
|
||||
data = value;
|
||||
}
|
||||
|
||||
- if (memcmp(pbap->primary, data, len)) {
|
||||
+ if (len == sizeof(pbap->primary) && memcmp(pbap->primary, data, len)) {
|
||||
memcpy(pbap->primary, data, len);
|
||||
g_dbus_emit_property_changed(conn,
|
||||
obc_session_get_path(pbap->session),
|
||||
@@ -299,7 +299,8 @@ static void read_version(struct pbap_data *pbap, GObexApparam *apparam)
|
||||
data = value;
|
||||
}
|
||||
|
||||
- if (memcmp(pbap->secondary, data, len)) {
|
||||
+ if (len == sizeof(pbap->secondary) &&
|
||||
+ memcmp(pbap->secondary, data, len)) {
|
||||
memcpy(pbap->secondary, data, len);
|
||||
g_dbus_emit_property_changed(conn,
|
||||
obc_session_get_path(pbap->session),
|
||||
32
meta/recipes-connectivity/ofono/ofono/CVE-2023-4233.patch
Normal file
32
meta/recipes-connectivity/ofono/ofono/CVE-2023-4233.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
From 1a5fbefa59465bec80425add562bdb1d36ec8e23 Mon Sep 17 00:00:00 2001
|
||||
From: Denis Grigorev <d.grigorev@omp.ru>
|
||||
Date: Fri, 29 Dec 2023 13:30:04 +0300
|
||||
Subject: [PATCH] smsutil: Validate the length of the address field
|
||||
|
||||
This addresses CVE-2023-4233.
|
||||
|
||||
CVE: CVE-2023-4233
|
||||
|
||||
Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=1a5fbefa59465bec]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
src/smsutil.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/smsutil.c b/src/smsutil.c
|
||||
index 5a12708..8dd2126 100644
|
||||
--- a/src/smsutil.c
|
||||
+++ b/src/smsutil.c
|
||||
@@ -626,6 +626,9 @@ gboolean sms_decode_address_field(const unsigned char *pdu, int len,
|
||||
|
||||
if (!next_octet(pdu, len, offset, &addr_len))
|
||||
return FALSE;
|
||||
+ /* According to 23.040 9.1.2.5 Address-Length must not exceed 20 */
|
||||
+ if (addr_len > 20)
|
||||
+ return FALSE;
|
||||
|
||||
if (sc && addr_len == 0) {
|
||||
out->address[0] = '\0';
|
||||
--
|
||||
2.40.0
|
||||
39
meta/recipes-connectivity/ofono/ofono/CVE-2023-4234.patch
Normal file
39
meta/recipes-connectivity/ofono/ofono/CVE-2023-4234.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
From 8d74bc66146ea78620d140640a0a57af86fc8936 Mon Sep 17 00:00:00 2001
|
||||
From: Denis Grigorev <d.grigorev@omp.ru>
|
||||
Date: Thu, 21 Dec 2023 17:16:38 +0300
|
||||
Subject: [PATCH] smsutil: Check that submit report fits in memory
|
||||
|
||||
This addresses CVE-2023-4234.
|
||||
|
||||
CVE: CVE-2023-4234.
|
||||
|
||||
Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=8d74bc66146ea786]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
src/smsutil.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/smsutil.c b/src/smsutil.c
|
||||
index 8e57a06..5a12708 100644
|
||||
--- a/src/smsutil.c
|
||||
+++ b/src/smsutil.c
|
||||
@@ -938,10 +938,16 @@ static gboolean decode_submit_report(const unsigned char *pdu, int len,
|
||||
return FALSE;
|
||||
|
||||
if (out->type == SMS_TYPE_SUBMIT_REPORT_ERROR) {
|
||||
+ if (expected > (int) sizeof(out->submit_err_report.ud))
|
||||
+ return FALSE;
|
||||
+
|
||||
out->submit_err_report.udl = udl;
|
||||
memcpy(out->submit_err_report.ud,
|
||||
pdu + offset, expected);
|
||||
} else {
|
||||
+ if (expected > (int) sizeof(out->submit_ack_report.ud))
|
||||
+ return FALSE;
|
||||
+
|
||||
out->submit_ack_report.udl = udl;
|
||||
memcpy(out->submit_ack_report.ud,
|
||||
pdu + offset, expected);
|
||||
--
|
||||
2.40.0
|
||||
@@ -12,6 +12,8 @@ SRC_URI = "\
|
||||
file://ofono \
|
||||
file://0001-mbim-add-an-optional-TEMP_FAILURE_RETRY-macro-copy.patch \
|
||||
file://0002-mbim-Fix-build-with-ell-0.39-by-restoring-unlikely-m.patch \
|
||||
file://CVE-2023-4234.patch \
|
||||
file://CVE-2023-4233.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "c0b96d3013447ec2bcb74579bef90e4e59c68dbfa4b9c6fbce5d12401a43aac7"
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
Description: fix signal handler race condition
|
||||
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/2070497
|
||||
|
||||
CVE: CVE-2024-6387
|
||||
|
||||
Upstream-Status: Backport
|
||||
https://git.launchpad.net/ubuntu/+source/openssh/commit/?h=applied/ubuntu/jammy-devel&id=b059bcfa928df4ff2d103ae2e8f4e3136ee03efc
|
||||
|
||||
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
|
||||
|
||||
--- a/log.c
|
||||
+++ b/log.c
|
||||
@@ -452,12 +452,14 @@ void
|
||||
sshsigdie(const char *file, const char *func, int line, int showfunc,
|
||||
LogLevel level, const char *suffix, const char *fmt, ...)
|
||||
{
|
||||
+#if 0
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
sshlogv(file, func, line, showfunc, SYSLOG_LEVEL_FATAL,
|
||||
suffix, fmt, args);
|
||||
va_end(args);
|
||||
+#endif
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
|
||||
file://CVE-2023-48795.patch \
|
||||
file://CVE-2023-51384.patch \
|
||||
file://CVE-2023-51385.patch \
|
||||
file://CVE-2024-6387.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "fd497654b7ab1686dac672fb83dfb4ba4096e8b5ffcdaccd262380ae58bec5e7"
|
||||
|
||||
@@ -49,6 +50,11 @@ CVE_CHECK_IGNORE += "CVE-2014-9278"
|
||||
# CVE only applies to some distributed RHEL binaries
|
||||
CVE_CHECK_IGNORE += "CVE-2008-3844"
|
||||
|
||||
# Upstream does not consider CVE-2023-51767 a bug underlying in OpenSSH and
|
||||
# does not intent to address it in OpenSSH
|
||||
# https://security-tracker.debian.org/tracker/CVE-2023-51767
|
||||
CVE_CHECK_IGNORE += "CVE-2023-51767"
|
||||
|
||||
PAM_SRC_URI = "file://sshd"
|
||||
|
||||
inherit manpages useradd update-rc.d update-alternatives systemd
|
||||
|
||||
115
meta/recipes-connectivity/openssl/openssl/CVE-2024-5535_1.patch
Normal file
115
meta/recipes-connectivity/openssl/openssl/CVE-2024-5535_1.patch
Normal file
@@ -0,0 +1,115 @@
|
||||
From e6190fc977f086428cc7880f95e8bcd5a11ac193 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Caswell <matt@openssl.org>
|
||||
Date: Fri, 31 May 2024 11:14:33 +0100
|
||||
Subject: [PATCH 1/9] Fix SSL_select_next_proto
|
||||
|
||||
Ensure that the provided client list is non-NULL and starts with a valid
|
||||
entry. When called from the ALPN callback the client list should already
|
||||
have been validated by OpenSSL so this should not cause a problem. When
|
||||
called from the NPN callback the client list is locally configured and
|
||||
will not have already been validated. Therefore SSL_select_next_proto
|
||||
should not assume that it is correctly formatted.
|
||||
|
||||
We implement stricter checking of the client protocol list. We also do the
|
||||
same for the server list while we are about it.
|
||||
|
||||
CVE-2024-5535
|
||||
|
||||
Reviewed-by: Neil Horman <nhorman@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/24718)
|
||||
|
||||
(cherry picked from commit 4ada436a1946cbb24db5ab4ca082b69c1bc10f37)
|
||||
|
||||
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/cf6f91f6121f4db167405db2f0de410a456f260c]
|
||||
CVE: CVE-2024-5535
|
||||
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
|
||||
---
|
||||
ssl/ssl_lib.c | 63 ++++++++++++++++++++++++++++++++-------------------
|
||||
1 file changed, 40 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
|
||||
index cb4e006..e628140 100644
|
||||
--- a/ssl/ssl_lib.c
|
||||
+++ b/ssl/ssl_lib.c
|
||||
@@ -2952,37 +2952,54 @@ int SSL_select_next_proto(unsigned char **out, unsigned char *outlen,
|
||||
unsigned int server_len,
|
||||
const unsigned char *client, unsigned int client_len)
|
||||
{
|
||||
- unsigned int i, j;
|
||||
- const unsigned char *result;
|
||||
- int status = OPENSSL_NPN_UNSUPPORTED;
|
||||
+ PACKET cpkt, csubpkt, spkt, ssubpkt;
|
||||
+
|
||||
+ if (!PACKET_buf_init(&cpkt, client, client_len)
|
||||
+ || !PACKET_get_length_prefixed_1(&cpkt, &csubpkt)
|
||||
+ || PACKET_remaining(&csubpkt) == 0) {
|
||||
+ *out = NULL;
|
||||
+ *outlen = 0;
|
||||
+ return OPENSSL_NPN_NO_OVERLAP;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Set the default opportunistic protocol. Will be overwritten if we find
|
||||
+ * a match.
|
||||
+ */
|
||||
+ *out = (unsigned char *)PACKET_data(&csubpkt);
|
||||
+ *outlen = (unsigned char)PACKET_remaining(&csubpkt);
|
||||
|
||||
/*
|
||||
* For each protocol in server preference order, see if we support it.
|
||||
*/
|
||||
- for (i = 0; i < server_len;) {
|
||||
- for (j = 0; j < client_len;) {
|
||||
- if (server[i] == client[j] &&
|
||||
- memcmp(&server[i + 1], &client[j + 1], server[i]) == 0) {
|
||||
- /* We found a match */
|
||||
- result = &server[i];
|
||||
- status = OPENSSL_NPN_NEGOTIATED;
|
||||
- goto found;
|
||||
+ if (PACKET_buf_init(&spkt, server, server_len)) {
|
||||
+ while (PACKET_get_length_prefixed_1(&spkt, &ssubpkt)) {
|
||||
+ if (PACKET_remaining(&ssubpkt) == 0)
|
||||
+ continue; /* Invalid - ignore it */
|
||||
+ if (PACKET_buf_init(&cpkt, client, client_len)) {
|
||||
+ while (PACKET_get_length_prefixed_1(&cpkt, &csubpkt)) {
|
||||
+ if (PACKET_equal(&csubpkt, PACKET_data(&ssubpkt),
|
||||
+ PACKET_remaining(&ssubpkt))) {
|
||||
+ /* We found a match */
|
||||
+ *out = (unsigned char *)PACKET_data(&ssubpkt);
|
||||
+ *outlen = (unsigned char)PACKET_remaining(&ssubpkt);
|
||||
+ return OPENSSL_NPN_NEGOTIATED;
|
||||
+ }
|
||||
+ }
|
||||
+ /* Ignore spurious trailing bytes in the client list */
|
||||
+ } else {
|
||||
+ /* This should never happen */
|
||||
+ return OPENSSL_NPN_NO_OVERLAP;
|
||||
}
|
||||
- j += client[j];
|
||||
- j++;
|
||||
}
|
||||
- i += server[i];
|
||||
- i++;
|
||||
+ /* Ignore spurious trailing bytes in the server list */
|
||||
}
|
||||
|
||||
- /* There's no overlap between our protocols and the server's list. */
|
||||
- result = client;
|
||||
- status = OPENSSL_NPN_NO_OVERLAP;
|
||||
-
|
||||
- found:
|
||||
- *out = (unsigned char *)result + 1;
|
||||
- *outlen = result[0];
|
||||
- return status;
|
||||
+ /*
|
||||
+ * There's no overlap between our protocols and the server's list. We use
|
||||
+ * the default opportunistic protocol selected earlier
|
||||
+ */
|
||||
+ return OPENSSL_NPN_NO_OVERLAP;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_NEXTPROTONEG
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
From 4a96c6b7265838b044dab4a2a6150c246297bc89 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Caswell <matt@openssl.org>
|
||||
Date: Fri, 31 May 2024 11:18:27 +0100
|
||||
Subject: [PATCH 2/9] More correctly handle a selected_len of 0 when processing
|
||||
NPN
|
||||
|
||||
In the case where the NPN callback returns with SSL_TLEXT_ERR_OK, but
|
||||
the selected_len is 0 we should fail. Previously this would fail with an
|
||||
internal_error alert because calling OPENSSL_malloc(selected_len) will
|
||||
return NULL when selected_len is 0. We make this error detection more
|
||||
explicit and return a handshake failure alert.
|
||||
|
||||
Follow on from CVE-2024-5535
|
||||
|
||||
Reviewed-by: Neil Horman <nhorman@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/24718)
|
||||
|
||||
(cherry picked from commit 4279c89a726025c758db3dafb263b17e52211304)
|
||||
|
||||
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/159921152fd4aa91e4c849fd281ad93ac0d0d0ba]
|
||||
CVE: CVE-2024-5535
|
||||
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
|
||||
---
|
||||
ssl/statem/extensions_clnt.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ssl/statem/extensions_clnt.c b/ssl/statem/extensions_clnt.c
|
||||
index 842be07..a07dc62 100644
|
||||
--- a/ssl/statem/extensions_clnt.c
|
||||
+++ b/ssl/statem/extensions_clnt.c
|
||||
@@ -1536,7 +1536,8 @@ int tls_parse_stoc_npn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
||||
PACKET_data(pkt),
|
||||
PACKET_remaining(pkt),
|
||||
s->ctx->ext.npn_select_cb_arg) !=
|
||||
- SSL_TLSEXT_ERR_OK) {
|
||||
+ SSL_TLSEXT_ERR_OK
|
||||
+ || selected_len == 0) {
|
||||
SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, SSL_R_BAD_EXTENSION);
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
From 6887608f77236d14b0789f4b1c14df53dfe2d618 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Caswell <matt@openssl.org>
|
||||
Date: Fri, 31 May 2024 11:46:38 +0100
|
||||
Subject: [PATCH 3/9] Clarify the SSL_select_next_proto() documentation
|
||||
|
||||
We clarify the input preconditions and the expected behaviour in the event
|
||||
of no overlap.
|
||||
|
||||
Follow on from CVE-2024-5535
|
||||
|
||||
Reviewed-by: Neil Horman <nhorman@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/24718)
|
||||
|
||||
(cherry picked from commit 889ed19ba25abebd2690997acd6d4791cbe5c493)
|
||||
|
||||
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/7a9f521b1de96e79184948e5813e791e608cc94b]
|
||||
CVE: CVE-2024-5535
|
||||
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
|
||||
---
|
||||
doc/man3/SSL_CTX_set_alpn_select_cb.pod | 26 +++++++++++++++++--------
|
||||
1 file changed, 18 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/doc/man3/SSL_CTX_set_alpn_select_cb.pod b/doc/man3/SSL_CTX_set_alpn_select_cb.pod
|
||||
index 102e657..a29557d 100644
|
||||
--- a/doc/man3/SSL_CTX_set_alpn_select_cb.pod
|
||||
+++ b/doc/man3/SSL_CTX_set_alpn_select_cb.pod
|
||||
@@ -52,7 +52,8 @@ SSL_select_next_proto, SSL_get0_alpn_selected, SSL_get0_next_proto_negotiated
|
||||
SSL_CTX_set_alpn_protos() and SSL_set_alpn_protos() are used by the client to
|
||||
set the list of protocols available to be negotiated. The B<protos> must be in
|
||||
protocol-list format, described below. The length of B<protos> is specified in
|
||||
-B<protos_len>.
|
||||
+B<protos_len>. Setting B<protos_len> to 0 clears any existing list of ALPN
|
||||
+protocols and no ALPN extension will be sent to the server.
|
||||
|
||||
SSL_CTX_set_alpn_select_cb() sets the application callback B<cb> used by a
|
||||
server to select which protocol to use for the incoming connection. When B<cb>
|
||||
@@ -73,9 +74,16 @@ B<server_len> and B<client>, B<client_len> must be in the protocol-list format
|
||||
described below. The first item in the B<server>, B<server_len> list that
|
||||
matches an item in the B<client>, B<client_len> list is selected, and returned
|
||||
in B<out>, B<outlen>. The B<out> value will point into either B<server> or
|
||||
-B<client>, so it should be copied immediately. If no match is found, the first
|
||||
-item in B<client>, B<client_len> is returned in B<out>, B<outlen>. This
|
||||
-function can also be used in the NPN callback.
|
||||
+B<client>, so it should be copied immediately. The client list must include at
|
||||
+least one valid (nonempty) protocol entry in the list.
|
||||
+
|
||||
+The SSL_select_next_proto() helper function can be useful from either the ALPN
|
||||
+callback or the NPN callback (described below). If no match is found, the first
|
||||
+item in B<client>, B<client_len> is returned in B<out>, B<outlen> and
|
||||
+B<OPENSSL_NPN_NO_OVERLAP> is returned. This can be useful when implementating
|
||||
+the NPN callback. In the ALPN case, the value returned in B<out> and B<outlen>
|
||||
+must be ignored if B<OPENSSL_NPN_NO_OVERLAP> has been returned from
|
||||
+SSL_select_next_proto().
|
||||
|
||||
SSL_CTX_set_next_proto_select_cb() sets a callback B<cb> that is called when a
|
||||
client needs to select a protocol from the server's provided list, and a
|
||||
@@ -85,9 +93,10 @@ must be set to point to the selected protocol (which may be within B<in>).
|
||||
The length of the protocol name must be written into B<outlen>. The
|
||||
server's advertised protocols are provided in B<in> and B<inlen>. The
|
||||
callback can assume that B<in> is syntactically valid. The client must
|
||||
-select a protocol. It is fatal to the connection if this callback returns
|
||||
-a value other than B<SSL_TLSEXT_ERR_OK>. The B<arg> parameter is the pointer
|
||||
-set via SSL_CTX_set_next_proto_select_cb().
|
||||
+select a protocol (although it may be an empty, zero length protocol). It is
|
||||
+fatal to the connection if this callback returns a value other than
|
||||
+B<SSL_TLSEXT_ERR_OK> or if the zero length protocol is selected. The B<arg>
|
||||
+parameter is the pointer set via SSL_CTX_set_next_proto_select_cb().
|
||||
|
||||
SSL_CTX_set_next_protos_advertised_cb() sets a callback B<cb> that is called
|
||||
when a TLS server needs a list of supported protocols for Next Protocol
|
||||
@@ -149,7 +158,8 @@ A match was found and is returned in B<out>, B<outlen>.
|
||||
=item OPENSSL_NPN_NO_OVERLAP
|
||||
|
||||
No match was found. The first item in B<client>, B<client_len> is returned in
|
||||
-B<out>, B<outlen>.
|
||||
+B<out>, B<outlen> (or B<NULL> and 0 in the case where the first entry in
|
||||
+B<client> is invalid).
|
||||
|
||||
=back
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
178
meta/recipes-connectivity/openssl/openssl/CVE-2024-5535_4.patch
Normal file
178
meta/recipes-connectivity/openssl/openssl/CVE-2024-5535_4.patch
Normal file
@@ -0,0 +1,178 @@
|
||||
From 6f9e71968f1f5e089bf79b0925e703a16f7bfa19 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Caswell <matt@openssl.org>
|
||||
Date: Fri, 31 May 2024 16:35:16 +0100
|
||||
Subject: [PATCH 4/9] Add a test for SSL_select_next_proto
|
||||
|
||||
Follow on from CVE-2024-5535
|
||||
|
||||
Reviewed-by: Neil Horman <nhorman@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/24718)
|
||||
|
||||
(cherry picked from commit ad1318efa2cfdf43ed49d23c4a815f4754604b97)
|
||||
|
||||
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/707c71aa03ba968e09325d72cf1e8dcac70df2df]
|
||||
CVE: CVE-2024-5535
|
||||
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
|
||||
---
|
||||
test/sslapitest.c | 137 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 137 insertions(+)
|
||||
|
||||
diff --git a/test/sslapitest.c b/test/sslapitest.c
|
||||
index 2b1c2fd..3922262 100644
|
||||
--- a/test/sslapitest.c
|
||||
+++ b/test/sslapitest.c
|
||||
@@ -10765,6 +10765,142 @@ static int test_multi_resume(int idx)
|
||||
return testresult;
|
||||
}
|
||||
|
||||
+static struct next_proto_st {
|
||||
+ int serverlen;
|
||||
+ unsigned char server[40];
|
||||
+ int clientlen;
|
||||
+ unsigned char client[40];
|
||||
+ int expected_ret;
|
||||
+ size_t selectedlen;
|
||||
+ unsigned char selected[40];
|
||||
+} next_proto_tests[] = {
|
||||
+ {
|
||||
+ 4, { 3, 'a', 'b', 'c' },
|
||||
+ 4, { 3, 'a', 'b', 'c' },
|
||||
+ OPENSSL_NPN_NEGOTIATED,
|
||||
+ 3, { 'a', 'b', 'c' }
|
||||
+ },
|
||||
+ {
|
||||
+ 7, { 3, 'a', 'b', 'c', 2, 'a', 'b' },
|
||||
+ 4, { 3, 'a', 'b', 'c' },
|
||||
+ OPENSSL_NPN_NEGOTIATED,
|
||||
+ 3, { 'a', 'b', 'c' }
|
||||
+ },
|
||||
+ {
|
||||
+ 7, { 2, 'a', 'b', 3, 'a', 'b', 'c', },
|
||||
+ 4, { 3, 'a', 'b', 'c' },
|
||||
+ OPENSSL_NPN_NEGOTIATED,
|
||||
+ 3, { 'a', 'b', 'c' }
|
||||
+ },
|
||||
+ {
|
||||
+ 4, { 3, 'a', 'b', 'c' },
|
||||
+ 7, { 3, 'a', 'b', 'c', 2, 'a', 'b', },
|
||||
+ OPENSSL_NPN_NEGOTIATED,
|
||||
+ 3, { 'a', 'b', 'c' }
|
||||
+ },
|
||||
+ {
|
||||
+ 4, { 3, 'a', 'b', 'c' },
|
||||
+ 7, { 2, 'a', 'b', 3, 'a', 'b', 'c'},
|
||||
+ OPENSSL_NPN_NEGOTIATED,
|
||||
+ 3, { 'a', 'b', 'c' }
|
||||
+ },
|
||||
+ {
|
||||
+ 7, { 2, 'b', 'c', 3, 'a', 'b', 'c' },
|
||||
+ 7, { 2, 'a', 'b', 3, 'a', 'b', 'c'},
|
||||
+ OPENSSL_NPN_NEGOTIATED,
|
||||
+ 3, { 'a', 'b', 'c' }
|
||||
+ },
|
||||
+ {
|
||||
+ 10, { 2, 'b', 'c', 3, 'a', 'b', 'c', 2, 'a', 'b' },
|
||||
+ 7, { 2, 'a', 'b', 3, 'a', 'b', 'c'},
|
||||
+ OPENSSL_NPN_NEGOTIATED,
|
||||
+ 3, { 'a', 'b', 'c' }
|
||||
+ },
|
||||
+ {
|
||||
+ 4, { 3, 'b', 'c', 'd' },
|
||||
+ 4, { 3, 'a', 'b', 'c' },
|
||||
+ OPENSSL_NPN_NO_OVERLAP,
|
||||
+ 3, { 'a', 'b', 'c' }
|
||||
+ },
|
||||
+ {
|
||||
+ 0, { 0 },
|
||||
+ 4, { 3, 'a', 'b', 'c' },
|
||||
+ OPENSSL_NPN_NO_OVERLAP,
|
||||
+ 3, { 'a', 'b', 'c' }
|
||||
+ },
|
||||
+ {
|
||||
+ -1, { 0 },
|
||||
+ 4, { 3, 'a', 'b', 'c' },
|
||||
+ OPENSSL_NPN_NO_OVERLAP,
|
||||
+ 3, { 'a', 'b', 'c' }
|
||||
+ },
|
||||
+ {
|
||||
+ 4, { 3, 'a', 'b', 'c' },
|
||||
+ 0, { 0 },
|
||||
+ OPENSSL_NPN_NO_OVERLAP,
|
||||
+ 0, { 0 }
|
||||
+ },
|
||||
+ {
|
||||
+ 4, { 3, 'a', 'b', 'c' },
|
||||
+ -1, { 0 },
|
||||
+ OPENSSL_NPN_NO_OVERLAP,
|
||||
+ 0, { 0 }
|
||||
+ },
|
||||
+ {
|
||||
+ 3, { 3, 'a', 'b', 'c' },
|
||||
+ 4, { 3, 'a', 'b', 'c' },
|
||||
+ OPENSSL_NPN_NO_OVERLAP,
|
||||
+ 3, { 'a', 'b', 'c' }
|
||||
+ },
|
||||
+ {
|
||||
+ 4, { 3, 'a', 'b', 'c' },
|
||||
+ 3, { 3, 'a', 'b', 'c' },
|
||||
+ OPENSSL_NPN_NO_OVERLAP,
|
||||
+ 0, { 0 }
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static int test_select_next_proto(int idx)
|
||||
+{
|
||||
+ struct next_proto_st *np = &next_proto_tests[idx];
|
||||
+ int ret = 0;
|
||||
+ unsigned char *out, *client, *server;
|
||||
+ unsigned char outlen;
|
||||
+ unsigned int clientlen, serverlen;
|
||||
+
|
||||
+ if (np->clientlen == -1) {
|
||||
+ client = NULL;
|
||||
+ clientlen = 0;
|
||||
+ } else {
|
||||
+ client = np->client;
|
||||
+ clientlen = (unsigned int)np->clientlen;
|
||||
+ }
|
||||
+ if (np->serverlen == -1) {
|
||||
+ server = NULL;
|
||||
+ serverlen = 0;
|
||||
+ } else {
|
||||
+ server = np->server;
|
||||
+ serverlen = (unsigned int)np->serverlen;
|
||||
+ }
|
||||
+
|
||||
+ if (!TEST_int_eq(SSL_select_next_proto(&out, &outlen, server, serverlen,
|
||||
+ client, clientlen),
|
||||
+ np->expected_ret))
|
||||
+ goto err;
|
||||
+
|
||||
+ if (np->selectedlen == 0) {
|
||||
+ if (!TEST_ptr_null(out) || !TEST_uchar_eq(outlen, 0))
|
||||
+ goto err;
|
||||
+ } else {
|
||||
+ if (!TEST_mem_eq(out, outlen, np->selected, np->selectedlen))
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ ret = 1;
|
||||
+ err:
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
OPT_TEST_DECLARE_USAGE("certfile privkeyfile srpvfile tmpfile provider config dhfile\n")
|
||||
|
||||
int setup_tests(void)
|
||||
@@ -11041,6 +11177,7 @@ int setup_tests(void)
|
||||
#endif
|
||||
ADD_ALL_TESTS(test_handshake_retry, 16);
|
||||
ADD_ALL_TESTS(test_multi_resume, 5);
|
||||
+ ADD_ALL_TESTS(test_select_next_proto, OSSL_NELEM(next_proto_tests));
|
||||
return 1;
|
||||
|
||||
err:
|
||||
--
|
||||
2.25.1
|
||||
|
||||
1175
meta/recipes-connectivity/openssl/openssl/CVE-2024-5535_5.patch
Normal file
1175
meta/recipes-connectivity/openssl/openssl/CVE-2024-5535_5.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,45 @@
|
||||
From a8c0ee154d212284f82680275de63642d914365e Mon Sep 17 00:00:00 2001
|
||||
From: Matt Caswell <matt@openssl.org>
|
||||
Date: Fri, 21 Jun 2024 10:41:55 +0100
|
||||
Subject: [PATCH 6/9] Correct return values for
|
||||
tls_construct_stoc_next_proto_neg
|
||||
|
||||
Return EXT_RETURN_NOT_SENT in the event that we don't send the extension,
|
||||
rather than EXT_RETURN_SENT. This actually makes no difference at all to
|
||||
the current control flow since this return value is ignored in this case
|
||||
anyway. But lets make it correct anyway.
|
||||
|
||||
Follow on from CVE-2024-5535
|
||||
|
||||
Reviewed-by: Neil Horman <nhorman@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/24718)
|
||||
|
||||
(cherry picked from commit 087501b4f572825e27ca8cc2c5874fcf6fd47cf7)
|
||||
|
||||
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/189a7ed3e380e34ea38fe4190a7c9396bace0fb7]
|
||||
CVE: CVE-2024-5535
|
||||
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
|
||||
---
|
||||
ssl/statem/extensions_srvr.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ssl/statem/extensions_srvr.c b/ssl/statem/extensions_srvr.c
|
||||
index 1fab5a3..51ea74b 100644
|
||||
--- a/ssl/statem/extensions_srvr.c
|
||||
+++ b/ssl/statem/extensions_srvr.c
|
||||
@@ -1471,9 +1471,10 @@ EXT_RETURN tls_construct_stoc_next_proto_neg(SSL *s, WPACKET *pkt,
|
||||
return EXT_RETURN_FAIL;
|
||||
}
|
||||
s->s3.npn_seen = 1;
|
||||
+ return EXT_RETURN_SENT;
|
||||
}
|
||||
|
||||
- return EXT_RETURN_SENT;
|
||||
+ return EXT_RETURN_NOT_SENT;
|
||||
}
|
||||
#endif
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
From fa5cc5eb58a4c9632929397fc9a6c291fff1b99d Mon Sep 17 00:00:00 2001
|
||||
From: Matt Caswell <matt@openssl.org>
|
||||
Date: Fri, 21 Jun 2024 11:51:54 +0100
|
||||
Subject: [PATCH 7/9] Add ALPN validation in the client
|
||||
|
||||
The ALPN protocol selected by the server must be one that we originally
|
||||
advertised. We should verify that it is.
|
||||
|
||||
Follow on from CVE-2024-5535
|
||||
|
||||
Reviewed-by: Neil Horman <nhorman@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/24718)
|
||||
|
||||
(cherry picked from commit 017e54183b95617825fb9316d618c154a34c634e)
|
||||
|
||||
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/4b375b998798dd516d367036773073e1b88e6433]
|
||||
CVE: CVE-2024-5535
|
||||
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
|
||||
---
|
||||
ssl/statem/extensions_clnt.c | 24 ++++++++++++++++++++++++
|
||||
1 file changed, 24 insertions(+)
|
||||
|
||||
diff --git a/ssl/statem/extensions_clnt.c b/ssl/statem/extensions_clnt.c
|
||||
index a07dc62..b21ccf9 100644
|
||||
--- a/ssl/statem/extensions_clnt.c
|
||||
+++ b/ssl/statem/extensions_clnt.c
|
||||
@@ -1566,6 +1566,8 @@ int tls_parse_stoc_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
||||
size_t chainidx)
|
||||
{
|
||||
size_t len;
|
||||
+ PACKET confpkt, protpkt;
|
||||
+ int valid = 0;
|
||||
|
||||
/* We must have requested it. */
|
||||
if (!s->s3.alpn_sent) {
|
||||
@@ -1584,6 +1586,28 @@ int tls_parse_stoc_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
||||
SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
|
||||
return 0;
|
||||
}
|
||||
+
|
||||
+ /* It must be a protocol that we sent */
|
||||
+ if (!PACKET_buf_init(&confpkt, s->ext.alpn, s->ext.alpn_len)) {
|
||||
+ SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ while (PACKET_get_length_prefixed_1(&confpkt, &protpkt)) {
|
||||
+ if (PACKET_remaining(&protpkt) != len)
|
||||
+ continue;
|
||||
+ if (memcmp(PACKET_data(pkt), PACKET_data(&protpkt), len) == 0) {
|
||||
+ /* Valid protocol found */
|
||||
+ valid = 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!valid) {
|
||||
+ /* The protocol sent from the server does not match one we advertised */
|
||||
+ SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
OPENSSL_free(s->s3.alpn_selected);
|
||||
s->s3.alpn_selected = OPENSSL_malloc(len);
|
||||
if (s->s3.alpn_selected == NULL) {
|
||||
--
|
||||
2.25.1
|
||||
|
||||
273
meta/recipes-connectivity/openssl/openssl/CVE-2024-5535_8.patch
Normal file
273
meta/recipes-connectivity/openssl/openssl/CVE-2024-5535_8.patch
Normal file
@@ -0,0 +1,273 @@
|
||||
From b898db2b91751a52d2af699e674a80a6b218084d Mon Sep 17 00:00:00 2001
|
||||
From: Matt Caswell <matt@openssl.org>
|
||||
Date: Fri, 21 Jun 2024 10:09:41 +0100
|
||||
Subject: [PATCH 8/9] Add explicit testing of ALN and NPN in sslapitest
|
||||
|
||||
We already had some tests elsewhere - but this extends that testing with
|
||||
additional tests.
|
||||
|
||||
Follow on from CVE-2024-5535
|
||||
|
||||
Reviewed-by: Neil Horman <nhorman@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/24718)
|
||||
|
||||
(cherry picked from commit 0453bf5a7ac60ab01c8bb713d8cc2a94324aa88c)
|
||||
|
||||
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/ca176d7291eb780e4ed2781342f5be5a32210a68]
|
||||
CVE: CVE-2024-5535
|
||||
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
|
||||
---
|
||||
test/sslapitest.c | 229 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 229 insertions(+)
|
||||
|
||||
diff --git a/test/sslapitest.c b/test/sslapitest.c
|
||||
index 3922262..171298b 100644
|
||||
--- a/test/sslapitest.c
|
||||
+++ b/test/sslapitest.c
|
||||
@@ -10901,6 +10901,231 @@ static int test_select_next_proto(int idx)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static const unsigned char fooprot[] = {3, 'f', 'o', 'o' };
|
||||
+static const unsigned char barprot[] = {3, 'b', 'a', 'r' };
|
||||
+
|
||||
+#if !defined(OPENSSL_NO_TLS1_2) && !defined(OPENSSL_NO_NEXTPROTONEG)
|
||||
+static int npn_advert_cb(SSL *ssl, const unsigned char **out,
|
||||
+ unsigned int *outlen, void *arg)
|
||||
+{
|
||||
+ int *idx = (int *)arg;
|
||||
+
|
||||
+ switch (*idx) {
|
||||
+ default:
|
||||
+ case 0:
|
||||
+ *out = fooprot;
|
||||
+ *outlen = sizeof(fooprot);
|
||||
+ return SSL_TLSEXT_ERR_OK;
|
||||
+
|
||||
+ case 1:
|
||||
+ *outlen = 0;
|
||||
+ return SSL_TLSEXT_ERR_OK;
|
||||
+
|
||||
+ case 2:
|
||||
+ return SSL_TLSEXT_ERR_NOACK;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int npn_select_cb(SSL *s, unsigned char **out, unsigned char *outlen,
|
||||
+ const unsigned char *in, unsigned int inlen, void *arg)
|
||||
+{
|
||||
+ int *idx = (int *)arg;
|
||||
+
|
||||
+ switch (*idx) {
|
||||
+ case 0:
|
||||
+ case 1:
|
||||
+ *out = (unsigned char *)(fooprot + 1);
|
||||
+ *outlen = *fooprot;
|
||||
+ return SSL_TLSEXT_ERR_OK;
|
||||
+
|
||||
+ case 3:
|
||||
+ *out = (unsigned char *)(barprot + 1);
|
||||
+ *outlen = *barprot;
|
||||
+ return SSL_TLSEXT_ERR_OK;
|
||||
+
|
||||
+ case 4:
|
||||
+ *outlen = 0;
|
||||
+ return SSL_TLSEXT_ERR_OK;
|
||||
+
|
||||
+ default:
|
||||
+ case 2:
|
||||
+ return SSL_TLSEXT_ERR_ALERT_FATAL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Test the NPN callbacks
|
||||
+ * Test 0: advert = foo, select = foo
|
||||
+ * Test 1: advert = <empty>, select = foo
|
||||
+ * Test 2: no advert
|
||||
+ * Test 3: advert = foo, select = bar
|
||||
+ * Test 4: advert = foo, select = <empty> (should fail)
|
||||
+ */
|
||||
+static int test_npn(int idx)
|
||||
+{
|
||||
+ SSL_CTX *sctx = NULL, *cctx = NULL;
|
||||
+ SSL *serverssl = NULL, *clientssl = NULL;
|
||||
+ int testresult = 0;
|
||||
+
|
||||
+ if (!TEST_true(create_ssl_ctx_pair(libctx, TLS_server_method(),
|
||||
+ TLS_client_method(), 0, TLS1_2_VERSION,
|
||||
+ &sctx, &cctx, cert, privkey)))
|
||||
+ goto end;
|
||||
+
|
||||
+ SSL_CTX_set_next_protos_advertised_cb(sctx, npn_advert_cb, &idx);
|
||||
+ SSL_CTX_set_next_proto_select_cb(cctx, npn_select_cb, &idx);
|
||||
+
|
||||
+ if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL,
|
||||
+ NULL)))
|
||||
+ goto end;
|
||||
+
|
||||
+ if (idx == 4) {
|
||||
+ /* We don't allow empty selection of NPN, so this should fail */
|
||||
+ if (!TEST_false(create_ssl_connection(serverssl, clientssl,
|
||||
+ SSL_ERROR_NONE)))
|
||||
+ goto end;
|
||||
+ } else {
|
||||
+ const unsigned char *prot;
|
||||
+ unsigned int protlen;
|
||||
+
|
||||
+ if (!TEST_true(create_ssl_connection(serverssl, clientssl,
|
||||
+ SSL_ERROR_NONE)))
|
||||
+ goto end;
|
||||
+
|
||||
+ SSL_get0_next_proto_negotiated(serverssl, &prot, &protlen);
|
||||
+ switch (idx) {
|
||||
+ case 0:
|
||||
+ case 1:
|
||||
+ if (!TEST_mem_eq(prot, protlen, fooprot + 1, *fooprot))
|
||||
+ goto end;
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ if (!TEST_uint_eq(protlen, 0))
|
||||
+ goto end;
|
||||
+ break;
|
||||
+ case 3:
|
||||
+ if (!TEST_mem_eq(prot, protlen, barprot + 1, *barprot))
|
||||
+ goto end;
|
||||
+ break;
|
||||
+ default:
|
||||
+ TEST_error("Should not get here");
|
||||
+ goto end;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ testresult = 1;
|
||||
+ end:
|
||||
+ SSL_free(serverssl);
|
||||
+ SSL_free(clientssl);
|
||||
+ SSL_CTX_free(sctx);
|
||||
+ SSL_CTX_free(cctx);
|
||||
+
|
||||
+ return testresult;
|
||||
+}
|
||||
+#endif /* !defined(OPENSSL_NO_TLS1_2) && !defined(OPENSSL_NO_NEXTPROTONEG) */
|
||||
+
|
||||
+static int alpn_select_cb2(SSL *ssl, const unsigned char **out,
|
||||
+ unsigned char *outlen, const unsigned char *in,
|
||||
+ unsigned int inlen, void *arg)
|
||||
+{
|
||||
+ int *idx = (int *)arg;
|
||||
+
|
||||
+ switch (*idx) {
|
||||
+ case 0:
|
||||
+ *out = (unsigned char *)(fooprot + 1);
|
||||
+ *outlen = *fooprot;
|
||||
+ return SSL_TLSEXT_ERR_OK;
|
||||
+
|
||||
+ case 2:
|
||||
+ *out = (unsigned char *)(barprot + 1);
|
||||
+ *outlen = *barprot;
|
||||
+ return SSL_TLSEXT_ERR_OK;
|
||||
+
|
||||
+ case 3:
|
||||
+ *outlen = 0;
|
||||
+ return SSL_TLSEXT_ERR_OK;
|
||||
+
|
||||
+ default:
|
||||
+ case 1:
|
||||
+ return SSL_TLSEXT_ERR_ALERT_FATAL;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Test the ALPN callbacks
|
||||
+ * Test 0: client = foo, select = foo
|
||||
+ * Test 1: client = <empty>, select = none
|
||||
+ * Test 2: client = foo, select = bar (should fail)
|
||||
+ * Test 3: client = foo, select = <empty> (should fail)
|
||||
+ */
|
||||
+static int test_alpn(int idx)
|
||||
+{
|
||||
+ SSL_CTX *sctx = NULL, *cctx = NULL;
|
||||
+ SSL *serverssl = NULL, *clientssl = NULL;
|
||||
+ int testresult = 0;
|
||||
+ const unsigned char *prots = fooprot;
|
||||
+ unsigned int protslen = sizeof(fooprot);
|
||||
+
|
||||
+ if (!TEST_true(create_ssl_ctx_pair(libctx, TLS_server_method(),
|
||||
+ TLS_client_method(), 0, 0,
|
||||
+ &sctx, &cctx, cert, privkey)))
|
||||
+ goto end;
|
||||
+
|
||||
+ SSL_CTX_set_alpn_select_cb(sctx, alpn_select_cb2, &idx);
|
||||
+
|
||||
+ if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL,
|
||||
+ NULL)))
|
||||
+ goto end;
|
||||
+
|
||||
+ if (idx == 1) {
|
||||
+ prots = NULL;
|
||||
+ protslen = 0;
|
||||
+ }
|
||||
+
|
||||
+ /* SSL_set_alpn_protos returns 0 for success! */
|
||||
+ if (!TEST_false(SSL_set_alpn_protos(clientssl, prots, protslen)))
|
||||
+ goto end;
|
||||
+
|
||||
+ if (idx == 2 || idx == 3) {
|
||||
+ /* We don't allow empty selection of NPN, so this should fail */
|
||||
+ if (!TEST_false(create_ssl_connection(serverssl, clientssl,
|
||||
+ SSL_ERROR_NONE)))
|
||||
+ goto end;
|
||||
+ } else {
|
||||
+ const unsigned char *prot;
|
||||
+ unsigned int protlen;
|
||||
+
|
||||
+ if (!TEST_true(create_ssl_connection(serverssl, clientssl,
|
||||
+ SSL_ERROR_NONE)))
|
||||
+ goto end;
|
||||
+
|
||||
+ SSL_get0_alpn_selected(clientssl, &prot, &protlen);
|
||||
+ switch (idx) {
|
||||
+ case 0:
|
||||
+ if (!TEST_mem_eq(prot, protlen, fooprot + 1, *fooprot))
|
||||
+ goto end;
|
||||
+ break;
|
||||
+ case 1:
|
||||
+ if (!TEST_uint_eq(protlen, 0))
|
||||
+ goto end;
|
||||
+ break;
|
||||
+ default:
|
||||
+ TEST_error("Should not get here");
|
||||
+ goto end;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ testresult = 1;
|
||||
+ end:
|
||||
+ SSL_free(serverssl);
|
||||
+ SSL_free(clientssl);
|
||||
+ SSL_CTX_free(sctx);
|
||||
+ SSL_CTX_free(cctx);
|
||||
+
|
||||
+ return testresult;
|
||||
+}
|
||||
+
|
||||
OPT_TEST_DECLARE_USAGE("certfile privkeyfile srpvfile tmpfile provider config dhfile\n")
|
||||
|
||||
int setup_tests(void)
|
||||
@@ -11178,6 +11403,10 @@ int setup_tests(void)
|
||||
ADD_ALL_TESTS(test_handshake_retry, 16);
|
||||
ADD_ALL_TESTS(test_multi_resume, 5);
|
||||
ADD_ALL_TESTS(test_select_next_proto, OSSL_NELEM(next_proto_tests));
|
||||
+#if !defined(OPENSSL_NO_TLS1_2) && !defined(OPENSSL_NO_NEXTPROTONEG)
|
||||
+ ADD_ALL_TESTS(test_npn, 5);
|
||||
+#endif
|
||||
+ ADD_ALL_TESTS(test_alpn, 4);
|
||||
return 1;
|
||||
|
||||
err:
|
||||
--
|
||||
2.25.1
|
||||
|
||||
205
meta/recipes-connectivity/openssl/openssl/CVE-2024-5535_9.patch
Normal file
205
meta/recipes-connectivity/openssl/openssl/CVE-2024-5535_9.patch
Normal file
@@ -0,0 +1,205 @@
|
||||
From 475480db0f9592f15f00a7cf692d3e04ad8e742f Mon Sep 17 00:00:00 2001
|
||||
From: Matt Caswell <matt@openssl.org>
|
||||
Date: Fri, 21 Jun 2024 14:29:26 +0100
|
||||
Subject: [PATCH 9/9] Add a test for an empty NextProto message
|
||||
|
||||
It is valid according to the spec for a NextProto message to have no
|
||||
protocols listed in it. The OpenSSL implementation however does not allow
|
||||
us to create such a message. In order to check that we work as expected
|
||||
when communicating with a client that does generate such messages we have
|
||||
to use a TLSProxy test.
|
||||
|
||||
Follow on from CVE-2024-5535
|
||||
|
||||
Reviewed-by: Neil Horman <nhorman@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/24718)
|
||||
|
||||
(cherry picked from commit a201030901de9f9a48b34c38f6922fb0b272f26f)
|
||||
|
||||
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/99c2b6b971c302595db1801e26a202247238659d]
|
||||
CVE: CVE-2024-5535
|
||||
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
|
||||
---
|
||||
test/recipes/70-test_npn.t | 73 +++++++++++++++++++++++++++++++++
|
||||
util/perl/TLSProxy/Message.pm | 9 ++++
|
||||
util/perl/TLSProxy/NextProto.pm | 54 ++++++++++++++++++++++++
|
||||
util/perl/TLSProxy/Proxy.pm | 1 +
|
||||
4 files changed, 137 insertions(+)
|
||||
create mode 100644 test/recipes/70-test_npn.t
|
||||
create mode 100644 util/perl/TLSProxy/NextProto.pm
|
||||
|
||||
diff --git a/test/recipes/70-test_npn.t b/test/recipes/70-test_npn.t
|
||||
new file mode 100644
|
||||
index 0000000..f82e71a
|
||||
--- /dev/null
|
||||
+++ b/test/recipes/70-test_npn.t
|
||||
@@ -0,0 +1,73 @@
|
||||
+#! /usr/bin/env perl
|
||||
+# Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
+#
|
||||
+# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
+# this file except in compliance with the License. You can obtain a copy
|
||||
+# in the file LICENSE in the source distribution or at
|
||||
+# https://www.openssl.org/source/license.html
|
||||
+
|
||||
+use strict;
|
||||
+use OpenSSL::Test qw/:DEFAULT cmdstr srctop_file/;
|
||||
+use OpenSSL::Test::Utils;
|
||||
+
|
||||
+use TLSProxy::Proxy;
|
||||
+
|
||||
+my $test_name = "test_npn";
|
||||
+setup($test_name);
|
||||
+
|
||||
+plan skip_all => "TLSProxy isn't usable on $^O"
|
||||
+ if $^O =~ /^(VMS)$/;
|
||||
+
|
||||
+plan skip_all => "$test_name needs the dynamic engine feature enabled"
|
||||
+ if disabled("engine") || disabled("dynamic-engine");
|
||||
+
|
||||
+plan skip_all => "$test_name needs the sock feature enabled"
|
||||
+ if disabled("sock");
|
||||
+
|
||||
+plan skip_all => "$test_name needs NPN enabled"
|
||||
+ if disabled("nextprotoneg");
|
||||
+
|
||||
+plan skip_all => "$test_name needs TLSv1.2 enabled"
|
||||
+ if disabled("tls1_2");
|
||||
+
|
||||
+my $proxy = TLSProxy::Proxy->new(
|
||||
+ undef,
|
||||
+ cmdstr(app(["openssl"]), display => 1),
|
||||
+ srctop_file("apps", "server.pem"),
|
||||
+ (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
|
||||
+);
|
||||
+
|
||||
+$proxy->start() or plan skip_all => "Unable to start up Proxy for tests";
|
||||
+plan tests => 1;
|
||||
+
|
||||
+my $npnseen = 0;
|
||||
+
|
||||
+# Test 1: Check sending an empty NextProto message from the client works. This is
|
||||
+# valid as per the spec, but OpenSSL does not allow you to send it.
|
||||
+# Therefore we must be prepared to receive such a message but we cannot
|
||||
+# generate it except via TLSProxy
|
||||
+$proxy->clear();
|
||||
+$proxy->filter(\&npn_filter);
|
||||
+$proxy->clientflags("-nextprotoneg foo -no_tls1_3");
|
||||
+$proxy->serverflags("-nextprotoneg foo");
|
||||
+$proxy->start();
|
||||
+ok($npnseen && TLSProxy::Message->success(), "Empty NPN message");
|
||||
+
|
||||
+sub npn_filter
|
||||
+{
|
||||
+ my $proxy = shift;
|
||||
+ my $message;
|
||||
+
|
||||
+ # The NextProto message always appears in flight 2
|
||||
+ return if $proxy->flight != 2;
|
||||
+
|
||||
+ foreach my $message (@{$proxy->message_list}) {
|
||||
+ if ($message->mt == TLSProxy::Message::MT_NEXT_PROTO) {
|
||||
+ # Our TLSproxy NextProto message support doesn't support parsing of
|
||||
+ # the message. If we repack it just creates an empty NextProto
|
||||
+ # message - which is exactly the scenario we want to test here.
|
||||
+ $message->repack();
|
||||
+ $npnseen = 1;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/util/perl/TLSProxy/Message.pm b/util/perl/TLSProxy/Message.pm
|
||||
index 2c1bdb3..eb350de 100644
|
||||
--- a/util/perl/TLSProxy/Message.pm
|
||||
+++ b/util/perl/TLSProxy/Message.pm
|
||||
@@ -379,6 +379,15 @@ sub create_message
|
||||
[@message_frag_lens]
|
||||
);
|
||||
$message->parse();
|
||||
+ } elsif ($mt == MT_NEXT_PROTO) {
|
||||
+ $message = TLSProxy::NextProto->new(
|
||||
+ $server,
|
||||
+ $data,
|
||||
+ [@message_rec_list],
|
||||
+ $startoffset,
|
||||
+ [@message_frag_lens]
|
||||
+ );
|
||||
+ $message->parse();
|
||||
} else {
|
||||
#Unknown message type
|
||||
$message = TLSProxy::Message->new(
|
||||
diff --git a/util/perl/TLSProxy/NextProto.pm b/util/perl/TLSProxy/NextProto.pm
|
||||
new file mode 100644
|
||||
index 0000000..0e18347
|
||||
--- /dev/null
|
||||
+++ b/util/perl/TLSProxy/NextProto.pm
|
||||
@@ -0,0 +1,54 @@
|
||||
+# Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
+#
|
||||
+# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
+# this file except in compliance with the License. You can obtain a copy
|
||||
+# in the file LICENSE in the source distribution or at
|
||||
+# https://www.openssl.org/source/license.html
|
||||
+
|
||||
+use strict;
|
||||
+
|
||||
+package TLSProxy::NextProto;
|
||||
+
|
||||
+use vars '@ISA';
|
||||
+push @ISA, 'TLSProxy::Message';
|
||||
+
|
||||
+sub new
|
||||
+{
|
||||
+ my $class = shift;
|
||||
+ my ($server,
|
||||
+ $data,
|
||||
+ $records,
|
||||
+ $startoffset,
|
||||
+ $message_frag_lens) = @_;
|
||||
+
|
||||
+ my $self = $class->SUPER::new(
|
||||
+ $server,
|
||||
+ TLSProxy::Message::MT_NEXT_PROTO,
|
||||
+ $data,
|
||||
+ $records,
|
||||
+ $startoffset,
|
||||
+ $message_frag_lens);
|
||||
+
|
||||
+ return $self;
|
||||
+}
|
||||
+
|
||||
+sub parse
|
||||
+{
|
||||
+ # We don't support parsing at the moment
|
||||
+}
|
||||
+
|
||||
+# This is supposed to reconstruct the on-the-wire message data following changes.
|
||||
+# For now though since we don't support parsing we just create an empty NextProto
|
||||
+# message - this capability is used in test_npn
|
||||
+sub set_message_contents
|
||||
+{
|
||||
+ my $self = shift;
|
||||
+ my $data;
|
||||
+
|
||||
+ $data = pack("C32", 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00);
|
||||
+ $self->data($data);
|
||||
+}
|
||||
+1;
|
||||
diff --git a/util/perl/TLSProxy/Proxy.pm b/util/perl/TLSProxy/Proxy.pm
|
||||
index 3de10ec..b707722 100644
|
||||
--- a/util/perl/TLSProxy/Proxy.pm
|
||||
+++ b/util/perl/TLSProxy/Proxy.pm
|
||||
@@ -23,6 +23,7 @@ use TLSProxy::CertificateRequest;
|
||||
use TLSProxy::CertificateVerify;
|
||||
use TLSProxy::ServerKeyExchange;
|
||||
use TLSProxy::NewSessionTicket;
|
||||
+use TLSProxy::NextProto;
|
||||
|
||||
my $have_IPv6;
|
||||
my $IP_factory;
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -12,13 +12,22 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
|
||||
file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \
|
||||
file://afalg.patch \
|
||||
file://0001-Configure-do-not-tweak-mips-cflags.patch \
|
||||
file://CVE-2024-5535_1.patch \
|
||||
file://CVE-2024-5535_2.patch \
|
||||
file://CVE-2024-5535_3.patch \
|
||||
file://CVE-2024-5535_4.patch \
|
||||
file://CVE-2024-5535_5.patch \
|
||||
file://CVE-2024-5535_6.patch \
|
||||
file://CVE-2024-5535_7.patch \
|
||||
file://CVE-2024-5535_8.patch \
|
||||
file://CVE-2024-5535_9.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:class-nativesdk = " \
|
||||
file://environment.d-openssl.sh \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "88525753f79d3bec27d2fa7c66aa0b92b3aa9498dafd93d7cfa4b3780cdae313"
|
||||
SRC_URI[sha256sum] = "eeca035d4dd4e84fc25846d952da6297484afa0650a6f84c682e39df3a4123ca"
|
||||
|
||||
inherit lib_package multilib_header multilib_script ptest perlnative
|
||||
MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
|
||||
@@ -5,7 +5,7 @@ SECTION = "console/network"
|
||||
HOMEPAGE = "http://samba.org/ppp/"
|
||||
BUGTRACKER = "http://ppp.samba.org/cgi-bin/ppp-bugs"
|
||||
DEPENDS = "libpcap openssl virtual/crypt"
|
||||
LICENSE = "BSD-3-Clause & BSD-3-Clause-Attribution & GPL-2.0-or-later & LGPL-2.0-or-later & PD"
|
||||
LICENSE = "BSD-3-Clause & BSD-3-Clause-Attribution & GPL-2.0-or-later & LGPL-2.0-or-later & PD & RSA-MD"
|
||||
LIC_FILES_CHKSUM = "file://pppd/ccp.c;beginline=1;endline=29;md5=e2c43fe6e81ff77d87dc9c290a424dea \
|
||||
file://pppd/plugins/passprompt.c;beginline=1;endline=10;md5=3bcbcdbf0e369c9a3e0b8c8275b065d8 \
|
||||
file://pppd/tdb.c;beginline=1;endline=27;md5=4ca3a9991b011038d085d6675ae7c4e6 \
|
||||
|
||||
35
meta/recipes-core/expat/expat/CVE-2023-52426-001.patch
Normal file
35
meta/recipes-core/expat/expat/CVE-2023-52426-001.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
From cdead241d4f1136c2f38d1b28e95073c59753d30 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Thu, 26 Oct 2023 01:40:05 +0200
|
||||
Subject: [PATCH] doc/reference.html: Clarify effect of XML_DTD on external
|
||||
entities
|
||||
|
||||
Defining XML_DTD emnables support for external parameter(!)
|
||||
entities. External general(!) entities have been supported
|
||||
even with XML_DTD undefined. (Only now with Expat 2.6.0
|
||||
defining XML_GE as 0 can take that away.)
|
||||
|
||||
CVE: CVE-2023-52426
|
||||
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/cdead241d4f1136c2f38d1b28e95073c59753d30]
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
doc/reference.html | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/doc/reference.html b/doc/reference.html
|
||||
index 8b0d47d..a30e462 100644
|
||||
--- a/doc/reference.html
|
||||
+++ b/doc/reference.html
|
||||
@@ -365,7 +365,7 @@ this is defined, default attribute values from an external DTD subset
|
||||
are reported and attribute value normalization occurs based on the
|
||||
type of attributes defined in the external subset. Without
|
||||
this, Expat has a smaller memory footprint and can be faster, but will
|
||||
-not load external entities or process conditional sections. If defined, makes
|
||||
+not load external parameter entities or process conditional sections. If defined, makes
|
||||
the functions <code><a
|
||||
href="#XML_SetBillionLaughsAttackProtectionMaximumAmplification">
|
||||
XML_SetBillionLaughsAttackProtectionMaximumAmplification</a></code> and <code>
|
||||
--
|
||||
2.40.0
|
||||
|
||||
72
meta/recipes-core/expat/expat/CVE-2023-52426-002.patch
Normal file
72
meta/recipes-core/expat/expat/CVE-2023-52426-002.patch
Normal file
@@ -0,0 +1,72 @@
|
||||
From daa89e42c005cc7f4f7af9eee271ae0723d30300 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Thu, 26 Oct 2023 00:59:52 +0200
|
||||
|
||||
Subject: [PATCH] cmake: Introduce option EXPAT_GE to control macro XML_GE
|
||||
|
||||
CVE: CVE-2023-52426
|
||||
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/daa89e42c005cc7f4f7af9eee271ae0723d30300]
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
CMakeLists.txt | 9 +++++++++
|
||||
expat_config.h.cmake | 3 +++
|
||||
2 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 2b4c13c..416fe96 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -140,6 +140,8 @@ expat_shy_set(EXPAT_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much
|
||||
mark_as_advanced(EXPAT_CONTEXT_BYTES)
|
||||
expat_shy_set(EXPAT_DTD ON CACHE BOOL "Define to make parameter entity parsing functionality available")
|
||||
mark_as_advanced(EXPAT_DTD)
|
||||
+expat_shy_set(EXPAT_GE ON CACHE BOOL "Define to make general entity parsing functionality available")
|
||||
+mark_as_advanced(EXPAT_GE)
|
||||
expat_shy_set(EXPAT_NS ON CACHE BOOL "Define to make XML Namespaces functionality available")
|
||||
mark_as_advanced(EXPAT_NS)
|
||||
expat_shy_set(EXPAT_WARNINGS_AS_ERRORS OFF CACHE BOOL "Treat all compiler warnings as errors")
|
||||
@@ -172,6 +174,11 @@ endif()
|
||||
#
|
||||
# Environment checks
|
||||
#
|
||||
+if(EXPAT_DTD AND NOT EXPAT_GE)
|
||||
+ message(SEND_ERROR "Option EXPAT_DTD requires that EXPAT_GE is also enabled.")
|
||||
+ message(SEND_ERROR "Please either enable option EXPAT_GE (recommended) or disable EXPAT_DTD also.")
|
||||
+endif()
|
||||
+
|
||||
if(EXPAT_WITH_LIBBSD)
|
||||
find_library(LIB_BSD NAMES bsd)
|
||||
if(NOT LIB_BSD)
|
||||
@@ -274,6 +281,7 @@ endif()
|
||||
|
||||
_expat_copy_bool_int(EXPAT_ATTR_INFO XML_ATTR_INFO)
|
||||
_expat_copy_bool_int(EXPAT_DTD XML_DTD)
|
||||
+_expat_copy_bool_int(EXPAT_GE XML_GE)
|
||||
_expat_copy_bool_int(EXPAT_LARGE_SIZE XML_LARGE_SIZE)
|
||||
_expat_copy_bool_int(EXPAT_MIN_SIZE XML_MIN_SIZE)
|
||||
_expat_copy_bool_int(EXPAT_NS XML_NS)
|
||||
@@ -893,6 +901,7 @@ message(STATUS " // Advanced options, changes not advised")
|
||||
message(STATUS " Attributes info .......... ${EXPAT_ATTR_INFO}")
|
||||
message(STATUS " Context bytes ............ ${EXPAT_CONTEXT_BYTES}")
|
||||
message(STATUS " DTD support .............. ${EXPAT_DTD}")
|
||||
+message(STATUS " General entities ......... ${EXPAT_GE}")
|
||||
message(STATUS " Large size ............... ${EXPAT_LARGE_SIZE}")
|
||||
message(STATUS " Minimum size ............. ${EXPAT_MIN_SIZE}")
|
||||
message(STATUS " Namespace support ........ ${EXPAT_NS}")
|
||||
diff --git a/expat_config.h.cmake b/expat_config.h.cmake
|
||||
index 78fcb4c..330945e 100644
|
||||
--- a/expat_config.h.cmake
|
||||
+++ b/expat_config.h.cmake
|
||||
@@ -103,6 +103,9 @@
|
||||
/* Define to make parameter entity parsing functionality available. */
|
||||
#cmakedefine XML_DTD
|
||||
|
||||
+/* Define as 1/0 to enable/disable support for general entities. */
|
||||
+#define XML_GE @XML_GE@
|
||||
+
|
||||
/* Define to make XML Namespaces functionality available. */
|
||||
#cmakedefine XML_NS
|
||||
|
||||
--
|
||||
2.40.0
|
||||
28
meta/recipes-core/expat/expat/CVE-2023-52426-003.patch
Normal file
28
meta/recipes-core/expat/expat/CVE-2023-52426-003.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
From ed87a4793404e91c0cc0c81435fcfcc64a8be9f4 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Thu, 26 Oct 2023 00:45:23 +0200
|
||||
Subject: [PATCH] configure.ac: Define macro XML_GE as 1
|
||||
|
||||
CVE: CVE-2023-52426
|
||||
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/ed87a4793404e91c0cc0c81435fcfcc64a8be9f4]
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
configure.ac | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index d3642de..153bb8e 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -295,6 +295,8 @@ AC_SUBST(FILEMAP)
|
||||
dnl Some basic configuration:
|
||||
AC_DEFINE([XML_NS], 1,
|
||||
[Define to make XML Namespaces functionality available.])
|
||||
+AC_DEFINE([XML_GE], 1,
|
||||
+ [Define as 1/0 to enable/disable support for general entities.])
|
||||
AC_DEFINE([XML_DTD], 1,
|
||||
[Define to make parameter entity parsing functionality available.])
|
||||
AC_DEFINE([XML_DEV_URANDOM], 1,
|
||||
--
|
||||
2.40.0
|
||||
429
meta/recipes-core/expat/expat/CVE-2023-52426-004.patch
Normal file
429
meta/recipes-core/expat/expat/CVE-2023-52426-004.patch
Normal file
@@ -0,0 +1,429 @@
|
||||
From 0f075ec8ecb5e43f8fdca5182f8cca4703da0404 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Thu, 26 Oct 2023 00:43:22 +0200
|
||||
Subject: [PATCH] lib|xmlwf|cmake: Extend scope of billion laughs attack
|
||||
protection
|
||||
|
||||
.. from "defined(XML_DTD)" to "defined(XML_DTD) || XML_GE==1".
|
||||
|
||||
CVE: CVE-2023-52426
|
||||
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/0f075ec8ecb5e43f8fdca5182f8cca4703da0404]
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
CMakeLists.txt | 8 ++++-
|
||||
lib/expat.h | 8 +++--
|
||||
lib/internal.h | 2 +-
|
||||
lib/libexpat.def.cmake | 4 +--
|
||||
lib/xmlparse.c | 71 ++++++++++++++++++++++--------------------
|
||||
xmlwf/xmlwf.c | 18 ++++++-----
|
||||
6 files changed, 62 insertions(+), 49 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 416fe96..e6939e2 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -389,7 +389,13 @@ if(EXPAT_SHARED_LIBS)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
- _expat_def_file_toggle(EXPAT_DTD _EXPAT_COMMENT_DTD)
|
||||
+ if(EXPAT_DTD OR EXPAT_GE)
|
||||
+ set(_EXPAT_DTD_OR_GE TRUE)
|
||||
+ else()
|
||||
+ set(_EXPAT_DTD_OR_GE FALSE)
|
||||
+ endif()
|
||||
+
|
||||
+ _expat_def_file_toggle(_EXPAT_DTD_OR_GE _EXPAT_COMMENT_DTD_OR_GE)
|
||||
_expat_def_file_toggle(EXPAT_ATTR_INFO _EXPAT_COMMENT_ATTR_INFO)
|
||||
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lib/libexpat.def.cmake" "${CMAKE_CURRENT_BINARY_DIR}/lib/libexpat.def")
|
||||
diff --git a/lib/expat.h b/lib/expat.h
|
||||
index 1c83563..33c94af 100644
|
||||
--- a/lib/expat.h
|
||||
+++ b/lib/expat.h
|
||||
@@ -1038,13 +1038,15 @@ typedef struct {
|
||||
XMLPARSEAPI(const XML_Feature *)
|
||||
XML_GetFeatureList(void);
|
||||
|
||||
-#ifdef XML_DTD
|
||||
-/* Added in Expat 2.4.0. */
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
+/* Added in Expat 2.4.0 for XML_DTD defined and
|
||||
+ * added in Expat 2.6.0 for XML_GE == 1. */
|
||||
XMLPARSEAPI(XML_Bool)
|
||||
XML_SetBillionLaughsAttackProtectionMaximumAmplification(
|
||||
XML_Parser parser, float maximumAmplificationFactor);
|
||||
|
||||
-/* Added in Expat 2.4.0. */
|
||||
+/* Added in Expat 2.4.0 for XML_DTD defined and
|
||||
+ * added in Expat 2.6.0 for XML_GE == 1. */
|
||||
XMLPARSEAPI(XML_Bool)
|
||||
XML_SetBillionLaughsAttackProtectionActivationThreshold(
|
||||
XML_Parser parser, unsigned long long activationThresholdBytes);
|
||||
diff --git a/lib/internal.h b/lib/internal.h
|
||||
index e09f533..1851925 100644
|
||||
--- a/lib/internal.h
|
||||
+++ b/lib/internal.h
|
||||
@@ -154,7 +154,7 @@ extern "C" {
|
||||
void _INTERNAL_trim_to_complete_utf8_characters(const char *from,
|
||||
const char **fromLimRef);
|
||||
|
||||
-#if defined(XML_DTD)
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
unsigned long long testingAccountingGetCountBytesDirect(XML_Parser parser);
|
||||
unsigned long long testingAccountingGetCountBytesIndirect(XML_Parser parser);
|
||||
const char *unsignedCharToPrintable(unsigned char c);
|
||||
diff --git a/lib/libexpat.def.cmake b/lib/libexpat.def.cmake
|
||||
index cf434a2..61a4f00 100644
|
||||
--- a/lib/libexpat.def.cmake
|
||||
+++ b/lib/libexpat.def.cmake
|
||||
@@ -75,5 +75,5 @@ EXPORTS
|
||||
XML_SetHashSalt @67
|
||||
; internal @68 removed with version 2.3.1
|
||||
; added with version 2.4.0
|
||||
-@_EXPAT_COMMENT_DTD@ XML_SetBillionLaughsAttackProtectionActivationThreshold @69
|
||||
-@_EXPAT_COMMENT_DTD@ XML_SetBillionLaughsAttackProtectionMaximumAmplification @70
|
||||
+@_EXPAT_COMMENT_DTD_OR_GE@ XML_SetBillionLaughsAttackProtectionActivationThreshold @69
|
||||
+@_EXPAT_COMMENT_DTD_OR_GE@ XML_SetBillionLaughsAttackProtectionMaximumAmplification @70
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index b6c2eca..e23441e 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -408,7 +408,7 @@ enum XML_Account {
|
||||
XML_ACCOUNT_NONE /* i.e. do not account, was accounted already */
|
||||
};
|
||||
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
typedef unsigned long long XmlBigCount;
|
||||
typedef struct accounting {
|
||||
XmlBigCount countBytesDirect;
|
||||
@@ -424,7 +424,7 @@ typedef struct entity_stats {
|
||||
unsigned int maximumDepthSeen;
|
||||
int debugLevel;
|
||||
} ENTITY_STATS;
|
||||
-#endif /* XML_DTD */
|
||||
+#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
|
||||
typedef enum XML_Error PTRCALL Processor(XML_Parser parser, const char *start,
|
||||
const char *end, const char **endPtr);
|
||||
@@ -562,7 +562,7 @@ static XML_Parser parserCreate(const XML_Char *encodingName,
|
||||
|
||||
static void parserInit(XML_Parser parser, const XML_Char *encodingName);
|
||||
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
static float accountingGetCurrentAmplification(XML_Parser rootParser);
|
||||
static void accountingReportStats(XML_Parser originParser, const char *epilog);
|
||||
static void accountingOnAbort(XML_Parser originParser);
|
||||
@@ -585,7 +585,7 @@ static void entityTrackingOnClose(XML_Parser parser, ENTITY *entity,
|
||||
|
||||
static XML_Parser getRootParserOf(XML_Parser parser,
|
||||
unsigned int *outLevelDiff);
|
||||
-#endif /* XML_DTD */
|
||||
+#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
|
||||
static unsigned long getDebugLevel(const char *variableName,
|
||||
unsigned long defaultDebugLevel);
|
||||
@@ -703,7 +703,7 @@ struct XML_ParserStruct {
|
||||
enum XML_ParamEntityParsing m_paramEntityParsing;
|
||||
#endif
|
||||
unsigned long m_hash_secret_salt;
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
ACCOUNTING m_accounting;
|
||||
ENTITY_STATS m_entity_stats;
|
||||
#endif
|
||||
@@ -1163,7 +1163,7 @@ parserInit(XML_Parser parser, const XML_Char *encodingName) {
|
||||
#endif
|
||||
parser->m_hash_secret_salt = 0;
|
||||
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
memset(&parser->m_accounting, 0, sizeof(ACCOUNTING));
|
||||
parser->m_accounting.debugLevel = getDebugLevel("EXPAT_ACCOUNTING_DEBUG", 0u);
|
||||
parser->m_accounting.maximumAmplificationFactor
|
||||
@@ -2522,8 +2522,9 @@ XML_GetFeatureList(void) {
|
||||
#ifdef XML_ATTR_INFO
|
||||
{XML_FEATURE_ATTR_INFO, XML_L("XML_ATTR_INFO"), 0},
|
||||
#endif
|
||||
-#ifdef XML_DTD
|
||||
- /* Added in Expat 2.4.0. */
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
+ /* Added in Expat 2.4.0 for XML_DTD defined and
|
||||
+ * added in Expat 2.6.0 for XML_GE == 1. */
|
||||
{XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT,
|
||||
XML_L("XML_BLAP_MAX_AMP"),
|
||||
(long int)
|
||||
@@ -2537,7 +2538,7 @@ XML_GetFeatureList(void) {
|
||||
return features;
|
||||
}
|
||||
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
XML_Bool XMLCALL
|
||||
XML_SetBillionLaughsAttackProtectionMaximumAmplification(
|
||||
XML_Parser parser, float maximumAmplificationFactor) {
|
||||
@@ -2559,7 +2560,7 @@ XML_SetBillionLaughsAttackProtectionActivationThreshold(
|
||||
parser->m_accounting.activationThresholdBytes = activationThresholdBytes;
|
||||
return XML_TRUE;
|
||||
}
|
||||
-#endif /* XML_DTD */
|
||||
+#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
|
||||
/* Initially tag->rawName always points into the parse buffer;
|
||||
for those TAG instances opened while the current parse buffer was
|
||||
@@ -2645,13 +2646,13 @@ externalEntityInitProcessor2(XML_Parser parser, const char *start,
|
||||
int tok = XmlContentTok(parser->m_encoding, start, end, &next);
|
||||
switch (tok) {
|
||||
case XML_TOK_BOM:
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, start, next, __LINE__,
|
||||
XML_ACCOUNT_DIRECT)) {
|
||||
accountingOnAbort(parser);
|
||||
return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
|
||||
}
|
||||
-#endif /* XML_DTD */
|
||||
+#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
|
||||
/* If we are at the end of the buffer, this would cause the next stage,
|
||||
i.e. externalEntityInitProcessor3, to pass control directly to
|
||||
@@ -2765,7 +2766,7 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
|
||||
for (;;) {
|
||||
const char *next = s; /* XmlContentTok doesn't always set the last arg */
|
||||
int tok = XmlContentTok(enc, s, end, &next);
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
const char *accountAfter
|
||||
= ((tok == XML_TOK_TRAILING_RSQB) || (tok == XML_TOK_TRAILING_CR))
|
||||
? (haveMore ? s /* i.e. 0 bytes */ : end)
|
||||
@@ -2831,14 +2832,14 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
|
||||
XML_Char ch = (XML_Char)XmlPredefinedEntityName(
|
||||
enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar);
|
||||
if (ch) {
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
/* NOTE: We are replacing 4-6 characters original input for 1 character
|
||||
* so there is no amplification and hence recording without
|
||||
* protection. */
|
||||
accountingDiffTolerated(parser, tok, (char *)&ch,
|
||||
((char *)&ch) + sizeof(XML_Char), __LINE__,
|
||||
XML_ACCOUNT_ENTITY_EXPANSION);
|
||||
-#endif /* XML_DTD */
|
||||
+#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
if (parser->m_characterDataHandler)
|
||||
parser->m_characterDataHandler(parser->m_handlerArg, &ch, 1);
|
||||
else if (parser->m_defaultHandler)
|
||||
@@ -4040,7 +4041,7 @@ doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr,
|
||||
for (;;) {
|
||||
const char *next = s; /* in case of XML_TOK_NONE or XML_TOK_PARTIAL */
|
||||
int tok = XmlCdataSectionTok(enc, s, end, &next);
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, s, next, __LINE__, account)) {
|
||||
accountingOnAbort(parser);
|
||||
return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
|
||||
@@ -4192,7 +4193,7 @@ doIgnoreSection(XML_Parser parser, const ENCODING *enc, const char **startPtr,
|
||||
*eventPP = s;
|
||||
*startPtr = NULL;
|
||||
tok = XmlIgnoreSectionTok(enc, s, end, &next);
|
||||
-# ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, s, next, __LINE__,
|
||||
XML_ACCOUNT_DIRECT)) {
|
||||
accountingOnAbort(parser);
|
||||
@@ -4284,7 +4285,7 @@ processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *s,
|
||||
const XML_Char *storedversion = NULL;
|
||||
int standalone = -1;
|
||||
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, XML_TOK_XML_DECL, s, next, __LINE__,
|
||||
XML_ACCOUNT_DIRECT)) {
|
||||
accountingOnAbort(parser);
|
||||
@@ -4491,7 +4492,7 @@ entityValueInitProcessor(XML_Parser parser, const char *s, const char *end,
|
||||
*/
|
||||
else if (tok == XML_TOK_BOM && next == end
|
||||
&& ! parser->m_parsingStatus.finalBuffer) {
|
||||
-# ifdef XML_DTD
|
||||
+# if defined(XML_DTD) || XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, s, next, __LINE__,
|
||||
XML_ACCOUNT_DIRECT)) {
|
||||
accountingOnAbort(parser);
|
||||
@@ -4707,11 +4708,13 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
|
||||
}
|
||||
}
|
||||
role = XmlTokenRole(&parser->m_prologState, tok, s, next, enc);
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
switch (role) {
|
||||
case XML_ROLE_INSTANCE_START: // bytes accounted in contentProcessor
|
||||
case XML_ROLE_XML_DECL: // bytes accounted in processXmlDecl
|
||||
- case XML_ROLE_TEXT_DECL: // bytes accounted in processXmlDecl
|
||||
+ # ifdef XML_DTD
|
||||
+ case XML_ROLE_TEXT_DECL: // bytes accounted in processXmlDecl
|
||||
+# endif
|
||||
break;
|
||||
default:
|
||||
if (! accountingDiffTolerated(parser, tok, s, next, __LINE__, account)) {
|
||||
@@ -5648,7 +5651,7 @@ epilogProcessor(XML_Parser parser, const char *s, const char *end,
|
||||
for (;;) {
|
||||
const char *next = NULL;
|
||||
int tok = XmlPrologTok(parser->m_encoding, s, end, &next);
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, s, next, __LINE__,
|
||||
XML_ACCOUNT_DIRECT)) {
|
||||
accountingOnAbort(parser);
|
||||
@@ -5728,7 +5731,7 @@ processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl) {
|
||||
return XML_ERROR_NO_MEMORY;
|
||||
}
|
||||
entity->open = XML_TRUE;
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
entityTrackingOnOpen(parser, entity, __LINE__);
|
||||
#endif
|
||||
entity->processed = 0;
|
||||
@@ -5762,9 +5765,9 @@ processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl) {
|
||||
entity->processed = (int)(next - textStart);
|
||||
parser->m_processor = internalEntityProcessor;
|
||||
} else {
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
entityTrackingOnClose(parser, entity, __LINE__);
|
||||
-#endif /* XML_DTD */
|
||||
+#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
entity->open = XML_FALSE;
|
||||
parser->m_openInternalEntities = openEntity->next;
|
||||
/* put openEntity back in list of free instances */
|
||||
@@ -5813,7 +5816,7 @@ internalEntityProcessor(XML_Parser parser, const char *s, const char *end,
|
||||
return result;
|
||||
}
|
||||
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
entityTrackingOnClose(parser, entity, __LINE__);
|
||||
#endif
|
||||
entity->open = XML_FALSE;
|
||||
@@ -5892,7 +5895,7 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
|
||||
const char *next
|
||||
= ptr; /* XmlAttributeValueTok doesn't always set the last arg */
|
||||
int tok = XmlAttributeValueTok(enc, ptr, end, &next);
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, ptr, next, __LINE__, account)) {
|
||||
accountingOnAbort(parser);
|
||||
return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
|
||||
@@ -5957,14 +5960,14 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
|
||||
XML_Char ch = (XML_Char)XmlPredefinedEntityName(
|
||||
enc, ptr + enc->minBytesPerChar, next - enc->minBytesPerChar);
|
||||
if (ch) {
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
/* NOTE: We are replacing 4-6 characters original input for 1 character
|
||||
* so there is no amplification and hence recording without
|
||||
* protection. */
|
||||
accountingDiffTolerated(parser, tok, (char *)&ch,
|
||||
((char *)&ch) + sizeof(XML_Char), __LINE__,
|
||||
XML_ACCOUNT_ENTITY_EXPANSION);
|
||||
-#endif /* XML_DTD */
|
||||
+#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
if (! poolAppendChar(pool, ch))
|
||||
return XML_ERROR_NO_MEMORY;
|
||||
break;
|
||||
@@ -6042,14 +6045,14 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
|
||||
enum XML_Error result;
|
||||
const XML_Char *textEnd = entity->textPtr + entity->textLen;
|
||||
entity->open = XML_TRUE;
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
entityTrackingOnOpen(parser, entity, __LINE__);
|
||||
#endif
|
||||
result = appendAttributeValue(parser, parser->m_internalEncoding,
|
||||
isCdata, (const char *)entity->textPtr,
|
||||
(const char *)textEnd, pool,
|
||||
XML_ACCOUNT_ENTITY_EXPANSION);
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
entityTrackingOnClose(parser, entity, __LINE__);
|
||||
#endif
|
||||
entity->open = XML_FALSE;
|
||||
@@ -6105,7 +6108,7 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
|
||||
= entityTextPtr; /* XmlEntityValueTok doesn't always set the last arg */
|
||||
int tok = XmlEntityValueTok(enc, entityTextPtr, entityTextEnd, &next);
|
||||
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, entityTextPtr, next, __LINE__,
|
||||
account)) {
|
||||
accountingOnAbort(parser);
|
||||
@@ -7651,7 +7654,7 @@ copyString(const XML_Char *s, const XML_Memory_Handling_Suite *memsuite) {
|
||||
return result;
|
||||
}
|
||||
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
|
||||
static float
|
||||
accountingGetCurrentAmplification(XML_Parser rootParser) {
|
||||
@@ -8382,7 +8385,7 @@ unsignedCharToPrintable(unsigned char c) {
|
||||
assert(0); /* never gets here */
|
||||
}
|
||||
|
||||
-#endif /* XML_DTD */
|
||||
+#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
|
||||
static unsigned long
|
||||
getDebugLevel(const char *variableName, unsigned long defaultDebugLevel) {
|
||||
diff --git a/xmlwf/xmlwf.c b/xmlwf/xmlwf.c
|
||||
index 471f2a2..be23f5a 100644
|
||||
--- a/xmlwf/xmlwf.c
|
||||
+++ b/xmlwf/xmlwf.c
|
||||
@@ -1062,9 +1062,10 @@ tmain(int argc, XML_Char **argv) {
|
||||
" (needs a floating point number greater or equal than 1.0)"));
|
||||
exit(XMLWF_EXIT_USAGE_ERROR);
|
||||
}
|
||||
-#ifndef XML_DTD
|
||||
- ftprintf(stderr, T("Warning: Given amplification limit ignored") T(
|
||||
- ", xmlwf has been compiled without DTD support.\n"));
|
||||
+#if ! defined(XML_DTD) && XML_GE == 0
|
||||
+ ftprintf(stderr,
|
||||
+ T("Warning: Given amplification limit ignored")
|
||||
+ T(", xmlwf has been compiled without DTD/GE support.\n"));
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -1083,9 +1084,10 @@ tmain(int argc, XML_Char **argv) {
|
||||
exit(XMLWF_EXIT_USAGE_ERROR);
|
||||
}
|
||||
attackThresholdGiven = XML_TRUE;
|
||||
-#ifndef XML_DTD
|
||||
- ftprintf(stderr, T("Warning: Given attack threshold ignored") T(
|
||||
- ", xmlwf has been compiled without DTD support.\n"));
|
||||
+#if ! defined(XML_DTD) && XML_GE == 0
|
||||
+ ftprintf(stderr,
|
||||
+ T("Warning: Given attack threshold ignored")
|
||||
+ T(", xmlwf has been compiled without DTD/GE support.\n"));
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -1120,13 +1122,13 @@ tmain(int argc, XML_Char **argv) {
|
||||
}
|
||||
|
||||
if (attackMaximumAmplification != -1.0f) {
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
XML_SetBillionLaughsAttackProtectionMaximumAmplification(
|
||||
parser, attackMaximumAmplification);
|
||||
#endif
|
||||
}
|
||||
if (attackThresholdGiven) {
|
||||
-#ifdef XML_DTD
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
XML_SetBillionLaughsAttackProtectionActivationThreshold(
|
||||
parser, attackThresholdBytes);
|
||||
#else
|
||||
--
|
||||
2.40.0
|
||||
34
meta/recipes-core/expat/expat/CVE-2023-52426-005.patch
Normal file
34
meta/recipes-core/expat/expat/CVE-2023-52426-005.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
From b0975cb73a41869fbecf0fa55afd35b69b64cc50 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Thu, 26 Oct 2023 00:47:52 +0200
|
||||
Subject: [PATCH] lib: Fail the build if XML_GE is not set to 1 or 0
|
||||
|
||||
CVE: CVE-2023-52426
|
||||
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/b0975cb73a41869fbecf0fa55afd35b69b64cc50]
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
lib/xmlparse.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index e23441e..ac3efe1 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -62,6 +62,14 @@
|
||||
|
||||
#include <expat_config.h>
|
||||
|
||||
+#if ! defined(XML_GE) || (1 - XML_GE - 1 == 2) || (XML_GE < 0) || (XML_GE > 1)
|
||||
+# error XML_GE (for general entities) must be defined, non-empty, either 1 or 0 (0 to disable, 1 to enable; 1 is a common default)
|
||||
+#endif
|
||||
+
|
||||
+#if defined(XML_DTD) && XML_GE == 0
|
||||
+# error Either undefine XML_DTD or define XML_GE to 1.
|
||||
+#endif
|
||||
+
|
||||
#if ! defined(_GNU_SOURCE)
|
||||
# define _GNU_SOURCE 1 /* syscall prototype */
|
||||
#endif
|
||||
--
|
||||
2.40.0
|
||||
174
meta/recipes-core/expat/expat/CVE-2023-52426-006.patch
Normal file
174
meta/recipes-core/expat/expat/CVE-2023-52426-006.patch
Normal file
@@ -0,0 +1,174 @@
|
||||
From 2b127c20b220b673cf52c6be8bef725bf04cbeaf Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Thu, 26 Oct 2023 18:32:11 +0200
|
||||
Subject: [PATCH] lib: Make XML_GE==0 use self-references as entity replacement
|
||||
text
|
||||
|
||||
CVE: CVE-2023-52426
|
||||
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/2b127c20b220b673cf52c6be8bef725bf04cbeaf]
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
lib/xmlparse.c | 79 +++++++++++++++++++++++++++++++++++++++++++++-----
|
||||
1 file changed, 71 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index ac3efe1..c479174 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -504,9 +504,13 @@ static enum XML_Error appendAttributeValue(XML_Parser parser, const ENCODING *,
|
||||
static ATTRIBUTE_ID *getAttributeId(XML_Parser parser, const ENCODING *enc,
|
||||
const char *start, const char *end);
|
||||
static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *);
|
||||
+#if XML_GE == 1
|
||||
static enum XML_Error storeEntityValue(XML_Parser parser, const ENCODING *enc,
|
||||
const char *start, const char *end,
|
||||
enum XML_Account account);
|
||||
+#else
|
||||
+static enum XML_Error storeSelfEntityValue(XML_Parser parser, ENTITY *entity);
|
||||
+#endif
|
||||
static int reportProcessingInstruction(XML_Parser parser, const ENCODING *enc,
|
||||
const char *start, const char *end);
|
||||
static int reportComment(XML_Parser parser, const ENCODING *enc,
|
||||
@@ -5040,6 +5044,9 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
|
||||
break;
|
||||
case XML_ROLE_ENTITY_VALUE:
|
||||
if (dtd->keepProcessing) {
|
||||
+#if defined(XML_DTD) || XML_GE == 1
|
||||
+ // This will store the given replacement text in
|
||||
+ // parser->m_declEntity->textPtr.
|
||||
enum XML_Error result
|
||||
= storeEntityValue(parser, enc, s + enc->minBytesPerChar,
|
||||
next - enc->minBytesPerChar, XML_ACCOUNT_NONE);
|
||||
@@ -5060,6 +5067,25 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
|
||||
poolDiscard(&dtd->entityValuePool);
|
||||
if (result != XML_ERROR_NONE)
|
||||
return result;
|
||||
+#else
|
||||
+ // This will store "&entity123;" in parser->m_declEntity->textPtr
|
||||
+ // to end up as "&entity123;" in the handler.
|
||||
+ if (parser->m_declEntity != NULL) {
|
||||
+ const enum XML_Error result
|
||||
+ = storeSelfEntityValue(parser, parser->m_declEntity);
|
||||
+ if (result != XML_ERROR_NONE)
|
||||
+ return result;
|
||||
+
|
||||
+ if (parser->m_entityDeclHandler) {
|
||||
+ *eventEndPP = s;
|
||||
+ parser->m_entityDeclHandler(
|
||||
+ parser->m_handlerArg, parser->m_declEntity->name,
|
||||
+ parser->m_declEntity->is_param, parser->m_declEntity->textPtr,
|
||||
+ parser->m_declEntity->textLen, parser->m_curBase, 0, 0, 0);
|
||||
+ handleDefault = XML_FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
break;
|
||||
case XML_ROLE_DOCTYPE_SYSTEM_ID:
|
||||
@@ -5102,6 +5128,16 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
|
||||
#endif /* XML_DTD */
|
||||
/* fall through */
|
||||
case XML_ROLE_ENTITY_SYSTEM_ID:
|
||||
+#if XML_GE == 0
|
||||
+ // This will store "&entity123;" in entity->textPtr
|
||||
+ // to end up as "&entity123;" in the handler.
|
||||
+ if (parser->m_declEntity != NULL) {
|
||||
+ const enum XML_Error result
|
||||
+ = storeSelfEntityValue(parser, parser->m_declEntity);
|
||||
+ if (result != XML_ERROR_NONE)
|
||||
+ return result;
|
||||
+ }
|
||||
+#endif
|
||||
if (dtd->keepProcessing && parser->m_declEntity) {
|
||||
parser->m_declEntity->systemId
|
||||
= poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar,
|
||||
@@ -6090,6 +6126,7 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
|
||||
/* not reached */
|
||||
}
|
||||
|
||||
+#if XML_GE == 1
|
||||
static enum XML_Error
|
||||
storeEntityValue(XML_Parser parser, const ENCODING *enc,
|
||||
const char *entityTextPtr, const char *entityTextEnd,
|
||||
@@ -6097,12 +6134,12 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
|
||||
DTD *const dtd = parser->m_dtd; /* save one level of indirection */
|
||||
STRING_POOL *pool = &(dtd->entityValuePool);
|
||||
enum XML_Error result = XML_ERROR_NONE;
|
||||
-#ifdef XML_DTD
|
||||
+# ifdef XML_DTD
|
||||
int oldInEntityValue = parser->m_prologState.inEntityValue;
|
||||
parser->m_prologState.inEntityValue = 1;
|
||||
-#else
|
||||
+# else
|
||||
UNUSED_P(account);
|
||||
-#endif /* XML_DTD */
|
||||
+# endif /* XML_DTD */
|
||||
/* never return Null for the value argument in EntityDeclHandler,
|
||||
since this would indicate an external entity; therefore we
|
||||
have to make sure that entityValuePool.start is not null */
|
||||
@@ -6116,18 +6153,18 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
|
||||
= entityTextPtr; /* XmlEntityValueTok doesn't always set the last arg */
|
||||
int tok = XmlEntityValueTok(enc, entityTextPtr, entityTextEnd, &next);
|
||||
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+# if defined(XML_DTD) || XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, entityTextPtr, next, __LINE__,
|
||||
account)) {
|
||||
accountingOnAbort(parser);
|
||||
result = XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
|
||||
goto endEntityValue;
|
||||
}
|
||||
-#endif
|
||||
+# endif
|
||||
|
||||
switch (tok) {
|
||||
case XML_TOK_PARAM_ENTITY_REF:
|
||||
-#ifdef XML_DTD
|
||||
+# ifdef XML_DTD
|
||||
if (parser->m_isParamEntity || enc != parser->m_encoding) {
|
||||
const XML_Char *name;
|
||||
ENTITY *entity;
|
||||
@@ -6270,12 +6307,38 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
|
||||
entityTextPtr = next;
|
||||
}
|
||||
endEntityValue:
|
||||
-#ifdef XML_DTD
|
||||
+# ifdef XML_DTD
|
||||
parser->m_prologState.inEntityValue = oldInEntityValue;
|
||||
-#endif /* XML_DTD */
|
||||
+# endif /* XML_DTD */
|
||||
return result;
|
||||
}
|
||||
|
||||
+#else /* XML_GE == 0 */
|
||||
+
|
||||
+static enum XML_Error
|
||||
+storeSelfEntityValue(XML_Parser parser, ENTITY *entity) {
|
||||
+ // This will store "&entity123;" in entity->textPtr
|
||||
+ // to end up as "&entity123;" in the handler.
|
||||
+ const char *const entity_start = "&";
|
||||
+ const char *const entity_end = ";";
|
||||
+
|
||||
+ STRING_POOL *const pool = &(parser->m_dtd->entityValuePool);
|
||||
+ if (! poolAppendString(pool, entity_start)
|
||||
+ || ! poolAppendString(pool, entity->name)
|
||||
+ || ! poolAppendString(pool, entity_end)) {
|
||||
+ poolDiscard(pool);
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+
|
||||
+ entity->textPtr = poolStart(pool);
|
||||
+ entity->textLen = (int)(poolLength(pool));
|
||||
+ poolFinish(pool);
|
||||
+
|
||||
+ return XML_ERROR_NONE;
|
||||
+}
|
||||
+
|
||||
+#endif /* XML_GE == 0 */
|
||||
+
|
||||
static void FASTCALL
|
||||
normalizeLines(XML_Char *s) {
|
||||
XML_Char *p;
|
||||
--
|
||||
2.40.0
|
||||
53
meta/recipes-core/expat/expat/CVE-2023-52426-007.patch
Normal file
53
meta/recipes-core/expat/expat/CVE-2023-52426-007.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
From d3f7bbd37bef2565d64f31b549e197a3a414574e Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Thu, 26 Oct 2023 01:39:39 +0200
|
||||
Subject: [PATCH] doc/reference.html: Document build time macro XML_GE
|
||||
|
||||
CVE: CVE-2023-52426
|
||||
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/d3f7bbd37bef2565d64f31b549e197a3a414574e]
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
doc/reference.html | 27 +++++++++++++++++++++++++++
|
||||
1 file changed, 27 insertions(+)
|
||||
|
||||
diff --git a/doc/reference.html b/doc/reference.html
|
||||
index 8b0d47d..74ba012 100644
|
||||
--- a/doc/reference.html
|
||||
+++ b/doc/reference.html
|
||||
@@ -359,6 +359,33 @@ and the definition of character types in the case of
|
||||
<code>XML_UNICODE_WCHAR_T</code>. The symbols are:</p>
|
||||
|
||||
<dl class="cpp-symbols">
|
||||
+<dt><a name="XML_GE">XML_GE</a></dt>
|
||||
+<dd>
|
||||
+Added in Expat 2.6.0.
|
||||
+Include support for
|
||||
+<a href="https://www.w3.org/TR/2006/REC-xml-20060816/#sec-physical-struct">general entities</a>
|
||||
+(syntax <code>&e1;</code> to reference and
|
||||
+syntax <code><!ENTITY e1 'value1'></code> (an internal general entity) or
|
||||
+<code><!ENTITY e2 SYSTEM 'file2'></code> (an external general entity) to declare).
|
||||
+With <code>XML_GE</code> enabled, general entities will be replaced by their declared replacement text;
|
||||
+for this to work for <em>external</em> general entities, in addition an
|
||||
+<code><a href="#XML_SetExternalEntityRefHandler">XML_ExternalEntityRefHandler</a></code> must be set using
|
||||
+<code><a href="#XML_SetExternalEntityRefHandler">XML_SetExternalEntityRefHandler</a></code>.
|
||||
+Also, enabling <code>XML_GE</code> makes
|
||||
+the functions <code><a href="#XML_SetBillionLaughsAttackProtectionMaximumAmplification">
|
||||
+XML_SetBillionLaughsAttackProtectionMaximumAmplification</a></code> and <code>
|
||||
+<a href="#XML_SetBillionLaughsAttackProtectionActivationThreshold">
|
||||
+XML_SetBillionLaughsAttackProtectionActivationThreshold</a></code> available.
|
||||
+<br/>
|
||||
+With <code>XML_GE</code> disabled, Expat has a smaller memory footprint and can be faster, but will
|
||||
+not load external general entities and will replace all general entities
|
||||
+(except the <a href="https://www.w3.org/TR/2006/REC-xml-20060816/#sec-predefined-ent">predefined five</a>:
|
||||
+<code>amp</code>, <code>apos</code>, <code>gt</code>, <code>lt</code>, <code>quot</code>)
|
||||
+with a self-reference:
|
||||
+for example, referencing an entity <code>e1</code> via <code>&e1;</code> will be replaced
|
||||
+by text <code>&e1;</code>.
|
||||
+</dd>
|
||||
+
|
||||
<dt>XML_DTD</dt>
|
||||
<dd>Include support for using and reporting DTD-based content. If
|
||||
this is defined, default attribute values from an external DTD subset
|
||||
--
|
||||
2.40.0
|
||||
37
meta/recipes-core/expat/expat/CVE-2023-52426-008.patch
Normal file
37
meta/recipes-core/expat/expat/CVE-2023-52426-008.patch
Normal file
@@ -0,0 +1,37 @@
|
||||
From 2848dc4e7067de503934b388717e7a3d8d0c5bca Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Fri, 27 Oct 2023 18:45:50 +0200
|
||||
Subject: [PATCH] Simplify "! defined(XML_DTD) && XML_GE == 0" to "XML_GE == 0"
|
||||
|
||||
CVE: CVE-2023-52426
|
||||
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/2848dc4e7067de503934b388717e7a3d8d0c5bca]
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
xmlwf/xmlwf.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/xmlwf/xmlwf.c b/xmlwf/xmlwf.c
|
||||
index be23f5a..04ca759 100644
|
||||
--- a/xmlwf/xmlwf.c
|
||||
+++ b/xmlwf/xmlwf.c
|
||||
@@ -1062,7 +1062,7 @@ tmain(int argc, XML_Char **argv) {
|
||||
" (needs a floating point number greater or equal than 1.0)"));
|
||||
exit(XMLWF_EXIT_USAGE_ERROR);
|
||||
}
|
||||
-#if ! defined(XML_DTD) && XML_GE == 0
|
||||
+#if XML_GE == 0
|
||||
ftprintf(stderr,
|
||||
T("Warning: Given amplification limit ignored")
|
||||
T(", xmlwf has been compiled without DTD/GE support.\n"));
|
||||
@@ -1084,7 +1084,7 @@ tmain(int argc, XML_Char **argv) {
|
||||
exit(XMLWF_EXIT_USAGE_ERROR);
|
||||
}
|
||||
attackThresholdGiven = XML_TRUE;
|
||||
-#if ! defined(XML_DTD) && XML_GE == 0
|
||||
+#if XML_GE == 0
|
||||
ftprintf(stderr,
|
||||
T("Warning: Given attack threshold ignored")
|
||||
T(", xmlwf has been compiled without DTD/GE support.\n"));
|
||||
--
|
||||
2.40.0
|
||||
354
meta/recipes-core/expat/expat/CVE-2023-52426-009.patch
Normal file
354
meta/recipes-core/expat/expat/CVE-2023-52426-009.patch
Normal file
@@ -0,0 +1,354 @@
|
||||
From caa27198637683b15d810737bb8a6a81af19bfa5 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Fri, 27 Oct 2023 18:47:37 +0200
|
||||
Subject: [PATCH] Simplify "defined(XML_DTD) || XML_GE == 1" to "XML_GE == 1"
|
||||
|
||||
CVE: CVE-2023-52426
|
||||
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/caa27198637683b15d810737bb8a6a81af19bfa5]
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
lib/expat.h | 2 +-
|
||||
lib/internal.h | 2 +-
|
||||
lib/xmlparse.c | 66 +++++++++++++++++++++++++-------------------------
|
||||
xmlwf/xmlwf.c | 4 +--
|
||||
4 files changed, 37 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/lib/expat.h b/lib/expat.h
|
||||
index 33c94af..fa2eb45 100644
|
||||
--- a/lib/expat.h
|
||||
+++ b/lib/expat.h
|
||||
@@ -1038,7 +1038,7 @@ typedef struct {
|
||||
XMLPARSEAPI(const XML_Feature *)
|
||||
XML_GetFeatureList(void);
|
||||
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
/* Added in Expat 2.4.0 for XML_DTD defined and
|
||||
* added in Expat 2.6.0 for XML_GE == 1. */
|
||||
XMLPARSEAPI(XML_Bool)
|
||||
diff --git a/lib/internal.h b/lib/internal.h
|
||||
index 1851925..03c8fde 100644
|
||||
--- a/lib/internal.h
|
||||
+++ b/lib/internal.h
|
||||
@@ -154,7 +154,7 @@ extern "C" {
|
||||
void _INTERNAL_trim_to_complete_utf8_characters(const char *from,
|
||||
const char **fromLimRef);
|
||||
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
unsigned long long testingAccountingGetCountBytesDirect(XML_Parser parser);
|
||||
unsigned long long testingAccountingGetCountBytesIndirect(XML_Parser parser);
|
||||
const char *unsignedCharToPrintable(unsigned char c);
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index c479174..2d8f4c0 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -416,7 +416,7 @@ enum XML_Account {
|
||||
XML_ACCOUNT_NONE /* i.e. do not account, was accounted already */
|
||||
};
|
||||
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
typedef unsigned long long XmlBigCount;
|
||||
typedef struct accounting {
|
||||
XmlBigCount countBytesDirect;
|
||||
@@ -432,7 +432,7 @@ typedef struct entity_stats {
|
||||
unsigned int maximumDepthSeen;
|
||||
int debugLevel;
|
||||
} ENTITY_STATS;
|
||||
-#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
+#endif /* XML_GE == 1 */
|
||||
|
||||
typedef enum XML_Error PTRCALL Processor(XML_Parser parser, const char *start,
|
||||
const char *end, const char **endPtr);
|
||||
@@ -574,7 +574,7 @@ static XML_Parser parserCreate(const XML_Char *encodingName,
|
||||
|
||||
static void parserInit(XML_Parser parser, const XML_Char *encodingName);
|
||||
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
static float accountingGetCurrentAmplification(XML_Parser rootParser);
|
||||
static void accountingReportStats(XML_Parser originParser, const char *epilog);
|
||||
static void accountingOnAbort(XML_Parser originParser);
|
||||
@@ -597,7 +597,7 @@ static void entityTrackingOnClose(XML_Parser parser, ENTITY *entity,
|
||||
|
||||
static XML_Parser getRootParserOf(XML_Parser parser,
|
||||
unsigned int *outLevelDiff);
|
||||
-#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
+#endif /* XML_GE == 1 */
|
||||
|
||||
static unsigned long getDebugLevel(const char *variableName,
|
||||
unsigned long defaultDebugLevel);
|
||||
@@ -715,7 +715,7 @@ struct XML_ParserStruct {
|
||||
enum XML_ParamEntityParsing m_paramEntityParsing;
|
||||
#endif
|
||||
unsigned long m_hash_secret_salt;
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
ACCOUNTING m_accounting;
|
||||
ENTITY_STATS m_entity_stats;
|
||||
#endif
|
||||
@@ -1175,7 +1175,7 @@ parserInit(XML_Parser parser, const XML_Char *encodingName) {
|
||||
#endif
|
||||
parser->m_hash_secret_salt = 0;
|
||||
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
memset(&parser->m_accounting, 0, sizeof(ACCOUNTING));
|
||||
parser->m_accounting.debugLevel = getDebugLevel("EXPAT_ACCOUNTING_DEBUG", 0u);
|
||||
parser->m_accounting.maximumAmplificationFactor
|
||||
@@ -2534,7 +2534,7 @@ XML_GetFeatureList(void) {
|
||||
#ifdef XML_ATTR_INFO
|
||||
{XML_FEATURE_ATTR_INFO, XML_L("XML_ATTR_INFO"), 0},
|
||||
#endif
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
/* Added in Expat 2.4.0 for XML_DTD defined and
|
||||
* added in Expat 2.6.0 for XML_GE == 1. */
|
||||
{XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT,
|
||||
@@ -2550,7 +2550,7 @@ XML_GetFeatureList(void) {
|
||||
return features;
|
||||
}
|
||||
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
XML_Bool XMLCALL
|
||||
XML_SetBillionLaughsAttackProtectionMaximumAmplification(
|
||||
XML_Parser parser, float maximumAmplificationFactor) {
|
||||
@@ -2572,7 +2572,7 @@ XML_SetBillionLaughsAttackProtectionActivationThreshold(
|
||||
parser->m_accounting.activationThresholdBytes = activationThresholdBytes;
|
||||
return XML_TRUE;
|
||||
}
|
||||
-#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
+#endif /* XML_GE == 1 */
|
||||
|
||||
/* Initially tag->rawName always points into the parse buffer;
|
||||
for those TAG instances opened while the current parse buffer was
|
||||
@@ -2658,13 +2658,13 @@ externalEntityInitProcessor2(XML_Parser parser, const char *start,
|
||||
int tok = XmlContentTok(parser->m_encoding, start, end, &next);
|
||||
switch (tok) {
|
||||
case XML_TOK_BOM:
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, start, next, __LINE__,
|
||||
XML_ACCOUNT_DIRECT)) {
|
||||
accountingOnAbort(parser);
|
||||
return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
|
||||
}
|
||||
-#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
+#endif /* XML_GE == 1 */
|
||||
|
||||
/* If we are at the end of the buffer, this would cause the next stage,
|
||||
i.e. externalEntityInitProcessor3, to pass control directly to
|
||||
@@ -2778,7 +2778,7 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
|
||||
for (;;) {
|
||||
const char *next = s; /* XmlContentTok doesn't always set the last arg */
|
||||
int tok = XmlContentTok(enc, s, end, &next);
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
const char *accountAfter
|
||||
= ((tok == XML_TOK_TRAILING_RSQB) || (tok == XML_TOK_TRAILING_CR))
|
||||
? (haveMore ? s /* i.e. 0 bytes */ : end)
|
||||
@@ -2844,14 +2844,14 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
|
||||
XML_Char ch = (XML_Char)XmlPredefinedEntityName(
|
||||
enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar);
|
||||
if (ch) {
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
/* NOTE: We are replacing 4-6 characters original input for 1 character
|
||||
* so there is no amplification and hence recording without
|
||||
* protection. */
|
||||
accountingDiffTolerated(parser, tok, (char *)&ch,
|
||||
((char *)&ch) + sizeof(XML_Char), __LINE__,
|
||||
XML_ACCOUNT_ENTITY_EXPANSION);
|
||||
-#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
+#endif /* XML_GE == 1 */
|
||||
if (parser->m_characterDataHandler)
|
||||
parser->m_characterDataHandler(parser->m_handlerArg, &ch, 1);
|
||||
else if (parser->m_defaultHandler)
|
||||
@@ -4053,7 +4053,7 @@ doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr,
|
||||
for (;;) {
|
||||
const char *next = s; /* in case of XML_TOK_NONE or XML_TOK_PARTIAL */
|
||||
int tok = XmlCdataSectionTok(enc, s, end, &next);
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+# if XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, s, next, __LINE__, account)) {
|
||||
accountingOnAbort(parser);
|
||||
return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
|
||||
@@ -4205,7 +4205,7 @@ doIgnoreSection(XML_Parser parser, const ENCODING *enc, const char **startPtr,
|
||||
*eventPP = s;
|
||||
*startPtr = NULL;
|
||||
tok = XmlIgnoreSectionTok(enc, s, end, &next);
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+# if XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, s, next, __LINE__,
|
||||
XML_ACCOUNT_DIRECT)) {
|
||||
accountingOnAbort(parser);
|
||||
@@ -4297,7 +4297,7 @@ processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *s,
|
||||
const XML_Char *storedversion = NULL;
|
||||
int standalone = -1;
|
||||
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, XML_TOK_XML_DECL, s, next, __LINE__,
|
||||
XML_ACCOUNT_DIRECT)) {
|
||||
accountingOnAbort(parser);
|
||||
@@ -4504,7 +4504,7 @@ entityValueInitProcessor(XML_Parser parser, const char *s, const char *end,
|
||||
*/
|
||||
else if (tok == XML_TOK_BOM && next == end
|
||||
&& ! parser->m_parsingStatus.finalBuffer) {
|
||||
-# if defined(XML_DTD) || XML_GE == 1
|
||||
+# if XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, s, next, __LINE__,
|
||||
XML_ACCOUNT_DIRECT)) {
|
||||
accountingOnAbort(parser);
|
||||
@@ -4720,7 +4720,7 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
|
||||
}
|
||||
}
|
||||
role = XmlTokenRole(&parser->m_prologState, tok, s, next, enc);
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
switch (role) {
|
||||
case XML_ROLE_INSTANCE_START: // bytes accounted in contentProcessor
|
||||
case XML_ROLE_XML_DECL: // bytes accounted in processXmlDecl
|
||||
@@ -5044,7 +5044,7 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
|
||||
break;
|
||||
case XML_ROLE_ENTITY_VALUE:
|
||||
if (dtd->keepProcessing) {
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
// This will store the given replacement text in
|
||||
// parser->m_declEntity->textPtr.
|
||||
enum XML_Error result
|
||||
@@ -5695,7 +5695,7 @@ epilogProcessor(XML_Parser parser, const char *s, const char *end,
|
||||
for (;;) {
|
||||
const char *next = NULL;
|
||||
int tok = XmlPrologTok(parser->m_encoding, s, end, &next);
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, s, next, __LINE__,
|
||||
XML_ACCOUNT_DIRECT)) {
|
||||
accountingOnAbort(parser);
|
||||
@@ -5775,7 +5775,7 @@ processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl) {
|
||||
return XML_ERROR_NO_MEMORY;
|
||||
}
|
||||
entity->open = XML_TRUE;
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
entityTrackingOnOpen(parser, entity, __LINE__);
|
||||
#endif
|
||||
entity->processed = 0;
|
||||
@@ -5809,9 +5809,9 @@ processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl) {
|
||||
entity->processed = (int)(next - textStart);
|
||||
parser->m_processor = internalEntityProcessor;
|
||||
} else {
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
entityTrackingOnClose(parser, entity, __LINE__);
|
||||
-#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
+#endif /* XML_GE == 1 */
|
||||
entity->open = XML_FALSE;
|
||||
parser->m_openInternalEntities = openEntity->next;
|
||||
/* put openEntity back in list of free instances */
|
||||
@@ -5860,7 +5860,7 @@ internalEntityProcessor(XML_Parser parser, const char *s, const char *end,
|
||||
return result;
|
||||
}
|
||||
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
entityTrackingOnClose(parser, entity, __LINE__);
|
||||
#endif
|
||||
entity->open = XML_FALSE;
|
||||
@@ -5939,7 +5939,7 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
|
||||
const char *next
|
||||
= ptr; /* XmlAttributeValueTok doesn't always set the last arg */
|
||||
int tok = XmlAttributeValueTok(enc, ptr, end, &next);
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, ptr, next, __LINE__, account)) {
|
||||
accountingOnAbort(parser);
|
||||
return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
|
||||
@@ -6004,14 +6004,14 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
|
||||
XML_Char ch = (XML_Char)XmlPredefinedEntityName(
|
||||
enc, ptr + enc->minBytesPerChar, next - enc->minBytesPerChar);
|
||||
if (ch) {
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
/* NOTE: We are replacing 4-6 characters original input for 1 character
|
||||
* so there is no amplification and hence recording without
|
||||
* protection. */
|
||||
accountingDiffTolerated(parser, tok, (char *)&ch,
|
||||
((char *)&ch) + sizeof(XML_Char), __LINE__,
|
||||
XML_ACCOUNT_ENTITY_EXPANSION);
|
||||
-#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
+#endif /* XML_GE == 1 */
|
||||
if (! poolAppendChar(pool, ch))
|
||||
return XML_ERROR_NO_MEMORY;
|
||||
break;
|
||||
@@ -6089,14 +6089,14 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
|
||||
enum XML_Error result;
|
||||
const XML_Char *textEnd = entity->textPtr + entity->textLen;
|
||||
entity->open = XML_TRUE;
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
entityTrackingOnOpen(parser, entity, __LINE__);
|
||||
#endif
|
||||
result = appendAttributeValue(parser, parser->m_internalEncoding,
|
||||
isCdata, (const char *)entity->textPtr,
|
||||
(const char *)textEnd, pool,
|
||||
XML_ACCOUNT_ENTITY_EXPANSION);
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
entityTrackingOnClose(parser, entity, __LINE__);
|
||||
#endif
|
||||
entity->open = XML_FALSE;
|
||||
@@ -6153,7 +6153,7 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
|
||||
= entityTextPtr; /* XmlEntityValueTok doesn't always set the last arg */
|
||||
int tok = XmlEntityValueTok(enc, entityTextPtr, entityTextEnd, &next);
|
||||
|
||||
-# if defined(XML_DTD) || XML_GE == 1
|
||||
+# if XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, entityTextPtr, next, __LINE__,
|
||||
account)) {
|
||||
accountingOnAbort(parser);
|
||||
@@ -7725,7 +7725,7 @@ copyString(const XML_Char *s, const XML_Memory_Handling_Suite *memsuite) {
|
||||
return result;
|
||||
}
|
||||
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
|
||||
static float
|
||||
accountingGetCurrentAmplification(XML_Parser rootParser) {
|
||||
@@ -8456,7 +8456,7 @@ unsignedCharToPrintable(unsigned char c) {
|
||||
assert(0); /* never gets here */
|
||||
}
|
||||
|
||||
-#endif /* defined(XML_DTD) || XML_GE == 1 */
|
||||
+#endif /* XML_GE == 1 */
|
||||
|
||||
static unsigned long
|
||||
getDebugLevel(const char *variableName, unsigned long defaultDebugLevel) {
|
||||
diff --git a/xmlwf/xmlwf.c b/xmlwf/xmlwf.c
|
||||
index 04ca759..dd023a9 100644
|
||||
--- a/xmlwf/xmlwf.c
|
||||
+++ b/xmlwf/xmlwf.c
|
||||
@@ -1122,13 +1122,13 @@ tmain(int argc, XML_Char **argv) {
|
||||
}
|
||||
|
||||
if (attackMaximumAmplification != -1.0f) {
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
XML_SetBillionLaughsAttackProtectionMaximumAmplification(
|
||||
parser, attackMaximumAmplification);
|
||||
#endif
|
||||
}
|
||||
if (attackThresholdGiven) {
|
||||
-#if defined(XML_DTD) || XML_GE == 1
|
||||
+#if XML_GE == 1
|
||||
XML_SetBillionLaughsAttackProtectionActivationThreshold(
|
||||
parser, attackThresholdBytes);
|
||||
#else
|
||||
--
|
||||
2.40.0
|
||||
50
meta/recipes-core/expat/expat/CVE-2023-52426-010.patch
Normal file
50
meta/recipes-core/expat/expat/CVE-2023-52426-010.patch
Normal file
@@ -0,0 +1,50 @@
|
||||
From 55fecd6aa4af4a540812b81234679cd6b5714f1b Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Wed, 1 Nov 2023 18:24:55 +0100
|
||||
Subject: [PATCH] Drop redundant "XML_GE == 1" guards
|
||||
|
||||
These are redundant because further out there is a guard
|
||||
for "XML_GE == 1" already. In the visual world, the pattern
|
||||
is this:
|
||||
|
||||
> #if XML_GE == 1
|
||||
> [..]
|
||||
> # if XML_GE == 1
|
||||
> [..]
|
||||
> # endif
|
||||
> [..]
|
||||
> #endif
|
||||
|
||||
Spotted by Snild Dolkow, thanks!
|
||||
|
||||
Co-authored-by: Snild Dolkow <snild@sony.com>
|
||||
|
||||
CVE: CVE-2023-52426
|
||||
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/55fecd6aa4af4a540812b81234679cd6b5714f1b]
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
lib/xmlparse.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index 2d8f4c0..82a8006 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -6153,14 +6153,12 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
|
||||
= entityTextPtr; /* XmlEntityValueTok doesn't always set the last arg */
|
||||
int tok = XmlEntityValueTok(enc, entityTextPtr, entityTextEnd, &next);
|
||||
|
||||
-# if XML_GE == 1
|
||||
if (! accountingDiffTolerated(parser, tok, entityTextPtr, next, __LINE__,
|
||||
account)) {
|
||||
accountingOnAbort(parser);
|
||||
result = XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
|
||||
goto endEntityValue;
|
||||
}
|
||||
-# endif
|
||||
|
||||
switch (tok) {
|
||||
case XML_TOK_PARAM_ENTITY_REF:
|
||||
--
|
||||
2.40.0
|
||||
45
meta/recipes-core/expat/expat/CVE-2023-52426-011.patch
Normal file
45
meta/recipes-core/expat/expat/CVE-2023-52426-011.patch
Normal file
@@ -0,0 +1,45 @@
|
||||
From 8a6c61de4a425977e357cafd8667a0d7771ce292 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Thu, 26 Oct 2023 01:29:03 +0200
|
||||
Subject: [PATCH] lib: Add XML_GE to XML_GetFeatureList and XML_FeatureEnum
|
||||
Co-authored-by: Snild Dolkow <snild@sony.com>
|
||||
|
||||
CVE: CVE-2023-52426
|
||||
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/8a6c61de4a425977e357cafd8667a0d7771ce292]
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
lib/expat.h | 4 +++-
|
||||
lib/xmlparse.c | 2 ++
|
||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/expat.h b/lib/expat.h
|
||||
index fa2eb45..9e64174 100644
|
||||
--- a/lib/expat.h
|
||||
+++ b/lib/expat.h
|
||||
@@ -1025,7 +1025,9 @@ enum XML_FeatureEnum {
|
||||
XML_FEATURE_ATTR_INFO,
|
||||
/* Added in Expat 2.4.0. */
|
||||
XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT,
|
||||
- XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT
|
||||
+ XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT,
|
||||
+ /* Added in Expat 2.6.0. */
|
||||
+ XML_FEATURE_GE
|
||||
/* Additional features must be added to the end of this enum. */
|
||||
};
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index 82a8006..0627d6c 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -2544,6 +2544,8 @@ XML_GetFeatureList(void) {
|
||||
{XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT,
|
||||
XML_L("XML_BLAP_ACT_THRES"),
|
||||
EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT},
|
||||
+ /* Added in Expat 2.6.0. */
|
||||
+ {XML_FEATURE_GE, XML_L("XML_GE"), 0},
|
||||
#endif
|
||||
{XML_FEATURE_END, NULL, 0}};
|
||||
|
||||
--
|
||||
2.40.0
|
||||
58
meta/recipes-core/expat/expat/CVE-2024-28757.patch
Executable file
58
meta/recipes-core/expat/expat/CVE-2024-28757.patch
Executable file
@@ -0,0 +1,58 @@
|
||||
From 1d50b80cf31de87750103656f6eb693746854aa8 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Mon, 4 Mar 2024 23:49:06 +0100
|
||||
Subject: [PATCH] lib/xmlparse.c: Detect billion laughs attack with isolated
|
||||
external parser
|
||||
|
||||
When parsing DTD content with code like ..
|
||||
|
||||
XML_Parser parser = XML_ParserCreate(NULL);
|
||||
XML_Parser ext_parser = XML_ExternalEntityParserCreate(parser, NULL, NULL);
|
||||
enum XML_Status status = XML_Parse(ext_parser, doc, (int)strlen(doc), XML_TRUE);
|
||||
|
||||
.. there are 0 bytes accounted as direct input and all input from `doc` accounted
|
||||
as indirect input. Now function accountingGetCurrentAmplification cannot calculate
|
||||
the current amplification ratio as "(direct + indirect) / direct", and it did refuse
|
||||
to divide by 0 as one would expect, but it returned 1.0 for this case to indicate
|
||||
no amplification over direct input. As a result, billion laughs attacks from
|
||||
DTD-only input were not detected with this isolated way of using an external parser.
|
||||
|
||||
The new approach is to assume direct input of length not 0 but 22 -- derived from
|
||||
ghost input "<!ENTITY a SYSTEM 'b'>", the shortest possible way to include an external
|
||||
DTD --, and do the usual "(direct + indirect) / direct" math with "direct := 22".
|
||||
|
||||
GitHub issue #839 has more details on this issue and its origin in ClusterFuzz
|
||||
finding 66812.
|
||||
|
||||
CVE: CVE-2024-28757
|
||||
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/1d50b80cf31de87750103656f6eb693746854aa8]
|
||||
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
lib/xmlparse.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index b884d82b5..d44baa68d 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -7655,6 +7655,8 @@ copyString(const XML_Char *s, const XML_Memory_Handling_Suite *memsuite) {
|
||||
|
||||
static float
|
||||
accountingGetCurrentAmplification(XML_Parser rootParser) {
|
||||
+ // 1.........1.........12 => 22
|
||||
+ const size_t lenOfShortestInclude = sizeof("<!ENTITY a SYSTEM 'b'>") - 1;
|
||||
const XmlBigCount countBytesOutput
|
||||
= rootParser->m_accounting.countBytesDirect
|
||||
+ rootParser->m_accounting.countBytesIndirect;
|
||||
@@ -7662,7 +7664,9 @@ accountingGetCurrentAmplification(XML_Parser rootParser) {
|
||||
= rootParser->m_accounting.countBytesDirect
|
||||
? (countBytesOutput
|
||||
/ (float)(rootParser->m_accounting.countBytesDirect))
|
||||
- : 1.0f;
|
||||
+ : ((lenOfShortestInclude
|
||||
+ + rootParser->m_accounting.countBytesIndirect)
|
||||
+ / (float)lenOfShortestInclude);
|
||||
assert(! rootParser->m_parentParser);
|
||||
return amplificationFactor;
|
||||
}
|
||||
@@ -10,6 +10,18 @@ VERSION_TAG = "${@d.getVar('PV').replace('.', '_')}"
|
||||
|
||||
SRC_URI = "https://github.com/libexpat/libexpat/releases/download/R_${VERSION_TAG}/expat-${PV}.tar.bz2 \
|
||||
file://run-ptest \
|
||||
file://CVE-2024-28757.patch \
|
||||
file://CVE-2023-52426-001.patch \
|
||||
file://CVE-2023-52426-002.patch \
|
||||
file://CVE-2023-52426-003.patch \
|
||||
file://CVE-2023-52426-004.patch \
|
||||
file://CVE-2023-52426-005.patch \
|
||||
file://CVE-2023-52426-006.patch \
|
||||
file://CVE-2023-52426-007.patch \
|
||||
file://CVE-2023-52426-008.patch \
|
||||
file://CVE-2023-52426-009.patch \
|
||||
file://CVE-2023-52426-010.patch \
|
||||
file://CVE-2023-52426-011.patch \
|
||||
"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://github.com/libexpat/libexpat/releases/"
|
||||
|
||||
129
meta/recipes-core/glib-2.0/glib-2.0/CVE-2024-34397_01.patch
Normal file
129
meta/recipes-core/glib-2.0/glib-2.0/CVE-2024-34397_01.patch
Normal file
@@ -0,0 +1,129 @@
|
||||
From c4e3022918565253ffad52449dd0e648b6d772c7 Mon Sep 17 00:00:00 2001
|
||||
From: Philip Withnall <pwithnall@gnome.org>
|
||||
Date: Tue, 28 Nov 2023 12:58:20 +0000
|
||||
Subject: [PATCH 01/18] gdbusmessage: Cache the arg0 value
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Technically we can’t rely on it being kept alive by the `message->body`
|
||||
pointer, unless we can guarantee that the `GVariant` is always
|
||||
serialised. That’s not necessarily the case, so keep a separate ref on
|
||||
the arg0 value at all times.
|
||||
|
||||
This avoids a potential use-after-free.
|
||||
|
||||
Spotted by Thomas Haller in
|
||||
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3720#note_1924707.
|
||||
|
||||
[This is a prerequisite for having tests pass after fixing the
|
||||
vulnerability described in glib#3268, because after fixing that
|
||||
vulnerability, the use-after-free genuinely does happen during
|
||||
regression testing. -smcv]
|
||||
|
||||
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
|
||||
|
||||
Helps: #3183, #3268
|
||||
(cherry picked from commit 10e9a917be7fb92b6b27837ef7a7f1d0be6095d5)
|
||||
|
||||
CVE: CVE-2024-34397
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/c4e3022918565253ffad52449dd0e648b6d772c7]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
gio/gdbusmessage.c | 35 ++++++++++++++++++++++-------------
|
||||
1 file changed, 22 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
|
||||
index ecef6cd3c..3fd1151ca 100644
|
||||
--- a/gio/gdbusmessage.c
|
||||
+++ b/gio/gdbusmessage.c
|
||||
@@ -506,6 +506,7 @@ struct _GDBusMessage
|
||||
guint32 serial;
|
||||
GHashTable *headers;
|
||||
GVariant *body;
|
||||
+ GVariant *arg0_cache; /* (nullable) (owned) */
|
||||
#ifdef G_OS_UNIX
|
||||
GUnixFDList *fd_list;
|
||||
#endif
|
||||
@@ -528,6 +529,7 @@ g_dbus_message_finalize (GObject *object)
|
||||
g_hash_table_unref (message->headers);
|
||||
if (message->body != NULL)
|
||||
g_variant_unref (message->body);
|
||||
+ g_clear_pointer (&message->arg0_cache, g_variant_unref);
|
||||
#ifdef G_OS_UNIX
|
||||
if (message->fd_list != NULL)
|
||||
g_object_unref (message->fd_list);
|
||||
@@ -1163,6 +1165,7 @@ g_dbus_message_set_body (GDBusMessage *message,
|
||||
if (body == NULL)
|
||||
{
|
||||
message->body = NULL;
|
||||
+ message->arg0_cache = NULL;
|
||||
g_dbus_message_set_signature (message, NULL);
|
||||
}
|
||||
else
|
||||
@@ -1173,6 +1176,12 @@ g_dbus_message_set_body (GDBusMessage *message,
|
||||
|
||||
message->body = g_variant_ref_sink (body);
|
||||
|
||||
+ if (g_variant_is_of_type (message->body, G_VARIANT_TYPE_TUPLE) &&
|
||||
+ g_variant_n_children (message->body) > 0)
|
||||
+ message->arg0_cache = g_variant_get_child_value (message->body, 0);
|
||||
+ else
|
||||
+ message->arg0_cache = NULL;
|
||||
+
|
||||
type_string = g_variant_get_type_string (body);
|
||||
type_string_len = strlen (type_string);
|
||||
g_assert (type_string_len >= 2);
|
||||
@@ -2325,6 +2334,14 @@ g_dbus_message_new_from_blob (guchar *blob,
|
||||
2,
|
||||
&local_error);
|
||||
g_variant_type_free (variant_type);
|
||||
+
|
||||
+ if (message->body != NULL &&
|
||||
+ g_variant_is_of_type (message->body, G_VARIANT_TYPE_TUPLE) &&
|
||||
+ g_variant_n_children (message->body) > 0)
|
||||
+ message->arg0_cache = g_variant_get_child_value (message->body, 0);
|
||||
+ else
|
||||
+ message->arg0_cache = NULL;
|
||||
+
|
||||
if (message->body == NULL)
|
||||
goto fail;
|
||||
}
|
||||
@@ -3364,22 +3381,13 @@ g_dbus_message_set_signature (GDBusMessage *message,
|
||||
const gchar *
|
||||
g_dbus_message_get_arg0 (GDBusMessage *message)
|
||||
{
|
||||
- const gchar *ret;
|
||||
-
|
||||
g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL);
|
||||
|
||||
- ret = NULL;
|
||||
+ if (message->arg0_cache != NULL &&
|
||||
+ g_variant_is_of_type (message->arg0_cache, G_VARIANT_TYPE_STRING))
|
||||
+ return g_variant_get_string (message->arg0_cache, NULL);
|
||||
|
||||
- if (message->body != NULL && g_variant_is_of_type (message->body, G_VARIANT_TYPE_TUPLE))
|
||||
- {
|
||||
- GVariant *item;
|
||||
- item = g_variant_get_child_value (message->body, 0);
|
||||
- if (g_variant_is_of_type (item, G_VARIANT_TYPE_STRING))
|
||||
- ret = g_variant_get_string (item, NULL);
|
||||
- g_variant_unref (item);
|
||||
- }
|
||||
-
|
||||
- return ret;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------- */
|
||||
@@ -3822,6 +3830,7 @@ g_dbus_message_copy (GDBusMessage *message,
|
||||
* to just ref (as opposed to deep-copying) the GVariant instances
|
||||
*/
|
||||
ret->body = message->body != NULL ? g_variant_ref (message->body) : NULL;
|
||||
+ ret->arg0_cache = message->arg0_cache != NULL ? g_variant_ref (message->arg0_cache) : NULL;
|
||||
g_hash_table_iter_init (&iter, message->headers);
|
||||
while (g_hash_table_iter_next (&iter, &header_key, (gpointer) &header_value))
|
||||
g_hash_table_insert (ret->headers, header_key, g_variant_ref (header_value));
|
||||
--
|
||||
2.30.2
|
||||
|
||||
62
meta/recipes-core/glib-2.0/glib-2.0/CVE-2024-34397_02.patch
Normal file
62
meta/recipes-core/glib-2.0/glib-2.0/CVE-2024-34397_02.patch
Normal file
@@ -0,0 +1,62 @@
|
||||
From c805fd3862baaa114d1cceee27cc931264894c98 Mon Sep 17 00:00:00 2001
|
||||
From: Simon McVittie <smcv@collabora.com>
|
||||
Date: Wed, 1 May 2024 15:51:42 +0100
|
||||
Subject: [PATCH 02/18] gdbusconnection: Make a backport of g_set_str()
|
||||
available
|
||||
|
||||
A subsequent commit will need this. Copying all of g_set_str() into a
|
||||
private header seems cleaner than replacing the call to it.
|
||||
|
||||
Helps: GNOME/glib#3268
|
||||
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
||||
|
||||
CVE: CVE-2024-34397
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/c805fd3862baaa114d1cceee27cc931264894c98]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
gio/gdbusconnection.c | 1 +
|
||||
glib/glib-private.h | 18 ++++++++++++++++++
|
||||
2 files changed, 19 insertions(+)
|
||||
|
||||
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
|
||||
index 1159c2db4..82a68437b 100644
|
||||
--- a/gio/gdbusconnection.c
|
||||
+++ b/gio/gdbusconnection.c
|
||||
@@ -95,6 +95,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
+#include "glib-private.h"
|
||||
#include "gdbusauth.h"
|
||||
#include "gdbusutils.h"
|
||||
#include "gdbusaddress.h"
|
||||
diff --git a/glib/glib-private.h b/glib/glib-private.h
|
||||
index 943252f1b..f02828ff5 100644
|
||||
--- a/glib/glib-private.h
|
||||
+++ b/glib/glib-private.h
|
||||
@@ -201,4 +201,22 @@ GLibPrivateVTable *glib__private__ (void);
|
||||
# define GLIB_DEFAULT_LOCALE ""
|
||||
#endif
|
||||
|
||||
+/* Backported from GLib 2.78.x, where it is public API in gstrfuncs.h */
|
||||
+static inline gboolean
|
||||
+g_set_str (char **str_pointer,
|
||||
+ const char *new_str)
|
||||
+{
|
||||
+ char *copy;
|
||||
+
|
||||
+ if (*str_pointer == new_str ||
|
||||
+ (*str_pointer && new_str && strcmp (*str_pointer, new_str) == 0))
|
||||
+ return FALSE;
|
||||
+
|
||||
+ copy = g_strdup (new_str);
|
||||
+ g_free (*str_pointer);
|
||||
+ *str_pointer = copy;
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
#endif /* __GLIB_PRIVATE_H__ */
|
||||
--
|
||||
2.30.2
|
||||
|
||||
985
meta/recipes-core/glib-2.0/glib-2.0/CVE-2024-34397_03.patch
Normal file
985
meta/recipes-core/glib-2.0/glib-2.0/CVE-2024-34397_03.patch
Normal file
@@ -0,0 +1,985 @@
|
||||
From 8b1d90457e2e72f1d7db7cb77b74754af3a5c4ef Mon Sep 17 00:00:00 2001
|
||||
From: Simon McVittie <smcv@collabora.com>
|
||||
Date: Fri, 8 Mar 2024 14:19:46 +0000
|
||||
Subject: [PATCH 03/18] tests: Add a data-driven test for signal subscriptions
|
||||
|
||||
This somewhat duplicates test_connection_signals(), but is easier to
|
||||
extend to cover different scenarios.
|
||||
|
||||
Each scenario is tested three times: once with lower-level
|
||||
GDBusConnection APIs, once with the higher-level GDBusProxy (which
|
||||
cannot implement all of the subscription scenarios, so some message
|
||||
counts are lower), and once with both (to check that delivery of the
|
||||
same message to multiple destinations is handled appropriately).
|
||||
|
||||
[Backported to glib-2-74, resolving conflicts in gio/tests/meson.build]
|
||||
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
||||
|
||||
CVE: CVE-2024-34397
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/8b1d90457e2e72f1d7db7cb77b74754af3a5c4ef]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
gio/tests/gdbus-subscribe.c | 938 ++++++++++++++++++++++++++++++++++++
|
||||
gio/tests/meson.build | 1 +
|
||||
2 files changed, 939 insertions(+)
|
||||
create mode 100644 gio/tests/gdbus-subscribe.c
|
||||
|
||||
diff --git a/gio/tests/gdbus-subscribe.c b/gio/tests/gdbus-subscribe.c
|
||||
new file mode 100644
|
||||
index 000000000..3f53e1d7f
|
||||
--- /dev/null
|
||||
+++ b/gio/tests/gdbus-subscribe.c
|
||||
@@ -0,0 +1,938 @@
|
||||
+/*
|
||||
+ * Copyright 2024 Collabora Ltd.
|
||||
+ * SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
+ */
|
||||
+
|
||||
+#include <gio/gio.h>
|
||||
+
|
||||
+#include "gdbus-tests.h"
|
||||
+
|
||||
+#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
|
||||
+#define DBUS_PATH_DBUS "/org/freedesktop/DBus"
|
||||
+#define DBUS_INTERFACE_DBUS DBUS_SERVICE_DBUS
|
||||
+
|
||||
+/* A signal that each connection emits to indicate that it has finished
|
||||
+ * emitting other signals */
|
||||
+#define FINISHED_PATH "/org/gtk/Test/Finished"
|
||||
+#define FINISHED_INTERFACE "org.gtk.Test.Finished"
|
||||
+#define FINISHED_SIGNAL "Finished"
|
||||
+
|
||||
+/* A signal emitted during testing */
|
||||
+#define EXAMPLE_PATH "/org/gtk/GDBus/ExampleInterface"
|
||||
+#define EXAMPLE_INTERFACE "org.gtk.GDBus.ExampleInterface"
|
||||
+#define FOO_SIGNAL "Foo"
|
||||
+
|
||||
+/* Log @s in a debug message. */
|
||||
+static inline const char *
|
||||
+nonnull (const char *s,
|
||||
+ const char *if_null)
|
||||
+{
|
||||
+ return (s == NULL) ? if_null : s;
|
||||
+}
|
||||
+
|
||||
+typedef enum
|
||||
+{
|
||||
+ TEST_CONN_NONE,
|
||||
+ TEST_CONN_FIRST,
|
||||
+ /* A connection that subscribes to signals */
|
||||
+ TEST_CONN_SUBSCRIBER = TEST_CONN_FIRST,
|
||||
+ /* A mockup of a legitimate service */
|
||||
+ TEST_CONN_SERVICE,
|
||||
+ /* A mockup of a second legitimate service */
|
||||
+ TEST_CONN_SERVICE2,
|
||||
+ /* A connection that tries to trick @subscriber into processing its signals
|
||||
+ * as if they came from @service */
|
||||
+ TEST_CONN_ATTACKER,
|
||||
+ NUM_TEST_CONNS
|
||||
+} TestConn;
|
||||
+
|
||||
+static const char * const test_conn_descriptions[NUM_TEST_CONNS] =
|
||||
+{
|
||||
+ "(unused)",
|
||||
+ "subscriber",
|
||||
+ "service",
|
||||
+ "service 2",
|
||||
+ "attacker"
|
||||
+};
|
||||
+
|
||||
+typedef enum
|
||||
+{
|
||||
+ SUBSCRIPTION_MODE_CONN,
|
||||
+ SUBSCRIPTION_MODE_PROXY,
|
||||
+ SUBSCRIPTION_MODE_PARALLEL
|
||||
+} SubscriptionMode;
|
||||
+
|
||||
+typedef struct
|
||||
+{
|
||||
+ GDBusProxy *received_by_proxy;
|
||||
+ TestConn sender;
|
||||
+ char *path;
|
||||
+ char *iface;
|
||||
+ char *member;
|
||||
+ GVariant *parameters;
|
||||
+ char *arg0;
|
||||
+ guint32 step;
|
||||
+} ReceivedMessage;
|
||||
+
|
||||
+static void
|
||||
+received_message_free (ReceivedMessage *self)
|
||||
+{
|
||||
+
|
||||
+ g_clear_object (&self->received_by_proxy);
|
||||
+ g_free (self->path);
|
||||
+ g_free (self->iface);
|
||||
+ g_free (self->member);
|
||||
+ g_clear_pointer (&self->parameters, g_variant_unref);
|
||||
+ g_free (self->arg0);
|
||||
+ g_free (self);
|
||||
+}
|
||||
+
|
||||
+typedef struct
|
||||
+{
|
||||
+ TestConn sender;
|
||||
+ TestConn unicast_to;
|
||||
+ const char *path;
|
||||
+ const char *iface;
|
||||
+ const char *member;
|
||||
+ const char *arg0;
|
||||
+ guint received_by_conn;
|
||||
+ guint received_by_proxy;
|
||||
+} TestEmitSignal;
|
||||
+
|
||||
+typedef struct
|
||||
+{
|
||||
+ TestConn sender;
|
||||
+ const char *path;
|
||||
+ const char *iface;
|
||||
+ const char *member;
|
||||
+ const char *arg0;
|
||||
+ GDBusSignalFlags flags;
|
||||
+} TestSubscribe;
|
||||
+
|
||||
+typedef enum
|
||||
+{
|
||||
+ TEST_ACTION_NONE = 0,
|
||||
+ TEST_ACTION_SUBSCRIBE,
|
||||
+ TEST_ACTION_EMIT_SIGNAL,
|
||||
+} TestAction;
|
||||
+
|
||||
+typedef struct
|
||||
+{
|
||||
+ TestAction action;
|
||||
+ union {
|
||||
+ TestEmitSignal signal;
|
||||
+ TestSubscribe subscribe;
|
||||
+ } u;
|
||||
+} TestStep;
|
||||
+
|
||||
+/* Arbitrary, extend as necessary to accommodate the longest test */
|
||||
+#define MAX_TEST_STEPS 10
|
||||
+
|
||||
+typedef struct
|
||||
+{
|
||||
+ const char *description;
|
||||
+ TestStep steps[MAX_TEST_STEPS];
|
||||
+} TestPlan;
|
||||
+
|
||||
+static const TestPlan plan_simple =
|
||||
+{
|
||||
+ .description = "A broadcast is only received after subscribing to it",
|
||||
+ .steps = {
|
||||
+ {
|
||||
+ /* We don't receive a signal if we haven't subscribed yet */
|
||||
+ .action = TEST_ACTION_EMIT_SIGNAL,
|
||||
+ .u.signal = {
|
||||
+ .sender = TEST_CONN_SERVICE,
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ .member = FOO_SIGNAL,
|
||||
+ .received_by_conn = 0,
|
||||
+ .received_by_proxy = 0
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ .action = TEST_ACTION_SUBSCRIBE,
|
||||
+ .u.subscribe = {
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ /* Now it works */
|
||||
+ .action = TEST_ACTION_EMIT_SIGNAL,
|
||||
+ .u.signal = {
|
||||
+ .sender = TEST_CONN_SERVICE,
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ .member = FOO_SIGNAL,
|
||||
+ .received_by_conn = 1,
|
||||
+ /* The proxy can't be used in this case, because it needs
|
||||
+ * a bus name to subscribe to */
|
||||
+ .received_by_proxy = 0
|
||||
+ },
|
||||
+ },
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static const TestPlan plan_broadcast_from_anyone =
|
||||
+{
|
||||
+ .description = "A subscription with NULL sender accepts broadcast and unicast",
|
||||
+ .steps = {
|
||||
+ {
|
||||
+ /* Subscriber wants to receive signals from anyone */
|
||||
+ .action = TEST_ACTION_SUBSCRIBE,
|
||||
+ .u.subscribe = {
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ /* First service sends a broadcast */
|
||||
+ .action = TEST_ACTION_EMIT_SIGNAL,
|
||||
+ .u.signal = {
|
||||
+ .sender = TEST_CONN_SERVICE,
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ .member = FOO_SIGNAL,
|
||||
+ .received_by_conn = 1,
|
||||
+ .received_by_proxy = 0
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ /* Second service also sends a broadcast */
|
||||
+ .action = TEST_ACTION_EMIT_SIGNAL,
|
||||
+ .u.signal = {
|
||||
+ .sender = TEST_CONN_SERVICE2,
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ .member = FOO_SIGNAL,
|
||||
+ .received_by_conn = 1,
|
||||
+ .received_by_proxy = 0
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ /* First service sends a unicast signal */
|
||||
+ .action = TEST_ACTION_EMIT_SIGNAL,
|
||||
+ .u.signal = {
|
||||
+ .sender = TEST_CONN_SERVICE,
|
||||
+ .unicast_to = TEST_CONN_SUBSCRIBER,
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ .member = FOO_SIGNAL,
|
||||
+ .received_by_conn = 1,
|
||||
+ .received_by_proxy = 0
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ /* Second service also sends a unicast signal */
|
||||
+ .action = TEST_ACTION_EMIT_SIGNAL,
|
||||
+ .u.signal = {
|
||||
+ .sender = TEST_CONN_SERVICE2,
|
||||
+ .unicast_to = TEST_CONN_SUBSCRIBER,
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ .member = FOO_SIGNAL,
|
||||
+ .received_by_conn = 1,
|
||||
+ .received_by_proxy = 0
|
||||
+ },
|
||||
+ },
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static const TestPlan plan_match_twice =
|
||||
+{
|
||||
+ .description = "A message matching more than one subscription is received "
|
||||
+ "once per subscription",
|
||||
+ .steps = {
|
||||
+ {
|
||||
+ .action = TEST_ACTION_SUBSCRIBE,
|
||||
+ .u.subscribe = {
|
||||
+ .sender = TEST_CONN_SERVICE,
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ .action = TEST_ACTION_SUBSCRIBE,
|
||||
+ .u.subscribe = {
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ .action = TEST_ACTION_SUBSCRIBE,
|
||||
+ .u.subscribe = {
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ .action = TEST_ACTION_SUBSCRIBE,
|
||||
+ .u.subscribe = {
|
||||
+ .sender = TEST_CONN_SERVICE,
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ .action = TEST_ACTION_EMIT_SIGNAL,
|
||||
+ .u.signal = {
|
||||
+ .sender = TEST_CONN_SERVICE,
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ .member = FOO_SIGNAL,
|
||||
+ .received_by_conn = 4,
|
||||
+ /* Only the first and last work with GDBusProxy */
|
||||
+ .received_by_proxy = 2
|
||||
+ },
|
||||
+ },
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static const TestPlan plan_limit_by_unique_name =
|
||||
+{
|
||||
+ .description = "A subscription via a unique name only accepts messages "
|
||||
+ "sent by that same unique name",
|
||||
+ .steps = {
|
||||
+ {
|
||||
+ /* Subscriber wants to receive signals from service */
|
||||
+ .action = TEST_ACTION_SUBSCRIBE,
|
||||
+ .u.subscribe = {
|
||||
+ .sender = TEST_CONN_SERVICE,
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ /* Attacker wants to trick subscriber into thinking that service
|
||||
+ * sent a signal */
|
||||
+ .action = TEST_ACTION_EMIT_SIGNAL,
|
||||
+ .u.signal = {
|
||||
+ .sender = TEST_CONN_ATTACKER,
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ .member = FOO_SIGNAL,
|
||||
+ .received_by_conn = 0,
|
||||
+ .received_by_proxy = 0
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ /* Attacker tries harder, by sending a signal unicast directly to
|
||||
+ * the subscriber */
|
||||
+ .action = TEST_ACTION_EMIT_SIGNAL,
|
||||
+ .u.signal = {
|
||||
+ .sender = TEST_CONN_ATTACKER,
|
||||
+ .unicast_to = TEST_CONN_SUBSCRIBER,
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ .member = FOO_SIGNAL,
|
||||
+ .received_by_conn = 0,
|
||||
+ .received_by_proxy = 0
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ /* When the real service sends a signal, it should still get through */
|
||||
+ .action = TEST_ACTION_EMIT_SIGNAL,
|
||||
+ .u.signal = {
|
||||
+ .sender = TEST_CONN_SERVICE,
|
||||
+ .path = EXAMPLE_PATH,
|
||||
+ .iface = EXAMPLE_INTERFACE,
|
||||
+ .member = FOO_SIGNAL,
|
||||
+ .received_by_conn = 1,
|
||||
+ .received_by_proxy = 1
|
||||
+ },
|
||||
+ },
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+typedef struct
|
||||
+{
|
||||
+ const TestPlan *plan;
|
||||
+ SubscriptionMode mode;
|
||||
+ GError *error;
|
||||
+ /* (element-type ReceivedMessage) */
|
||||
+ GPtrArray *received;
|
||||
+ /* conns[TEST_CONN_NONE] is unused and remains NULL */
|
||||
+ GDBusConnection *conns[NUM_TEST_CONNS];
|
||||
+ /* Proxies on conns[TEST_CONN_SUBSCRIBER] */
|
||||
+ GPtrArray *proxies;
|
||||
+ /* unique_names[TEST_CONN_NONE] is unused and remains NULL */
|
||||
+ const char *unique_names[NUM_TEST_CONNS];
|
||||
+ /* finished[TEST_CONN_NONE] is unused and remains FALSE */
|
||||
+ gboolean finished[NUM_TEST_CONNS];
|
||||
+ /* Remains 0 for any step that is not a subscription */
|
||||
+ guint subscriptions[MAX_TEST_STEPS];
|
||||
+ /* Number of times the signal from step n was received */
|
||||
+ guint received_by_conn[MAX_TEST_STEPS];
|
||||
+ /* Number of times the signal from step n was received */
|
||||
+ guint received_by_proxy[MAX_TEST_STEPS];
|
||||
+ guint finished_subscription;
|
||||
+} Fixture;
|
||||
+
|
||||
+/* Wait for asynchronous messages from @conn to have been processed
|
||||
+ * by the message bus, as a sequence point so that we can make
|
||||
+ * "happens before" and "happens after" assertions relative to this.
|
||||
+ * The easiest way to achieve this is to call a message bus method that has
|
||||
+ * no arguments and wait for it to return: because the message bus processes
|
||||
+ * messages in-order, anything we sent before this must have been processed
|
||||
+ * by the time this call arrives. */
|
||||
+static void
|
||||
+connection_wait_for_bus (GDBusConnection *conn)
|
||||
+{
|
||||
+ GError *error = NULL;
|
||||
+ GVariant *call_result;
|
||||
+
|
||||
+ call_result = g_dbus_connection_call_sync (conn,
|
||||
+ DBUS_SERVICE_DBUS,
|
||||
+ DBUS_PATH_DBUS,
|
||||
+ DBUS_INTERFACE_DBUS,
|
||||
+ "GetId",
|
||||
+ NULL, /* arguments */
|
||||
+ NULL, /* result type */
|
||||
+ G_DBUS_CALL_FLAGS_NONE,
|
||||
+ -1,
|
||||
+ NULL,
|
||||
+ &error);
|
||||
+ g_assert_no_error (error);
|
||||
+ g_assert_nonnull (call_result);
|
||||
+ g_variant_unref (call_result);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Called when the subscriber receives a message from any connection
|
||||
+ * announcing that it has emitted all the signals that it plans to emit.
|
||||
+ */
|
||||
+static void
|
||||
+subscriber_finished_cb (GDBusConnection *conn,
|
||||
+ const char *sender_name,
|
||||
+ const char *path,
|
||||
+ const char *iface,
|
||||
+ const char *member,
|
||||
+ GVariant *parameters,
|
||||
+ void *user_data)
|
||||
+{
|
||||
+ Fixture *f = user_data;
|
||||
+ GDBusConnection *subscriber = f->conns[TEST_CONN_SUBSCRIBER];
|
||||
+ guint i;
|
||||
+
|
||||
+ g_assert_true (conn == subscriber);
|
||||
+
|
||||
+ for (i = TEST_CONN_FIRST; i < G_N_ELEMENTS (f->conns); i++)
|
||||
+ {
|
||||
+ if (g_str_equal (sender_name, f->unique_names[i]))
|
||||
+ {
|
||||
+ g_assert_false (f->finished[i]);
|
||||
+ f->finished[i] = TRUE;
|
||||
+
|
||||
+ g_test_message ("Received Finished signal from %s %s",
|
||||
+ test_conn_descriptions[i], sender_name);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ g_error ("Received Finished signal from unknown sender %s", sender_name);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Called when we receive a signal, either via the GDBusProxy (proxy != NULL)
|
||||
+ * or via the GDBusConnection (proxy == NULL).
|
||||
+ */
|
||||
+static void
|
||||
+fixture_received_signal (Fixture *f,
|
||||
+ GDBusProxy *proxy,
|
||||
+ const char *sender_name,
|
||||
+ const char *path,
|
||||
+ const char *iface,
|
||||
+ const char *member,
|
||||
+ GVariant *parameters)
|
||||
+{
|
||||
+ guint i;
|
||||
+ ReceivedMessage *received;
|
||||
+
|
||||
+ /* Ignore the Finished signal if it matches a wildcard subscription */
|
||||
+ if (g_str_equal (member, FINISHED_SIGNAL))
|
||||
+ return;
|
||||
+
|
||||
+ received = g_new0 (ReceivedMessage, 1);
|
||||
+
|
||||
+ if (proxy != NULL)
|
||||
+ received->received_by_proxy = g_object_ref (proxy);
|
||||
+ else
|
||||
+ received->received_by_proxy = NULL;
|
||||
+
|
||||
+ received->path = g_strdup (path);
|
||||
+ received->iface = g_strdup (iface);
|
||||
+ received->member = g_strdup (member);
|
||||
+ received->parameters = g_variant_ref (parameters);
|
||||
+
|
||||
+ for (i = TEST_CONN_FIRST; i < G_N_ELEMENTS (f->conns); i++)
|
||||
+ {
|
||||
+ if (g_str_equal (sender_name, f->unique_names[i]))
|
||||
+ {
|
||||
+ received->sender = i;
|
||||
+ g_assert_false (f->finished[i]);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ g_assert_cmpint (received->sender, !=, TEST_CONN_NONE);
|
||||
+
|
||||
+ g_test_message ("Signal received from %s %s via %s",
|
||||
+ test_conn_descriptions[received->sender],
|
||||
+ sender_name,
|
||||
+ proxy != NULL ? "proxy" : "connection");
|
||||
+ g_test_message ("\tPath: %s", path);
|
||||
+ g_test_message ("\tInterface: %s", iface);
|
||||
+ g_test_message ("\tMember: %s", member);
|
||||
+
|
||||
+ if (g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(su)")))
|
||||
+ {
|
||||
+ g_variant_get (parameters, "(su)", &received->arg0, &received->step);
|
||||
+ g_test_message ("\tString argument 0: %s", received->arg0);
|
||||
+ g_test_message ("\tSent in step: %u", received->step);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ g_assert_cmpstr (g_variant_get_type_string (parameters), ==, "(uu)");
|
||||
+ g_variant_get (parameters, "(uu)", NULL, &received->step);
|
||||
+ g_test_message ("\tArgument 0: (not a string)");
|
||||
+ g_test_message ("\tSent in step: %u", received->step);
|
||||
+ }
|
||||
+
|
||||
+ g_ptr_array_add (f->received, g_steal_pointer (&received));
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+proxy_signal_cb (GDBusProxy *proxy,
|
||||
+ const char *sender_name,
|
||||
+ const char *member,
|
||||
+ GVariant *parameters,
|
||||
+ void *user_data)
|
||||
+{
|
||||
+ Fixture *f = user_data;
|
||||
+
|
||||
+ fixture_received_signal (f, proxy, sender_name,
|
||||
+ g_dbus_proxy_get_object_path (proxy),
|
||||
+ g_dbus_proxy_get_interface_name (proxy),
|
||||
+ member, parameters);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+subscribed_signal_cb (GDBusConnection *conn,
|
||||
+ const char *sender_name,
|
||||
+ const char *path,
|
||||
+ const char *iface,
|
||||
+ const char *member,
|
||||
+ GVariant *parameters,
|
||||
+ void *user_data)
|
||||
+{
|
||||
+ Fixture *f = user_data;
|
||||
+ GDBusConnection *subscriber = f->conns[TEST_CONN_SUBSCRIBER];
|
||||
+
|
||||
+ g_assert_true (conn == subscriber);
|
||||
+
|
||||
+ fixture_received_signal (f, NULL, sender_name, path, iface, member, parameters);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+fixture_subscribe (Fixture *f,
|
||||
+ const TestSubscribe *subscribe,
|
||||
+ guint step_number)
|
||||
+{
|
||||
+ GDBusConnection *subscriber = f->conns[TEST_CONN_SUBSCRIBER];
|
||||
+ const char *sender;
|
||||
+
|
||||
+ if (subscribe->sender != TEST_CONN_NONE)
|
||||
+ {
|
||||
+ sender = f->unique_names[subscribe->sender];
|
||||
+ g_test_message ("\tSender: %s %s",
|
||||
+ test_conn_descriptions[subscribe->sender],
|
||||
+ sender);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ sender = NULL;
|
||||
+ g_test_message ("\tSender: (any)");
|
||||
+ }
|
||||
+
|
||||
+ g_test_message ("\tPath: %s", nonnull (subscribe->path, "(any)"));
|
||||
+ g_test_message ("\tInterface: %s",
|
||||
+ nonnull (subscribe->iface, "(any)"));
|
||||
+ g_test_message ("\tMember: %s",
|
||||
+ nonnull (subscribe->member, "(any)"));
|
||||
+ g_test_message ("\tString argument 0: %s",
|
||||
+ nonnull (subscribe->arg0, "(any)"));
|
||||
+ g_test_message ("\tFlags: %x", subscribe->flags);
|
||||
+
|
||||
+ if (f->mode != SUBSCRIPTION_MODE_PROXY)
|
||||
+ {
|
||||
+ /* CONN or PARALLEL */
|
||||
+ guint id;
|
||||
+
|
||||
+ g_test_message ("\tSubscribing via connection");
|
||||
+ id = g_dbus_connection_signal_subscribe (subscriber,
|
||||
+ sender,
|
||||
+ subscribe->iface,
|
||||
+ subscribe->member,
|
||||
+ subscribe->path,
|
||||
+ subscribe->arg0,
|
||||
+ subscribe->flags,
|
||||
+ subscribed_signal_cb,
|
||||
+ f, NULL);
|
||||
+ g_assert_cmpuint (id, !=, 0);
|
||||
+ f->subscriptions[step_number] = id;
|
||||
+ }
|
||||
+
|
||||
+ if (f->mode != SUBSCRIPTION_MODE_CONN)
|
||||
+ {
|
||||
+ /* PROXY or PARALLEL */
|
||||
+
|
||||
+ if (sender == NULL)
|
||||
+ {
|
||||
+ g_test_message ("\tCannot subscribe via proxy: no bus name");
|
||||
+ }
|
||||
+ else if (subscribe->path == NULL)
|
||||
+ {
|
||||
+ g_test_message ("\tCannot subscribe via proxy: no path");
|
||||
+ }
|
||||
+ else if (subscribe->iface == NULL)
|
||||
+ {
|
||||
+ g_test_message ("\tCannot subscribe via proxy: no interface");
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ GDBusProxy *proxy;
|
||||
+
|
||||
+ g_test_message ("\tSubscribing via proxy");
|
||||
+ proxy = g_dbus_proxy_new_sync (subscriber,
|
||||
+ (G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES
|
||||
+ | G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START),
|
||||
+ NULL, /* GDBusInterfaceInfo */
|
||||
+ sender,
|
||||
+ subscribe->path,
|
||||
+ subscribe->iface,
|
||||
+ NULL, /* GCancellable */
|
||||
+ &f->error);
|
||||
+ g_assert_no_error (f->error);
|
||||
+ g_assert_nonnull (proxy);
|
||||
+ g_signal_connect (proxy, "g-signal", G_CALLBACK (proxy_signal_cb), f);
|
||||
+ g_ptr_array_add (f->proxies, g_steal_pointer (&proxy));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* As in setup(), we need to wait for AddMatch to happen. */
|
||||
+ g_test_message ("Waiting for AddMatch to be processed");
|
||||
+ connection_wait_for_bus (subscriber);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+fixture_emit_signal (Fixture *f,
|
||||
+ const TestEmitSignal *signal,
|
||||
+ guint step_number)
|
||||
+{
|
||||
+ GVariant *body;
|
||||
+ const char *destination;
|
||||
+ gboolean ok;
|
||||
+
|
||||
+ g_test_message ("\tSender: %s",
|
||||
+ test_conn_descriptions[signal->sender]);
|
||||
+
|
||||
+ if (signal->unicast_to != TEST_CONN_NONE)
|
||||
+ {
|
||||
+ destination = f->unique_names[signal->unicast_to];
|
||||
+ g_test_message ("\tDestination: %s %s",
|
||||
+ test_conn_descriptions[signal->unicast_to],
|
||||
+ destination);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ destination = NULL;
|
||||
+ g_test_message ("\tDestination: (broadcast)");
|
||||
+ }
|
||||
+
|
||||
+ g_assert_nonnull (signal->path);
|
||||
+ g_test_message ("\tPath: %s", signal->path);
|
||||
+ g_assert_nonnull (signal->iface);
|
||||
+ g_test_message ("\tInterface: %s", signal->iface);
|
||||
+ g_assert_nonnull (signal->member);
|
||||
+ g_test_message ("\tMember: %s", signal->member);
|
||||
+
|
||||
+ /* If arg0 is non-NULL, put it in the message's argument 0.
|
||||
+ * Otherwise put something that will not match any arg0.
|
||||
+ * Either way, put the sequence number in argument 1 so we can
|
||||
+ * correlate sent messages with received messages later. */
|
||||
+ if (signal->arg0 != NULL)
|
||||
+ {
|
||||
+ g_test_message ("\tString argument 0: %s", signal->arg0);
|
||||
+ /* floating */
|
||||
+ body = g_variant_new ("(su)", signal->arg0, (guint32) step_number);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ g_test_message ("\tArgument 0: (not a string)");
|
||||
+ body = g_variant_new ("(uu)", (guint32) 0, (guint32) step_number);
|
||||
+ }
|
||||
+
|
||||
+ ok = g_dbus_connection_emit_signal (f->conns[signal->sender],
|
||||
+ destination,
|
||||
+ signal->path,
|
||||
+ signal->iface,
|
||||
+ signal->member,
|
||||
+ /* steals floating reference */
|
||||
+ g_steal_pointer (&body),
|
||||
+ &f->error);
|
||||
+ g_assert_no_error (f->error);
|
||||
+ g_assert_true (ok);
|
||||
+
|
||||
+ /* Emitting the signal is asynchronous, so if we want subsequent steps
|
||||
+ * to be guaranteed to happen after the signal from the message bus's
|
||||
+ * perspective, we have to do a round-trip to the message bus to sync up. */
|
||||
+ g_test_message ("Waiting for signal to reach message bus");
|
||||
+ connection_wait_for_bus (f->conns[signal->sender]);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+fixture_run_plan (Fixture *f,
|
||||
+ const TestPlan *plan,
|
||||
+ SubscriptionMode mode)
|
||||
+{
|
||||
+ guint i;
|
||||
+
|
||||
+ G_STATIC_ASSERT (G_N_ELEMENTS (plan->steps) == G_N_ELEMENTS (f->subscriptions));
|
||||
+ G_STATIC_ASSERT (G_N_ELEMENTS (plan->steps) == G_N_ELEMENTS (f->received_by_conn));
|
||||
+ G_STATIC_ASSERT (G_N_ELEMENTS (plan->steps) == G_N_ELEMENTS (f->received_by_proxy));
|
||||
+
|
||||
+ f->mode = mode;
|
||||
+ f->plan = plan;
|
||||
+
|
||||
+ g_test_summary (plan->description);
|
||||
+
|
||||
+ for (i = 0; i < G_N_ELEMENTS (plan->steps); i++)
|
||||
+ {
|
||||
+ const TestStep *step = &plan->steps[i];
|
||||
+
|
||||
+ switch (step->action)
|
||||
+ {
|
||||
+ case TEST_ACTION_SUBSCRIBE:
|
||||
+ g_test_message ("Step %u: adding subscription", i);
|
||||
+ fixture_subscribe (f, &step->u.subscribe, i);
|
||||
+ break;
|
||||
+
|
||||
+ case TEST_ACTION_EMIT_SIGNAL:
|
||||
+ g_test_message ("Step %u: emitting signal", i);
|
||||
+ fixture_emit_signal (f, &step->u.signal, i);
|
||||
+ break;
|
||||
+
|
||||
+ case TEST_ACTION_NONE:
|
||||
+ /* Padding to fill the rest of the array, do nothing */
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ g_return_if_reached ();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Now that we have done everything we wanted to do, emit Finished
|
||||
+ * from each connection. */
|
||||
+ for (i = TEST_CONN_FIRST; i < G_N_ELEMENTS (f->conns); i++)
|
||||
+ {
|
||||
+ gboolean ok;
|
||||
+
|
||||
+ ok = g_dbus_connection_emit_signal (f->conns[i],
|
||||
+ NULL,
|
||||
+ FINISHED_PATH,
|
||||
+ FINISHED_INTERFACE,
|
||||
+ FINISHED_SIGNAL,
|
||||
+ NULL,
|
||||
+ &f->error);
|
||||
+ g_assert_no_error (f->error);
|
||||
+ g_assert_true (ok);
|
||||
+ }
|
||||
+
|
||||
+ /* Wait until we have seen the Finished signal from each sender */
|
||||
+ while (TRUE)
|
||||
+ {
|
||||
+ gboolean all_finished = TRUE;
|
||||
+
|
||||
+ for (i = TEST_CONN_FIRST; i < G_N_ELEMENTS (f->conns); i++)
|
||||
+ all_finished = all_finished && f->finished[i];
|
||||
+
|
||||
+ if (all_finished)
|
||||
+ break;
|
||||
+
|
||||
+ g_main_context_iteration (NULL, TRUE);
|
||||
+ }
|
||||
+
|
||||
+ /* Assert that the correct things happened before each Finished signal */
|
||||
+ for (i = 0; i < f->received->len; i++)
|
||||
+ {
|
||||
+ const ReceivedMessage *received = g_ptr_array_index (f->received, i);
|
||||
+
|
||||
+ g_assert_cmpuint (received->step, <, G_N_ELEMENTS (f->received_by_conn));
|
||||
+ g_assert_cmpuint (received->step, <, G_N_ELEMENTS (f->received_by_proxy));
|
||||
+ g_assert_cmpint (plan->steps[received->step].action,
|
||||
+ ==, TEST_ACTION_EMIT_SIGNAL);
|
||||
+
|
||||
+ if (received->received_by_proxy != NULL)
|
||||
+ f->received_by_proxy[received->step] += 1;
|
||||
+ else
|
||||
+ f->received_by_conn[received->step] += 1;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < G_N_ELEMENTS (plan->steps); i++)
|
||||
+ {
|
||||
+ const TestStep *step = &plan->steps[i];
|
||||
+
|
||||
+ if (step->action == TEST_ACTION_EMIT_SIGNAL)
|
||||
+ {
|
||||
+ const TestEmitSignal *signal = &plan->steps[i].u.signal;
|
||||
+
|
||||
+ if (mode != SUBSCRIPTION_MODE_PROXY)
|
||||
+ {
|
||||
+ g_test_message ("Signal from step %u was received %u times by "
|
||||
+ "GDBusConnection, expected %u",
|
||||
+ i, f->received_by_conn[i], signal->received_by_conn);
|
||||
+ g_assert_cmpuint (f->received_by_conn[i], ==, signal->received_by_conn);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ g_assert_cmpuint (f->received_by_conn[i], ==, 0);
|
||||
+ }
|
||||
+
|
||||
+ if (mode != SUBSCRIPTION_MODE_CONN)
|
||||
+ {
|
||||
+ g_test_message ("Signal from step %u was received %u times by "
|
||||
+ "GDBusProxy, expected %u",
|
||||
+ i, f->received_by_proxy[i], signal->received_by_proxy);
|
||||
+ g_assert_cmpuint (f->received_by_proxy[i], ==, signal->received_by_proxy);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ g_assert_cmpuint (f->received_by_proxy[i], ==, 0);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+setup (Fixture *f,
|
||||
+ G_GNUC_UNUSED const void *context)
|
||||
+{
|
||||
+ GDBusConnection *subscriber;
|
||||
+ guint i;
|
||||
+
|
||||
+ session_bus_up ();
|
||||
+
|
||||
+ f->proxies = g_ptr_array_new_full (MAX_TEST_STEPS, g_object_unref);
|
||||
+ f->received = g_ptr_array_new_full (MAX_TEST_STEPS,
|
||||
+ (GDestroyNotify) received_message_free);
|
||||
+
|
||||
+ for (i = TEST_CONN_FIRST; i < G_N_ELEMENTS (f->conns); i++)
|
||||
+ {
|
||||
+ f->conns[i] = _g_bus_get_priv (G_BUS_TYPE_SESSION, NULL, &f->error);
|
||||
+ g_assert_no_error (f->error);
|
||||
+ g_assert_nonnull (f->conns[i]);
|
||||
+
|
||||
+ f->unique_names[i] = g_dbus_connection_get_unique_name (f->conns[i]);
|
||||
+ g_assert_nonnull (f->unique_names[i]);
|
||||
+ g_test_message ("%s is %s",
|
||||
+ test_conn_descriptions[i],
|
||||
+ f->unique_names[i]);
|
||||
+ }
|
||||
+
|
||||
+ subscriber = f->conns[TEST_CONN_SUBSCRIBER];
|
||||
+
|
||||
+ /* Used to wait for all connections to finish sending whatever they
|
||||
+ * wanted to send */
|
||||
+ f->finished_subscription = g_dbus_connection_signal_subscribe (subscriber,
|
||||
+ NULL,
|
||||
+ FINISHED_INTERFACE,
|
||||
+ FINISHED_SIGNAL,
|
||||
+ FINISHED_PATH,
|
||||
+ NULL,
|
||||
+ G_DBUS_SIGNAL_FLAGS_NONE,
|
||||
+ subscriber_finished_cb,
|
||||
+ f, NULL);
|
||||
+ /* AddMatch is sent asynchronously, so we don't know how
|
||||
+ * soon it will be processed. Before emitting signals, we
|
||||
+ * need to wait for the message bus to get as far as processing
|
||||
+ * AddMatch. */
|
||||
+ g_test_message ("Waiting for AddMatch to be processed");
|
||||
+ connection_wait_for_bus (subscriber);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+test_conn_subscribe (Fixture *f,
|
||||
+ const void *context)
|
||||
+{
|
||||
+ fixture_run_plan (f, context, SUBSCRIPTION_MODE_CONN);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+test_proxy_subscribe (Fixture *f,
|
||||
+ const void *context)
|
||||
+{
|
||||
+ fixture_run_plan (f, context, SUBSCRIPTION_MODE_PROXY);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+test_parallel_subscribe (Fixture *f,
|
||||
+ const void *context)
|
||||
+{
|
||||
+ fixture_run_plan (f, context, SUBSCRIPTION_MODE_PARALLEL);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+teardown (Fixture *f,
|
||||
+ G_GNUC_UNUSED const void *context)
|
||||
+{
|
||||
+ GDBusConnection *subscriber = f->conns[TEST_CONN_SUBSCRIBER];
|
||||
+ guint i;
|
||||
+
|
||||
+ g_ptr_array_unref (f->proxies);
|
||||
+
|
||||
+ if (f->finished_subscription != 0)
|
||||
+ g_dbus_connection_signal_unsubscribe (subscriber, f->finished_subscription);
|
||||
+
|
||||
+ for (i = 0; i < G_N_ELEMENTS (f->subscriptions); i++)
|
||||
+ {
|
||||
+ if (f->subscriptions[i] != 0)
|
||||
+ g_dbus_connection_signal_unsubscribe (subscriber, f->subscriptions[i]);
|
||||
+ }
|
||||
+
|
||||
+ g_ptr_array_unref (f->received);
|
||||
+
|
||||
+ for (i = TEST_CONN_FIRST; i < G_N_ELEMENTS (f->conns); i++)
|
||||
+ g_clear_object (&f->conns[i]);
|
||||
+
|
||||
+ g_clear_error (&f->error);
|
||||
+
|
||||
+ session_bus_down ();
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (int argc,
|
||||
+ char *argv[])
|
||||
+{
|
||||
+ g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||
+
|
||||
+ g_test_dbus_unset ();
|
||||
+
|
||||
+#define ADD_SUBSCRIBE_TEST(name) \
|
||||
+ do { \
|
||||
+ g_test_add ("/gdbus/subscribe/conn/" #name, \
|
||||
+ Fixture, &plan_ ## name, \
|
||||
+ setup, test_conn_subscribe, teardown); \
|
||||
+ g_test_add ("/gdbus/subscribe/proxy/" #name, \
|
||||
+ Fixture, &plan_ ## name, \
|
||||
+ setup, test_proxy_subscribe, teardown); \
|
||||
+ g_test_add ("/gdbus/subscribe/parallel/" #name, \
|
||||
+ Fixture, &plan_ ## name, \
|
||||
+ setup, test_parallel_subscribe, teardown); \
|
||||
+ } while (0)
|
||||
+
|
||||
+ ADD_SUBSCRIBE_TEST (simple);
|
||||
+ ADD_SUBSCRIBE_TEST (broadcast_from_anyone);
|
||||
+ ADD_SUBSCRIBE_TEST (match_twice);
|
||||
+ ADD_SUBSCRIBE_TEST (limit_by_unique_name);
|
||||
+
|
||||
+ return g_test_run();
|
||||
+}
|
||||
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
|
||||
index 383d84319..a1551aa53 100644
|
||||
--- a/gio/tests/meson.build
|
||||
+++ b/gio/tests/meson.build
|
||||
@@ -354,6 +354,7 @@ if host_machine.system() != 'windows'
|
||||
},
|
||||
'gdbus-proxy-unique-name' : {'extra_sources' : extra_sources},
|
||||
'gdbus-proxy-well-known-name' : {'extra_sources' : extra_sources},
|
||||
+ 'gdbus-subscribe' : {'extra_sources' : extra_sources},
|
||||
'gdbus-test-codegen' : {
|
||||
'extra_sources' : [extra_sources, gdbus_test_codegen_generated, gdbus_test_codegen_generated_interface_info],
|
||||
'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32'],
|
||||
--
|
||||
2.30.2
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user