mirror of
https://git.yoctoproject.org/poky
synced 2026-02-21 08:59:41 +01:00
Compare commits
202 Commits
yocto-4.0.
...
kirkstone-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c05660b21 | ||
|
|
cb1206dd84 | ||
|
|
33d90091be | ||
|
|
9f461395a8 | ||
|
|
0002d5d082 | ||
|
|
db73f23fc2 | ||
|
|
40701465df | ||
|
|
ba9338d810 | ||
|
|
46c836aefa | ||
|
|
5f8155aefa | ||
|
|
dd0a2c2470 | ||
|
|
c5794d82b0 | ||
|
|
169ca8debf | ||
|
|
5d27e8f05d | ||
|
|
d492537188 | ||
|
|
052e4214aa | ||
|
|
c76f44b1da | ||
|
|
088d1497d5 | ||
|
|
22f8da4818 | ||
|
|
4030876db9 | ||
|
|
c6234dce63 | ||
|
|
6639c7b295 | ||
|
|
7c4bd642e4 | ||
|
|
f58483837c | ||
|
|
cdc78fd36f | ||
|
|
36165cce68 | ||
|
|
9734a91472 | ||
|
|
42d2a2e8cd | ||
|
|
940e5e75b9 | ||
|
|
3d559d269a | ||
|
|
36037789d2 | ||
|
|
7dd51aea98 | ||
|
|
851a3f0c55 | ||
|
|
dacb67f70f | ||
|
|
232e8ebe3c | ||
|
|
41c16e82e9 | ||
|
|
cab0ee97d8 | ||
|
|
d54b15eba1 | ||
|
|
2943f88d88 | ||
|
|
9479971ef9 | ||
|
|
2cf2a95adb | ||
|
|
bababfb854 | ||
|
|
6f01aae51d | ||
|
|
33d61e50c1 | ||
|
|
9cc35e0f6d | ||
|
|
a916d3a38a | ||
|
|
b0c11efc8f | ||
|
|
478f5eaa61 | ||
|
|
748f958fd3 | ||
|
|
73e3da5d44 | ||
|
|
6b397fb207 | ||
|
|
6ab506f474 | ||
|
|
809b3e9113 | ||
|
|
e2d947b1cc | ||
|
|
1dd6d90744 | ||
|
|
8641f0fec9 | ||
|
|
484d31c23d | ||
|
|
aaf9219788 | ||
|
|
d152607f64 | ||
|
|
0de012f0f6 | ||
|
|
c4200e606c | ||
|
|
04b39e5b7e | ||
|
|
8d5cd4a310 | ||
|
|
59579acac7 | ||
|
|
56aa9e3241 | ||
|
|
ea90d0a5b1 | ||
|
|
9e1c28514a | ||
|
|
24772dd301 | ||
|
|
5f0dcc1dc6 | ||
|
|
8d8972d1b4 | ||
|
|
9626809dce | ||
|
|
3fe029171f | ||
|
|
9a4c708aa5 | ||
|
|
2442316a1e | ||
|
|
48ab50b55c | ||
|
|
bee2fe9cc5 | ||
|
|
d0f445a1e2 | ||
|
|
0118bd1e10 | ||
|
|
7ca21c761a | ||
|
|
4e75dd0f5f | ||
|
|
75cb79eaf5 | ||
|
|
5abe7f3283 | ||
|
|
9a1d2ff9d0 | ||
|
|
2b691e84d8 | ||
|
|
41ae63737b | ||
|
|
ca6745e603 | ||
|
|
d847c8aac1 | ||
|
|
1bf7d50410 | ||
|
|
b48d3ea982 | ||
|
|
42b3adafcc | ||
|
|
2105de9c82 | ||
|
|
dd624cec3b | ||
|
|
2fdbec72e5 | ||
|
|
7b6bc5b49c | ||
|
|
0c1db5ac27 | ||
|
|
8f20ad5f77 | ||
|
|
74672d72c0 | ||
|
|
f245c680a8 | ||
|
|
2325a1dbc5 | ||
|
|
2952d99f0f | ||
|
|
962d08fb40 | ||
|
|
425363de54 | ||
|
|
e5fb48f371 | ||
|
|
259d81175f | ||
|
|
eca1e13385 | ||
|
|
e46adde7bb | ||
|
|
d34a0bd00b | ||
|
|
11f3763b0f | ||
|
|
89a78911d7 | ||
|
|
673b839a6b | ||
|
|
f63f49bdea | ||
|
|
7a5c6b3e18 | ||
|
|
5d1ccbd52f | ||
|
|
c95f2e55ac | ||
|
|
02148028a0 | ||
|
|
093e91d190 | ||
|
|
0163ca382a | ||
|
|
0adb465b9e | ||
|
|
ca3783f70d | ||
|
|
b5a57a04eb | ||
|
|
ed56389e82 | ||
|
|
4a1254610c | ||
|
|
4ef41425c6 | ||
|
|
db50dd87bc | ||
|
|
2b82706dc5 | ||
|
|
bc7377a239 | ||
|
|
7f12221f49 | ||
|
|
11d8b290dd | ||
|
|
55c58356f1 | ||
|
|
3c3b5d0fe9 | ||
|
|
3ff44348f7 | ||
|
|
1f6c798015 | ||
|
|
fd0df2cb78 | ||
|
|
ffd5cd98d6 | ||
|
|
794b42f01a | ||
|
|
11999973cb | ||
|
|
49a5ab4d5f | ||
|
|
d153a3dc36 | ||
|
|
2399c63ca5 | ||
|
|
866395041f | ||
|
|
6303a9d5b5 | ||
|
|
1811a2d13e | ||
|
|
15dd68bda1 | ||
|
|
9c9c706252 | ||
|
|
d2a96dd89c | ||
|
|
9ae3736eb4 | ||
|
|
51dc9c464d | ||
|
|
49e837cefa | ||
|
|
03a1a4c956 | ||
|
|
0813376d84 | ||
|
|
5fc83da6b2 | ||
|
|
686d908085 | ||
|
|
9e8df15269 | ||
|
|
6d64cdb02b | ||
|
|
15535d452d | ||
|
|
d3568e56a7 | ||
|
|
ad403d6f6f | ||
|
|
7c76036780 | ||
|
|
4f27d5ff82 | ||
|
|
e9b1bb75ff | ||
|
|
4415ab1560 | ||
|
|
69d52fa539 | ||
|
|
6ae24cb3c6 | ||
|
|
3899075ad9 | ||
|
|
9f689b3049 | ||
|
|
57bd1bec8d | ||
|
|
e271e3cf36 | ||
|
|
7e420c5834 | ||
|
|
999a2e1aa4 | ||
|
|
41c69cd099 | ||
|
|
d655701622 | ||
|
|
34ee6fc494 | ||
|
|
ecef511127 | ||
|
|
b5d3231d38 | ||
|
|
f8c794053b | ||
|
|
37f7f262e8 | ||
|
|
96973ede70 | ||
|
|
d0fd4d9160 | ||
|
|
17e3bd9df8 | ||
|
|
d6f3ce1651 | ||
|
|
6b05a97369 | ||
|
|
bedb86690f | ||
|
|
6a6d768268 | ||
|
|
1070bb4499 | ||
|
|
372bb5d81e | ||
|
|
169ae15f95 | ||
|
|
68fd70f349 | ||
|
|
1e0216c6ba | ||
|
|
e1b698abcc | ||
|
|
39df9602b1 | ||
|
|
f81ed8523a | ||
|
|
5d6f6b2619 | ||
|
|
79435187b1 | ||
|
|
f11ea352ef | ||
|
|
db89896907 | ||
|
|
1afc7cf4cf | ||
|
|
423e0ff3fb | ||
|
|
8f356f507e | ||
|
|
aa37836708 | ||
|
|
e371e6b3a7 | ||
|
|
dc468377e8 | ||
|
|
c2581b7811 |
@@ -123,110 +123,116 @@ to add the upgraded version.
|
||||
|
||||
$ git commit -s file1 file2 dir1 dir2 ...
|
||||
|
||||
To include **a**\ ll staged files::
|
||||
To include all staged files::
|
||||
|
||||
$ git commit -sa
|
||||
|
||||
- The ``-s`` option of ``git commit`` adds a "Signed-off-by:" line
|
||||
to your commit message. There is the same requirement for contributing
|
||||
to the Linux kernel. Adding such a line signifies that you, the
|
||||
submitter, have agreed to the `Developer's Certificate of Origin 1.1
|
||||
<https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin>`__
|
||||
as follows:
|
||||
#. The ``-s`` option of ``git commit`` adds a "Signed-off-by:" line
|
||||
to your commit message. There is the same requirement for contributing
|
||||
to the Linux kernel. Adding such a line signifies that you, the
|
||||
submitter, have agreed to the `Developer's Certificate of Origin 1.1
|
||||
<https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin>`__
|
||||
as follows:
|
||||
|
||||
.. code-block:: none
|
||||
.. code-block:: none
|
||||
|
||||
Developer's Certificate of Origin 1.1
|
||||
Developer's Certificate of Origin 1.1
|
||||
|
||||
By making a contribution to this project, I certify that:
|
||||
By making a contribution to this project, I certify that:
|
||||
|
||||
(a) The contribution was created in whole or in part by me and I
|
||||
have the right to submit it under the open source license
|
||||
indicated in the file; or
|
||||
(a) The contribution was created in whole or in part by me and I
|
||||
have the right to submit it under the open source license
|
||||
indicated in the file; or
|
||||
|
||||
(b) The contribution is based upon previous work that, to the best
|
||||
of my knowledge, is covered under an appropriate open source
|
||||
license and I have the right under that license to submit that
|
||||
work with modifications, whether created in whole or in part
|
||||
by me, under the same open source license (unless I am
|
||||
permitted to submit under a different license), as indicated
|
||||
in the file; or
|
||||
(b) The contribution is based upon previous work that, to the best
|
||||
of my knowledge, is covered under an appropriate open source
|
||||
license and I have the right under that license to submit that
|
||||
work with modifications, whether created in whole or in part
|
||||
by me, under the same open source license (unless I am
|
||||
permitted to submit under a different license), as indicated
|
||||
in the file; or
|
||||
|
||||
(c) The contribution was provided directly to me by some other
|
||||
person who certified (a), (b) or (c) and I have not modified
|
||||
it.
|
||||
(c) The contribution was provided directly to me by some other
|
||||
person who certified (a), (b) or (c) and I have not modified
|
||||
it.
|
||||
|
||||
(d) I understand and agree that this project and the contribution
|
||||
are public and that a record of the contribution (including all
|
||||
personal information I submit with it, including my sign-off) is
|
||||
maintained indefinitely and may be redistributed consistent with
|
||||
this project or the open source license(s) involved.
|
||||
(d) I understand and agree that this project and the contribution
|
||||
are public and that a record of the contribution (including all
|
||||
personal information I submit with it, including my sign-off) is
|
||||
maintained indefinitely and may be redistributed consistent with
|
||||
this project or the open source license(s) involved.
|
||||
|
||||
- Provide a single-line summary of the change and, if more
|
||||
explanation is needed, provide more detail in the body of the
|
||||
commit. This summary is typically viewable in the "shortlist" of
|
||||
changes. Thus, providing something short and descriptive that
|
||||
gives the reader a summary of the change is useful when viewing a
|
||||
list of many commits. You should prefix this short description
|
||||
with the recipe name (if changing a recipe), or else with the
|
||||
short form path to the file being changed.
|
||||
#. Provide a single-line summary of the change and, if more
|
||||
explanation is needed, provide more detail in the description of the
|
||||
commit. This summary is typically viewable in the "shortlist" of
|
||||
changes. Thus, providing something short and descriptive that
|
||||
gives the reader a summary of the change is useful when viewing a
|
||||
list of many commits. You should prefix this short description
|
||||
with the recipe name (if changing a recipe), or else with the
|
||||
short form path to the file being changed.
|
||||
|
||||
.. note::
|
||||
|
||||
To find a suitable prefix for the commit summary, a good idea
|
||||
is to look for prefixes used in previous commits touching the
|
||||
same files or directories::
|
||||
|
||||
git log --oneline <paths>
|
||||
|
||||
#. For the commit description, provide detailed information
|
||||
that describes what you changed, why you made the change, and the
|
||||
approach you used. It might also be helpful if you mention how you
|
||||
tested the change. Provide as much detail as you can in the commit
|
||||
description.
|
||||
|
||||
.. note::
|
||||
|
||||
If the single line summary is enough to describe a simple
|
||||
change, the commit description can be left empty.
|
||||
|
||||
#. If the change addresses a specific bug or issue that is associated
|
||||
with a bug-tracking ID, include a reference to that ID in the body of the
|
||||
commit message. For example, the Yocto Project uses a
|
||||
specific convention for bug references --- any commit that addresses
|
||||
a specific bug should use the following form for the body of the commit
|
||||
message. Be sure to use the actual bug-tracking ID from
|
||||
Bugzilla for bug-id::
|
||||
|
||||
single-line summary of change
|
||||
|
||||
Fixes [YOCTO #bug-id]
|
||||
|
||||
detailed description of change
|
||||
|
||||
#. If other people participated in this patch, add some tags to the commit
|
||||
description to credit other contributors to the change:
|
||||
|
||||
- ``Reported-by``: name and email of a person reporting a bug
|
||||
that your commit is trying to fix. This is a good practice
|
||||
to encourage people to go on reporting bugs and let them
|
||||
know that their reports are taken into account.
|
||||
|
||||
- ``Suggested-by``: name and email of a person to credit for the
|
||||
idea of making the change.
|
||||
|
||||
- ``Tested-by``, ``Reviewed-by``: name and email for people having
|
||||
tested your changes or reviewed their code. These fields are
|
||||
usually added by the maintainer accepting a patch, or by
|
||||
yourself if you submitted your patches to early reviewers,
|
||||
or are submitting an unmodified patch again as part of a
|
||||
new iteration of your patch series.
|
||||
|
||||
- ``Cc``: name and email of people you want to send a copy
|
||||
of your changes to. This field will be used by ``git send-email``.
|
||||
|
||||
See `more guidance about using such tags
|
||||
<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.
|
||||
|
||||
.. note::
|
||||
|
||||
To find a suitable prefix for the commit summary, a good idea
|
||||
is to look for prefixes used in previous commits touching the
|
||||
same files or directories::
|
||||
|
||||
git log --oneline <paths>
|
||||
|
||||
- For the body of the commit message, provide detailed information
|
||||
that describes what you changed, why you made the change, and the
|
||||
approach you used. It might also be helpful if you mention how you
|
||||
tested the change. Provide as much detail as you can in the body
|
||||
of the commit message.
|
||||
|
||||
.. note::
|
||||
|
||||
If the single line summary is enough to describe a simple
|
||||
change, the body of the commit message can be left empty.
|
||||
|
||||
- If the change addresses a specific bug or issue that is associated
|
||||
with a bug-tracking ID, include a reference to that ID in your
|
||||
detailed description. For example, the Yocto Project uses a
|
||||
specific convention for bug references --- any commit that addresses
|
||||
a specific bug should use the following form for the detailed
|
||||
description. Be sure to use the actual bug-tracking ID from
|
||||
Bugzilla for bug-id::
|
||||
|
||||
Fixes [YOCTO #bug-id]
|
||||
|
||||
detailed description of change
|
||||
|
||||
#. *Crediting contributors:* By using the ``git commit --amend`` command,
|
||||
you can add some tags to the commit description to credit other contributors
|
||||
to the change:
|
||||
|
||||
- ``Reported-by``: name and email of a person reporting a bug
|
||||
that your commit is trying to fix. This is a good practice
|
||||
to encourage people to go on reporting bugs and let them
|
||||
know that their reports are taken into account.
|
||||
|
||||
- ``Suggested-by``: name and email of a person to credit for the
|
||||
idea of making the change.
|
||||
|
||||
- ``Tested-by``, ``Reviewed-by``: name and email for people having
|
||||
tested your changes or reviewed their code. These fields are
|
||||
usually added by the maintainer accepting a patch, or by
|
||||
yourself if you submitted your patches to early reviewers,
|
||||
or are submitting an unmodified patch again as part of a
|
||||
new iteration of your patch series.
|
||||
|
||||
- ``CC:`` Name and email of people you want to send a copy
|
||||
of your changes to. This field will be used by ``git send-email``.
|
||||
|
||||
See `more guidance about using such tags
|
||||
<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.
|
||||
One can amend an existing git commit message to add missing tags for
|
||||
contributors with the ``git commit --amend`` command.
|
||||
|
||||
Test your changes
|
||||
-----------------
|
||||
@@ -650,8 +656,8 @@ backported to a stable branch unless the bug in question does not affect the
|
||||
master branch or the fix on the master branch is unsuitable for backporting.
|
||||
|
||||
The list of stable branches along with the status and maintainer for each
|
||||
branch can be obtained from the
|
||||
:yocto_wiki:`Releases wiki page </Releases>`.
|
||||
branch can be obtained from the :yocto_home:`Releases </development/releases/>`
|
||||
page.
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@@ -909,6 +909,11 @@ to point to that directory::
|
||||
|
||||
EXTERNALSRC_BUILD:pn-myrecipe = "path-to-your-source-tree"
|
||||
|
||||
.. note::
|
||||
|
||||
The values of :term:`EXTERNALSRC` and :term:`EXTERNALSRC_BUILD`
|
||||
must be absolute paths.
|
||||
|
||||
Replicating a Build Offline
|
||||
===========================
|
||||
|
||||
|
||||
@@ -111,17 +111,17 @@ occurred in your project. Perhaps an attempt to :ref:`modify a variable
|
||||
<bitbake-user-manual/bitbake-user-manual-metadata:modifying existing
|
||||
variables>` did not work out as expected.
|
||||
|
||||
BitBake's ``-e`` option is used to display variable values after
|
||||
parsing. The following command displays the variable values after the
|
||||
configuration files (i.e. ``local.conf``, ``bblayers.conf``,
|
||||
BitBake's ``bitbake-getvar`` command is used to display variable values after
|
||||
parsing. The following command displays the variable value for :term:`OVERRIDES`
|
||||
after the configuration files (i.e. ``local.conf``, ``bblayers.conf``,
|
||||
``bitbake.conf`` and so forth) have been parsed::
|
||||
|
||||
$ bitbake -e
|
||||
$ bitbake-getvar OVERRIDES
|
||||
|
||||
The following command displays variable values after a specific recipe has
|
||||
been parsed. The variables include those from the configuration as well::
|
||||
The following command displays the value of :term:`PV` after a specific recipe
|
||||
has been parsed::
|
||||
|
||||
$ bitbake -e recipename
|
||||
$ bitbake-getvar -r recipename PV
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -135,19 +135,25 @@ been parsed. The variables include those from the configuration as well::
|
||||
the recipe datastore, which means that variables set within one task
|
||||
will not be visible to other tasks.
|
||||
|
||||
In the output of ``bitbake -e``, each variable is preceded by a
|
||||
description of how the variable got its value, including temporary
|
||||
values that were later overridden. This description also includes
|
||||
variable flags (varflags) set on the variable. The output can be very
|
||||
In the output of ``bitbake-getvar``, the line containing the value of the
|
||||
variable is preceded by a description of how the variable got its value,
|
||||
including temporary values that were later overridden. This description also
|
||||
includes variable flags (varflags) set on the variable. The output can be very
|
||||
helpful during debugging.
|
||||
|
||||
Variables that are exported to the environment are preceded by
|
||||
``export`` in the output of ``bitbake -e``. See the following example::
|
||||
``export`` in the output of ``bitbake-getvar``. See the following example::
|
||||
|
||||
export CC="i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/ulf/poky/build/tmp/sysroots/qemux86"
|
||||
|
||||
In addition to variable values, the output of the ``bitbake -e`` and
|
||||
``bitbake -e`` recipe commands includes the following information:
|
||||
Shell functions and tasks can also be inspected with the same mechanism::
|
||||
|
||||
$ bitbake-getvar -r recipename do_install
|
||||
|
||||
For Python functions and tasks, ``bitbake -e recipename`` can be used instead.
|
||||
|
||||
Moreover, the output of the ``bitbake -e`` and ``bitbake -e`` recipe commands
|
||||
includes the following information:
|
||||
|
||||
- The output starts with a tree listing all configuration files and
|
||||
classes included globally, recursively listing the files they include
|
||||
|
||||
@@ -123,10 +123,9 @@ Follow these general steps to create your layer without using tools:
|
||||
Lists all layers on which this layer depends (if any).
|
||||
|
||||
- :term:`LAYERSERIES_COMPAT`:
|
||||
Lists the :yocto_wiki:`Yocto Project </Releases>`
|
||||
releases for which the current version is compatible. This
|
||||
variable is a good way to indicate if your particular layer is
|
||||
current.
|
||||
Lists the :yocto_home:`Yocto Project releases </development/releases/>`
|
||||
for which the current version is compatible. This variable is a good
|
||||
way to indicate if your particular layer is current.
|
||||
|
||||
|
||||
.. note::
|
||||
@@ -822,6 +821,8 @@ The following list describes the available commands:
|
||||
|
||||
- ``create-layer``: Creates a basic layer.
|
||||
|
||||
- ``show-machines``: Lists the machines available in the currently configured layers.
|
||||
|
||||
Creating a General Layer Using the ``bitbake-layers`` Script
|
||||
============================================================
|
||||
|
||||
|
||||
@@ -83,19 +83,20 @@ command::
|
||||
OpenEmbedded recipe tool
|
||||
|
||||
options:
|
||||
-d, --debug Enable debug output
|
||||
-q, --quiet Print only errors
|
||||
--color COLOR Colorize output (where COLOR is auto, always, never)
|
||||
-h, --help show this help message and exit
|
||||
-d, --debug Enable debug output
|
||||
-q, --quiet Print only errors
|
||||
--color COLOR Colorize output (where COLOR is auto, always, never)
|
||||
-h, --help show this help message and exit
|
||||
|
||||
subcommands:
|
||||
create Create a new recipe
|
||||
newappend Create a bbappend for the specified target in the specified
|
||||
layer
|
||||
setvar Set a variable within a recipe
|
||||
appendfile Create/update a bbappend to replace a target file
|
||||
appendsrcfiles Create/update a bbappend to add or replace source files
|
||||
appendsrcfile Create/update a bbappend to add or replace a source file
|
||||
newappend Create a bbappend for the specified target in the specified layer
|
||||
create Create a new recipe
|
||||
setvar Set a variable within a recipe
|
||||
appendfile Create/update a bbappend to replace a target file
|
||||
appendsrcfiles Create/update a bbappend to add or replace source files
|
||||
appendsrcfile Create/update a bbappend to add or replace a source file
|
||||
edit Edit the recipe and appends for the specified target. This obeys $VISUAL if set,
|
||||
otherwise $EDITOR, otherwise vi.
|
||||
Use recipetool <subcommand> --help to get help on a specific command
|
||||
|
||||
Running ``recipetool create -o OUTFILE`` creates the base recipe and
|
||||
@@ -218,9 +219,9 @@ compilation and packaging files, and so forth.
|
||||
|
||||
The path to the per-recipe temporary work directory depends on the
|
||||
context in which it is being built. The quickest way to find this path
|
||||
is to have BitBake return it by running the following::
|
||||
is to use the ``bitbake-getvar`` utility::
|
||||
|
||||
$ bitbake -e basename | grep ^WORKDIR=
|
||||
$ bitbake-getvar -r basename WORKDIR
|
||||
|
||||
As an example, assume a Source Directory
|
||||
top-level folder named ``poky``, a default :term:`Build Directory` at
|
||||
@@ -438,7 +439,7 @@ Licensing
|
||||
=========
|
||||
|
||||
Your recipe needs to define variables related to the license
|
||||
under whith the software is distributed. See the
|
||||
under which the software is distributed. See the
|
||||
:ref:`contributor-guide/recipe-style-guide:recipe license fields`
|
||||
section in the Contributor Guide for details.
|
||||
|
||||
|
||||
@@ -44,27 +44,32 @@ See the
|
||||
documentation for details regarding the policies and maintenance of stable
|
||||
branches.
|
||||
|
||||
The :yocto_wiki:`Releases page </Releases>` contains a list
|
||||
of all releases of the Yocto Project. Versions in gray are no longer actively
|
||||
maintained with security patches, but well-tested patches may still be accepted
|
||||
for them for significant issues.
|
||||
The :yocto_home:`Releases </development/releases/>` page contains a list of all
|
||||
releases of the Yocto Project, grouped into current and previous releases.
|
||||
Previous releases are no longer actively maintained with security patches, but
|
||||
well-tested patches may still be accepted for them for significant issues.
|
||||
|
||||
Security-related discussions at the Yocto Project
|
||||
-------------------------------------------------
|
||||
|
||||
We have set up two security-related mailing lists:
|
||||
We have set up two security-related emails/mailing lists:
|
||||
|
||||
- Public List: yocto [dash] security [at] yoctoproject[dot] org
|
||||
- Public Mailing List: yocto [dash] security [at] yoctoproject[dot] org
|
||||
|
||||
This is a public mailing list for anyone to subscribe to. This list is an
|
||||
open list to discuss public security issues/patches and security-related
|
||||
initiatives. For more information, including subscription information,
|
||||
please see the :yocto_lists:`yocto-security mailing list info page </g/yocto-security>`.
|
||||
This is a public mailing list for anyone to subscribe to. This list is an
|
||||
open list to discuss public security issues/patches and security-related
|
||||
initiatives. For more information, including subscription information,
|
||||
please see the :yocto_lists:`yocto-security mailing list info page
|
||||
</g/yocto-security>`.
|
||||
|
||||
- Private List: security [at] yoctoproject [dot] org
|
||||
This list requires moderator approval for new topics to be posted, to avoid
|
||||
private security reports to be posted by mistake.
|
||||
|
||||
This is a private mailing list for reporting non-published potential
|
||||
vulnerabilities. The list is monitored by the Yocto Project Security team.
|
||||
- Yocto Project Security Team: security [at] yoctoproject [dot] org
|
||||
|
||||
This is an email for reporting non-published potential vulnerabilities.
|
||||
Emails sent to this address are forwarded to the Yocto Project Security
|
||||
Team members.
|
||||
|
||||
|
||||
What you should do if you find a security vulnerability
|
||||
|
||||
@@ -676,7 +676,7 @@ described in the ":ref:`dev-manual/start:accessing index of releases`" section.
|
||||
.. note::
|
||||
|
||||
For a "map" of Yocto Project releases to version numbers, see the
|
||||
:yocto_wiki:`Releases </Releases>` wiki page.
|
||||
:yocto_home:`Releases </development/releases/>` page.
|
||||
|
||||
You can use the "RELEASE ARCHIVE" link to reveal a menu of all Yocto
|
||||
Project releases.
|
||||
|
||||
@@ -12,7 +12,7 @@ known security vulnerabilities, as tracked by the public
|
||||
database.
|
||||
|
||||
The Yocto Project maintains a `list of known vulnerabilities
|
||||
<https://autobuilder.yocto.io/pub/non-release/patchmetrics/>`__
|
||||
<https://valkyrie.yocto.io/pub/non-release/patchmetrics/>`__
|
||||
for packages in Poky and OE-Core, tracking the evolution of the number of
|
||||
unpatched CVEs and the status of patches. Such information is available for
|
||||
the current development version and for each supported release.
|
||||
@@ -235,7 +235,7 @@ products defined in :term:`CVE_PRODUCT`. Then, for each found CVE:
|
||||
The CVE database is stored in :term:`DL_DIR` and can be inspected using
|
||||
``sqlite3`` command as follows::
|
||||
|
||||
sqlite3 downloads/CVE_CHECK/nvdcve_1.1.db .dump | grep CVE-2021-37462
|
||||
sqlite3 downloads/CVE_CHECK/nvd*.db .dump | grep CVE-2021-37462
|
||||
|
||||
When analyzing CVEs, it is recommended to:
|
||||
|
||||
|
||||
@@ -724,13 +724,9 @@ a Raspberry Pi 2, which is based on the Broadcom 2708/2709 chipset::
|
||||
|
||||
KBUILD_DEFCONFIG:raspberrypi2 ?= "bcm2709_defconfig"
|
||||
|
||||
Aside from modifying your kernel recipe and providing your own
|
||||
``defconfig`` file, you need to be sure no files or statements set
|
||||
:term:`SRC_URI` to use a ``defconfig`` other than your "in-tree" file (e.g.
|
||||
a kernel's ``linux-``\ `machine`\ ``.inc`` file). In other words, if the
|
||||
build system detects a statement that identifies an "out-of-tree"
|
||||
``defconfig`` file, that statement will override your
|
||||
:term:`KBUILD_DEFCONFIG` variable.
|
||||
If the build system detects a statement that identifies an "out-of-tree"
|
||||
``defconfig`` file, your :term:`KBUILD_DEFCONFIG` variable will take precedence
|
||||
over it.
|
||||
|
||||
See the
|
||||
:term:`KBUILD_DEFCONFIG`
|
||||
@@ -1276,10 +1272,12 @@ appear in the ``.config`` file, which is in the :term:`Build Directory`.
|
||||
|
||||
It is simple to create a configuration fragment. One method is to use
|
||||
shell commands. For example, issuing the following from the shell
|
||||
creates a configuration fragment file named ``my_smp.cfg`` that enables
|
||||
multi-processor support within the kernel::
|
||||
creates a configuration fragment file named ``my_changes.cfg`` that enables
|
||||
multi-processor support within the kernel and disables the FPGA
|
||||
Configuration Framework::
|
||||
|
||||
$ echo "CONFIG_SMP=y" >> my_smp.cfg
|
||||
$ echo "CONFIG_SMP=y" >> my_changes.cfg
|
||||
$ echo "# CONFIG_FPGA is not set" >> my_changes.cfg
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -1516,15 +1514,13 @@ Expanding Variables
|
||||
===================
|
||||
|
||||
Sometimes it is helpful to determine what a variable expands to during a
|
||||
build. You can examine the values of variables by examining the
|
||||
output of the ``bitbake -e`` command. The output is long and is more
|
||||
easily managed in a text file, which allows for easy searches::
|
||||
build. You can examine the value of a variable by running the ``bitbake-getvar``
|
||||
command::
|
||||
|
||||
$ bitbake -e virtual/kernel > some_text_file
|
||||
$ bitbake-getvar -r virtual/kernel VARIABLE
|
||||
|
||||
Within the text file, you can see
|
||||
exactly how each variable is expanded and used by the OpenEmbedded build
|
||||
system.
|
||||
The output of the command explains exactly how the variable is expanded and used
|
||||
by the :term:`OpenEmbedded Build System`.
|
||||
|
||||
Working with a "Dirty" Kernel Version String
|
||||
============================================
|
||||
|
||||
@@ -35,3 +35,6 @@ Release 4.0 (kirkstone)
|
||||
release-notes-4.0.26
|
||||
release-notes-4.0.27
|
||||
release-notes-4.0.28
|
||||
release-notes-4.0.29
|
||||
release-notes-4.0.30
|
||||
release-notes-4.0.31
|
||||
|
||||
178
documentation/migration-guides/release-notes-4.0.29.rst
Normal file
178
documentation/migration-guides/release-notes-4.0.29.rst
Normal file
@@ -0,0 +1,178 @@
|
||||
Release notes for Yocto-4.0.29 (Kirkstone)
|
||||
------------------------------------------
|
||||
|
||||
Security Fixes in Yocto-4.0.29
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- avahi: Fix :cve_nist:`2024-52615`
|
||||
- binutils: Fix :cve_nist:`2025-7545` and :cve_nist:`2025-7546`
|
||||
- coreutils: Fix :cve_nist:`2025-5278`
|
||||
- curl: Fix :cve_nist:`2024-11053` and :cve_nist:`2025-0167`
|
||||
- dropbear: Fix :cve_nist:`2025-47203`
|
||||
- ffmpeg: Ignore :cve_nist:`2022-3109` and :cve_nist:`2022-3341`
|
||||
- gdk-pixbuf: Fix :cve_nist:`2025-7345`
|
||||
- ghostscript: Ignore :cve_nist:`2025-46646`
|
||||
- gnupg: Fix :cve_nist:`2025-30258`
|
||||
- gnutls: Fix :cve_nist:`2025-6395`, :cve_nist:`2025-32988`, :cve_nist:`2025-32989` and
|
||||
:cve_nist:`2025-32990`
|
||||
- iputils: Fix :cve_nist:`2025-48964`
|
||||
- libarchive: Fix :cve_nist:`2025-5914`, :cve_nist:`2025-5915`, :cve_nist:`2025-5916` and
|
||||
:cve_nist:`2025-5917`
|
||||
- libpam: Fix :cve_nist:`2025-6020`
|
||||
- libsoup-2.4: Fix :cve_nist:`2025-4945`
|
||||
- libsoup-2.4: Fix :cve_nist:`2025-4969` (update patch)
|
||||
- libsoup: Fix :cve_nist:`2025-4945`, :cve_nist:`2025-6021`, :cve_nist:`2025-6170`,
|
||||
:cve_nist:`2025-49794` and :cve_nist:`2025-49796`
|
||||
- ncurses: Fix :cve_nist:`2025-6141`
|
||||
- ofono: Fix :cve_nist:`2023-4232` and :cve_nist:`2023-4235`
|
||||
- openssl: Fix :cve_nist:`2024-41996`
|
||||
- python3-urllib3: Fix :cve_nist:`2025-50181`
|
||||
- ruby: Fix :cve_nist:`2024-43398` (update patches)
|
||||
- sqlite3: Fix :cve_nist:`2025-6965` and :cve_nist:`2025-7458`
|
||||
- sqlite3: Ignore :cve_nist:`2025-3277`
|
||||
- systemd: Fix :cve_nist:`2025-4598`
|
||||
- xwayland: Fix :cve_nist:`2025-49175`, :cve_nist:`2025-49176`, :cve_nist:`2025-49177`,
|
||||
:cve_nist:`2025-49178`, :cve_nist:`2025-49179` and :cve_nist:`2025-49180`
|
||||
|
||||
|
||||
Fixes in Yocto-4.0.29
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- bintuils: stable 2.38 branch update
|
||||
- bitbake: test/fetch: Switch u-boot based test to use our own mirror
|
||||
- build-appliance-image: Update to kirkstone head revision
|
||||
- conf.py: improve SearchEnglish to handle terms with dots
|
||||
- db: ignore implicit-int and implicit-function-declaration issues fatal with gcc-14
|
||||
- dev-manual/start.rst: added missing command in Optimize your VHDX file using DiskPart
|
||||
- glibc: stable 2.35 branch updates
|
||||
- gnutls: patch read buffer overrun in the "pre_shared_key" extension
|
||||
- gnutls: patch reject zero-length version in certificate request
|
||||
- linux-yocto/5.15: update to v5.15.186
|
||||
- migration-guides: add release notes for 4.0.28
|
||||
- oeqa/core/decorator: add decorators to skip based on :term:`HOST_ARCH`
|
||||
- openssl: upgrade to 3.0.17
|
||||
- orc: set :term:`CVE_PRODUCT`
|
||||
- overview-manual/concepts.rst: fix sayhello hardcoded bindir
|
||||
- poky.conf: bump version for 4.0.29
|
||||
- python3: update CVE product
|
||||
- ref-manual: document :term:`KERNEL_SPLIT_MODULES` variable
|
||||
- scripts/install-buildtools: Update to 4.0.28
|
||||
- sudo: upgrade to 1.9.17p1
|
||||
- tcf-agent: correct the :term:`SRC_URI`
|
||||
|
||||
|
||||
Known Issues in Yocto-4.0.29
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- N/A
|
||||
|
||||
|
||||
Contributors to Yocto-4.0.29
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Aleksandar Nikolic
|
||||
- Antonin Godard
|
||||
- Archana Polampalli
|
||||
- Bruce Ashfield
|
||||
- Changqing Li
|
||||
- Chen Qi
|
||||
- Colin Pinnell McAllister
|
||||
- Daniel Díaz
|
||||
- Deepesh Varatharajan
|
||||
- Divya Chellam
|
||||
- Dixit Parmar
|
||||
- Enrico Jörns
|
||||
- Guocai He
|
||||
- Hitendra Prajapati
|
||||
- Lee Chee Yang
|
||||
- Marco Cavallini
|
||||
- Martin Jansa
|
||||
- Peter Marko
|
||||
- Praveen Kumar
|
||||
- Richard Purdie
|
||||
- Rob Woolley
|
||||
- Ross Burton
|
||||
- Steve Sakoman
|
||||
- Vijay Anusuri
|
||||
- Yash Shinde
|
||||
- Yogita Urade
|
||||
- Zhang Peng
|
||||
|
||||
|
||||
Repositories / Downloads for Yocto-4.0.29
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
poky
|
||||
|
||||
- Repository Location: :yocto_git:`/poky`
|
||||
- Branch: :yocto_git:`kirkstone </poky/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.29 </poky/log/?h=yocto-4.0.29>`
|
||||
- Git Revision: :yocto_git:`81ab000fa437ca04f584a3327b076f7a512dc6d0 </poky/commit/?id=81ab000fa437ca04f584a3327b076f7a512dc6d0>`
|
||||
- Release Artefact: poky-81ab000fa437ca04f584a3327b076f7a512dc6d0
|
||||
- sha: 2fecf3cac5c2361c201b5ae826960af92289862ec9be13837a8431138e534fd2
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.29/poky-81ab000fa437ca04f584a3327b076f7a512dc6d0.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.29/poky-81ab000fa437ca04f584a3327b076f7a512dc6d0.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.29 </openembedded-core/log/?h=yocto-4.0.29>`
|
||||
- Git Revision: :oe_git:`bd620eb14660075fd0f7476bbbb65d5da6293874 </openembedded-core/commit/?id=bd620eb14660075fd0f7476bbbb65d5da6293874>`
|
||||
- Release Artefact: oecore-bd620eb14660075fd0f7476bbbb65d5da6293874
|
||||
- sha: f32ab195c7090268e6e87ccf8db2813cf705c517030654326d14b25d926de88e
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.29/oecore-bd620eb14660075fd0f7476bbbb65d5da6293874.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.29/oecore-bd620eb14660075fd0f7476bbbb65d5da6293874.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.29 </meta-mingw/log/?h=yocto-4.0.29>`
|
||||
- Git Revision: :yocto_git:`87c22abb1f11be430caf4372e6b833dc7d77564e </meta-mingw/commit/?id=87c22abb1f11be430caf4372e6b833dc7d77564e>`
|
||||
- Release Artefact: meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e
|
||||
- sha: f0bc4873e2e0319fb9d6d6ab9b98eb3f89664d4339a167d2db6a787dd12bc1a8
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.29/meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.29/meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e.tar.bz2
|
||||
|
||||
meta-gplv2
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-gplv2`
|
||||
- Branch: :yocto_git:`kirkstone </meta-gplv2/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.29 </meta-gplv2/log/?h=yocto-4.0.29>`
|
||||
- Git Revision: :yocto_git:`d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a </meta-gplv2/commit/?id=d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a>`
|
||||
- Release Artefact: meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a
|
||||
- sha: c386f59f8a672747dc3d0be1d4234b6039273d0e57933eb87caa20f56b9cca6d
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.29/meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.29/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.29 </bitbake/log/?h=yocto-4.0.29>`
|
||||
- Git Revision: :oe_git:`8e2d1f8de055549b2101614d85454fcd1d0f94b2 </bitbake/commit/?id=8e2d1f8de055549b2101614d85454fcd1d0f94b2>`
|
||||
- Release Artefact: bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2
|
||||
- sha: fad4e7699bae62082118e89785324b031b0af0743064caee87c91ba28549afb0
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.29/bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.29/bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2.tar.bz2
|
||||
|
||||
meta-yocto
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-yocto`
|
||||
- Branch: :yocto_git:`kirkstone </meta-yocto/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.29 </meta-yocto/log/?h=yocto-4.0.29>`
|
||||
- Git Revision: :yocto_git:`e916d3bad58f955b73e2c67aba975e63cd191394 </meta-yocto/commit/?id=e916d3bad58f955b73e2c67aba975e63cd191394>`
|
||||
|
||||
yocto-docs
|
||||
|
||||
- Repository Location: :yocto_git:`/yocto-docs`
|
||||
- Branch: :yocto_git:`kirkstone </yocto-docs/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.29 </yocto-docs/log/?h=yocto-4.0.29>`
|
||||
- Git Revision: :yocto_git:`bf855ecaf4bec4cef9bbfea2e50caa65a8339828 </yocto-docs/commit/?id=bf855ecaf4bec4cef9bbfea2e50caa65a8339828>`
|
||||
|
||||
170
documentation/migration-guides/release-notes-4.0.30.rst
Normal file
170
documentation/migration-guides/release-notes-4.0.30.rst
Normal file
@@ -0,0 +1,170 @@
|
||||
Release notes for Yocto-4.0.30 (Kirkstone)
|
||||
------------------------------------------
|
||||
|
||||
Security Fixes in Yocto-4.0.30
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- cups: Fix :cve_nist:`2025-58060` and :cve_nist:`2025-58364`
|
||||
- dpkg: Fix :cve_nist:`2025-6297`
|
||||
- ffmpeg: Fix :cve_nist:`2023-6602`, :cve_nist:`2023-6604`, :cve_nist:`2023-6605`,
|
||||
:cve_nist:`2025-1594` and CVE-2025-7700
|
||||
- git: Fix :cve_nist:`2025-27613`, :cve_nist:`2025-27614`, :cve_nist:`2025-46334`,
|
||||
:cve_nist:`2025-46835` and :cve_nist:`2025-48384`
|
||||
- glib-2.0: Fix :cve_nist:`2025-7039`
|
||||
- glib-2.0: Ignore :cve_nist:`2025-4056`
|
||||
- go: Ignore :cve_nist:`2024-24790` and :cve_nist:`2025-0913`
|
||||
- gstreamer1.0-plugins-base: Fix :cve_nist:`2025-47806`, :cve_nist:`2025-47807` and
|
||||
:cve_nist:`2025-47808`
|
||||
- gstreamer1.0-plugins-good: Fix :cve_nist:`2025-47183` and :cve_nist:`2025-47219`
|
||||
- libarchive: Fix :cve_nist:`2025-5918`
|
||||
- libxslt: Fix :cve_nist:`2023-40403`
|
||||
- openssl: Fix :cve_nist:`2023-50781`
|
||||
- python3: Fix :cve_nist:`2025-8194`
|
||||
- qemu: Ignore :cve_nist:`2024-7730`
|
||||
- sqlite3: Revert "sqlite3: patch CVE-2025-7458"
|
||||
- tiff: Fix :cve_nist:`2024-13978`, :cve_nist:`2025-8176`, :cve_nist:`2025-8177`,
|
||||
:cve_nist:`2025-8534` and :cve_nist:`2025-8851`
|
||||
- vim: Fix :cve_nist:`2025-53905` and :cve_nist:`2025-53906`
|
||||
- wpa-supplicant: Fix :cve_nist:`2022-37660`
|
||||
- xserver-xorg: Fix :cve_nist:`2025-49175`, :cve_nist:`2025-49176`, :cve_nist:`2025-49177`,
|
||||
:cve_nist:`2025-49178`, :cve_nist:`2025-49179` and :cve_nist:`2025-49180`
|
||||
|
||||
|
||||
Fixes in Yocto-4.0.30
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- build-appliance-image: Update to kirkstone head revision
|
||||
- default-distrovars.inc: Fix CONNECTIVITY_CHECK_URIS redirect issue
|
||||
- dev-manual/security-subjects.rst: update mailing lists
|
||||
- gnupg: disable tests to avoid running target binaries at build time
|
||||
- go-helloworld: fix license
|
||||
- insane: Ensure that `src-uri-bad` fails correctly
|
||||
- insane: Improve patch warning/error handling
|
||||
- libubootenv: backport patch to fix unknown type name 'size_t'
|
||||
- llvm: fix typo in CVE-2024-0151.patch
|
||||
- migration-guides: add release notes for 4.0.29
|
||||
- overview-manual/yp-intro.rst: fix broken link to article
|
||||
- poky.conf: bump version for 4.0.30
|
||||
- pulseaudio: Add audio group explicitly
|
||||
- ref-manual/classes.rst: document the testexport class
|
||||
- ref-manual/system-requirements.rst: update supported distributions
|
||||
- ref-manual/variables.rst: document :term:`FIT_CONF_PREFIX` :term:`SPL_DTB_BINARY` variable
|
||||
- ref-manual/variables.rst: expand :term:`IMAGE_OVERHEAD_FACTOR` glossary entry
|
||||
- sdk: The main in the C example should return an int
|
||||
- sudo: remove devtool FIXME comment
|
||||
- systemd: Fix manpage build after :cve_nist:`2025-4598`
|
||||
- vim: not adjust script pathnames for native scripts either
|
||||
- vim: upgrade to 9.1.1652
|
||||
|
||||
|
||||
Known Issues in Yocto-4.0.30
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- N/A
|
||||
|
||||
Contributors to Yocto-4.0.30
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Antonin Godard
|
||||
- Archana Polampalli
|
||||
- Dan McGregor
|
||||
- Deepak Rathore
|
||||
- Divya Chellam
|
||||
- Erik Lindsten
|
||||
- Guocai He
|
||||
- Gyorgy Sarvari
|
||||
- Hitendra Prajapati
|
||||
- Jan Vermaete
|
||||
- Jiaying Song
|
||||
- Joao Marcos Costa
|
||||
- Kyungjik Min
|
||||
- Lee Chee Yang
|
||||
- Mingli Yu
|
||||
- Peter Marko
|
||||
- Philip Lorenz
|
||||
- Praveen Kumar
|
||||
- Quentin Schulz
|
||||
- Richard Purdie
|
||||
- Steve Sakoman
|
||||
- Vijay Anusuri
|
||||
- Yogita Urade
|
||||
- Youngseok Jeong
|
||||
|
||||
|
||||
Repositories / Downloads for Yocto-4.0.30
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
poky
|
||||
|
||||
- Repository Location: :yocto_git:`/poky`
|
||||
- Branch: :yocto_git:`kirkstone </poky/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.30 </poky/log/?h=yocto-4.0.30>`
|
||||
- Git Revision: :yocto_git:`51dc9c464de0703bfbc6f1ee71ac9bea20933a45 </poky/commit/?id=51dc9c464de0703bfbc6f1ee71ac9bea20933a45>`
|
||||
- Release Artefact: poky-51dc9c464de0703bfbc6f1ee71ac9bea20933a45
|
||||
- sha: 2b5db0a07598df7684975c0839e6f31515a8e78d366503feb9917ef1ca56c0b2
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.30/poky-51dc9c464de0703bfbc6f1ee71ac9bea20933a45.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.30/poky-51dc9c464de0703bfbc6f1ee71ac9bea20933a45.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.30 </openembedded-core/log/?h=yocto-4.0.30>`
|
||||
- Git Revision: :oe_git:`d381eeb5e70bd0ce9e78032c909e4a23564f4dd7 </openembedded-core/commit/?id=d381eeb5e70bd0ce9e78032c909e4a23564f4dd7>`
|
||||
- Release Artefact: oecore-d381eeb5e70bd0ce9e78032c909e4a23564f4dd7
|
||||
- sha: 022ab4ef5ac59ac3f01a9dacd8b1d6310cc117c6bed2e86e195ced88e0689c85
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.30/oecore-d381eeb5e70bd0ce9e78032c909e4a23564f4dd7.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.30/oecore-d381eeb5e70bd0ce9e78032c909e4a23564f4dd7.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.30 </meta-mingw/log/?h=yocto-4.0.30>`
|
||||
- Git Revision: :yocto_git:`87c22abb1f11be430caf4372e6b833dc7d77564e </meta-mingw/commit/?id=87c22abb1f11be430caf4372e6b833dc7d77564e>`
|
||||
- Release Artefact: meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e
|
||||
- sha: f0bc4873e2e0319fb9d6d6ab9b98eb3f89664d4339a167d2db6a787dd12bc1a8
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.30/meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.30/meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e.tar.bz2
|
||||
|
||||
meta-gplv2
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-gplv2`
|
||||
- Branch: :yocto_git:`kirkstone </meta-gplv2/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.30 </meta-gplv2/log/?h=yocto-4.0.30>`
|
||||
- Git Revision: :yocto_git:`d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a </meta-gplv2/commit/?id=d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a>`
|
||||
- Release Artefact: meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a
|
||||
- sha: c386f59f8a672747dc3d0be1d4234b6039273d0e57933eb87caa20f56b9cca6d
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.30/meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.30/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.30 </bitbake/log/?h=yocto-4.0.30>`
|
||||
- Git Revision: :oe_git:`8e2d1f8de055549b2101614d85454fcd1d0f94b2 </bitbake/commit/?id=8e2d1f8de055549b2101614d85454fcd1d0f94b2>`
|
||||
- Release Artefact: bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2
|
||||
- sha: fad4e7699bae62082118e89785324b031b0af0743064caee87c91ba28549afb0
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.30/bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.30/bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2.tar.bz2
|
||||
|
||||
meta-yocto
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-yocto`
|
||||
- Branch: :yocto_git:`kirkstone </meta-yocto/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.30 </meta-yocto/log/?h=yocto-4.0.30>`
|
||||
- Git Revision: :yocto_git:`edf7950e4d81dd31f29a58acdd8022dabd2be494 </meta-yocto/commit/?id=edf7950e4d81dd31f29a58acdd8022dabd2be494>`
|
||||
|
||||
yocto-docs
|
||||
|
||||
- Repository Location: :yocto_git:`/yocto-docs`
|
||||
- Branch: :yocto_git:`kirkstone </yocto-docs/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.30 </yocto-docs/log/?h=yocto-4.0.30>`
|
||||
- Git Revision: :yocto_git:`71a3933c609ce73ff07e5be48d9e7b03f22ef8d7 </yocto-docs/commit/?id=71a3933c609ce73ff07e5be48d9e7b03f22ef8d7>`
|
||||
|
||||
210
documentation/migration-guides/release-notes-4.0.31.rst
Normal file
210
documentation/migration-guides/release-notes-4.0.31.rst
Normal file
@@ -0,0 +1,210 @@
|
||||
Release notes for Yocto-4.0.31 (Kirkstone)
|
||||
------------------------------------------
|
||||
|
||||
Security Fixes in Yocto-4.0.31
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- binutils: Fix :cve_nist:`2025-8225`, :cve_nist:`2025-11081`, :cve_nist:`2025-11082` and
|
||||
:cve_nist:`2025-11083`
|
||||
- busybox: Fix :cve_nist:`2025-46394`
|
||||
- cmake: Fix :cve_nist:`2025-9301`
|
||||
- curl: Fix :cve_nist:`2025-9086`
|
||||
- ffmpeg: Ignore :cve_nist:`2023-6603`
|
||||
- ffmpeg: mark :cve_nist:`2023-6601` as Fixed
|
||||
- ghostscript: Fix :cve_nist:`2025-59798`, :cve_nist:`2025-59799` and :cve_nist:`2025-59800`
|
||||
- git: Fix :cve_nist:`2025-48386`
|
||||
- glib-networking: Fix :cve_nist:`2025-60018` and :cve_nist:`2025-60019`
|
||||
- go: Fix :cve_nist:`2025-47906` and :cve_nist:`2025-47907`
|
||||
- grub2: Fix :cve_nist:`2024-56738`
|
||||
- grub: Ignore :cve_nist:`2024-2312`
|
||||
- gstreamer1.0-plugins-bad: Fix :cve_nist:`2025-3887`
|
||||
- gstreamer1.0: Ignore :cve_nist:`2025-2759`, :cve_nist:`2025-3887`, :cve_nist:`2025-47183`,
|
||||
:cve_nist:`2025-47219`, :cve_nist:`2025-47806`, :cve_nist:`2025-47807` and :cve_nist:`2025-47808`
|
||||
- python3-jinja2: Fix :cve_nist:`2024-56201`, :cve_nist:`2024-56326` and :cve_nist:`2025-27516`
|
||||
- libxml2: Fix :cve_nist:`2025-9714`
|
||||
- libxslt: Fix :cve_nist:`2025-7424`
|
||||
- lz4: Fix :cve_nist:`2025-62813`
|
||||
- openssl: Fix :cve_nist:`2025-9230` and :cve_nist:`2025-9232`
|
||||
- pulseaudio: Ignore :cve_nist:`2024-11586`
|
||||
- python3: Fix :cve_nist:`2024-6345`, :cve_nist:`2025-47273` and :cve_nist:`2025-59375`
|
||||
- qemu: Fix :cve_nist:`2024-8354`
|
||||
- tiff: Fix :cve_nist:`2025-8961`, :cve_nist:`2025-9165` and :cve_nist:`2025-9900`
|
||||
- vim: Fix :cve_nist:`2025-9389`
|
||||
|
||||
|
||||
Fixes in Yocto-4.0.31
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- build-appliance-image: Update to kirkstone head revision
|
||||
- poky.conf: bump version for 4.0.31
|
||||
- ref-manual/classes.rst: document the relative_symlinks class
|
||||
- ref-manual/classes.rst: gettext: extend the documentation of the class
|
||||
- ref-manual/variables.rst: document the CCACHE_DISABLE, UNINATIVE_CHECKSUM, UNINATIVE_URL, USE_NLS,
|
||||
REQUIRED_COMBINED_FEATURES, REQUIRED_IMAGE_FEATURES, :term:`REQUIRED_MACHINE_FEATURES` variable
|
||||
- ref-manual/variables.rst: fix :term:`LAYERDEPENDS` description
|
||||
- dev-manual, test-manual: Update autobuilder output links
|
||||
- ref-manual/classes.rst: extend the uninative class documentation
|
||||
- python3: upgrade to 3.10.19
|
||||
- linux-yocto/5.15: update to v5.15.194
|
||||
- glibc: : PTHREAD_COND_INITIALIZER compatibility with pre-2.41 versions (bug 32786)
|
||||
- glibc: nptl Use all of g1_start and g_signals
|
||||
- glibc: nptl rename __condvar_quiesce_and_switch_g1
|
||||
- glibc: nptl Fix indentation
|
||||
- glibc: nptl Use a single loop in pthread_cond_wait instaed of a nested loop
|
||||
- glibc: Remove g_refs from condition variables
|
||||
- glibc: nptl Remove unnecessary quadruple check in pthread_cond_wait
|
||||
- glibc: nptl Remove unnecessary catch-all-wake in condvar group switch
|
||||
- glibc: nptl Update comments and indentation for new condvar implementation
|
||||
- glibc: pthreads NPTL lost wakeup fix 2
|
||||
- glibc: Remove partial BZ#25847 backport patches
|
||||
- vulnerabilities: update nvdcve file name
|
||||
- migration-guides: add release notes for 4.0.30
|
||||
- oeqa/sdk/cases/buildcpio.py: use gnu mirror instead of main server
|
||||
- selftest/cases/meta_ide.py: use use gnu mirror instead of main server
|
||||
- conf/bitbake.conf: use gnu mirror instead of main server
|
||||
- p11-kit: backport fix for handle :term:`USE_NLS` from master
|
||||
- systemd: backport fix for handle :term:`USE_NLS` from master
|
||||
- glibc: stable 2.35 branch updates
|
||||
- openssl: upgrade to 3.0.18
|
||||
- scripts/install-buildtools: Update to 4.0.30
|
||||
- ref-manual/variables.rst: fix the description of :term:`STAGING_DIR`
|
||||
- ref-manual/structure: document the auto.conf file
|
||||
- dev-manual/building.rst: add note about externalsrc variables absolute paths
|
||||
- ref-manual/variables.rst: fix the description of :term:`KBUILD_DEFCONFIG`
|
||||
- kernel-dev/common.rst: fix the in-tree defconfig description
|
||||
- test-manual/yocto-project-compatible.rst: fix a typo
|
||||
- contributor-guide: submit-changes: make "Crediting contributors" part of "Commit your changes"
|
||||
- contributor-guide: submit-changes: number instruction list in commit your changes
|
||||
- contributor-guide: submit-changes: reword commit message instructions
|
||||
- contributor-guide: submit-changes: make the Cc tag follow kernel guidelines
|
||||
- contributor-guide: submit-changes: align :term:`CC` tag description
|
||||
- contributor-guide: submit-changes: clarify example with Yocto bug ID
|
||||
- contributor-guide: submit-changes: fix improper bold string
|
||||
- libhandy: update git branch name
|
||||
- python3-jinja2: upgrade to 3.1.6
|
||||
- vim: upgrade to 9.1.1683
|
||||
|
||||
|
||||
Known Issues in Yocto-4.0.31
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- N/A
|
||||
|
||||
|
||||
Contributors to Yocto-4.0.31
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Adam Blank
|
||||
- Aleksandar Nikolic
|
||||
- Antonin Godard
|
||||
- Archana Polampalli
|
||||
- AshishKumar Mishra
|
||||
- Bruce Ashfield
|
||||
- Deepesh Varatharajan
|
||||
- Divya Chellam
|
||||
- Gyorgy Sarvari
|
||||
- Hitendra Prajapati
|
||||
- João Marcos Costa
|
||||
- Lee Chee Yang
|
||||
- Paul Barker
|
||||
- Peter Marko
|
||||
- Praveen Kumar
|
||||
- Quentin Schulz
|
||||
- Rajeshkumar Ramasamy
|
||||
- Saravanan
|
||||
- Soumya Sambu
|
||||
- Steve Sakoman
|
||||
- Sunil Dora
|
||||
- Talel BELHAJ SALEM
|
||||
- Theo GAIGE
|
||||
- Vijay Anusuri
|
||||
- Yash Shinde
|
||||
- Yogita Urade
|
||||
|
||||
Repositories / Downloads for Yocto-4.0.31
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
yocto-docs
|
||||
|
||||
- Repository Location: :yocto_git:`/yocto-docs`
|
||||
- Branch: :yocto_git:`kirkstone </yocto-docs/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.31 </yocto-docs/log/?h=yocto-4.0.31>`
|
||||
- Git Revision: :yocto_git:`073f3bca4c374b03398317e7f445d2440a287741 </yocto-docs/commit/?id=073f3bca4c374b03398317e7f445d2440a287741>`
|
||||
- Release Artefact: yocto-docs-073f3bca4c374b03398317e7f445d2440a287741
|
||||
- sha: 3bfde9b6ad310dd42817509b67f61cd69552f74b2bc5011bd20788fe96d6823b
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.31/yocto-docs-073f3bca4c374b03398317e7f445d2440a287741.tar.bz2
|
||||
https://mirrors.edge.kernel.org/yocto/yocto/yocto-4.0.31/yocto-docs-073f3bca4c374b03398317e7f445d2440a287741.tar.bz2
|
||||
|
||||
poky
|
||||
|
||||
- Repository Location: :yocto_git:`/poky`
|
||||
- Branch: :yocto_git:`kirkstone </poky/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.31 </poky/log/?h=yocto-4.0.31>`
|
||||
- Git Revision: :yocto_git:`04b39e5b7eb19498215d85c88a5fffb460fea1eb </poky/commit/?id=04b39e5b7eb19498215d85c88a5fffb460fea1eb>`
|
||||
- Release Artefact: poky-04b39e5b7eb19498215d85c88a5fffb460fea1eb
|
||||
- sha: 0ca18ab1ed25c0d77412ba30dbb03d74811756c7c2fe2401940f848a5e734930
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.31/poky-04b39e5b7eb19498215d85c88a5fffb460fea1eb.tar.bz2
|
||||
https://mirrors.edge.kernel.org/yocto/yocto/yocto-4.0.31/poky-04b39e5b7eb19498215d85c88a5fffb460fea1eb.tar.bz2
|
||||
|
||||
openembedded-core
|
||||
|
||||
- Repository Location: :oe_git:`/openembedded-core`
|
||||
- Branch: :oe_git:`kirkstone </openembedded-core/log/?h=kirkstone>`
|
||||
- Tag: :oe_git:`yocto-4.0.31 </openembedded-core/log/?h=yocto-4.0.31>`
|
||||
- Git Revision: :oe_git:`99204008786f659ab03538cd2ae2fd23ed4164c5 </openembedded-core/commit/?id=99204008786f659ab03538cd2ae2fd23ed4164c5>`
|
||||
- Release Artefact: oecore-99204008786f659ab03538cd2ae2fd23ed4164c5
|
||||
- sha: aa97bf826ad217b3a5278b4ad60bef4d194f0f1ff617677cf2323d3cc4897687
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.31/oecore-99204008786f659ab03538cd2ae2fd23ed4164c5.tar.bz2
|
||||
https://mirrors.edge.kernel.org/yocto/yocto/yocto-4.0.31/oecore-99204008786f659ab03538cd2ae2fd23ed4164c5.tar.bz2
|
||||
|
||||
meta-yocto
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-yocto`
|
||||
- Branch: :yocto_git:`kirkstone </meta-yocto/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.31 </meta-yocto/log/?h=yocto-4.0.31>`
|
||||
- Git Revision: :yocto_git:`3b2df00345b46479237fe0218675a818249f891c </meta-yocto/commit/?id=3b2df00345b46479237fe0218675a818249f891c>`
|
||||
- Release Artefact: meta-yocto-3b2df00345b46479237fe0218675a818249f891c
|
||||
- sha: 630e99e0f515bab8a316b2e32aff1352b4404f15aa087e8821b84093596a08ce
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.31/meta-yocto-3b2df00345b46479237fe0218675a818249f891c.tar.bz2
|
||||
https://mirrors.edge.kernel.org/yocto/yocto/yocto-4.0.31/meta-yocto-3b2df00345b46479237fe0218675a818249f891c.tar.bz2
|
||||
|
||||
meta-mingw
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-mingw`
|
||||
- Branch: :yocto_git:`kirkstone </meta-mingw/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.31 </meta-mingw/log/?h=yocto-4.0.31>`
|
||||
- Git Revision: :yocto_git:`87c22abb1f11be430caf4372e6b833dc7d77564e </meta-mingw/commit/?id=87c22abb1f11be430caf4372e6b833dc7d77564e>`
|
||||
- Release Artefact: meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e
|
||||
- sha: f0bc4873e2e0319fb9d6d6ab9b98eb3f89664d4339a167d2db6a787dd12bc1a8
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.31/meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e.tar.bz2
|
||||
https://mirrors.edge.kernel.org/yocto/yocto/yocto-4.0.31/meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e.tar.bz2
|
||||
|
||||
meta-gplv2
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-gplv2`
|
||||
- Branch: :yocto_git:`kirkstone </meta-gplv2/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.31 </meta-gplv2/log/?h=yocto-4.0.31>`
|
||||
- Git Revision: :yocto_git:`d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a </meta-gplv2/commit/?id=d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a>`
|
||||
- Release Artefact: meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a
|
||||
- sha: c386f59f8a672747dc3d0be1d4234b6039273d0e57933eb87caa20f56b9cca6d
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.31/meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a.tar.bz2
|
||||
https://mirrors.edge.kernel.org/yocto/yocto/yocto-4.0.31/meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a.tar.bz2
|
||||
|
||||
bitbake
|
||||
|
||||
- Repository Location: :oe_git:`/bitbake`
|
||||
- Branch: :oe_git:`2.0 </bitbake/log/?h=2.0>`
|
||||
- Tag: :oe_git:`yocto-4.0.31 </bitbake/log/?h=yocto-4.0.31>`
|
||||
- Git Revision: :oe_git:`8e2d1f8de055549b2101614d85454fcd1d0f94b2 </bitbake/commit/?id=8e2d1f8de055549b2101614d85454fcd1d0f94b2>`
|
||||
- Release Artefact: bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2
|
||||
- sha: fad4e7699bae62082118e89785324b031b0af0743064caee87c91ba28549afb0
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.31/bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2.tar.bz2
|
||||
https://mirrors.edge.kernel.org/yocto/yocto/yocto-4.0.31/bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2.tar.bz2
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 20 KiB |
172
documentation/overview-manual/svg/key-dev-elements.svg
Normal file
172
documentation/overview-manual/svg/key-dev-elements.svg
Normal file
@@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="164.765mm"
|
||||
height="72.988113mm"
|
||||
viewBox="0 0 164.765 72.988114"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
xml:space="preserve"
|
||||
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
|
||||
sodipodi:docname="key-dev-elements.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="false"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="341.5"
|
||||
inkscape:cy="-31.5"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1440"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="layer2"
|
||||
showborder="false"
|
||||
borderlayer="false"
|
||||
inkscape:antialias-rendering="true"
|
||||
showguides="true" /><defs
|
||||
id="defs1" /><g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="Layer "
|
||||
style="display:inline"
|
||||
transform="translate(-20.664242,-129.6793)"><rect
|
||||
style="display:inline;fill:#f1e9cc;fill-opacity:1;stroke:#6d8eb4;stroke-width:0.653;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
id="rect1"
|
||||
width="164.112"
|
||||
height="54.273098"
|
||||
x="20.990742"
|
||||
y="130.0058"
|
||||
ry="0"
|
||||
inkscape:label="yp-rect" /><rect
|
||||
style="display:inline;fill:#f3d770;fill-opacity:1;stroke:#6d8eb4;stroke-width:0.653;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
id="rect2"
|
||||
width="101.45864"
|
||||
height="41.151588"
|
||||
x="28.1292"
|
||||
y="137.10953"
|
||||
inkscape:label="poky-rect" /><rect
|
||||
style="display:inline;fill:#c0ebf5;fill-opacity:1;stroke:#6d8eb4;stroke-width:0.653;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
id="rect3"
|
||||
width="50.652737"
|
||||
height="53.04562"
|
||||
x="35.516178"
|
||||
y="149.29529"
|
||||
inkscape:label="oe-rect" /><text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;white-space:pre;inline-size:46.7487;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
x="136.38763"
|
||||
y="137.69727"
|
||||
id="text3"
|
||||
inkscape:label="poky-title"
|
||||
transform="matrix(0.90889596,0,0,0.81399719,-26.072941,39.399474)"><tspan
|
||||
x="136.38763"
|
||||
y="137.69727"
|
||||
id="tspan2">Poky</tspan></text><text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;white-space:pre;inline-size:46.7487;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
x="136.38763"
|
||||
y="137.69727"
|
||||
id="text3-8"
|
||||
inkscape:label="oe-title"
|
||||
transform="matrix(0.90889596,0,0,0.81399719,-78.327995,83.175189)"><tspan
|
||||
x="136.38763"
|
||||
y="137.69727"
|
||||
id="tspan4">OpenEmbedded</tspan></text><text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;white-space:pre;inline-size:46.7487;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
x="136.38763"
|
||||
y="137.69727"
|
||||
id="text3-0"
|
||||
inkscape:label="yp-title"
|
||||
transform="matrix(0.8469291,0,0,0.81399719,21.497595,28.033837)"><tspan
|
||||
x="136.38763"
|
||||
y="137.69727"
|
||||
id="tspan5">YOCTO PROJECT (YP)</tspan></text><text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.98347px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
x="137.19444"
|
||||
y="150.50006"
|
||||
id="text4"
|
||||
transform="scale(1.0050579,0.9949676)"
|
||||
inkscape:label="yp-text"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.98347px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="137.19444"
|
||||
y="150.50006">Umbrella Open Source Project</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.98347px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="137.19444"
|
||||
y="154.2294"
|
||||
id="tspan6">that Builds and Maintains</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.98347px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="137.19444"
|
||||
y="157.95874"
|
||||
id="tspan7">Validated Open Source Tools and</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.98347px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="137.19444"
|
||||
y="161.68808"
|
||||
id="tspan8">Components Associated with</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.98347px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="137.19444"
|
||||
y="165.4174"
|
||||
id="tspan9">Embedded Linux</tspan></text><text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.97078px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
x="90.582634"
|
||||
y="159.10139"
|
||||
id="text10"
|
||||
transform="scale(1.0018079,0.9981954)"
|
||||
inkscape:label="poky-text"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan10"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.97078px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="90.582634"
|
||||
y="159.10139">Yocto Project Open</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.97078px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="90.582634"
|
||||
y="162.81487"
|
||||
id="tspan11">Source Reference</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.97078px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="90.582634"
|
||||
y="166.52835"
|
||||
id="tspan12">Embedded Distribution</tspan></text><text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.01677px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:7.4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
x="40.36692"
|
||||
y="160.98824"
|
||||
id="text13"
|
||||
transform="scale(0.99784993,1.0021547)"
|
||||
inkscape:label="oe-text"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan13"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.01677px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="40.36692"
|
||||
y="160.98824">Open Source Build Engine</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.01677px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="40.36692"
|
||||
y="164.7592"
|
||||
id="tspan14">and YP-Compatible Metadata</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.01677px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0"
|
||||
x="40.36692"
|
||||
y="168.53017"
|
||||
id="tspan15">for Embedded Linux</tspan></text></g></svg>
|
||||
|
After Width: | Height: | Size: 12 KiB |
@@ -23,12 +23,12 @@ comes to delivering embedded software stacks. The project allows
|
||||
software customizations and build interchange for multiple hardware
|
||||
platforms as well as software stacks that can be maintained and scaled.
|
||||
|
||||
.. image:: figures/key-dev-elements.png
|
||||
:align: center
|
||||
.. image:: svg/key-dev-elements.*
|
||||
:width: 100%
|
||||
|
||||
For further introductory information on the Yocto Project, you might be
|
||||
interested in this
|
||||
`article <https://www.embedded.com/electronics-blogs/say-what-/4458600/Why-the-Yocto-Project-for-my-IoT-Project->`__
|
||||
`article <https://www.embedded.com/why-the-yocto-project-for-my-iot-project/>`__
|
||||
by Drew Moseley and in this short introductory
|
||||
`video <https://www.youtube.com/watch?v=utZpKM7i5Z4>`__.
|
||||
|
||||
|
||||
@@ -309,8 +309,12 @@ file for details about how to enable this mechanism in your configuration
|
||||
file, how to disable it for specific recipes, and how to share ``ccache``
|
||||
files between builds.
|
||||
|
||||
However, using the class can lead to unexpected side-effects. Thus, using
|
||||
this class is not recommended.
|
||||
Recipes can also explicitly disable `Ccache` support even when the
|
||||
:ref:`ref-classes-ccache` class is enabled, by setting the
|
||||
:term:`CCACHE_DISABLE` variable to "1".
|
||||
|
||||
Using the :ref:`ref-classes-ccache` class can lead to unexpected side-effects.
|
||||
Using this class is not recommended.
|
||||
|
||||
.. _ref-classes-chrpath:
|
||||
|
||||
@@ -825,6 +829,14 @@ software that uses the GNU ``gettext`` internationalization and localization
|
||||
system. All recipes building software that use ``gettext`` should inherit this
|
||||
class.
|
||||
|
||||
This class will configure recipes to build translations *unless*:
|
||||
|
||||
- the :term:`USE_NLS` variable is set to ``no``, or
|
||||
|
||||
- the :term:`INHIBIT_DEFAULT_DEPS` variable is set and the recipe inheriting
|
||||
the :ref:`ref-classes-gettext` class does not also inherit the
|
||||
:ref:`ref-classes-cross-canadian` class.
|
||||
|
||||
.. _ref-classes-gnomebase:
|
||||
|
||||
``gnomebase``
|
||||
@@ -2544,6 +2556,25 @@ The :ref:`ref-classes-recipe_sanity` class checks for the presence of any host s
|
||||
recipe prerequisites that might affect the build (e.g. variables that
|
||||
are set or software that is present).
|
||||
|
||||
.. _ref-classes-relative_symlinks:
|
||||
|
||||
``relative_symlinks``
|
||||
=====================
|
||||
|
||||
The :ref:`ref-classes-relative_symlinks` class walks the symbolic links in the
|
||||
:term:`D` directory and replaces links pointing to absolute paths to relative
|
||||
paths. This is occasionally used in some recipes that create wrong symbolic
|
||||
links when their :ref:`ref-classes-native` version is built, and/or would cause
|
||||
breakage in the :ref:`overview-manual/concepts:shared state cache`.
|
||||
|
||||
For example, if the following symbolic link is found in :term:`D`::
|
||||
|
||||
/usr/bin/foo -> /sbin/bar
|
||||
|
||||
It is replaced by::
|
||||
|
||||
/usr/bin/foo -> ../../sbin/bar
|
||||
|
||||
.. _ref-classes-relocatable:
|
||||
|
||||
``relocatable``
|
||||
@@ -3038,6 +3069,22 @@ class assuming :term:`PATCHRESOLVE` is set to "user", the
|
||||
:ref:`ref-classes-cml1` class, and the :ref:`ref-classes-devshell` class all
|
||||
use the :ref:`ref-classes-terminal` class.
|
||||
|
||||
.. _ref-classes-testexport:
|
||||
|
||||
``testexport``
|
||||
==============
|
||||
|
||||
Based on the :ref:`ref-classes-testimage` class, the
|
||||
:ref:`ref-classes-testexport` class can be used to export the test environment
|
||||
outside of the :term:`OpenEmbedded Build System`. This will generate the
|
||||
directory structure to execute the runtime tests using the
|
||||
:oe_git:`runexported.py </openembedded-core/tree/meta/lib/oeqa/runexported.py>`
|
||||
Python script.
|
||||
|
||||
For more details on how to use :ref:`ref-classes-testexport`, see
|
||||
the :ref:`test-manual/runtime-testing:Exporting Tests` section in the Yocto
|
||||
Project Test Environment Manual.
|
||||
|
||||
.. _ref-classes-testimage:
|
||||
|
||||
``testimage``
|
||||
@@ -3163,6 +3210,9 @@ It is intended to be inherited from U-Boot recipes.
|
||||
|
||||
The variables used by this class are:
|
||||
|
||||
- :term:`SPL_DTB_BINARY`: Name of the SPL device tree binary. Can be set to an
|
||||
empty string to indicate that no SPL should be created and added to the FIT
|
||||
image.
|
||||
- :term:`SPL_MKIMAGE_DTCOPTS`: DTC options for U-Boot ``mkimage`` when
|
||||
building the FIT image.
|
||||
- :term:`SPL_SIGN_ENABLE`: enable signing the FIT image.
|
||||
@@ -3195,22 +3245,51 @@ imitates.
|
||||
``uninative``
|
||||
=============
|
||||
|
||||
Attempts to isolate the build system from the host distribution's C
|
||||
library in order to make re-use of native shared state artifacts across
|
||||
different host distributions practical. With this class enabled, a
|
||||
tarball containing a pre-built C library is downloaded at the start of
|
||||
the build. In the Poky reference distribution this is enabled by default
|
||||
through ``meta/conf/distro/include/yocto-uninative.inc``. Other
|
||||
distributions that do not derive from poky can also
|
||||
"``require conf/distro/include/yocto-uninative.inc``" to use this.
|
||||
Alternatively if you prefer, you can build the uninative-tarball recipe
|
||||
yourself, publish the resulting tarball (e.g. via HTTP) and set
|
||||
``UNINATIVE_URL`` and ``UNINATIVE_CHECKSUM`` appropriately. For an
|
||||
example, see the ``meta/conf/distro/include/yocto-uninative.inc``.
|
||||
The :ref:`ref-classes-uninative` class allows binaries to run on systems with
|
||||
older or newer :wikipedia:`Glibc <Glibc>` versions. This means
|
||||
:ref:`ref-classes-native` recipe :ref:`overview-manual/concepts:shared state
|
||||
cache` can be shared among different host distributions of different versions,
|
||||
i.e. the :ref:`overview-manual/concepts:shared state cache` is "universal".
|
||||
|
||||
The :ref:`ref-classes-uninative` class is also used unconditionally by the extensible
|
||||
SDK. When building the extensible SDK, ``uninative-tarball`` is built
|
||||
and the resulting tarball is included within the SDK.
|
||||
To allow this to work, the dynamic loader is changed to our own :manpage:`ld.so
|
||||
<ld.so.8>` when binaries are compiled using the
|
||||
``--dynamic-linker`` option. This means when the binary is executed, it finds
|
||||
our own :manpage:`ld.so <ld.so.8>` and that loader has a modified search path
|
||||
which finds a newer Glibc version.
|
||||
|
||||
The linking of the binaries is not changed at link time since the
|
||||
headers on the system wouldn't match the newer Glibc and this causes
|
||||
obtuse failures. Changing the loader is effectively the same as if the
|
||||
system had a Glibc upgrade after the binary was compiled, so it is a
|
||||
mechanism supported by upstream.
|
||||
|
||||
One caveat to this approach is that the uninative Glibc binary must be
|
||||
equal to or newer in version to the versions on all the systems using
|
||||
the common :ref:`overview-manual/concepts:shared state cache`. This is why
|
||||
:ref:`ref-classes-uninative` is regularly changed on the development and stable
|
||||
branches.
|
||||
|
||||
Another potential issue is static linking: static libraries created on
|
||||
a system with a new Glibc version may have symbols not present in older
|
||||
versions, which would then fail during linking on older systems. This
|
||||
is one reason we don't use static linking for our :ref:`ref-classes-native`
|
||||
binaries.
|
||||
|
||||
With this class enabled, a tarball containing a pre-built C library is
|
||||
downloaded at the start of the build. In the Poky reference distribution this is
|
||||
enabled by default through :oe_git:`meta/conf/distro/include/yocto-uninative.inc
|
||||
</openembedded-core/tree/meta/conf/distro/include/yocto-uninative.inc>`. Other distributions that do
|
||||
not derive from Poky can also "``require conf/distro/include/yocto-uninative.inc``"
|
||||
to use this. Alternatively if you prefer, you can build the uninative-tarball
|
||||
recipe yourself, publish the resulting tarball (e.g. via HTTP) and set
|
||||
:term:`UNINATIVE_URL` and :term:`UNINATIVE_CHECKSUM` appropriately. For an
|
||||
example, see :oe_git:`meta/conf/distro/include/yocto-uninative.inc
|
||||
</openembedded-core/tree/meta/conf/distro/include/yocto-uninative.inc>`.
|
||||
|
||||
The :ref:`ref-classes-uninative` class is also used unconditionally by the
|
||||
:doc:`extensible SDK </sdk-manual/extensible>`. When building the extensible
|
||||
SDK, ``uninative-tarball`` is built and the resulting tarball is included within
|
||||
the SDK.
|
||||
|
||||
.. _ref-classes-update-alternatives:
|
||||
|
||||
|
||||
@@ -62,7 +62,8 @@ codename are likely to be compatible and thus work together.
|
||||
|
||||
Releases are given a nominal release version as well but the codename is
|
||||
used in repositories for this reason. You can find information on Yocto
|
||||
Project releases and codenames at :yocto_wiki:`/Releases`.
|
||||
Project releases and codenames in the :yocto_home:`Releases page
|
||||
</development/releases/>`.
|
||||
|
||||
Our :doc:`/migration-guides/index` detail how to migrate from one release of
|
||||
the Yocto Project to the next.
|
||||
|
||||
@@ -328,6 +328,15 @@ Once the build process gets the sample file, it uses ``sed`` to substitute final
|
||||
This file indicates the state of the sanity checks and is created during
|
||||
the build.
|
||||
|
||||
.. _structure-build-conf-auto.conf:
|
||||
|
||||
``build/conf/auto.conf``
|
||||
------------------------
|
||||
|
||||
This file contains configuration variables that are automatically modified by
|
||||
tools such as :oe_git:`bitbake-config-build </bitbake/tree/bin/bitbake-config-build>`.
|
||||
This file should not be modified manually.
|
||||
|
||||
.. _structure-build-downloads:
|
||||
|
||||
``build/downloads/``
|
||||
|
||||
@@ -58,20 +58,35 @@ Supported Linux Distributions
|
||||
Currently, the &DISTRO; release ("&DISTRO_NAME;") of the Yocto Project is
|
||||
supported on the following distributions:
|
||||
|
||||
- Ubuntu 20.04 (LTS)
|
||||
|
||||
- Ubuntu 22.04 (LTS)
|
||||
|
||||
- Fedora 38
|
||||
|
||||
- Debian GNU/Linux 11.x (Bullseye)
|
||||
..
|
||||
Can be generated with yocto-autobuilder-helper's scripts/yocto-supported-distros:
|
||||
yocto-supported-distros --release kirkstone --config yocto-autobuilder2/config.py --output-format docs --poky-distros
|
||||
|
||||
- AlmaLinux 8
|
||||
- AlmaLinux 9
|
||||
- Debian 11
|
||||
- Debian 12
|
||||
- Fedora 39
|
||||
- Fedora 40
|
||||
- Fedora 41
|
||||
- Rocky Linux 8
|
||||
- Rocky Linux 9
|
||||
- Ubuntu 20.04 (LTS)
|
||||
- Ubuntu 22.04 (LTS)
|
||||
- Ubuntu 24.04 (LTS)
|
||||
- Ubuntu 24.10
|
||||
|
||||
The following distribution versions are still tested, even though the
|
||||
organizations publishing them no longer make updates publicly available:
|
||||
|
||||
- Ubuntu 18.04 (LTS)
|
||||
..
|
||||
This list contains EOL distros that are still tested on the Autobuilder
|
||||
(meaning there are running workers for them).
|
||||
See https://endoflife.date for information of EOL releases.
|
||||
|
||||
- Fedora 39
|
||||
- Fedora 40
|
||||
- Ubuntu 20.04 (LTS)
|
||||
|
||||
Note that the Yocto Project doesn't have access to private updates
|
||||
that some of these versions may have. Therefore, our testing has
|
||||
@@ -80,19 +95,33 @@ limited value if you have access to such updates.
|
||||
Finally, here are the distribution versions which were previously
|
||||
tested on former revisions of "&DISTRO_NAME;", but no longer are:
|
||||
|
||||
- Ubuntu 18.04 (LTS)
|
||||
|
||||
- Ubuntu 20.04 (LTS)
|
||||
|
||||
- Ubuntu 22.04 (LTS)
|
||||
..
|
||||
Can be generated with yocto-autobuilder-helper's scripts/yocto-supported-distros:
|
||||
yocto-supported-distros --release kirkstone --config yocto-autobuilder2/config.py --output-format docs --old-distros
|
||||
|
||||
- CentOS 7
|
||||
- CentOS 8
|
||||
- Debian 10
|
||||
- Debian 8
|
||||
- Debian 9
|
||||
- Fedora 29
|
||||
- Fedora 30
|
||||
- Fedora 31
|
||||
- Fedora 32
|
||||
- Fedora 33
|
||||
- Fedora 34
|
||||
- Fedora 35
|
||||
- Fedora 36
|
||||
- Fedora 37
|
||||
|
||||
- Debian GNU/Linux 11.x (Bookworm)
|
||||
|
||||
- Fedora 38
|
||||
- OpenSUSE Leap 15.0
|
||||
- OpenSUSE Leap 15.1
|
||||
- OpenSUSE Leap 15.2
|
||||
- OpenSUSE Leap 15.3
|
||||
|
||||
- AlmaLinux 8
|
||||
- Ubuntu 16.04
|
||||
- Ubuntu 18.04
|
||||
- Ubuntu 19.04
|
||||
- Ubuntu 21.10
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@@ -1097,6 +1097,11 @@ system and gives an overview of their function and contents.
|
||||
:term:`CC`
|
||||
The minimal command and arguments used to run the C compiler.
|
||||
|
||||
:term:`CCACHE_DISABLE`
|
||||
When inheriting the :ref:`ref-classes-ccache` class, the
|
||||
:term:`CCACHE_DISABLE` variable can be set to "1" in a recipe to disable
|
||||
`Ccache` support. This is useful when the recipe is known to not support it.
|
||||
|
||||
:term:`CFLAGS`
|
||||
Specifies the flags to pass to the C compiler. This variable is
|
||||
exported to an environment variable and thus made visible to the
|
||||
@@ -2801,6 +2806,10 @@ system and gives an overview of their function and contents.
|
||||
For guidance on how to create your own file permissions settings
|
||||
table file, examine the existing ``fs-perms.txt``.
|
||||
|
||||
:term:`FIT_CONF_PREFIX`
|
||||
When using the :ref:`ref-classes-kernel-fitimage`, this is the prefix
|
||||
used for creating FIT configuration nodes. Its default value is "conf-".
|
||||
|
||||
:term:`FIT_DESC`
|
||||
Specifies the description string encoded into a fitImage. The default
|
||||
value is set by the :ref:`kernel-fitimage <ref-classes-kernel-fitimage>`
|
||||
@@ -3531,6 +3540,12 @@ system and gives an overview of their function and contents.
|
||||
added to the image by using the :term:`IMAGE_ROOTFS_EXTRA_SPACE`
|
||||
variable.
|
||||
|
||||
When using Wic tool, beware that a second overhead factor is also applied.
|
||||
This overhead value is defined by the ``--overhead-factor`` option, which
|
||||
defaults to "1.3" when omitted. See the
|
||||
:ref:`ref-manual/kickstart:command: part or partition` chapter in
|
||||
:doc:`/ref-manual/kickstart` for details.
|
||||
|
||||
:term:`IMAGE_PKGTYPE`
|
||||
Defines the package type (i.e. DEB, RPM, IPK, or TAR) used by the
|
||||
OpenEmbedded build system. The variable is defined appropriately by
|
||||
@@ -4241,8 +4256,7 @@ system and gives an overview of their function and contents.
|
||||
would place patch files and configuration fragment files (i.e.
|
||||
"out-of-tree"). However, if you want to use a ``defconfig`` file that
|
||||
is part of the kernel tree (i.e. "in-tree"), you can use the
|
||||
:term:`KBUILD_DEFCONFIG` variable and append the
|
||||
:term:`KMACHINE` variable to point to the
|
||||
:term:`KBUILD_DEFCONFIG` variable to point to the
|
||||
``defconfig`` file.
|
||||
|
||||
To use the variable, set it in the append file for your kernel recipe
|
||||
@@ -4678,7 +4692,7 @@ system and gives an overview of their function and contents.
|
||||
information on how this variable is used.
|
||||
|
||||
:term:`LAYERDEPENDS`
|
||||
Lists the layers, separated by spaces, on which this recipe depends.
|
||||
Lists the layers, separated by spaces, on which this layer depends.
|
||||
Optionally, you can specify a specific layer version for a dependency
|
||||
by adding it to the end of the layer name. Here is an example::
|
||||
|
||||
@@ -5535,8 +5549,8 @@ system and gives an overview of their function and contents.
|
||||
|
||||
.. note::
|
||||
|
||||
An easy way to see what overrides apply is to search for :term:`OVERRIDES`
|
||||
in the output of the ``bitbake -e`` command. See the
|
||||
An easy way to see what overrides apply is to run the command
|
||||
``bitbake-getvar -r myrecipe OVERRIDES``. See the
|
||||
":ref:`dev-manual/debugging:viewing variable values`" section in the Yocto
|
||||
Project Development Tasks Manual for more information.
|
||||
|
||||
@@ -6812,6 +6826,16 @@ system and gives an overview of their function and contents.
|
||||
:term:`REPODIR`
|
||||
See :term:`bitbake:REPODIR` in the BitBake manual.
|
||||
|
||||
:term:`REQUIRED_COMBINED_FEATURES`
|
||||
When inheriting the :ref:`ref-classes-features_check` class, this variable
|
||||
identifies combined features (the intersection of :term:`MACHINE_FEATURES`
|
||||
and :term:`DISTRO_FEATURES`) that must exist in the current configuration
|
||||
in order for the :term:`OpenEmbedded Build System` to build the recipe. In
|
||||
other words, if the :term:`REQUIRED_COMBINED_FEATURES` variable lists a
|
||||
feature that does not appear in :term:`COMBINED_FEATURES` within the
|
||||
current configuration, then the recipe will be skipped, and if the build
|
||||
system attempts to build the recipe then an error will be triggered.
|
||||
|
||||
:term:`REQUIRED_DISTRO_FEATURES`
|
||||
When inheriting the
|
||||
:ref:`features_check <ref-classes-features_check>`
|
||||
@@ -6823,6 +6847,32 @@ system and gives an overview of their function and contents.
|
||||
the recipe will be skipped, and if the build system attempts to build
|
||||
the recipe then an error will be triggered.
|
||||
|
||||
:term:`REQUIRED_IMAGE_FEATURES`
|
||||
When inheriting the :ref:`ref-classes-features_check` class, this variable
|
||||
identifies image features that must exist in the current
|
||||
configuration in order for the :term:`OpenEmbedded Build System` to build
|
||||
the recipe. In other words, if the :term:`REQUIRED_IMAGE_FEATURES` variable
|
||||
lists a feature that does not appear in :term:`IMAGE_FEATURES` within the
|
||||
current configuration, then the recipe will be skipped, and if the build
|
||||
system attempts to build the recipe then an error will be triggered.
|
||||
|
||||
Compared to other ``REQUIRED_*_FEATURES`` variables, the
|
||||
:term:`REQUIRED_IMAGE_FEATURES` varible only targets image recipes, as the
|
||||
:term:`IMAGE_FEATURES` variable is handled by the :ref:`ref-classes-core-image`
|
||||
class). However, the :term:`REQUIRED_IMAGE_FEATURES` varible can also be
|
||||
set from a :term:`Configuration File`, such as a distro
|
||||
configuration file, if the list of required image features should apply to
|
||||
all images using this :term:`DISTRO`.
|
||||
|
||||
:term:`REQUIRED_MACHINE_FEATURES`
|
||||
When inheriting the :ref:`ref-classes-features_check` class, this variable
|
||||
identifies :term:`MACHINE_FEATURES` that must exist in the current
|
||||
configuration in order for the :term:`OpenEmbedded Build System` to build
|
||||
the recipe. In other words, if the :term:`REQUIRED_MACHINE_FEATURES` variable
|
||||
lists a feature that does not appear in :term:`MACHINE_FEATURES` within the
|
||||
current configuration, then the recipe will be skipped, and if the build
|
||||
system attempts to build the recipe then an error will be triggered.
|
||||
|
||||
:term:`REQUIRED_VERSION`
|
||||
If there are multiple versions of a recipe available, this variable
|
||||
determines which version should be given preference.
|
||||
@@ -7791,6 +7841,11 @@ system and gives an overview of their function and contents.
|
||||
section in the Yocto Project Board Support Package Developer's Guide
|
||||
for additional information.
|
||||
|
||||
:term:`SPL_DTB_BINARY`
|
||||
When inheriting the :ref:`ref-classes-uboot-sign` class, the
|
||||
:term:`SPL_DTB_BINARY` variable contains the name of the SPL binary to be
|
||||
compiled.
|
||||
|
||||
:term:`SPL_MKIMAGE_DTCOPTS`
|
||||
Options for the device tree compiler passed to ``mkimage -D`` feature
|
||||
while creating a FIT image with the :ref:`ref-classes-uboot-sign`
|
||||
@@ -8159,7 +8214,7 @@ system and gives an overview of their function and contents.
|
||||
directory for the build host.
|
||||
|
||||
:term:`STAGING_DIR`
|
||||
Helps construct the ``recipe-sysroots`` directory, which is used
|
||||
Helps construct the ``recipe-sysroot*`` directories, which are used
|
||||
during packaging.
|
||||
|
||||
For information on how staging for recipe-specific sysroots occurs,
|
||||
@@ -9407,6 +9462,22 @@ system and gives an overview of their function and contents.
|
||||
passes and uses "all" for the target during the U-Boot building
|
||||
process.
|
||||
|
||||
:term:`UNINATIVE_CHECKSUM`
|
||||
When inheriting the :ref:`ref-classes-uninative` class, the
|
||||
:term:`UNINATIVE_CHECKSUM` variable flags contain the checksums of the
|
||||
uninative tarball as specified by the :term:`UNINATIVE_URL` variable.
|
||||
There should be one checksum per tarballs published at
|
||||
:term:`UNINATIVE_URL`, which match architectures. For example::
|
||||
|
||||
UNINATIVE_CHECKSUM[aarch64] ?= "812045d826b7fda88944055e8526b95a5a9440bfef608d5b53fd52faab49bf85"
|
||||
UNINATIVE_CHECKSUM[i686] ?= "5cc28efd0c15a75de4bcb147c6cce65f1c1c9d442173a220f08427f40a3ffa09"
|
||||
UNINATIVE_CHECKSUM[x86_64] ?= "4c03d1ed2b7b4e823aca4a1a23d8f2e322f1770fc10e859adcede5777aff4f3a"
|
||||
|
||||
:term:`UNINATIVE_URL`
|
||||
When inheriting the :ref:`ref-classes-uninative` class, the
|
||||
:term:`UNINATIVE_URL` variable contains the URL where the uninative
|
||||
tarballs are published.
|
||||
|
||||
:term:`UNKNOWN_CONFIGURE_OPT_IGNORE`
|
||||
Specifies a list of options that, if reported by the configure script
|
||||
as being invalid, should not generate a warning during the
|
||||
@@ -9502,6 +9573,18 @@ system and gives an overview of their function and contents.
|
||||
the Yocto Project Development Tasks Manual for information on how to
|
||||
use this variable.
|
||||
|
||||
:term:`USE_NLS`
|
||||
Determine if language translations should be built for recipes that can
|
||||
build them. This variable can be equal to:
|
||||
|
||||
- ``yes``: translations are enabled.
|
||||
- ``no``: translation are disabled.
|
||||
|
||||
Recipes can use the value of this variable to enable language
|
||||
translations in their build. Classes such as :ref:`ref-classes-gettext`
|
||||
use the value of this variable to enable :wikipedia:`Gettext <Gettext>`
|
||||
support.
|
||||
|
||||
:term:`USE_VT`
|
||||
When using
|
||||
:ref:`SysVinit <dev-manual/new-recipe:enabling system services>`,
|
||||
|
||||
@@ -56,9 +56,10 @@ project:
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
main()
|
||||
int main()
|
||||
{
|
||||
printf("Hello World!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
- ``configure.ac``::
|
||||
|
||||
@@ -113,7 +113,7 @@ If ``OEQA_DEBUGGING_SAVED_OUTPUT`` is set, any differing packages will be saved
|
||||
here. The test is also able to run the ``diffoscope`` command on the output to
|
||||
generate HTML files showing the differences between the packages, to aid
|
||||
debugging. On the Autobuilder, these appear under
|
||||
https://autobuilder.yocto.io/pub/repro-fail/ in the form ``oe-reproducible +
|
||||
https://valkyrie.yocto.io/pub/repro-fail/ in the form ``oe-reproducible +
|
||||
<date> + <random ID>``, e.g. ``oe-reproducible-20200202-1lm8o1th``.
|
||||
|
||||
The project's current reproducibility status can be seen at
|
||||
|
||||
@@ -69,7 +69,7 @@ box to "generate an email to QA" is also checked.
|
||||
When the build completes, an email is sent out using the ``send-qa-email``
|
||||
script in the :yocto_git:`yocto-autobuilder-helper </yocto-autobuilder-helper>`
|
||||
repository to the list of people configured for that release. Release builds
|
||||
are placed into a directory in https://autobuilder.yocto.io/pub/releases on the
|
||||
are placed into a directory in https://valkyrie.yocto.io/pub/releases on the
|
||||
Autobuilder which is included in the email. The process from here is
|
||||
more manual and control is effectively passed to release engineering.
|
||||
The next steps include:
|
||||
|
||||
@@ -38,7 +38,7 @@ Benefits
|
||||
and flexible: it gives users the ultimate power to change pretty much any
|
||||
aspect of the system but as with most things, power comes with responsibility.
|
||||
The Yocto Project would like to see people able to mix and match BSPs with
|
||||
distro configs or software stacks and be able to merge succesfully.
|
||||
distro configs or software stacks and be able to merge successfully.
|
||||
Over time, the project identified characteristics in layers that allow them
|
||||
to operate well together. "anti-patterns" were also found, preventing layers
|
||||
from working well together.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
#DISTRO_VERSION = "3.4+snapshot-${METADATA_REVISION}"
|
||||
DISTRO_VERSION = "4.0.29"
|
||||
DISTRO_VERSION = "4.0.32"
|
||||
DISTRO_CODENAME = "kirkstone"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${METADATA_REVISION}', 'snapshot')}"
|
||||
|
||||
@@ -25,3 +25,4 @@ weston:x:525:
|
||||
wayland:x:526:
|
||||
render:x:527:
|
||||
sgx:x:528:
|
||||
audio:x:529:
|
||||
|
||||
@@ -18,6 +18,9 @@ TARGET_GOMIPS = "${@go_map_mips(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES
|
||||
TARGET_GOARM:class-native = "7"
|
||||
TARGET_GO386:class-native = "sse2"
|
||||
TARGET_GOMIPS:class-native = "hardfloat"
|
||||
TARGET_GOARM:class-crosssdk = "7"
|
||||
TARGET_GO386:class-crosssdk = "sse2"
|
||||
TARGET_GOMIPS:class-crosssdk = "hardfloat"
|
||||
TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}"
|
||||
GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE') == d.getVar('HOST_GOTUPLE')]}"
|
||||
|
||||
|
||||
@@ -1182,24 +1182,27 @@ python do_qa_patch() {
|
||||
msg += " devtool modify %s\n" % d.getVar('PN')
|
||||
msg += " devtool finish --force-patch-refresh %s <layer_path>\n\n" % d.getVar('PN')
|
||||
msg += "Don't forget to review changes done by devtool!\n"
|
||||
if bb.utils.filter('ERROR_QA', 'patch-fuzz', d):
|
||||
bb.error(msg)
|
||||
elif bb.utils.filter('WARN_QA', 'patch-fuzz', d):
|
||||
bb.warn(msg)
|
||||
msg = "Patch log indicates that patches do not apply cleanly."
|
||||
msg += "\nPatch log indicates that patches do not apply cleanly."
|
||||
oe.qa.handle_error("patch-fuzz", msg, d)
|
||||
|
||||
# Check if the patch contains a correctly formatted and spelled Upstream-Status
|
||||
import re
|
||||
from oe import patch
|
||||
|
||||
allpatches = False
|
||||
if bb.utils.filter('ERROR_QA', 'patch-status-noncore', d) or bb.utils.filter('WARN_QA', 'patch-status-noncore', d):
|
||||
allpatches = True
|
||||
|
||||
coremeta_path = os.path.join(d.getVar('COREBASE'), 'meta', '')
|
||||
for url in patch.src_patches(d):
|
||||
(_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
|
||||
|
||||
# skip patches not in oe-core
|
||||
patchtype = "patch-status-core"
|
||||
if not os.path.abspath(fullpath).startswith(coremeta_path):
|
||||
continue
|
||||
patchtype = "patch-status-noncore"
|
||||
if not allpatches:
|
||||
continue
|
||||
|
||||
kinda_status_re = re.compile(r"^.*upstream.*status.*$", re.IGNORECASE | re.MULTILINE)
|
||||
strict_status_re = re.compile(r"^Upstream-Status: (Pending|Submitted|Denied|Accepted|Inappropriate|Backport|Inactive-Upstream)( .+)?$", re.MULTILINE)
|
||||
@@ -1212,9 +1215,13 @@ python do_qa_patch() {
|
||||
|
||||
if not match_strict:
|
||||
if match_kinda:
|
||||
bb.error("Malformed Upstream-Status in patch\n%s\nPlease correct according to %s :\n%s" % (fullpath, guidelines, match_kinda.group(0)))
|
||||
msg = "Malformed Upstream-Status in patch\n%s\nPlease correct according to %s :\n%s" % (fullpath, guidelines, match_kinda.group(0))
|
||||
oe.qa.handle_error(patchtype, msg, d)
|
||||
else:
|
||||
bb.error("Missing Upstream-Status in patch\n%s\nPlease add according to %s ." % (fullpath, guidelines))
|
||||
msg = "Missing Upstream-Status in patch\n%s\nPlease add according to %s ." % (fullpath, guidelines)
|
||||
oe.qa.handle_error(patchtype, msg, d)
|
||||
|
||||
oe.qa.exit_if_errors(d)
|
||||
}
|
||||
|
||||
python do_qa_configure() {
|
||||
@@ -1331,6 +1338,7 @@ python do_qa_unpack() {
|
||||
bb.warn('%s: the directory %s (%s) pointed to by the S variable doesn\'t exist - please set S within the recipe to point to where the source has been unpacked to' % (d.getVar('PN'), d.getVar('S', False), s_dir))
|
||||
|
||||
unpack_check_src_uri(d.getVar('PN'), d)
|
||||
oe.qa.exit_if_errors(d)
|
||||
}
|
||||
|
||||
# The Staging Func, to check all staging
|
||||
|
||||
@@ -690,7 +690,7 @@ DEBIAN_MIRROR = "http://ftp.debian.org/debian/pool"
|
||||
GENTOO_MIRROR = "http://distfiles.gentoo.org/distfiles"
|
||||
GNOME_GIT = "git://gitlab.gnome.org/GNOME"
|
||||
GNOME_MIRROR = "https://download.gnome.org/sources/"
|
||||
GNU_MIRROR = "https://ftp.gnu.org/gnu"
|
||||
GNU_MIRROR = "https://ftpmirror.gnu.org/gnu"
|
||||
GNUPG_MIRROR = "https://www.gnupg.org/ftp/gcrypt"
|
||||
GPE_MIRROR = "http://gpe.linuxtogo.org/download/source"
|
||||
KERNELORG_MIRROR = "https://cdn.kernel.org/pub"
|
||||
|
||||
@@ -52,4 +52,4 @@ KERNEL_IMAGETYPES ??= "${KERNEL_IMAGETYPE}"
|
||||
# fetch from the network (and warn you if not). To disable the test set
|
||||
# the variable to be empty.
|
||||
# Git example url: git://git.yoctoproject.org/yocto-firewall-test;protocol=git;rev=master;branch=master
|
||||
CONNECTIVITY_CHECK_URIS ?= "https://yoctoproject.org/connectivity.html"
|
||||
CONNECTIVITY_CHECK_URIS ?= "https://www.yoctoproject.org/connectivity.html"
|
||||
|
||||
@@ -13,8 +13,8 @@ class HTTPTests(OESDKTestCase):
|
||||
"""
|
||||
|
||||
def test_wget(self):
|
||||
self._run('env -i wget --debug --output-document /dev/null https://yoctoproject.org/connectivity.html')
|
||||
self._run('env -i wget --debug --output-document /dev/null https://www.yoctoproject.org/connectivity.html')
|
||||
|
||||
def test_python(self):
|
||||
# urlopen() returns a file-like object on success and throws an exception otherwise
|
||||
self._run('python3 -c \'import urllib.request; urllib.request.urlopen("https://yoctoproject.org/connectivity.html")\'')
|
||||
self._run('python3 -c \'import urllib.request; urllib.request.urlopen("https://www.yoctoproject.org/connectivity.html")\'')
|
||||
|
||||
@@ -17,7 +17,7 @@ class BuildCpioTest(OESDKTestCase):
|
||||
"""
|
||||
def test_cpio(self):
|
||||
with tempfile.TemporaryDirectory(prefix="cpio-", dir=self.tc.sdk_dir) as testdir:
|
||||
tarball = self.fetch(testdir, self.td["DL_DIR"], "https://ftp.gnu.org/gnu/cpio/cpio-2.13.tar.gz")
|
||||
tarball = self.fetch(testdir, self.td["DL_DIR"], "https://ftpmirror.gnu.org/gnu/cpio/cpio-2.13.tar.gz")
|
||||
|
||||
dirs = {}
|
||||
dirs["source"] = os.path.join(testdir, "cpio-2.13")
|
||||
|
||||
@@ -40,7 +40,7 @@ class MetaIDE(OESelftestTestCase):
|
||||
def test_meta_ide_can_build_cpio_project(self):
|
||||
dl_dir = self.td.get('DL_DIR', None)
|
||||
self.project = SDKBuildProject(self.tmpdir_metaideQA + "/cpio/", self.environment_script_path,
|
||||
"https://ftp.gnu.org/gnu/cpio/cpio-2.13.tar.gz",
|
||||
"https://ftpmirror.gnu.org/gnu/cpio/cpio-2.13.tar.gz",
|
||||
self.tmpdir_metaideQA, self.td['DATETIME'], dl_dir=dl_dir)
|
||||
self.project.download_archive()
|
||||
self.assertEqual(self.project.run_configure('$CONFIGURE_FLAGS --disable-maintainer-mode','sed -i -e "/char \*program_name/d" src/global.c;'), 0,
|
||||
|
||||
@@ -10,7 +10,7 @@ DEPENDS = "efivar popt"
|
||||
|
||||
COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
|
||||
|
||||
SRC_URI = "git://github.com/rhinstaller/efibootmgr.git;protocol=https;branch=master \
|
||||
SRC_URI = "git://github.com/rhinstaller/efibootmgr.git;protocol=https;branch=main \
|
||||
file://0001-remove-extra-decl.patch \
|
||||
file://97668ae0bce776a36ea2001dea63d376be8274ac.patch \
|
||||
file://0001-src-make-compatible-with-efivar-38.patch \
|
||||
|
||||
75
meta/recipes-bsp/grub/files/CVE-2024-56738.patch
Normal file
75
meta/recipes-bsp/grub/files/CVE-2024-56738.patch
Normal file
@@ -0,0 +1,75 @@
|
||||
From 4cef2fc7308b2132317ad166939994f098b41561 Mon Sep 17 00:00:00 2001
|
||||
From: Ross Burton <ross.burton@arm.com>
|
||||
Date: Tue, 9 Sep 2025 14:23:14 +0100
|
||||
Subject: [PATCH] CVE-2024-56738
|
||||
|
||||
Backport an algorithmic change to grub_crypto_memcmp() so that it completes in
|
||||
constant time and thus isn't susceptible to side-channel attacks.
|
||||
|
||||
This is a partial backport of grub 0739d24cd
|
||||
("libgcrypt: Adjust import script, definitions and API users for libgcrypt 1.11")
|
||||
|
||||
CVE: CVE-2024-56738
|
||||
Upstream-Status: Backport [0739d24cd]
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
grub-core/lib/crypto.c | 23 ++++++++++++++++-------
|
||||
include/grub/crypto.h | 2 +-
|
||||
2 files changed, 17 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/grub-core/lib/crypto.c b/grub-core/lib/crypto.c
|
||||
index ca334d5..1bfa922 100644
|
||||
--- a/grub-core/lib/crypto.c
|
||||
+++ b/grub-core/lib/crypto.c
|
||||
@@ -433,19 +433,28 @@ grub_crypto_gcry_error (gcry_err_code_t in)
|
||||
return GRUB_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Compare byte arrays of length LEN, return 1 if it's not same,
|
||||
+ * 0, otherwise.
|
||||
+ */
|
||||
int
|
||||
-grub_crypto_memcmp (const void *a, const void *b, grub_size_t n)
|
||||
+grub_crypto_memcmp (const void *b1, const void *b2, grub_size_t len)
|
||||
{
|
||||
- register grub_size_t counter = 0;
|
||||
- const grub_uint8_t *pa, *pb;
|
||||
+ const grub_uint8_t *a = b1;
|
||||
+ const grub_uint8_t *b = b2;
|
||||
+ int ab, ba;
|
||||
+ grub_size_t i;
|
||||
|
||||
- for (pa = a, pb = b; n; pa++, pb++, n--)
|
||||
+ /* Constant-time compare. */
|
||||
+ for (i = 0, ab = 0, ba = 0; i < len; i++)
|
||||
{
|
||||
- if (*pa != *pb)
|
||||
- counter++;
|
||||
+ /* If a[i] != b[i], either ab or ba will be negative. */
|
||||
+ ab |= a[i] - b[i];
|
||||
+ ba |= b[i] - a[i];
|
||||
}
|
||||
|
||||
- return !!counter;
|
||||
+ /* 'ab | ba' is negative when buffers are not equal, extract sign bit. */
|
||||
+ return ((unsigned int)(ab | ba) >> (sizeof(unsigned int) * 8 - 1)) & 1;
|
||||
}
|
||||
|
||||
#ifndef GRUB_UTIL
|
||||
diff --git a/include/grub/crypto.h b/include/grub/crypto.h
|
||||
index 21cd1f7..432912b 100644
|
||||
--- a/include/grub/crypto.h
|
||||
+++ b/include/grub/crypto.h
|
||||
@@ -393,7 +393,7 @@ grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
|
||||
grub_uint8_t *DK, grub_size_t dkLen);
|
||||
|
||||
int
|
||||
-grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);
|
||||
+grub_crypto_memcmp (const void *b1, const void *b2, grub_size_t len);
|
||||
|
||||
int
|
||||
grub_password_get (char buf[], unsigned buf_size);
|
||||
--
|
||||
2.40.0
|
||||
@@ -59,6 +59,7 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
|
||||
file://CVE-2025-0678_CVE-2025-1125.patch \
|
||||
file://CVE-2025-0690.patch \
|
||||
file://CVE-2025-1118.patch \
|
||||
file://CVE-2024-56738.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f"
|
||||
@@ -69,6 +70,8 @@ CVE_CHECK_IGNORE += "CVE-2019-14865"
|
||||
CVE_CHECK_IGNORE += "CVE-2021-46705"
|
||||
# not-applicable-platform: Applies only to RHEL/Fedora
|
||||
CVE_CHECK_IGNORE += "CVE-2024-1048 CVE-2023-4001"
|
||||
# not-applicable-platform: Applies only to Ubuntu
|
||||
CVE_CHECK_IGNORE += "CVE-2024-2312"
|
||||
|
||||
DEPENDS = "flex-native bison-native gettext-native"
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From 10c9a571f1c0472799f72b1924b039aab231e95f Mon Sep 17 00:00:00 2001
|
||||
From: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>
|
||||
Date: Thu, 16 Dec 2021 16:19:50 +0100
|
||||
Subject: [PATCH] Include cstddef in the header for C++
|
||||
|
||||
So C++ compiler always has access to the definition of size_t.
|
||||
|
||||
Signed-off-by: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>
|
||||
Signed-off-by: Youngseok Jeong <youngseok1.jeong@lge.com>
|
||||
Upstream-Status: Backport [v0.3.3 https://github.com/sbabic/libubootenv/pull/19/commits/764226a7de2ea79b182d92829922489537c766fa]
|
||||
---
|
||||
src/libuboot.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/libuboot.h b/src/libuboot.h
|
||||
index 88f0558..1f305f4 100644
|
||||
--- a/src/libuboot.h
|
||||
+++ b/src/libuboot.h
|
||||
@@ -6,6 +6,8 @@
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
+#include <cstddef>
|
||||
+
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
56
meta/recipes-bsp/u-boot/files/CVE-2024-42040.patch
Normal file
56
meta/recipes-bsp/u-boot/files/CVE-2024-42040.patch
Normal file
@@ -0,0 +1,56 @@
|
||||
From 1406fc918977bba4dac0af5e22e63a5553aa6aff Mon Sep 17 00:00:00 2001
|
||||
From: Paul HENRYS <paul.henrys_ext@softathome.com>
|
||||
Date: Thu, 9 Oct 2025 17:43:28 +0200
|
||||
Subject: [PATCH] net: bootp: Prevent buffer overflow to avoid leaking the RAM
|
||||
content
|
||||
|
||||
CVE-2024-42040 describes a possible buffer overflow when calling
|
||||
bootp_process_vendor() in bootp_handler() since the total length
|
||||
of the packet is passed to bootp_process_vendor() without being
|
||||
reduced to len-(offsetof(struct bootp_hdr,bp_vend)+4).
|
||||
|
||||
The packet length is also checked against its minimum size to avoid
|
||||
reading data from struct bootp_hdr outside of the packet length.
|
||||
|
||||
Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
|
||||
Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
|
||||
|
||||
CVE: CVE-2024-42040
|
||||
Upstream-Status: Backport [https://source.denx.de/u-boot/u-boot/-/commit/81e5708cc2c865df606e49aed5415adb2a662171]
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
---
|
||||
net/bootp.c | 11 ++++++++++-
|
||||
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/net/bootp.c b/net/bootp.c
|
||||
index 68002909634..843180d296c 100644
|
||||
--- a/net/bootp.c
|
||||
+++ b/net/bootp.c
|
||||
@@ -362,6 +362,14 @@ static void bootp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
|
||||
debug("got BOOTP packet (src=%d, dst=%d, len=%d want_len=%zu)\n",
|
||||
src, dest, len, sizeof(struct bootp_hdr));
|
||||
|
||||
+ /* Check the minimum size of a BOOTP packet is respected.
|
||||
+ * A BOOTP packet is between 300 bytes and 576 bytes big
|
||||
+ */
|
||||
+ if (len < offsetof(struct bootp_hdr, bp_vend) + 64) {
|
||||
+ printf("Error: got an invalid BOOTP packet (len=%u)\n", len);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
bp = (struct bootp_hdr *)pkt;
|
||||
|
||||
/* Filter out pkts we don't want */
|
||||
@@ -379,7 +387,8 @@ static void bootp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
|
||||
|
||||
/* Retrieve extended information (we must parse the vendor area) */
|
||||
if (net_read_u32((u32 *)&bp->bp_vend[0]) == htonl(BOOTP_VENDOR_MAGIC))
|
||||
- bootp_process_vendor((uchar *)&bp->bp_vend[4], len);
|
||||
+ bootp_process_vendor((uchar *)&bp->bp_vend[4], len -
|
||||
+ (offsetof(struct bootp_hdr, bp_vend) + 4));
|
||||
|
||||
net_set_timeout_handler(0, (thand_f *)0);
|
||||
bootstage_mark_name(BOOTSTAGE_ID_BOOTP_STOP, "bootp_stop");
|
||||
--
|
||||
2.49.0
|
||||
|
||||
@@ -10,7 +10,11 @@ LICENSE = "LGPL-2.1-only"
|
||||
LIC_FILES_CHKSUM = "file://Licenses/lgpl-2.1.txt;md5=4fbd65380cdd255951079008b364516c"
|
||||
SECTION = "libs"
|
||||
|
||||
SRC_URI = "git://github.com/sbabic/libubootenv;protocol=https;branch=master"
|
||||
SRC_URI = " \
|
||||
git://github.com/sbabic/libubootenv;protocol=https;branch=master \
|
||||
file://0001-Include-cstddef-in-the-header-for-C.patch \
|
||||
"
|
||||
|
||||
SRCREV = "ba7564f5006d09bec51058cf4f5ac90d4dc18b3c"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
@@ -14,7 +14,9 @@ PE = "1"
|
||||
# repo during parse
|
||||
SRCREV = "d637294e264adfeb29f390dfc393106fd4d41b17"
|
||||
|
||||
SRC_URI = "git://source.denx.de/u-boot/u-boot.git;protocol=https;branch=master"
|
||||
SRC_URI = "git://source.denx.de/u-boot/u-boot.git;protocol=https;branch=master \
|
||||
file://CVE-2024-42040.patch \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
B = "${WORKDIR}/build"
|
||||
|
||||
@@ -20,7 +20,7 @@ SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.xz \
|
||||
file://0001-avoid-start-failure-with-bind-user.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "fb373fac5ebbc41c645160afd5a9fb451918f6c0e69ab1d9474154e2b515de40"
|
||||
SRC_URI[sha256sum] = "6ddc1d981511c4da0b203b0513af131e5d15e5f1c261145736fe1f35dd1fe79d"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
|
||||
# follow the ESV versions divisible by 2
|
||||
@@ -0,0 +1,98 @@
|
||||
From 35d5917652106aede47621bb3f64044604164043 Mon Sep 17 00:00:00 2001
|
||||
From: "djm@openbsd.org" <djm@openbsd.org>
|
||||
Date: Thu, 4 Sep 2025 00:29:09 +0000
|
||||
Subject: [PATCH] upstream: Improve rules for %-expansion of username.
|
||||
|
||||
Usernames passed on the commandline will no longer be subject to
|
||||
% expansion. Some tools invoke ssh with connection information
|
||||
(i.e. usernames and host names) supplied from untrusted sources.
|
||||
These may contain % expansion sequences which could yield
|
||||
unexpected results.
|
||||
|
||||
Since openssh-9.6, all usernames have been subject to validity
|
||||
checking. This change tightens the validity checks by refusing
|
||||
usernames that include control characters (again, these can cause
|
||||
surprises when supplied adversarially).
|
||||
|
||||
This change also relaxes the validity checks in one small way:
|
||||
usernames supplied via the configuration file as literals (i.e.
|
||||
include no % expansion characters) are not subject to these
|
||||
validity checks. This allows usernames that contain arbitrary
|
||||
characters to be used, but only via configuration files. This
|
||||
is done on the basis that ssh's configuration is trusted.
|
||||
|
||||
Pointed out by David Leadbeater, ok deraadt@
|
||||
|
||||
OpenBSD-Commit-ID: e2f0c871fbe664aba30607321575e7c7fc798362
|
||||
|
||||
CVE: CVE-2025-61984
|
||||
Upstream-Status: Backport [https://github.com/openssh/openssh-portable/commit/35d5917652106aede47621bb3f64044604164043]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
ssh.c | 11 +++++++++++++++--
|
||||
1 file changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/ssh.c b/ssh.c
|
||||
index 82ed15f..d4e2040 100644
|
||||
--- a/ssh.c
|
||||
+++ b/ssh.c
|
||||
@@ -634,6 +634,8 @@ valid_ruser(const char *s)
|
||||
if (*s == '-')
|
||||
return 0;
|
||||
for (i = 0; s[i] != 0; i++) {
|
||||
+ if (iscntrl((u_char)s[i]))
|
||||
+ return 0;
|
||||
if (strchr("'`\";&<>|(){}", s[i]) != NULL)
|
||||
return 0;
|
||||
/* Disallow '-' after whitespace */
|
||||
@@ -655,6 +657,7 @@ main(int ac, char **av)
|
||||
struct ssh *ssh = NULL;
|
||||
int i, r, opt, exit_status, use_syslog, direct, timeout_ms;
|
||||
int was_addr, config_test = 0, opt_terminated = 0, want_final_pass = 0;
|
||||
+ int user_on_commandline = 0, user_was_default = 0, user_expanded = 0;
|
||||
char *p, *cp, *line, *argv0, *logfile, *host_arg;
|
||||
char cname[NI_MAXHOST], thishost[NI_MAXHOST];
|
||||
struct stat st;
|
||||
@@ -995,8 +998,10 @@ main(int ac, char **av)
|
||||
}
|
||||
break;
|
||||
case 'l':
|
||||
- if (options.user == NULL)
|
||||
+ if (options.user == NULL) {
|
||||
options.user = optarg;
|
||||
+ user_on_commandline = 1;
|
||||
+ }
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
@@ -1099,6 +1104,7 @@ main(int ac, char **av)
|
||||
if (options.user == NULL) {
|
||||
options.user = tuser;
|
||||
tuser = NULL;
|
||||
+ user_on_commandline = 1;
|
||||
}
|
||||
free(tuser);
|
||||
if (options.port == -1 && tport != -1)
|
||||
@@ -1113,6 +1119,7 @@ main(int ac, char **av)
|
||||
if (options.user == NULL) {
|
||||
options.user = p;
|
||||
p = NULL;
|
||||
+ user_on_commandline = 1;
|
||||
}
|
||||
*cp++ = '\0';
|
||||
host = xstrdup(cp);
|
||||
@@ -1265,8 +1272,10 @@ main(int ac, char **av)
|
||||
if (fill_default_options(&options) != 0)
|
||||
cleanup_exit(255);
|
||||
|
||||
- if (options.user == NULL)
|
||||
+ if (options.user == NULL) {
|
||||
+ user_was_default = 1;
|
||||
options.user = xstrdup(pw->pw_name);
|
||||
+ }
|
||||
|
||||
/*
|
||||
* If ProxyJump option specified, then construct a ProxyCommand now.
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 54928cb9eaa7143ff17f463efa7ed3109afdbf30 Mon Sep 17 00:00:00 2001
|
||||
From: "djm@openbsd.org" <djm@openbsd.org>
|
||||
Date: Thu, 4 Sep 2025 00:30:06 +0000
|
||||
Subject: [PATCH] upstream: don't allow \0 characters in url-encoded strings.
|
||||
Suggested by David Leadbeater, ok deraadt@
|
||||
|
||||
OpenBSD-Commit-ID: c92196cef0f970ceabc1e8007a80b01e9b7cd49c
|
||||
|
||||
CVE: CVE-2025-61985
|
||||
|
||||
Upstream-Status: Backport [https://github.com/openssh/openssh-portable/commit/43b3bff47bb029f2299bacb6a36057981b39fdb0]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
misc.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/misc.c b/misc.c
|
||||
index 6135b15..3d133b5 100644
|
||||
--- a/misc.c
|
||||
+++ b/misc.c
|
||||
@@ -934,9 +934,10 @@ urldecode(const char *src)
|
||||
*dst++ = ' ';
|
||||
break;
|
||||
case '%':
|
||||
+ /* note: don't allow \0 characters */
|
||||
if (!isxdigit((unsigned char)src[1]) ||
|
||||
!isxdigit((unsigned char)src[2]) ||
|
||||
- (ch = hexchar(src + 1)) == -1) {
|
||||
+ (ch = hexchar(src + 1)) == -1 || ch == 0) {
|
||||
free(ret);
|
||||
return NULL;
|
||||
}
|
||||
--
|
||||
2.40.0
|
||||
@@ -39,6 +39,8 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
|
||||
file://CVE-2024-6387.patch \
|
||||
file://CVE-2025-26465.patch \
|
||||
file://CVE-2025-32728.patch \
|
||||
file://CVE-2025-61985.patch \
|
||||
file://CVE-2025-61984.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "fd497654b7ab1686dac672fb83dfb4ba4096e8b5ffcdaccd262380ae58bec5e7"
|
||||
|
||||
|
||||
618
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-1.patch
Normal file
618
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-1.patch
Normal file
@@ -0,0 +1,618 @@
|
||||
From 24734088e1034392de981151dfe57e3a379ada18 Mon Sep 17 00:00:00 2001
|
||||
From: Hubert Kario <hkario@redhat.com>
|
||||
Date: Tue, 15 Mar 2022 13:58:08 +0100
|
||||
Subject: [PATCH 1/3] rsa: add implicit rejection in PKCS#1 v1.5
|
||||
|
||||
The RSA decryption as implemented before required very careful handling
|
||||
of both the exit code returned by OpenSSL and the potentially returned
|
||||
ciphertext. Looking at the recent security vulnerabilities
|
||||
(CVE-2020-25659 and CVE-2020-25657) it is unlikely that most users of
|
||||
OpenSSL do it correctly.
|
||||
|
||||
Given that correct code requires side channel secure programming in
|
||||
application code, we can classify the existing RSA decryption methods
|
||||
as CWE-676, which in turn likely causes CWE-208 and CWE-385 in
|
||||
application code.
|
||||
|
||||
To prevent that, we can use a technique called "implicit rejection".
|
||||
For that we generate a random message to be returned in case the
|
||||
padding check fails. We generate the message based on static secret
|
||||
data (the private exponent) and the provided ciphertext (so that the
|
||||
attacker cannot determine that the returned value is randomly generated
|
||||
instead of result of decryption and de-padding). We return it in case
|
||||
any part of padding check fails.
|
||||
|
||||
The upshot of this approach is that then not only is the length of the
|
||||
returned message useless as the Bleichenbacher oracle, so are the
|
||||
actual bytes of the returned message. So application code doesn't have
|
||||
to perform any operations on the returned message in side-channel free
|
||||
way to remain secure against Bleichenbacher attacks.
|
||||
|
||||
Note: this patch implements a specific algorithm, shared with Mozilla
|
||||
NSS, so that the attacker cannot use one library as an oracle against the
|
||||
other in heterogeneous environments.
|
||||
|
||||
CVE: CVE-2023-50781
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://github.com/openssl/openssl/commit/7fc67e0a33102aa47bbaa56533eeecb98c0450f7]
|
||||
|
||||
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
|
||||
Reviewed-by: Tim Hudson <tjh@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/13817)
|
||||
|
||||
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
|
||||
---
|
||||
crypto/rsa/rsa_ossl.c | 95 +++++++-
|
||||
crypto/rsa/rsa_pk1.c | 252 ++++++++++++++++++++++
|
||||
doc/man1/openssl-pkeyutl.pod.in | 5 +
|
||||
doc/man1/openssl-rsautl.pod.in | 5 +
|
||||
doc/man3/EVP_PKEY_CTX_ctrl.pod | 7 +
|
||||
doc/man3/EVP_PKEY_decrypt.pod | 12 ++
|
||||
doc/man3/RSA_padding_add_PKCS1_type_1.pod | 7 +-
|
||||
doc/man3/RSA_public_encrypt.pod | 11 +-
|
||||
include/crypto/rsa.h | 4 +
|
||||
9 files changed, 393 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/crypto/rsa/rsa_ossl.c b/crypto/rsa/rsa_ossl.c
|
||||
index 0fc642e777..330302ae55 100644
|
||||
--- a/crypto/rsa/rsa_ossl.c
|
||||
+++ b/crypto/rsa/rsa_ossl.c
|
||||
@@ -17,6 +17,9 @@
|
||||
#include "crypto/bn.h"
|
||||
#include "rsa_local.h"
|
||||
#include "internal/constant_time.h"
|
||||
+#include <openssl/evp.h>
|
||||
+#include <openssl/sha.h>
|
||||
+#include <openssl/hmac.h>
|
||||
|
||||
static int rsa_ossl_public_encrypt(int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa, int padding);
|
||||
@@ -377,8 +380,13 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
|
||||
BIGNUM *f, *ret;
|
||||
int j, num = 0, r = -1;
|
||||
unsigned char *buf = NULL;
|
||||
+ unsigned char d_hash[SHA256_DIGEST_LENGTH] = {0};
|
||||
+ HMAC_CTX *hmac = NULL;
|
||||
+ unsigned int md_len = SHA256_DIGEST_LENGTH;
|
||||
+ unsigned char kdk[SHA256_DIGEST_LENGTH] = {0};
|
||||
BN_CTX *ctx = NULL;
|
||||
int local_blinding = 0;
|
||||
+ EVP_MD *md = NULL;
|
||||
/*
|
||||
* Used only if the blinding structure is shared. A non-NULL unblind
|
||||
* instructs rsa_blinding_convert() and rsa_blinding_invert() to store
|
||||
@@ -408,6 +416,11 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
|
||||
goto err;
|
||||
}
|
||||
|
||||
+ if (flen < 1) {
|
||||
+ ERR_raise(ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
/* make data into a big number */
|
||||
if (BN_bin2bn(from, (int)flen, f) == NULL)
|
||||
goto err;
|
||||
@@ -472,13 +485,91 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
|
||||
if (!rsa_blinding_invert(blinding, ret, unblind, ctx))
|
||||
goto err;
|
||||
|
||||
+ /*
|
||||
+ * derive the Key Derivation Key from private exponent and public
|
||||
+ * ciphertext
|
||||
+ */
|
||||
+ if (!(rsa->flags & RSA_FLAG_EXT_PKEY)) {
|
||||
+ /*
|
||||
+ * because we use d as a handle to rsa->d we need to keep it local and
|
||||
+ * free before any further use of rsa->d
|
||||
+ */
|
||||
+ BIGNUM *d = BN_new();
|
||||
+ if (d == NULL) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_MALLOC_FAILURE);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ if (rsa->d == NULL) {
|
||||
+ ERR_raise(ERR_LIB_RSA, RSA_R_MISSING_PRIVATE_KEY);
|
||||
+ BN_free(d);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ BN_with_flags(d, rsa->d, BN_FLG_CONSTTIME);
|
||||
+ if (BN_bn2binpad(d, buf, num) < 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ BN_free(d);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ BN_free(d);
|
||||
+
|
||||
+ /*
|
||||
+ * we use hardcoded hash so that migrating between versions that use
|
||||
+ * different hash doesn't provide a Bleichenbacher oracle:
|
||||
+ * if the attacker can see that different versions return different
|
||||
+ * messages for the same ciphertext, they'll know that the message is
|
||||
+ * syntethically generated, which means that the padding check failed
|
||||
+ */
|
||||
+ md = EVP_MD_fetch(rsa->libctx, "sha256", NULL);
|
||||
+ if (md == NULL) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ if (EVP_Digest(buf, num, d_hash, NULL, md, NULL) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ hmac = HMAC_CTX_new();
|
||||
+ if (hmac == NULL) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_MALLOC_FAILURE);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ if (HMAC_Init_ex(hmac, d_hash, sizeof(d_hash), md, NULL) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ if (flen < num) {
|
||||
+ memset(buf, 0, num - flen);
|
||||
+ if (HMAC_Update(hmac, buf, num - flen) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ }
|
||||
+ if (HMAC_Update(hmac, from, flen) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ md_len = SHA256_DIGEST_LENGTH;
|
||||
+ if (HMAC_Final(hmac, kdk, &md_len) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
j = BN_bn2binpad(ret, buf, num);
|
||||
if (j < 0)
|
||||
goto err;
|
||||
|
||||
switch (padding) {
|
||||
case RSA_PKCS1_PADDING:
|
||||
- r = RSA_padding_check_PKCS1_type_2(to, num, buf, j, num);
|
||||
+ if (rsa->flags & RSA_FLAG_EXT_PKEY)
|
||||
+ r = RSA_padding_check_PKCS1_type_2(to, num, buf, j, num);
|
||||
+ else
|
||||
+ r = ossl_rsa_padding_check_PKCS1_type_2(rsa->libctx, to, num, buf, j, num, kdk);
|
||||
break;
|
||||
case RSA_PKCS1_OAEP_PADDING:
|
||||
r = RSA_padding_check_PKCS1_OAEP(to, num, buf, j, num, NULL, 0);
|
||||
@@ -501,6 +592,8 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
|
||||
#endif
|
||||
|
||||
err:
|
||||
+ HMAC_CTX_free(hmac);
|
||||
+ EVP_MD_free(md);
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_free(ctx);
|
||||
OPENSSL_clear_free(buf, num);
|
||||
diff --git a/crypto/rsa/rsa_pk1.c b/crypto/rsa/rsa_pk1.c
|
||||
index 51507fc030..5cd2b26879 100644
|
||||
--- a/crypto/rsa/rsa_pk1.c
|
||||
+++ b/crypto/rsa/rsa_pk1.c
|
||||
@@ -21,10 +21,14 @@
|
||||
#include <openssl/rand.h>
|
||||
/* Just for the SSL_MAX_MASTER_KEY_LENGTH value */
|
||||
#include <openssl/prov_ssl.h>
|
||||
+#include <openssl/evp.h>
|
||||
+#include <openssl/sha.h>
|
||||
+#include <openssl/hmac.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include "crypto/rsa.h"
|
||||
#include "rsa_local.h"
|
||||
|
||||
+
|
||||
int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
|
||||
const unsigned char *from, int flen)
|
||||
{
|
||||
@@ -273,6 +277,254 @@ int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
|
||||
return constant_time_select_int(good, mlen, -1);
|
||||
}
|
||||
|
||||
+
|
||||
+static int ossl_rsa_prf(OSSL_LIB_CTX *ctx,
|
||||
+ unsigned char *to, int tlen,
|
||||
+ const char *label, int llen,
|
||||
+ const unsigned char *kdk,
|
||||
+ uint16_t bitlen)
|
||||
+{
|
||||
+ int pos;
|
||||
+ int ret = -1;
|
||||
+ uint16_t iter = 0;
|
||||
+ unsigned char be_iter[sizeof(iter)];
|
||||
+ unsigned char be_bitlen[sizeof(bitlen)];
|
||||
+ HMAC_CTX *hmac = NULL;
|
||||
+ EVP_MD *md = NULL;
|
||||
+ unsigned char hmac_out[SHA256_DIGEST_LENGTH];
|
||||
+ unsigned int md_len;
|
||||
+
|
||||
+ if (tlen * 8 != bitlen) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ be_bitlen[0] = (bitlen >> 8) & 0xff;
|
||||
+ be_bitlen[1] = bitlen & 0xff;
|
||||
+
|
||||
+ hmac = HMAC_CTX_new();
|
||||
+ if (hmac == NULL) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * we use hardcoded hash so that migrating between versions that use
|
||||
+ * different hash doesn't provide a Bleichenbacher oracle:
|
||||
+ * if the attacker can see that different versions return different
|
||||
+ * messages for the same ciphertext, they'll know that the message is
|
||||
+ * syntethically generated, which means that the padding check failed
|
||||
+ */
|
||||
+ md = EVP_MD_fetch(ctx, "sha256", NULL);
|
||||
+ if (md == NULL) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ if (HMAC_Init_ex(hmac, kdk, SHA256_DIGEST_LENGTH, md, NULL) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ for (pos = 0; pos < tlen; pos += SHA256_DIGEST_LENGTH, iter++) {
|
||||
+ if (HMAC_Init_ex(hmac, NULL, 0, NULL, NULL) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ be_iter[0] = (iter >> 8) & 0xff;
|
||||
+ be_iter[1] = iter & 0xff;
|
||||
+
|
||||
+ if (HMAC_Update(hmac, be_iter, sizeof(be_iter)) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ if (HMAC_Update(hmac, (unsigned char *)label, llen) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ if (HMAC_Update(hmac, be_bitlen, sizeof(be_bitlen)) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * HMAC_Final requires the output buffer to fit the whole MAC
|
||||
+ * value, so we need to use the intermediate buffer for the last
|
||||
+ * unaligned block
|
||||
+ */
|
||||
+ md_len = SHA256_DIGEST_LENGTH;
|
||||
+ if (pos + SHA256_DIGEST_LENGTH > tlen) {
|
||||
+ if (HMAC_Final(hmac, hmac_out, &md_len) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ memcpy(to + pos, hmac_out, tlen - pos);
|
||||
+ } else {
|
||||
+ if (HMAC_Final(hmac, to + pos, &md_len) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ret = 0;
|
||||
+
|
||||
+err:
|
||||
+ HMAC_CTX_free(hmac);
|
||||
+ EVP_MD_free(md);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ossl_rsa_padding_check_PKCS1_type_2() checks and removes the PKCS#1 type 2
|
||||
+ * padding from a decrypted RSA message. Unlike the
|
||||
+ * RSA_padding_check_PKCS1_type_2() it will not return an error in case it
|
||||
+ * detects a padding error, rather it will return a deterministically generated
|
||||
+ * random message. In other words it will perform an implicit rejection
|
||||
+ * of an invalid padding. This means that the returned value does not indicate
|
||||
+ * if the padding of the encrypted message was correct or not, making
|
||||
+ * side channel attacks like the ones described by Bleichenbacher impossible
|
||||
+ * without access to the full decrypted value and a brute-force search of
|
||||
+ * remaining padding bytes
|
||||
+ */
|
||||
+int ossl_rsa_padding_check_PKCS1_type_2(OSSL_LIB_CTX *ctx,
|
||||
+ unsigned char *to, int tlen,
|
||||
+ const unsigned char *from, int flen,
|
||||
+ int num, unsigned char *kdk)
|
||||
+{
|
||||
+/*
|
||||
+ * We need to generate a random length for the synthethic message, to avoid
|
||||
+ * bias towards zero and avoid non-constant timeness of DIV, we prepare
|
||||
+ * 128 values to check if they are not too large for the used key size,
|
||||
+ * and use 0 in case none of them are small enough, as 2^-128 is a good enough
|
||||
+ * safety margin
|
||||
+ */
|
||||
+#define MAX_LEN_GEN_TRIES 128
|
||||
+ unsigned char *synthetic = NULL;
|
||||
+ int synthethic_length;
|
||||
+ uint16_t len_candidate;
|
||||
+ unsigned char candidate_lengths[MAX_LEN_GEN_TRIES * sizeof(len_candidate)];
|
||||
+ uint16_t len_mask;
|
||||
+ uint16_t max_sep_offset;
|
||||
+ int synth_msg_index = 0;
|
||||
+ int ret = -1;
|
||||
+ int i, j;
|
||||
+ unsigned int good, found_zero_byte;
|
||||
+ int zero_index = 0, msg_index;
|
||||
+
|
||||
+ /*
|
||||
+ * If these checks fail then either the message in publicly invalid, or
|
||||
+ * we've been called incorrectly. We can fail immediately.
|
||||
+ * Since this code is called only internally by openssl, those are just
|
||||
+ * sanity checks
|
||||
+ */
|
||||
+ if (num != flen || tlen <= 0 || flen <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ /* Generate a random message to return in case the padding checks fail */
|
||||
+ synthetic = OPENSSL_malloc(flen);
|
||||
+ if (synthetic == NULL) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_MALLOC_FAILURE);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (ossl_rsa_prf(ctx, synthetic, flen, "message", 7, kdk, flen * 8) < 0)
|
||||
+ goto err;
|
||||
+
|
||||
+ /* decide how long the random message should be */
|
||||
+ if (ossl_rsa_prf(ctx, candidate_lengths, sizeof(candidate_lengths),
|
||||
+ "length", 6, kdk,
|
||||
+ MAX_LEN_GEN_TRIES * sizeof(len_candidate) * 8) < 0)
|
||||
+ goto err;
|
||||
+
|
||||
+ /*
|
||||
+ * max message size is the size of the modulus size less 2 bytes for
|
||||
+ * version and padding type and a minimum of 8 bytes padding
|
||||
+ */
|
||||
+ len_mask = max_sep_offset = flen - 2 - 8;
|
||||
+ /*
|
||||
+ * we want a mask so lets propagate the high bit to all positions less
|
||||
+ * significant than it
|
||||
+ */
|
||||
+ len_mask |= len_mask >> 1;
|
||||
+ len_mask |= len_mask >> 2;
|
||||
+ len_mask |= len_mask >> 4;
|
||||
+ len_mask |= len_mask >> 8;
|
||||
+
|
||||
+ synthethic_length = 0;
|
||||
+ for (i = 0; i < MAX_LEN_GEN_TRIES * (int)sizeof(len_candidate);
|
||||
+ i += sizeof(len_candidate)) {
|
||||
+ len_candidate = (candidate_lengths[i] << 8) | candidate_lengths[i + 1];
|
||||
+ len_candidate &= len_mask;
|
||||
+
|
||||
+ synthethic_length = constant_time_select_int(
|
||||
+ constant_time_lt(len_candidate, max_sep_offset),
|
||||
+ len_candidate, synthethic_length);
|
||||
+ }
|
||||
+
|
||||
+ synth_msg_index = flen - synthethic_length;
|
||||
+
|
||||
+ /* we have alternative message ready, check the real one */
|
||||
+ good = constant_time_is_zero(from[0]);
|
||||
+ good &= constant_time_eq(from[1], 2);
|
||||
+
|
||||
+ /* then look for the padding|message separator (the first zero byte) */
|
||||
+ found_zero_byte = 0;
|
||||
+ for (i = 2; i < flen; i++) {
|
||||
+ unsigned int equals0 = constant_time_is_zero(from[i]);
|
||||
+ zero_index = constant_time_select_int(~found_zero_byte & equals0,
|
||||
+ i, zero_index);
|
||||
+ found_zero_byte |= equals0;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * padding must be at least 8 bytes long, and it starts two bytes into
|
||||
+ * |from|. If we never found a 0-byte, then |zero_index| is 0 and the check
|
||||
+ * also fails.
|
||||
+ */
|
||||
+ good &= constant_time_ge(zero_index, 2 + 8);
|
||||
+
|
||||
+ /*
|
||||
+ * Skip the zero byte. This is incorrect if we never found a zero-byte
|
||||
+ * but in this case we also do not copy the message out.
|
||||
+ */
|
||||
+ msg_index = zero_index + 1;
|
||||
+
|
||||
+ /*
|
||||
+ * old code returned an error in case the decrypted message wouldn't fit
|
||||
+ * into the |to|, since that would leak information, return the synthethic
|
||||
+ * message instead
|
||||
+ */
|
||||
+ good &= constant_time_ge(tlen, num - msg_index);
|
||||
+
|
||||
+ msg_index = constant_time_select_int(good, msg_index, synth_msg_index);
|
||||
+
|
||||
+ /*
|
||||
+ * since at this point the |msg_index| does not provide the signal
|
||||
+ * indicating if the padding check failed or not, we don't have to worry
|
||||
+ * about leaking the length of returned message, we still need to ensure
|
||||
+ * that we read contents of both buffers so that cache accesses don't leak
|
||||
+ * the value of |good|
|
||||
+ */
|
||||
+ for (i = msg_index, j = 0; i < flen && j < tlen; i++, j++)
|
||||
+ to[j] = constant_time_select_8(good, from[i], synthetic[i]);
|
||||
+ ret = j;
|
||||
+
|
||||
+err:
|
||||
+ /*
|
||||
+ * the only time ret < 0 is when the ciphertext is publicly invalid
|
||||
+ * or we were called with invalid parameters, so we don't have to perform
|
||||
+ * a side-channel secure raising of the error
|
||||
+ */
|
||||
+ if (ret < 0)
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ OPENSSL_free(synthetic);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* ossl_rsa_padding_check_PKCS1_type_2_TLS() checks and removes the PKCS1 type 2
|
||||
* padding from a decrypted RSA message in a TLS signature. The result is stored
|
||||
diff --git a/doc/man1/openssl-pkeyutl.pod.in b/doc/man1/openssl-pkeyutl.pod.in
|
||||
index 2f6ef0021d..015265a74d 100644
|
||||
--- a/doc/man1/openssl-pkeyutl.pod.in
|
||||
+++ b/doc/man1/openssl-pkeyutl.pod.in
|
||||
@@ -273,6 +273,11 @@ signed or verified directly instead of using a B<DigestInfo> structure. If a
|
||||
digest is set, then the B<DigestInfo> structure is used and its length
|
||||
must correspond to the digest type.
|
||||
|
||||
+Note, for B<pkcs1> padding, as a protection against Bleichenbacher attack,
|
||||
+the decryption will not fail in case of padding check failures. Use B<none>
|
||||
+and manual inspection of the decrypted message to verify if the decrypted
|
||||
+value has correct PKCS#1 v1.5 padding.
|
||||
+
|
||||
For B<oaep> mode only encryption and decryption is supported.
|
||||
|
||||
For B<x931> if the digest type is set it is used to format the block data
|
||||
diff --git a/doc/man1/openssl-rsautl.pod.in b/doc/man1/openssl-rsautl.pod.in
|
||||
index 0a32fd965b..4c462abc8c 100644
|
||||
--- a/doc/man1/openssl-rsautl.pod.in
|
||||
+++ b/doc/man1/openssl-rsautl.pod.in
|
||||
@@ -105,6 +105,11 @@ The padding to use: PKCS#1 v1.5 (the default), PKCS#1 OAEP,
|
||||
ANSI X9.31, or no padding, respectively.
|
||||
For signatures, only B<-pkcs> and B<-raw> can be used.
|
||||
|
||||
+Note: because of protection against Bleichenbacher attacks, decryption
|
||||
+using PKCS#1 v1.5 mode will not return errors in case padding check failed.
|
||||
+Use B<-raw> and inspect the returned value manually to check if the
|
||||
+padding is correct.
|
||||
+
|
||||
=item B<-hexdump>
|
||||
|
||||
Hex dump the output data.
|
||||
diff --git a/doc/man3/EVP_PKEY_CTX_ctrl.pod b/doc/man3/EVP_PKEY_CTX_ctrl.pod
|
||||
index 3075eaafd6..e788f38809 100644
|
||||
--- a/doc/man3/EVP_PKEY_CTX_ctrl.pod
|
||||
+++ b/doc/man3/EVP_PKEY_CTX_ctrl.pod
|
||||
@@ -386,6 +386,13 @@ this behaviour should be tolerated then
|
||||
OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION should be set to the actual
|
||||
negotiated protocol version. Otherwise it should be left unset.
|
||||
|
||||
+Similarly to the B<RSA_PKCS1_WITH_TLS_PADDING> above, since OpenSSL version
|
||||
+3.1.0, the use of B<RSA_PKCS1_PADDING> will return a randomly generated message
|
||||
+instead of padding errors in case padding checks fail. Applications that
|
||||
+want to remain secure while using earlier versions of OpenSSL, still need to
|
||||
+handle both the error code from the RSA decryption operation and the
|
||||
+returned message in a side channel secure manner.
|
||||
+
|
||||
=head2 DSA parameters
|
||||
|
||||
EVP_PKEY_CTX_set_dsa_paramgen_bits() sets the number of bits used for DSA
|
||||
diff --git a/doc/man3/EVP_PKEY_decrypt.pod b/doc/man3/EVP_PKEY_decrypt.pod
|
||||
index b6f9bad5f1..898535a7a2 100644
|
||||
--- a/doc/man3/EVP_PKEY_decrypt.pod
|
||||
+++ b/doc/man3/EVP_PKEY_decrypt.pod
|
||||
@@ -51,6 +51,18 @@ return 1 for success and 0 or a negative value for failure. In particular a
|
||||
return value of -2 indicates the operation is not supported by the public key
|
||||
algorithm.
|
||||
|
||||
+=head1 WARNINGS
|
||||
+
|
||||
+In OpenSSL versions before 3.1.0, when used in PKCS#1 v1.5 padding,
|
||||
+both the return value from the EVP_PKEY_decrypt() and the B<outlen> provided
|
||||
+information useful in mounting a Bleichenbacher attack against the
|
||||
+used private key. They had to processed in a side-channel free way.
|
||||
+
|
||||
+Since version 3.1.0, the EVP_PKEY_decrypt() method when used with PKCS#1
|
||||
+v1.5 padding doesn't return an error in case it detects an error in padding,
|
||||
+instead it returns a pseudo-randomly generated message, removing the need
|
||||
+of side-channel secure code from applications using OpenSSL.
|
||||
+
|
||||
=head1 EXAMPLES
|
||||
|
||||
Decrypt data using OAEP (for RSA keys):
|
||||
diff --git a/doc/man3/RSA_padding_add_PKCS1_type_1.pod b/doc/man3/RSA_padding_add_PKCS1_type_1.pod
|
||||
index 9f7025c497..36ae18563f 100644
|
||||
--- a/doc/man3/RSA_padding_add_PKCS1_type_1.pod
|
||||
+++ b/doc/man3/RSA_padding_add_PKCS1_type_1.pod
|
||||
@@ -121,8 +121,8 @@ L<ERR_get_error(3)>.
|
||||
|
||||
=head1 WARNINGS
|
||||
|
||||
-The result of RSA_padding_check_PKCS1_type_2() is a very sensitive
|
||||
-information which can potentially be used to mount a Bleichenbacher
|
||||
+The result of RSA_padding_check_PKCS1_type_2() is exactly the
|
||||
+information which is used to mount a classical Bleichenbacher
|
||||
padding oracle attack. This is an inherent weakness in the PKCS #1
|
||||
v1.5 padding design. Prefer PKCS1_OAEP padding. If that is not
|
||||
possible, the result of RSA_padding_check_PKCS1_type_2() should be
|
||||
@@ -137,6 +137,9 @@ as this would create a small timing side channel which could be
|
||||
used to mount a Bleichenbacher attack against any padding mode
|
||||
including PKCS1_OAEP.
|
||||
|
||||
+You should prefer the use of EVP PKEY APIs for PKCS#1 v1.5 decryption
|
||||
+as they implement the necessary workarounds internally.
|
||||
+
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<RSA_public_encrypt(3)>,
|
||||
diff --git a/doc/man3/RSA_public_encrypt.pod b/doc/man3/RSA_public_encrypt.pod
|
||||
index 1d38073aea..bd3f835ac6 100644
|
||||
--- a/doc/man3/RSA_public_encrypt.pod
|
||||
+++ b/doc/man3/RSA_public_encrypt.pod
|
||||
@@ -52,8 +52,8 @@ Encrypting user data directly with RSA is insecure.
|
||||
|
||||
=back
|
||||
|
||||
-B<flen> must not be more than RSA_size(B<rsa>) - 11 for the PKCS #1 v1.5
|
||||
-based padding modes, not more than RSA_size(B<rsa>) - 42 for
|
||||
+When encrypting B<flen> must not be more than RSA_size(B<rsa>) - 11 for the
|
||||
+PKCS #1 v1.5 based padding modes, not more than RSA_size(B<rsa>) - 42 for
|
||||
RSA_PKCS1_OAEP_PADDING and exactly RSA_size(B<rsa>) for RSA_NO_PADDING.
|
||||
When a padding mode other than RSA_NO_PADDING is in use, then
|
||||
RSA_public_encrypt() will include some random bytes into the ciphertext
|
||||
@@ -92,6 +92,13 @@ which can potentially be used to mount a Bleichenbacher padding oracle
|
||||
attack. This is an inherent weakness in the PKCS #1 v1.5 padding
|
||||
design. Prefer RSA_PKCS1_OAEP_PADDING.
|
||||
|
||||
+In OpenSSL before version 3.1.0, both the return value and the length of
|
||||
+returned value could be used to mount the Bleichenbacher attack.
|
||||
+Since version 3.1.0, OpenSSL does not return an error in case of padding
|
||||
+checks failed. Instead it generates a random message based on used private
|
||||
+key and provided ciphertext so that application code doesn't have to implement
|
||||
+a side-channel secure error handling.
|
||||
+
|
||||
=head1 CONFORMING TO
|
||||
|
||||
SSL, PKCS #1 v2.0
|
||||
diff --git a/include/crypto/rsa.h b/include/crypto/rsa.h
|
||||
index 949873d0ee..f267e5d9d1 100644
|
||||
--- a/include/crypto/rsa.h
|
||||
+++ b/include/crypto/rsa.h
|
||||
@@ -83,6 +83,10 @@ int ossl_rsa_param_decode(RSA *rsa, const X509_ALGOR *alg);
|
||||
RSA *ossl_rsa_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
+int ossl_rsa_padding_check_PKCS1_type_2(OSSL_LIB_CTX *ctx,
|
||||
+ unsigned char *to, int tlen,
|
||||
+ const unsigned char *from, int flen,
|
||||
+ int num, unsigned char *kdk);
|
||||
int ossl_rsa_padding_check_PKCS1_type_2_TLS(OSSL_LIB_CTX *ctx, unsigned char *to,
|
||||
size_t tlen,
|
||||
const unsigned char *from,
|
||||
--
|
||||
2.34.1
|
||||
|
||||
358
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-2.patch
Normal file
358
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-2.patch
Normal file
@@ -0,0 +1,358 @@
|
||||
From e92f0cd3b03e5aca948b03df7e3d02e536700f68 Mon Sep 17 00:00:00 2001
|
||||
From: Hubert Kario <hkario@redhat.com>
|
||||
Date: Thu, 27 Oct 2022 19:16:58 +0200
|
||||
Subject: [PATCH 2/3] rsa: Add option to disable implicit rejection
|
||||
|
||||
CVE: CVE-2023-50781
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://github.com/openssl/openssl/commit/5ab3ec1bb1eaa795d775f5896818cfaa84d33a1a]
|
||||
|
||||
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
|
||||
Reviewed-by: Tim Hudson <tjh@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/13817)
|
||||
|
||||
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
|
||||
---
|
||||
crypto/cms/cms_env.c | 7 +++++
|
||||
crypto/evp/ctrl_params_translate.c | 6 +++++
|
||||
crypto/rsa/rsa_ossl.c | 16 ++++++++----
|
||||
crypto/rsa/rsa_pmeth.c | 20 +++++++++++++-
|
||||
doc/man1/openssl-pkeyutl.pod.in | 10 +++++++
|
||||
doc/man3/EVP_PKEY_CTX_ctrl.pod | 2 ++
|
||||
doc/man7/provider-asym_cipher.pod | 9 +++++++
|
||||
include/openssl/core_names.h | 2 ++
|
||||
include/openssl/rsa.h | 5 ++++
|
||||
.../implementations/asymciphers/rsa_enc.c | 26 +++++++++++++++++--
|
||||
10 files changed, 95 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/crypto/cms/cms_env.c b/crypto/cms/cms_env.c
|
||||
index 445a16fb77..49b0289114 100644
|
||||
--- a/crypto/cms/cms_env.c
|
||||
+++ b/crypto/cms/cms_env.c
|
||||
@@ -581,6 +581,13 @@ static int cms_RecipientInfo_ktri_decrypt(CMS_ContentInfo *cms,
|
||||
if (!ossl_cms_env_asn1_ctrl(ri, 1))
|
||||
goto err;
|
||||
|
||||
+ if (EVP_PKEY_is_a(pkey, "RSA"))
|
||||
+ /* upper layer CMS code incorrectly assumes that a successful RSA
|
||||
+ * decryption means that the key matches ciphertext (which never
|
||||
+ * was the case, implicit rejection or not), so to make it work
|
||||
+ * disable implicit rejection for RSA keys */
|
||||
+ EVP_PKEY_CTX_ctrl_str(ktri->pctx, "rsa_pkcs1_implicit_rejection", "0");
|
||||
+
|
||||
if (EVP_PKEY_decrypt(ktri->pctx, NULL, &eklen,
|
||||
ktri->encryptedKey->data,
|
||||
ktri->encryptedKey->length) <= 0)
|
||||
diff --git a/crypto/evp/ctrl_params_translate.c b/crypto/evp/ctrl_params_translate.c
|
||||
index 44d0895bcf..db7325439a 100644
|
||||
--- a/crypto/evp/ctrl_params_translate.c
|
||||
+++ b/crypto/evp/ctrl_params_translate.c
|
||||
@@ -2269,6 +2269,12 @@ static const struct translation_st evp_pkey_ctx_translations[] = {
|
||||
EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL, NULL, NULL,
|
||||
OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL, OSSL_PARAM_OCTET_PTR, NULL },
|
||||
|
||||
+ { SET, EVP_PKEY_RSA, 0, EVP_PKEY_OP_TYPE_CRYPT,
|
||||
+ EVP_PKEY_CTRL_RSA_IMPLICIT_REJECTION, NULL,
|
||||
+ "rsa_pkcs1_implicit_rejection",
|
||||
+ OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION, OSSL_PARAM_UNSIGNED_INTEGER,
|
||||
+ NULL },
|
||||
+
|
||||
{ SET, EVP_PKEY_RSA_PSS, 0, EVP_PKEY_OP_TYPE_GEN,
|
||||
EVP_PKEY_CTRL_MD, "rsa_pss_keygen_md", NULL,
|
||||
OSSL_ALG_PARAM_DIGEST, OSSL_PARAM_UTF8_STRING, fix_md },
|
||||
diff --git a/crypto/rsa/rsa_ossl.c b/crypto/rsa/rsa_ossl.c
|
||||
index 330302ae55..4bdacd5ed9 100644
|
||||
--- a/crypto/rsa/rsa_ossl.c
|
||||
+++ b/crypto/rsa/rsa_ossl.c
|
||||
@@ -395,6 +395,12 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
|
||||
BIGNUM *unblind = NULL;
|
||||
BN_BLINDING *blinding = NULL;
|
||||
|
||||
+ /*
|
||||
+ * we need the value of the private exponent to perform implicit rejection
|
||||
+ */
|
||||
+ if ((rsa->flags & RSA_FLAG_EXT_PKEY) && (padding == RSA_PKCS1_PADDING))
|
||||
+ padding = RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING;
|
||||
+
|
||||
if ((ctx = BN_CTX_new_ex(rsa->libctx)) == NULL)
|
||||
goto err;
|
||||
BN_CTX_start(ctx);
|
||||
@@ -489,7 +495,7 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
|
||||
* derive the Key Derivation Key from private exponent and public
|
||||
* ciphertext
|
||||
*/
|
||||
- if (!(rsa->flags & RSA_FLAG_EXT_PKEY)) {
|
||||
+ if (padding == RSA_PKCS1_PADDING) {
|
||||
/*
|
||||
* because we use d as a handle to rsa->d we need to keep it local and
|
||||
* free before any further use of rsa->d
|
||||
@@ -565,11 +571,11 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
|
||||
goto err;
|
||||
|
||||
switch (padding) {
|
||||
+ case RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING:
|
||||
+ r = RSA_padding_check_PKCS1_type_2(to, num, buf, j, num);
|
||||
+ break;
|
||||
case RSA_PKCS1_PADDING:
|
||||
- if (rsa->flags & RSA_FLAG_EXT_PKEY)
|
||||
- r = RSA_padding_check_PKCS1_type_2(to, num, buf, j, num);
|
||||
- else
|
||||
- r = ossl_rsa_padding_check_PKCS1_type_2(rsa->libctx, to, num, buf, j, num, kdk);
|
||||
+ r = ossl_rsa_padding_check_PKCS1_type_2(rsa->libctx, to, num, buf, j, num, kdk);
|
||||
break;
|
||||
case RSA_PKCS1_OAEP_PADDING:
|
||||
r = RSA_padding_check_PKCS1_OAEP(to, num, buf, j, num, NULL, 0);
|
||||
diff --git a/crypto/rsa/rsa_pmeth.c b/crypto/rsa/rsa_pmeth.c
|
||||
index 0bf5ac098a..81b031f81b 100644
|
||||
--- a/crypto/rsa/rsa_pmeth.c
|
||||
+++ b/crypto/rsa/rsa_pmeth.c
|
||||
@@ -52,6 +52,8 @@ typedef struct {
|
||||
/* OAEP label */
|
||||
unsigned char *oaep_label;
|
||||
size_t oaep_labellen;
|
||||
+ /* if to use implicit rejection in PKCS#1 v1.5 decryption */
|
||||
+ int implicit_rejection;
|
||||
} RSA_PKEY_CTX;
|
||||
|
||||
/* True if PSS parameters are restricted */
|
||||
@@ -72,6 +74,7 @@ static int pkey_rsa_init(EVP_PKEY_CTX *ctx)
|
||||
/* Maximum for sign, auto for verify */
|
||||
rctx->saltlen = RSA_PSS_SALTLEN_AUTO;
|
||||
rctx->min_saltlen = -1;
|
||||
+ rctx->implicit_rejection = 1;
|
||||
ctx->data = rctx;
|
||||
ctx->keygen_info = rctx->gentmp;
|
||||
ctx->keygen_info_count = 2;
|
||||
@@ -97,6 +100,7 @@ static int pkey_rsa_copy(EVP_PKEY_CTX *dst, const EVP_PKEY_CTX *src)
|
||||
dctx->md = sctx->md;
|
||||
dctx->mgf1md = sctx->mgf1md;
|
||||
dctx->saltlen = sctx->saltlen;
|
||||
+ dctx->implicit_rejection = sctx->implicit_rejection;
|
||||
if (sctx->oaep_label) {
|
||||
OPENSSL_free(dctx->oaep_label);
|
||||
dctx->oaep_label = OPENSSL_memdup(sctx->oaep_label, sctx->oaep_labellen);
|
||||
@@ -347,6 +351,7 @@ static int pkey_rsa_decrypt(EVP_PKEY_CTX *ctx,
|
||||
const unsigned char *in, size_t inlen)
|
||||
{
|
||||
int ret;
|
||||
+ int pad_mode;
|
||||
RSA_PKEY_CTX *rctx = ctx->data;
|
||||
/*
|
||||
* Discard const. Its marked as const because this may be a cached copy of
|
||||
@@ -367,7 +372,12 @@ static int pkey_rsa_decrypt(EVP_PKEY_CTX *ctx,
|
||||
rctx->oaep_labellen,
|
||||
rctx->md, rctx->mgf1md);
|
||||
} else {
|
||||
- ret = RSA_private_decrypt(inlen, in, out, rsa, rctx->pad_mode);
|
||||
+ if (rctx->pad_mode == RSA_PKCS1_PADDING &&
|
||||
+ rctx->implicit_rejection == 0)
|
||||
+ pad_mode = RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING;
|
||||
+ else
|
||||
+ pad_mode = rctx->pad_mode;
|
||||
+ ret = RSA_private_decrypt(inlen, in, out, rsa, pad_mode);
|
||||
}
|
||||
*outlen = constant_time_select_s(constant_time_msb_s(ret), *outlen, ret);
|
||||
ret = constant_time_select_int(constant_time_msb(ret), ret, 1);
|
||||
@@ -591,6 +601,14 @@ static int pkey_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
|
||||
*(unsigned char **)p2 = rctx->oaep_label;
|
||||
return rctx->oaep_labellen;
|
||||
|
||||
+ case EVP_PKEY_CTRL_RSA_IMPLICIT_REJECTION:
|
||||
+ if (rctx->pad_mode != RSA_PKCS1_PADDING) {
|
||||
+ ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE);
|
||||
+ return -2;
|
||||
+ }
|
||||
+ rctx->implicit_rejection = p1;
|
||||
+ return 1;
|
||||
+
|
||||
case EVP_PKEY_CTRL_DIGESTINIT:
|
||||
case EVP_PKEY_CTRL_PKCS7_SIGN:
|
||||
#ifndef OPENSSL_NO_CMS
|
||||
diff --git a/doc/man1/openssl-pkeyutl.pod.in b/doc/man1/openssl-pkeyutl.pod.in
|
||||
index 015265a74d..5e62551d34 100644
|
||||
--- a/doc/man1/openssl-pkeyutl.pod.in
|
||||
+++ b/doc/man1/openssl-pkeyutl.pod.in
|
||||
@@ -305,6 +305,16 @@ explicitly set in PSS mode then the signing digest is used.
|
||||
Sets the digest used for the OAEP hash function. If not explicitly set then
|
||||
SHA1 is used.
|
||||
|
||||
+=item B<rsa_pkcs1_implicit_rejection:>I<flag>
|
||||
+
|
||||
+Disables (when set to 0) or enables (when set to 1) the use of implicit
|
||||
+rejection with PKCS#1 v1.5 decryption. When enabled (the default), as a
|
||||
+protection against Bleichenbacher attack, the library will generate a
|
||||
+deterministic random plaintext that it will return to the caller in case
|
||||
+of padding check failure.
|
||||
+When disabled, it's the callers' responsibility to handle the returned
|
||||
+errors in a side-channel free manner.
|
||||
+
|
||||
=back
|
||||
|
||||
=head1 RSA-PSS ALGORITHM
|
||||
diff --git a/doc/man3/EVP_PKEY_CTX_ctrl.pod b/doc/man3/EVP_PKEY_CTX_ctrl.pod
|
||||
index e788f38809..3844aa2199 100644
|
||||
--- a/doc/man3/EVP_PKEY_CTX_ctrl.pod
|
||||
+++ b/doc/man3/EVP_PKEY_CTX_ctrl.pod
|
||||
@@ -392,6 +392,8 @@ instead of padding errors in case padding checks fail. Applications that
|
||||
want to remain secure while using earlier versions of OpenSSL, still need to
|
||||
handle both the error code from the RSA decryption operation and the
|
||||
returned message in a side channel secure manner.
|
||||
+This protection against Bleichenbacher attacks can be disabled by setting
|
||||
+the OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION (an unsigned integer) to 0.
|
||||
|
||||
=head2 DSA parameters
|
||||
|
||||
diff --git a/doc/man7/provider-asym_cipher.pod b/doc/man7/provider-asym_cipher.pod
|
||||
index 0976a263a8..2a8426a6ed 100644
|
||||
--- a/doc/man7/provider-asym_cipher.pod
|
||||
+++ b/doc/man7/provider-asym_cipher.pod
|
||||
@@ -234,6 +234,15 @@ The TLS protocol version first requested by the client.
|
||||
|
||||
The negotiated TLS protocol version.
|
||||
|
||||
+=item "implicit-rejection" (B<OSSL_PKEY_PARAM_IMPLICIT_REJECTION>) <unsigned integer>
|
||||
+
|
||||
+Gets of sets the use of the implicit rejection mechanism for RSA PKCS#1 v1.5
|
||||
+decryption. When set (non zero value), the decryption API will return
|
||||
+a deterministically random value if the PKCS#1 v1.5 padding check fails.
|
||||
+This makes explotation of the Bleichenbacher significantly harder, even
|
||||
+if the code using the RSA decryption API is not implemented in side-channel
|
||||
+free manner. Set by default.
|
||||
+
|
||||
=back
|
||||
|
||||
OSSL_FUNC_asym_cipher_gettable_ctx_params() and OSSL_FUNC_asym_cipher_settable_ctx_params()
|
||||
diff --git a/include/openssl/core_names.h b/include/openssl/core_names.h
|
||||
index 6bed5a8a67..5a350b537f 100644
|
||||
--- a/include/openssl/core_names.h
|
||||
+++ b/include/openssl/core_names.h
|
||||
@@ -292,6 +292,7 @@ extern "C" {
|
||||
#define OSSL_PKEY_PARAM_DIST_ID "distid"
|
||||
#define OSSL_PKEY_PARAM_PUB_KEY "pub"
|
||||
#define OSSL_PKEY_PARAM_PRIV_KEY "priv"
|
||||
+#define OSSL_PKEY_PARAM_IMPLICIT_REJECTION "implicit-rejection"
|
||||
|
||||
/* Diffie-Hellman/DSA Parameters */
|
||||
#define OSSL_PKEY_PARAM_FFC_P "p"
|
||||
@@ -467,6 +468,7 @@ extern "C" {
|
||||
#define OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL "oaep-label"
|
||||
#define OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION "tls-client-version"
|
||||
#define OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION "tls-negotiated-version"
|
||||
+#define OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION "implicit-rejection"
|
||||
|
||||
/*
|
||||
* Encoder / decoder parameters
|
||||
diff --git a/include/openssl/rsa.h b/include/openssl/rsa.h
|
||||
index a55c9727c6..247f9014e3 100644
|
||||
--- a/include/openssl/rsa.h
|
||||
+++ b/include/openssl/rsa.h
|
||||
@@ -183,6 +183,8 @@ int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, unsigned char **label);
|
||||
|
||||
# define EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES (EVP_PKEY_ALG_CTRL + 13)
|
||||
|
||||
+# define EVP_PKEY_CTRL_RSA_IMPLICIT_REJECTION (EVP_PKEY_ALG_CTRL + 14)
|
||||
+
|
||||
# define RSA_PKCS1_PADDING 1
|
||||
# define RSA_NO_PADDING 3
|
||||
# define RSA_PKCS1_OAEP_PADDING 4
|
||||
@@ -192,6 +194,9 @@ int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, unsigned char **label);
|
||||
# define RSA_PKCS1_PSS_PADDING 6
|
||||
# define RSA_PKCS1_WITH_TLS_PADDING 7
|
||||
|
||||
+/* internal RSA_ only */
|
||||
+# define RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING 8
|
||||
+
|
||||
# define RSA_PKCS1_PADDING_SIZE 11
|
||||
|
||||
# define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg)
|
||||
diff --git a/providers/implementations/asymciphers/rsa_enc.c b/providers/implementations/asymciphers/rsa_enc.c
|
||||
index c8921acd6e..11a91e62b1 100644
|
||||
--- a/providers/implementations/asymciphers/rsa_enc.c
|
||||
+++ b/providers/implementations/asymciphers/rsa_enc.c
|
||||
@@ -75,6 +75,8 @@ typedef struct {
|
||||
/* TLS padding */
|
||||
unsigned int client_version;
|
||||
unsigned int alt_version;
|
||||
+ /* PKCS#1 v1.5 decryption mode */
|
||||
+ unsigned int implicit_rejection;
|
||||
} PROV_RSA_CTX;
|
||||
|
||||
static void *rsa_newctx(void *provctx)
|
||||
@@ -107,6 +109,7 @@ static int rsa_init(void *vprsactx, void *vrsa, const OSSL_PARAM params[],
|
||||
RSA_free(prsactx->rsa);
|
||||
prsactx->rsa = vrsa;
|
||||
prsactx->operation = operation;
|
||||
+ prsactx->implicit_rejection = 1;
|
||||
|
||||
switch (RSA_test_flags(prsactx->rsa, RSA_FLAG_TYPE_MASK)) {
|
||||
case RSA_FLAG_TYPE_RSA:
|
||||
@@ -199,6 +202,7 @@ static int rsa_decrypt(void *vprsactx, unsigned char *out, size_t *outlen,
|
||||
{
|
||||
PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
|
||||
int ret;
|
||||
+ int pad_mode;
|
||||
size_t len = RSA_size(prsactx->rsa);
|
||||
|
||||
if (!ossl_prov_is_running())
|
||||
@@ -276,8 +280,12 @@ static int rsa_decrypt(void *vprsactx, unsigned char *out, size_t *outlen,
|
||||
}
|
||||
OPENSSL_free(tbuf);
|
||||
} else {
|
||||
- ret = RSA_private_decrypt(inlen, in, out, prsactx->rsa,
|
||||
- prsactx->pad_mode);
|
||||
+ if ((prsactx->implicit_rejection == 0) &&
|
||||
+ (prsactx->pad_mode == RSA_PKCS1_PADDING))
|
||||
+ pad_mode = RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING;
|
||||
+ else
|
||||
+ pad_mode = prsactx->pad_mode;
|
||||
+ ret = RSA_private_decrypt(inlen, in, out, prsactx->rsa, pad_mode);
|
||||
}
|
||||
*outlen = constant_time_select_s(constant_time_msb_s(ret), *outlen, ret);
|
||||
ret = constant_time_select_int(constant_time_msb(ret), 0, 1);
|
||||
@@ -401,6 +409,10 @@ static int rsa_get_ctx_params(void *vprsactx, OSSL_PARAM *params)
|
||||
if (p != NULL && !OSSL_PARAM_set_uint(p, prsactx->alt_version))
|
||||
return 0;
|
||||
|
||||
+ p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION);
|
||||
+ if (p != NULL && !OSSL_PARAM_set_uint(p, prsactx->implicit_rejection))
|
||||
+ return 0;
|
||||
+
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -412,6 +424,7 @@ static const OSSL_PARAM known_gettable_ctx_params[] = {
|
||||
NULL, 0),
|
||||
OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION, NULL),
|
||||
OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION, NULL),
|
||||
+ OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION, NULL),
|
||||
OSSL_PARAM_END
|
||||
};
|
||||
|
||||
@@ -549,6 +562,14 @@ static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
|
||||
return 0;
|
||||
prsactx->alt_version = alt_version;
|
||||
}
|
||||
+ p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION);
|
||||
+ if (p != NULL) {
|
||||
+ unsigned int implicit_rejection;
|
||||
+
|
||||
+ if (!OSSL_PARAM_get_uint(p, &implicit_rejection))
|
||||
+ return 0;
|
||||
+ prsactx->implicit_rejection = implicit_rejection;
|
||||
+ }
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -562,6 +583,7 @@ static const OSSL_PARAM known_settable_ctx_params[] = {
|
||||
OSSL_PARAM_octet_string(OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL, NULL, 0),
|
||||
OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION, NULL),
|
||||
OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION, NULL),
|
||||
+ OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION, NULL),
|
||||
OSSL_PARAM_END
|
||||
};
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
From ba78f7b0599ba5bfb5032dd2664465c5b13388e3 Mon Sep 17 00:00:00 2001
|
||||
From: Hubert Kario <hkario@redhat.com>
|
||||
Date: Tue, 22 Nov 2022 18:25:49 +0100
|
||||
Subject: [PATCH 3/3] smime/pkcs7: disable the Bleichenbacher workaround
|
||||
|
||||
CVE: CVE-2023-50781
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://github.com/openssl/openssl/commit/056dade341d2589975a3aae71f81c8d7061583c7]
|
||||
|
||||
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
|
||||
Reviewed-by: Tim Hudson <tjh@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/13817)
|
||||
|
||||
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
|
||||
---
|
||||
crypto/pkcs7/pk7_doit.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c
|
||||
index e9de097da1..6d3124da87 100644
|
||||
--- a/crypto/pkcs7/pk7_doit.c
|
||||
+++ b/crypto/pkcs7/pk7_doit.c
|
||||
@@ -170,6 +170,13 @@ static int pkcs7_decrypt_rinfo(unsigned char **pek, int *peklen,
|
||||
if (EVP_PKEY_decrypt_init(pctx) <= 0)
|
||||
goto err;
|
||||
|
||||
+ if (EVP_PKEY_is_a(pkey, "RSA"))
|
||||
+ /* upper layer pkcs7 code incorrectly assumes that a successful RSA
|
||||
+ * decryption means that the key matches ciphertext (which never
|
||||
+ * was the case, implicit rejection or not), so to make it work
|
||||
+ * disable implicit rejection for RSA keys */
|
||||
+ EVP_PKEY_CTX_ctrl_str(pctx, "rsa_pkcs1_implicit_rejection", "0");
|
||||
+
|
||||
if (EVP_PKEY_decrypt(pctx, NULL, &eklen,
|
||||
ri->enc_key->data, ri->enc_key->length) <= 0)
|
||||
goto err;
|
||||
--
|
||||
2.34.1
|
||||
|
||||
441
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-4.patch
Normal file
441
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-4.patch
Normal file
@@ -0,0 +1,441 @@
|
||||
From 8ae4f0e68ebb7435be494b58676827ae91695371 Mon Sep 17 00:00:00 2001
|
||||
From: Hubert Kario <hkario@redhat.com>
|
||||
Date: Tue, 12 Jan 2021 14:58:04 +0100
|
||||
Subject: [PATCH] rsa: add test vectors for the implicit rejection in RSA
|
||||
PKCS#1 v1.5
|
||||
|
||||
CVE: CVE-2023-50781
|
||||
|
||||
Upstream-Status: Backport [https://github.com/openssl/openssl/commit/8ae4f0e68ebb7435be494b58676827ae91695371]
|
||||
|
||||
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
|
||||
Reviewed-by: Tim Hudson <tjh@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/13817)
|
||||
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
|
||||
---
|
||||
.../30-test_evp_data/evppkey_rsa_common.txt | 408 ++++++++++++++++++
|
||||
1 file changed, 408 insertions(+)
|
||||
|
||||
diff --git a/test/recipes/30-test_evp_data/evppkey_rsa_common.txt b/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
index 080c4d02af..1405465098 100644
|
||||
--- a/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
+++ b/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
@@ -277,6 +277,414 @@ Derive = RSA-2048
|
||||
Result = KEYOP_INIT_ERROR
|
||||
Reason = operation not supported for this keytype
|
||||
|
||||
+# Test vectors for the Bleichenbacher workaround
|
||||
+
|
||||
+PrivateKey = RSA-2048-2
|
||||
+-----BEGIN RSA PRIVATE KEY-----
|
||||
+MIIEowIBAAKCAQEAyMyDlxQJjaVsqiNkD5PciZfBY3KWj8Gwxt9RE8HJTosh5IrS
|
||||
+KX5lQZARtObY9ec7G3iyV0ADIdHva2AtTsjOjRQclJBetK0wZjmkkgZTS25/JgdC
|
||||
+Ppff/RM8iNchOZ3vvH6WzNy9fzquH+iScSv7SSmBfVEWZkQKH6y3ogj16hZZEK3Y
|
||||
+o/LUlyAjYMy2MgJPDQcWnBkY8xb3lLFDrvVOyHUipMApePlomYC/+/ZJwwfoGBm/
|
||||
++IQJY41IvZS+FStZ/2SfoL1inQ/6GBPDq/S1a9PC6lRl3/oUWJKSqdiiStJr5+4F
|
||||
+EHQbY4LUPIPVv6QKRmE9BivkRVF9vK8MtOGnaQIDAQABAoIBABRVAQ4PLVh2Y6Zm
|
||||
+pv8czbvw7dgQBkbQKgI5IpCJksStOeVWWSlybvZQjDpxFY7wtv91HTnQdYC7LS8G
|
||||
+MhBELQYD/1DbvXs1/iybsZpHoa+FpMJJAeAsqLWLeRmyDt8yqs+/Ua20vEthubfp
|
||||
+aMqk1XD3DvGNgGMiiJPkfUOe/KeTJZvPLNEIo9hojN8HjnrHmZafIznSwfUiuWlo
|
||||
+RimpM7quwmgWJeq4T05W9ER+nYj7mhmc9xAj4OJXsURBszyE07xnyoAx0mEmGBA6
|
||||
+egpAhEJi912IkM1hblH5A1SI/W4Jnej/bWWk/xGCVIB8n1jS+7qLoVHcjGi+NJyX
|
||||
+eiBOBMECgYEA+PWta6gokxvqRZuKP23AQdI0gkCcJXHpY/MfdIYColY3GziD7UWe
|
||||
+z5cFJkWe3RbgVSL1pF2UdRsuwtrycsf4gWpSwA0YCAFxY02omdeXMiL1G5N2MFSG
|
||||
+lqn32MJKWUl8HvzUVc+5fuhtK200lyszL9owPwSZm062tcwLsz53Yd0CgYEAznou
|
||||
+O0mpC5YzChLcaCvfvfuujdbcA7YUeu+9V1dD8PbaTYYjUGG3Gv2crS00Al5WrIaw
|
||||
+93Q+s14ay8ojeJVCRGW3Bu0iF15XGMjHC2cD6o9rUQ+UW+SOWja7PDyRcytYnfwF
|
||||
+1y2AkDGURSvaITSGR+xylD8RqEbmL66+jrU2sP0CgYB2/hXxiuI5zfHfa0RcpLxr
|
||||
+uWjXiMIZM6T13NKAAz1nEgYswIpt8gTB+9C+RjB0Q+bdSmRWN1Qp1OA4yiVvrxyb
|
||||
+3pHGsXt2+BmV+RxIy768e/DjSUwINZ5OjNalh9e5bWIh/X4PtcVXXwgu5XdpeYBx
|
||||
+sru0oyI4FRtHMUu2VHkDEQKBgQCZiEiwVUmaEAnLx9KUs2sf/fICDm5zZAU+lN4a
|
||||
+AA3JNAWH9+JydvaM32CNdTtjN3sDtvQITSwCfEs4lgpiM7qe2XOLdvEOp1vkVgeL
|
||||
+9wH2fMaz8/3BhuZDNsdrNy6AkQ7ICwrcwj0C+5rhBIaigkgHW06n5W3fzziC5FFW
|
||||
+FHGikQKBgGQ790ZCn32DZnoGUwITR++/wF5jUfghqd67YODszeUAWtnp7DHlWPfp
|
||||
+LCkyjnRWnXzvfHTKvCs1XtQBoaCRS048uwZITlgZYFEWntFMqi76bqBE4FTSYUTM
|
||||
+FinFUBBVigThM/RLfCRNrCW/kTxXuJDuSfVIJZzWNAT+9oWdz5da
|
||||
+-----END RSA PRIVATE KEY-----
|
||||
+
|
||||
+# corresponding public key
|
||||
+PublicKey = RSA-2048-2-PUBLIC
|
||||
+-----BEGIN PUBLIC KEY-----
|
||||
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyMyDlxQJjaVsqiNkD5Pc
|
||||
+iZfBY3KWj8Gwxt9RE8HJTosh5IrSKX5lQZARtObY9ec7G3iyV0ADIdHva2AtTsjO
|
||||
+jRQclJBetK0wZjmkkgZTS25/JgdCPpff/RM8iNchOZ3vvH6WzNy9fzquH+iScSv7
|
||||
+SSmBfVEWZkQKH6y3ogj16hZZEK3Yo/LUlyAjYMy2MgJPDQcWnBkY8xb3lLFDrvVO
|
||||
+yHUipMApePlomYC/+/ZJwwfoGBm/+IQJY41IvZS+FStZ/2SfoL1inQ/6GBPDq/S1
|
||||
+a9PC6lRl3/oUWJKSqdiiStJr5+4FEHQbY4LUPIPVv6QKRmE9BivkRVF9vK8MtOGn
|
||||
+aQIDAQAB
|
||||
+-----END PUBLIC KEY-----
|
||||
+
|
||||
+PrivPubKeyPair = RSA-2048-2:RSA-2048-2-PUBLIC
|
||||
+
|
||||
+# RSA decrypt
|
||||
+
|
||||
+# a random positive test case
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 8bfe264e85d3bdeaa6b8851b8e3b956ee3d226fd3f69063a86880173a273d9f283b2eebdd1ed35f7e02d91c571981b6737d5320bd8396b0f3ad5b019daec1b0aab3cbbc026395f4fd14f13673f2dfc81f9b660ec26ac381e6db3299b4e460b43fab9955df2b3cfaa20e900e19c856238fd371899c2bf2ce8c868b76754e5db3b036533fd603746be13c10d4e3e6022ebc905d20c2a7f32b215a4cd53b3f44ca1c327d2c2b651145821c08396c89071f665349c25e44d2733cd9305985ceef6430c3cf57af5fa224089221218fa34737c79c446d28a94c41c96e4e92ac53fbcf384dea8419ea089f8784445a492c812eb0d409467f75afd7d4d1078886205a066
|
||||
+Output = "lorem ipsum dolor sit amet"
|
||||
+
|
||||
+# a random negative test case decrypting to empty
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 20aaa8adbbc593a924ba1c5c7990b5c2242ae4b99d0fe636a19a4cf754edbcee774e472fe028160ed42634f8864900cb514006da642cae6ae8c7d087caebcfa6dad1551301e130344989a1d462d4164505f6393933450c67bc6d39d8f5160907cabc251b737925a1cf21e5c6aa5781b7769f6a2a583d97cce008c0f8b6add5f0b2bd80bee60237aa39bb20719fe75749f4bc4e42466ef5a861ae3a92395c7d858d430bfe38040f445ea93fa2958b503539800ffa5ce5f8cf51fa8171a91f36cb4f4575e8de6b4d3f096ee140b938fd2f50ee13f0d050222e2a72b0a3069ff3a6738e82c87090caa5aed4fcbe882c49646aa250b98f12f83c8d528113614a29e7
|
||||
+Output =
|
||||
+
|
||||
+# invalid decrypting to max length message
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 48cceab10f39a4db32f60074feea473cbcdb7accf92e150417f76b44756b190e843e79ec12aa85083a21f5437e7bad0a60482e601198f9d86923239c8786ee728285afd0937f7dde12717f28389843d7375912b07b991f4fdb0190fced8ba665314367e8c5f9d2981d0f5128feeb46cb50fc237e64438a86df198dd0209364ae3a842d77532b66b7ef263b83b1541ed671b120dfd660462e2107a4ee7b964e734a7bd68d90dda61770658a3c242948532da32648687e0318286473f675b412d6468f013f14d760a358dfcad3cda2afeec5e268a37d250c37f722f468a70dfd92d7294c3c1ee1e7f8843b7d16f9f37ef35748c3ae93aa155cdcdfeb4e78567303
|
||||
+Output = 22d850137b9eebe092b24f602dc5bb7918c16bd89ddbf20467b119d205f9c2e4bd7d2592cf1e532106e0f33557565923c73a02d4f09c0c22bea89148183e60317f7028b3aa1f261f91c979393101d7e15f4067e63979b32751658ef769610fe97cf9cef3278b3117d384051c3b1d82c251c2305418c8f6840530e631aad63e70e20e025bcd8efb54c92ec6d3b106a2f8e64eeff7d38495b0fc50c97138af4b1c0a67a1c4e27b077b8439332edfa8608dfeae653cd6a628ac550395f7e74390e42c11682234870925eeaa1fa71b76cf1f2ee3bda69f6717033ff8b7c95c9799e7a3bea5e7e4a1c359772fb6b1c6e6c516661dfe30c3
|
||||
+
|
||||
+# invalid decrypting to message with length specified by second to last value from PRF
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 1439e08c3f84c1a7fec74ce07614b20e01f6fa4e8c2a6cffdc3520d8889e5d9a950c6425798f85d4be38d300ea5695f13ecd4cb389d1ff5b82484b494d6280ab7fa78e645933981cb934cce8bfcd114cc0e6811eefa47aae20af638a1cd163d2d3366186d0a07df0c81f6c9f3171cf3561472e98a6006bf75ddb457bed036dcce199369de7d94ef2c68e8467ee0604eea2b3009479162a7891ba5c40cab17f49e1c438cb6eaea4f76ce23cce0e483ff0e96fa790ea15be67671814342d0a23f4a20262b6182e72f3a67cd289711503c85516a9ed225422f98b116f1ab080a80abd6f0216df88d8cfd67c139243be8dd78502a7aaf6bc99d7da71bcdf627e7354
|
||||
+Output = 0f9b
|
||||
+
|
||||
+# invalid decrypting to message with length specified by third to last value from PRF
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 1690ebcceece2ce024f382e467cf8510e74514120937978576caf684d4a02ad569e8d76cbe365a060e00779de2f0865ccf0d923de3b4783a4e2c74f422e2f326086c390b658ba47f31ab013aa80f468c71256e5fa5679b24e83cd82c3d1e05e398208155de2212993cd2b8bab6987cf4cc1293f19909219439d74127545e9ed8a706961b8ee2119f6bfacafbef91b75a789ba65b8b833bc6149cf49b5c4d2c6359f62808659ba6541e1cd24bf7f7410486b5103f6c0ea29334ea6f4975b17387474fe920710ea61568d7b7c0a7916acf21665ad5a31c4eabcde44f8fb6120d8457afa1f3c85d517cda364af620113ae5a3c52a048821731922737307f77a1081
|
||||
+Output = 4f02
|
||||
+
|
||||
+# positive test with 11 byte long value
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 6213634593332c485cef783ea2846e3d6e8b0e005cd8293eaebbaa5079712fd681579bdfbbda138ae4d9d952917a03c92398ec0cb2bb0c6b5a8d55061fed0d0d8d72473563152648cfe640b335dc95331c21cb133a91790fa93ae44497c128708970d2beeb77e8721b061b1c44034143734a77be8220877415a6dba073c3871605380542a9f25252a4babe8331cdd53cf828423f3cc70b560624d0581fb126b2ed4f4ed358f0eb8065cf176399ac1a846a31055f9ae8c9c24a1ba050bc20842125bc1753158f8065f3adb9cc16bfdf83816bdf38b624f12022c5a6fbfe29bc91542be8c0208a770bcd677dc597f5557dc2ce28a11bf3e3857f158717a33f6592
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test with 11 byte long value and zero padded ciphertext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 00a2e8f114ea8d05d12dc843e3cc3b2edc8229ff2a028bda29ba9d55e3cd02911902fef1f42a075bf05e8016e8567213d6f260fa49e360779dd81aeea3e04c2cb567e0d72b98bf754014561b7511e083d20e0bfb9cd23f8a0d3c88900c49d2fcd5843ff0765607b2026f28202a87aa94678aed22a0c20724541394cd8f44e373eba1d2bae98f516c1e2ba3d86852d064f856b1daf24795e767a2b90396e50743e3150664afab131fe40ea405dcf572dd1079af1d3f0392ccadcca0a12740dbb213b925ca2a06b1bc1383e83a658c82ba2e7427342379084d5f66b544579f07664cb26edd4f10fd913fdbc0de05ef887d4d1ec1ac95652397ea7fd4e4759fda8b
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test with 11 byte long value and zero truncated ciphertext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = a2e8f114ea8d05d12dc843e3cc3b2edc8229ff2a028bda29ba9d55e3cd02911902fef1f42a075bf05e8016e8567213d6f260fa49e360779dd81aeea3e04c2cb567e0d72b98bf754014561b7511e083d20e0bfb9cd23f8a0d3c88900c49d2fcd5843ff0765607b2026f28202a87aa94678aed22a0c20724541394cd8f44e373eba1d2bae98f516c1e2ba3d86852d064f856b1daf24795e767a2b90396e50743e3150664afab131fe40ea405dcf572dd1079af1d3f0392ccadcca0a12740dbb213b925ca2a06b1bc1383e83a658c82ba2e7427342379084d5f66b544579f07664cb26edd4f10fd913fdbc0de05ef887d4d1ec1ac95652397ea7fd4e4759fda8b
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test with 11 byte long value and double zero padded ciphertext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 00001f71879b426127f7dead621f7380a7098cf7d22173aa27991b143c46d53383c209bd0c9c00d84078037e715f6b98c65005a77120070522ede51d472c87ef94b94ead4c5428ee108a345561658301911ec5a8f7dd43ed4a3957fd29fb02a3529bf63f8040d3953490939bd8f78b2a3404b6fb5ff70a4bfdaac5c541d6bcce49c9778cc390be24cbef1d1eca7e870457241d3ff72ca44f9f56bdf31a890fa5eb3a9107b603ccc9d06a5dd911a664c82b6abd4fe036f8db8d5a070c2d86386ae18d97adc1847640c211d91ff5c3387574a26f8ef27ca7f48d2dd1f0c7f14b81cc9d33ee6853031d3ecf10a914ffd90947909c8011fd30249219348ebff76bfc
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test with 11 byte long value and double zero truncated ciphertext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 1f71879b426127f7dead621f7380a7098cf7d22173aa27991b143c46d53383c209bd0c9c00d84078037e715f6b98c65005a77120070522ede51d472c87ef94b94ead4c5428ee108a345561658301911ec5a8f7dd43ed4a3957fd29fb02a3529bf63f8040d3953490939bd8f78b2a3404b6fb5ff70a4bfdaac5c541d6bcce49c9778cc390be24cbef1d1eca7e870457241d3ff72ca44f9f56bdf31a890fa5eb3a9107b603ccc9d06a5dd911a664c82b6abd4fe036f8db8d5a070c2d86386ae18d97adc1847640c211d91ff5c3387574a26f8ef27ca7f48d2dd1f0c7f14b81cc9d33ee6853031d3ecf10a914ffd90947909c8011fd30249219348ebff76bfc
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive that generates a 0 byte long synthethic message internally
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = b5e49308f6e9590014ffaffc5b8560755739dd501f1d4e9227a7d291408cf4b753f292322ff8bead613bf2caa181b221bc38caf6392deafb28eb21ad60930841ed02fd6225cc9c463409adbe7d8f32440212fbe3881c51375bb09565efb22e62b071472fb38676e5b4e23a0617db5d14d93519ac0007a30a9c822eb31c38b57fcb1be29608fcf1ca2abdcaf5d5752bbc2b5ac7dba5afcff4a5641da360dd01f7112539b1ed46cdb550a3b1006559b9fe1891030ec80f0727c42401ddd6cbb5e3c80f312df6ec89394c5a7118f573105e7ab00fe57833c126141b50a935224842addfb479f75160659ba28877b512bb9a93084ad8bec540f92640f63a11a010e0
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive that generates a 245 byte long synthethic message internally
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 1ea0b50ca65203d0a09280d39704b24fe6e47800189db5033f202761a78bafb270c5e25abd1f7ecc6e7abc4f26d1b0cd9b8c648d529416ee64ccbdd7aa72a771d0353262b543f0e436076f40a1095f5c7dfd10dcf0059ccb30e92dfa5e0156618215f1c3ff3aa997a9d999e506924f5289e3ac72e5e2086cc7b499d71583ed561028671155db4005bee01800a7cdbdae781dd32199b8914b5d4011dd6ff11cd26d46aad54934d293b0bc403dd211bf13b5a5c6836a5e769930f437ffd8634fb7371776f4bc88fa6c271d8aa6013df89ae6470154497c4ac861be2a1c65ebffec139bf7aaba3a81c7c5cdd84da9af5d3edfb957848074686b5837ecbcb6a41c50
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# a random negative test that generates an 11 byte long message
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 5f02f4b1f46935c742ebe62b6f05aa0a3286aab91a49b34780adde6410ab46f7386e05748331864ac98e1da63686e4babe3a19ed40a7f5ceefb89179596aab07ab1015e03b8f825084dab028b6731288f2e511a4b314b6ea3997d2e8fe2825cef8897cbbdfb6c939d441d6e04948414bb69e682927ef8576c9a7090d4aad0e74c520d6d5ce63a154720f00b76de8cc550b1aa14f016d63a7b6d6eaa1f7dbe9e50200d3159b3d099c900116bf4eba3b94204f18b1317b07529751abf64a26b0a0bf1c8ce757333b3d673211b67cc0653f2fe2620d57c8b6ee574a0323a167eab1106d9bc7fd90d415be5f1e9891a0e6c709f4fc0404e8226f8477b4e939b36eb2
|
||||
+Output = af9ac70191c92413cb9f2d
|
||||
+
|
||||
+# an otherwise correct plaintext, but with wrong first byte
|
||||
+# (0x01 instead of 0x00), generates a random 11 byte long plaintext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 9b2ec9c0c917c98f1ad3d0119aec6be51ae3106e9af1914d48600ab6a2c0c0c8ae02a2dc3039906ff3aac904af32ec798fd65f3ad1afa2e69400e7c1de81f5728f3b3291f38263bc7a90a0563e43ce7a0d4ee9c0d8a716621ca5d3d081188769ce1b131af7d35b13dea99153579c86db31fe07d5a2c14d621b77854e48a8df41b5798563af489a291e417b6a334c63222627376118c02c53b6e86310f728734ffc86ef9d7c8bf56c0c841b24b82b59f51aee4526ba1c4268506d301e4ebc498c6aebb6fd5258c876bf900bac8ca4d309dd522f6a6343599a8bc3760f422c10c72d0ad527ce4af1874124ace3d99bb74db8d69d2528db22c3a37644640f95c05f
|
||||
+Output = a1f8c9255c35cfba403ccc
|
||||
+
|
||||
+# an otherwise correct plaintext, but with wrong second byte
|
||||
+# (0x01 instead of 0x02), generates a random 11 byte long plaintext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 782c2b59a21a511243820acedd567c136f6d3090c115232a82a5efb0b178285f55b5ec2d2bac96bf00d6592ea7cdc3341610c8fb07e527e5e2d20cfaf2c7f23e375431f45e998929a02f25fd95354c33838090bca838502259e92d86d568bc2cdb132fab2a399593ca60a015dc2bb1afcd64fef8a3834e17e5358d822980dc446e845b3ab4702b1ee41fe5db716d92348d5091c15d35a110555a35deb4650a5a1d2c98025d42d4544f8b32aa6a5e02dc02deaed9a7313b73b49b0d4772a3768b0ea0db5846ace6569cae677bf67fb0acf3c255dc01ec8400c963b6e49b1067728b4e563d7e1e1515664347b92ee64db7efb5452357a02fff7fcb7437abc2e579
|
||||
+Output = e6d700309ca0ed62452254
|
||||
+
|
||||
+# an invalid ciphertext, with a zero byte in first byte of
|
||||
+# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
+# plaintext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 0096136621faf36d5290b16bd26295de27f895d1faa51c800dafce73d001d60796cd4e2ac3fa2162131d859cd9da5a0c8a42281d9a63e5f353971b72e36b5722e4ac444d77f892a5443deb3dca49fa732fe855727196e23c26eeac55eeced8267a209ebc0f92f4656d64a6c13f7f7ce544ebeb0f668fe3a6c0f189e4bcd5ea12b73cf63e0c8350ee130dd62f01e5c97a1e13f52fde96a9a1bc9936ce734fdd61f27b18216f1d6de87f49cf4f2ea821fb8efd1f92cdad529baf7e31aff9bff4074f2cad2b4243dd15a711adcf7de900851fbd6bcb53dac399d7c880531d06f25f7002e1aaf1722765865d2c2b902c7736acd27bc6cbd3e38b560e2eecf7d4b576
|
||||
+Output = ba27b1842e7c21c0e7ef6a
|
||||
+
|
||||
+# an invalid ciphertext, with a zero byte removed from first byte of
|
||||
+# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
+# plaintext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 96136621faf36d5290b16bd26295de27f895d1faa51c800dafce73d001d60796cd4e2ac3fa2162131d859cd9da5a0c8a42281d9a63e5f353971b72e36b5722e4ac444d77f892a5443deb3dca49fa732fe855727196e23c26eeac55eeced8267a209ebc0f92f4656d64a6c13f7f7ce544ebeb0f668fe3a6c0f189e4bcd5ea12b73cf63e0c8350ee130dd62f01e5c97a1e13f52fde96a9a1bc9936ce734fdd61f27b18216f1d6de87f49cf4f2ea821fb8efd1f92cdad529baf7e31aff9bff4074f2cad2b4243dd15a711adcf7de900851fbd6bcb53dac399d7c880531d06f25f7002e1aaf1722765865d2c2b902c7736acd27bc6cbd3e38b560e2eecf7d4b576
|
||||
+Output = ba27b1842e7c21c0e7ef6a
|
||||
+
|
||||
+# an invalid ciphertext, with two zero bytes in first bytes of
|
||||
+# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
+# plaintext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 0000587cccc6b264bdfe0dc2149a988047fa921801f3502ea64624c510c6033d2f427e3f136c26e88ea9f6519e86a542cec96aad1e5e9013c3cc203b6de15a69183050813af5c9ad79703136d4b92f50ce171eefc6aa7988ecf02f319ffc5eafd6ee7a137f8fce64b255bb1b8dd19cfe767d64fdb468b9b2e9e7a0c24dae03239c8c714d3f40b7ee9c4e59ac15b17e4d328f1100756bce17133e8e7493b54e5006c3cbcdacd134130c5132a1edebdbd01a0c41452d16ed7a0788003c34730d0808e7e14c797a21f2b45a8aa1644357fd5e988f99b017d9df37563a354c788dc0e2f9466045622fa3f3e17db63414d27761f57392623a2bef6467501c63e8d645
|
||||
+Output = d5cf555b1d6151029a429a
|
||||
+
|
||||
+# an invalid ciphertext, with two zero bytes removed from first bytes of
|
||||
+# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
+# plaintext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 587cccc6b264bdfe0dc2149a988047fa921801f3502ea64624c510c6033d2f427e3f136c26e88ea9f6519e86a542cec96aad1e5e9013c3cc203b6de15a69183050813af5c9ad79703136d4b92f50ce171eefc6aa7988ecf02f319ffc5eafd6ee7a137f8fce64b255bb1b8dd19cfe767d64fdb468b9b2e9e7a0c24dae03239c8c714d3f40b7ee9c4e59ac15b17e4d328f1100756bce17133e8e7493b54e5006c3cbcdacd134130c5132a1edebdbd01a0c41452d16ed7a0788003c34730d0808e7e14c797a21f2b45a8aa1644357fd5e988f99b017d9df37563a354c788dc0e2f9466045622fa3f3e17db63414d27761f57392623a2bef6467501c63e8d645
|
||||
+Output = d5cf555b1d6151029a429a
|
||||
+
|
||||
+# and invalid ciphertext, otherwise valid but starting with 000002, decrypts
|
||||
+# to random 11 byte long synthethic plaintext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 1786550ce8d8433052e01ecba8b76d3019f1355b212ac9d0f5191b023325a7e7714b7802f8e9a17c4cb3cd3a84041891471b10ca1fcfb5d041d34c82e6d0011cf4dc76b90e9c2e0743590579d55bcd7857057152c4a8040361343d1d22ba677d62b011407c652e234b1d663af25e2386251d7409190f19fc8ec3f9374fdf1254633874ce2ec2bff40ad0cb473f9761ec7b68da45a4bd5e33f5d7dac9b9a20821df9406b653f78a95a6c0ea0a4d57f867e4db22c17bf9a12c150f809a7b72b6db86c22a8732241ebf3c6a4f2cf82671d917aba8bc61052b40ccddd743a94ea9b538175106201971cca9d136d25081739aaf6cd18b2aecf9ad320ea3f89502f955
|
||||
+Output = 3d4a054d9358209e9cbbb9
|
||||
+
|
||||
+# negative test with otherwise valid padding but a zero byte in first byte
|
||||
+# of padding
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 179598823812d2c58a7eb50521150a48bcca8b4eb53414018b6bca19f4801456c5e36a940037ac516b0d6412ba44ec6b4f268a55ef1c5ffbf18a2f4e3522bb7b6ed89774b79bffa22f7d3102165565642de0d43a955e96a1f2e80e5430671d7266eb4f905dc8ff5e106dc5588e5b0289e49a4913940e392a97062616d2bda38155471b7d360cfb94681c702f60ed2d4de614ea72bf1c53160e63179f6c5b897b59492bee219108309f0b7b8cb2b136c346a5e98b8b4b8415fb1d713bae067911e3057f1c335b4b7e39101eafd5d28f0189037e4334f4fdb9038427b1d119a6702aa8233319cc97d496cc289ae8c956ddc84042659a2d43d6aa22f12b81ab884e
|
||||
+Output = 1f037dd717b07d3e7f7359
|
||||
+
|
||||
+# negative test with otherwise valid padding but a zero byte at the eigth
|
||||
+# byte of padding
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = a7a340675a82c30e22219a55bc07cdf36d47d01834c1834f917f18b517419ce9de2a96460e745024436470ed85e94297b283537d52189c406a3f533cb405cc6a9dba46b482ce98b6e3dd52d8fce2237425617e38c11fbc46b61897ef200d01e4f25f5f6c4c5b38cd0de38ba11908b86595a8036a08a42a3d05b79600a97ac18ba368a08d6cf6ccb624f6e8002afc75599fba4de3d4f3ba7d208391ebe8d21f8282b18e2c10869eb2702e68f9176b42b0ddc9d763f0c86ba0ff92c957aaeab76d9ab8da52ea297ec11d92d770146faa1b300e0f91ef969b53e7d2907ffc984e9a9c9d11fb7d6cba91972059b46506b035efec6575c46d7114a6b935864858445f
|
||||
+Output = 63cb0bf65fc8255dd29e17
|
||||
+
|
||||
+# negative test with an otherwise valid plaintext but with missing separator
|
||||
+# byte
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 3d1b97e7aa34eaf1f4fc171ceb11dcfffd9a46a5b6961205b10b302818c1fcc9f4ec78bf18ea0cee7e9fa5b16fb4c611463b368b3312ac11cf9c06b7cf72b54e284848a508d3f02328c62c2999d0fb60929f81783c7a256891bc2ff4d91df2af96a24fc5701a1823af939ce6dbdc510608e3d41eec172ad2d51b9fc61b4217c923cadcf5bac321355ef8be5e5f090cdc2bd0c697d9058247db3ad613fdce87d2955a6d1c948a5160f93da21f731d74137f5d1f53a1923adb513d2e6e1589d44cc079f4c6ddd471d38ac82d20d8b1d21f8d65f3b6907086809f4123e08d86fb38729585de026a485d8f0e703fd4772f6668febf67df947b82195fa3867e3a3065
|
||||
+Output = 6f09a0b62699337c497b0b
|
||||
+
|
||||
+# Test vectors for the Bleichenbacher workaround (2049 bit key size)
|
||||
+
|
||||
+PrivateKey = RSA-2049
|
||||
+-----BEGIN RSA PRIVATE KEY-----
|
||||
+MIIEpQIBAAKCAQEBVfiJVWoXdfHHp3hqULGLwoyemG7eVmfKs5uEEk6Q66dcHbCD
|
||||
+rD5EO7qU3CNWD3XjqBaToqQ73HQm2MTq/mjIXeD+dX9uSbue1EfmAkMIANuwTOsi
|
||||
+5/pXoY0zj7ZgJs20Z+cMwEDn02fvQDx78ePfYkZQCUYx8h6v0vtbyRX/BDeazRES
|
||||
+9zLAtGYHwXjTiiD1LtpQny+cBAXVEGnoDM+UFVTQRwRnUFw89UHqCJffyfQAzssp
|
||||
+j/x1M3LZ9pM68XTMQO2W1GcDFzO5f4zd0/krw6A+qFdsQX8kAHteT3UBEFtUTen6
|
||||
+3N/635jftLsFuBmfP4Ws/ZH3qaCUuaOD9QSQlwIDAQABAoIBAQEZwrP1CnrWFSZ5
|
||||
+1/9RCVisLYym8AKFkvMy1VoWc2F4qOZ/F+cFzjAOPodUclEAYBP5dNCj20nvNEyl
|
||||
+omo0wEUHBNDkIuDOI6aUJcFf77bybhBu7/ZMyLnXRC5NpOjIUAjq6zZYWaIpT6OT
|
||||
+e8Jr5WMy59geLBYO9jXMUoqnvlXmM6cj28Hha6KeUrKa7y+eVlT9wGZrsPwlSsvo
|
||||
+DmOHTw9fAgeC48nc/CUg0MnEp7Y05FA/u0k+Gq/us/iL16EzmHJdrm/jmed1zV1M
|
||||
+8J/IODR8TJjasaSIPM5iBRNhWvqhCmM2jm17ed9BZqsWJznvUVpEAu4eBgHFpVvH
|
||||
+HfDjDt+BAoGBAYj2k2DwHhjZot4pUlPSUsMeRHbOpf97+EE99/3jVlI83JdoBfhP
|
||||
+wN3sdw3wbO0GXIETSHVLNGrxaXVod/07PVaGgsh4fQsxTvasZ9ZegTM5i2Kgg8D4
|
||||
+dlxa1A1agfm73OJSftfpUAjLECnLTKvR+em+38KGyWVSJV2n6rGSF473AoGBAN7H
|
||||
+zxHa3oOkxD0vgBl/If1dRv1XtDH0T+gaHeN/agkf/ARk7ZcdyFCINa3mzF9Wbzll
|
||||
+YTqLNnmMkubiP1LvkH6VZ+NBvrxTNxiWJfu+qx87ez+S/7JoHm71p4SowtePfC2J
|
||||
+qqok0s7b0GaBz+ZcNse/o8W6E1FiIi71wukUyYNhAoGAEgk/OnPK7dkPYKME5FQC
|
||||
++HGrMsjJVbCa9GOjvkNw8tVYSpq7q2n9sDHqRPmEBl0EYehAqyGIhmAONxVUbIsL
|
||||
+ha0m04y0MI9S0H+ZRH2R8IfzndNAONsuk46XrQU6cfvtZ3Xh3IcY5U5sr35lRn2c
|
||||
+ut3H52XIWJ4smN/cJcpOyoECgYEAjM5hNHnPlgj392wkXPkbtJXWHp3mSISQVLTd
|
||||
+G0MW8/mBQg3AlXi/eRb+RpHPrppk5jQLhgMjRSPyXXe2amb8PuWTqfGN6l32PtX3
|
||||
+3+udILpppb71Wf+w7JTbcl9v9uq7o9SVR8DKdPA+AeweSQ0TmqCnlHuNZizOSjwP
|
||||
+G16GF0ECgYEA+ZWbNMS8qM5IiHgbMbHptdit9dDT4+1UXoNn0/hUW6ZEMriHMDXv
|
||||
+iBwrzeANGAn5LEDYeDe1xPms9Is2uNxTpZVhpFZSNALR6Po68wDlTJG2PmzuBv5t
|
||||
+5mbzkpWCoD4fRU53ifsHgaTW+7Um74gWIf0erNIUZuTN2YrtEPTnb3k=
|
||||
+-----END RSA PRIVATE KEY-----
|
||||
+
|
||||
+# corresponding public key
|
||||
+PublicKey = RSA-2049-PUBLIC
|
||||
+-----BEGIN PUBLIC KEY-----
|
||||
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEBVfiJVWoXdfHHp3hqULGL
|
||||
+woyemG7eVmfKs5uEEk6Q66dcHbCDrD5EO7qU3CNWD3XjqBaToqQ73HQm2MTq/mjI
|
||||
+XeD+dX9uSbue1EfmAkMIANuwTOsi5/pXoY0zj7ZgJs20Z+cMwEDn02fvQDx78ePf
|
||||
+YkZQCUYx8h6v0vtbyRX/BDeazRES9zLAtGYHwXjTiiD1LtpQny+cBAXVEGnoDM+U
|
||||
+FVTQRwRnUFw89UHqCJffyfQAzsspj/x1M3LZ9pM68XTMQO2W1GcDFzO5f4zd0/kr
|
||||
+w6A+qFdsQX8kAHteT3UBEFtUTen63N/635jftLsFuBmfP4Ws/ZH3qaCUuaOD9QSQ
|
||||
+lwIDAQAB
|
||||
+-----END PUBLIC KEY-----
|
||||
+
|
||||
+PrivPubKeyPair = RSA-2049:RSA-2049-PUBLIC
|
||||
+
|
||||
+# RSA decrypt
|
||||
+
|
||||
+# malformed that generates length specified by 3rd last value from PRF
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 00b26f6404b82649629f2704494282443776929122e279a9cf30b0c6fe8122a0a9042870d97cc8ef65490fe58f031eb2442352191f5fbc311026b5147d32df914599f38b825ebb824af0d63f2d541a245c5775d1c4b78630e4996cc5fe413d38455a776cf4edcc0aa7fccb31c584d60502ed2b77398f536e137ff7ba6430e9258e21c2db5b82f5380f566876110ac4c759178900fbad7ab70ea07b1daf7a1639cbb4196543a6cbe8271f35dddb8120304f6eef83059e1c5c5678710f904a6d760c4d1d8ad076be17904b9e69910040b47914a0176fb7eea0c06444a6c4b86d674d19a556a1de5490373cb01ce31bbd15a5633362d3d2cd7d4af1b4c5121288b894
|
||||
+Output = 42
|
||||
+
|
||||
+# simple positive test case
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 013300edbf0bb3571e59889f7ed76970bf6d57e1c89bbb6d1c3991d9df8e65ed54b556d928da7d768facb395bbcc81e9f8573b45cf8195dbd85d83a59281cddf4163aec11b53b4140053e3bd109f787a7c3cec31d535af1f50e0598d85d96d91ea01913d07097d25af99c67464ebf2bb396fb28a9233e56f31f7e105d71a23e9ef3b736d1e80e713d1691713df97334779552fc94b40dd733c7251bc522b673d3ec9354af3dd4ad44fa71c0662213a57ada1d75149697d0eb55c053aaed5ffd0b815832f454179519d3736fb4faf808416071db0d0f801aca8548311ee708c131f4be658b15f6b54256872c2903ac708bd43b017b073b5707bc84c2cd9da70e967
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test case with null padded ciphertext
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 0002aadf846a329fadc6760980303dbd87bfadfa78c2015ce4d6c5782fd9d3f1078bd3c0a2c5bfbdd1c024552e5054d98b5bcdc94e476dd280e64d650089326542ce7c61d4f1ab40004c2e6a88a883613568556a10f3f9edeab67ae8dddc1e6b0831c2793d2715de943f7ce34c5c05d1b09f14431fde566d17e76c9feee90d86a2c158616ec81dda0c642f58c0ba8fa4495843124a7235d46fb4069715a51bf710fd024259131ba94da73597ace494856c94e7a3ec261545793b0990279b15fa91c7fd13dbfb1df2f221dab9fa9f7c1d21e48aa49f6aaecbabf5ee76dc6c2af2317ffb4e303115386a97f8729afc3d0c89419669235f1a3a69570e0836c79fc162
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test case with null truncated ciphertext
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 02aadf846a329fadc6760980303dbd87bfadfa78c2015ce4d6c5782fd9d3f1078bd3c0a2c5bfbdd1c024552e5054d98b5bcdc94e476dd280e64d650089326542ce7c61d4f1ab40004c2e6a88a883613568556a10f3f9edeab67ae8dddc1e6b0831c2793d2715de943f7ce34c5c05d1b09f14431fde566d17e76c9feee90d86a2c158616ec81dda0c642f58c0ba8fa4495843124a7235d46fb4069715a51bf710fd024259131ba94da73597ace494856c94e7a3ec261545793b0990279b15fa91c7fd13dbfb1df2f221dab9fa9f7c1d21e48aa49f6aaecbabf5ee76dc6c2af2317ffb4e303115386a97f8729afc3d0c89419669235f1a3a69570e0836c79fc162
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test case with double null padded ciphertext
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 0000f36da3b72d8ff6ded74e7efd08c01908f3f5f0de7b55eab92b5f875190809c39d4162e1e6649618f854fd84aeab03970d16bb814e999852c06de38d82b95c0f32e2a7b5714021fe303389be9c0eac24c90a6b7210f929d390fabf903d44e04110bb7a7fd6c383c275804721efa6d7c93aa64c0bb2b18d97c5220a846c66a4895ae52adddbe2a9996825e013585adcec4b32ba61d782737bd343e5fabd68e8a95b8b1340318559860792dd70dffbe05a1052b54cbfb48cfa7bb3c19cea52076bddac5c25ee276f153a610f6d06ed696d192d8ae4507ffae4e5bdda10a625d6b67f32f7cffcd48dee2431fe66f6105f9d17e611cdcc674868e81692a360f4052
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test case with double null truncated ciphertext
|
||||
+Decrypt = RSA-2049
|
||||
+Input = f36da3b72d8ff6ded74e7efd08c01908f3f5f0de7b55eab92b5f875190809c39d4162e1e6649618f854fd84aeab03970d16bb814e999852c06de38d82b95c0f32e2a7b5714021fe303389be9c0eac24c90a6b7210f929d390fabf903d44e04110bb7a7fd6c383c275804721efa6d7c93aa64c0bb2b18d97c5220a846c66a4895ae52adddbe2a9996825e013585adcec4b32ba61d782737bd343e5fabd68e8a95b8b1340318559860792dd70dffbe05a1052b54cbfb48cfa7bb3c19cea52076bddac5c25ee276f153a610f6d06ed696d192d8ae4507ffae4e5bdda10a625d6b67f32f7cffcd48dee2431fe66f6105f9d17e611cdcc674868e81692a360f4052
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# a random negative test case that generates an 11 byte long message
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 00f910200830fc8fff478e99e145f1474b312e2512d0f90b8cef77f8001d09861688c156d1cbaf8a8957f7ebf35f724466952d0524cad48aad4fba1e45ce8ea27e8f3ba44131b7831b62d60c0762661f4c1d1a88cd06263a259abf1ba9e6b0b172069afb86a7e88387726f8ab3adb30bfd6b3f6be6d85d5dfd044e7ef052395474a9cbb1c3667a92780b43a22693015af6c513041bdaf87d43b24ddd244e791eeaea1066e1f4917117b3a468e22e0f7358852bb981248de4d720add2d15dccba6280355935b67c96f9dcb6c419cc38ab9f6fba2d649ef2066e0c34c9f788ae49babd9025fa85b21113e56ce4f43aa134c512b030dd7ac7ce82e76f0be9ce09ebca
|
||||
+Output = 1189b6f5498fd6df532b00
|
||||
+
|
||||
+# otherwise correct plaintext, but with wrong first byte (0x01 instead of 0x00)
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 002c9ddc36ba4cf0038692b2d3a1c61a4bb3786a97ce2e46a3ba74d03158aeef456ce0f4db04dda3fe062268a1711250a18c69778a6280d88e133a16254e1f0e30ce8dac9b57d2e39a2f7d7be3ee4e08aec2fdbe8dadad7fdbf442a29a8fb40857407bf6be35596b8eefb5c2b3f58b894452c2dc54a6123a1a38d642e23751746597e08d71ac92704adc17803b19e131b4d1927881f43b0200e6f95658f559f912c889b4cd51862784364896cd6e8618f485a992f82997ad6a0917e32ae5872eaf850092b2d6c782ad35f487b79682333c1750c685d7d32ab3e1538f31dcaa5e7d5d2825875242c83947308dcf63ba4bfff20334c9c140c837dbdbae7a8dee72ff
|
||||
+Output = f6d0f5b78082fe61c04674
|
||||
+
|
||||
+# otherwise correct plaintext, but with wrong second byte (0x01 instead of 0x02)
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 00c5d77826c1ab7a34d6390f9d342d5dbe848942e2618287952ba0350d7de6726112e9cebc391a0fae1839e2bf168229e3e0d71d4161801509f1f28f6e1487ca52df05c466b6b0a6fbbe57a3268a970610ec0beac39ec0fa67babce1ef2a86bf77466dc127d7d0d2962c20e66593126f276863cd38dc6351428f884c1384f67cad0a0ffdbc2af16711fb68dc559b96b37b4f04cd133ffc7d79c43c42ca4948fa895b9daeb853150c8a5169849b730cc77d68b0217d6c0e3dbf38d751a1998186633418367e7576530566c23d6d4e0da9b038d0bb5169ce40133ea076472d055001f0135645940fd08ea44269af2604c8b1ba225053d6db9ab43577689401bdc0f3
|
||||
+Output = 1ab287fcef3ff17067914d
|
||||
+
|
||||
+# RSA decrypt with 3072 bit keys
|
||||
+PrivateKey = RSA-3072
|
||||
+-----BEGIN RSA PRIVATE KEY-----
|
||||
+MIIG5AIBAAKCAYEAr9ccqtXp9bjGw2cHCkfxnX5mrt4YpbJ0H7PE0zQ0VgaSotkJ
|
||||
+72iI7GAv9rk68ljudDA8MBr81O2+xDMR3cjdvwDdu+OG0zuNDiKxtEk23EiYcbhS
|
||||
+N7NM50etj9sMTk0dqnqt8HOFxchzLMt9Wkni5QyIPH16wQ7Wp02ayQ35EpkFoX1K
|
||||
+CHIQ/Hi20EseuWlILBGm7recUOWxbz8lT3VxUosvFxargW1uygcnveqYBZMpcw64
|
||||
+wzznHWHdSsOTtiVuB6wdEk8CANHD4FpMG8fx7S/IPlcZnP5ZCLEAh+J/vZfSwkIU
|
||||
+YZxxR8j778o5vCVnYqaCNTH34jTWjq56DZ+vEN0V6VI3gMfVrlgJStUlqQY7TDP5
|
||||
+XhAG2i6xLTdDaJSVwfICPkBzU8XrPkyhxIz/gaEJANFIIOuAGvTxpZbEuc6aUx/P
|
||||
+ilTZ/9ckJYtu7CAQjfb9/XbUrgO6fqWY3LDkooCElYcob01/JWzoXl61Z5sdrMH5
|
||||
+CVZJty5foHKusAN5AgMBAAECggGAJRfqyzr+9L/65gOY35lXpdKhVKgzaNjhWEKy
|
||||
+9Z7gn3kZe9LvHprdr4eG9rQSdEdAXjBCsh8vULeqc3cWgMO7y2wiWl1f9rVsRxwY
|
||||
+gqCjOwrxZaPtbCSdx3g+a8dYrDfmVy0z/jJQeO2VJlDy65YEkC75mlEaERnRPE/J
|
||||
+pDoXXc37+xoUAP4XCTtpzTzbiV9lQy6iGV+QURxzNrWKaF2s/y2vTF6S5WWxZlrm
|
||||
+DlErqplluAjV/xGc63zWksv5IAZ6+s2An2a+cG2iaBCseQ2xVslI5v5YG8mEkVf0
|
||||
+2kk/OmSwxuEZ4DGxB/hDbOKRYLRYuPnxCV/esZJjOE/1OHVXvE8QtANN6EFwO60s
|
||||
+HnacI4U+tjCjbRBh3UbipruvdDqX8LMsNvUMGjci3vOjlNkcLgeL8J15Xs3l5WuC
|
||||
+Avl0Am91/FbpoN1qiPLny3jvEpjMbGUgfKRb03GIgHtPzbHmDdjluFZI+376i2/d
|
||||
+RI85dBqNmAn+Fjrz3kW6wkpahByBAoHBAOSj2DDXPosxxoLidP/J/RKsMT0t0FE9
|
||||
+UFcNt+tHYv6hk+e7VAuUqUpd3XQqz3P13rnK4xvSOsVguyeU/WgmH4ID9XGSgpBP
|
||||
+Rh6s7izn4KAJeqfI26vTPxvyaZEqB4JxT6k7SerENus95zSn1v/f2MLBQ16EP8cJ
|
||||
++QSOVCoZfEhUK+srherQ9eZKpj0OwBUrP4VhLdymv96r8xddWX1AVj4OBi2RywKI
|
||||
+gAgv6fjwkb292jFu6x6FjKRNKwKK6c3jqQKBwQDE4c0Oz0KYYV4feJun3iL9UJSv
|
||||
+StGsKVDuljA4WiBAmigMZTii/u0DFEjibiLWcJOnH53HTr0avA6c6D1nCwJ2qxyF
|
||||
+rHNN2L+cdMx/7L1zLR11+InvRgpIGbpeGwHeIzJVUYG3b6llRJMZimBvAMr9ipM1
|
||||
+bkVvIjt1G9W1ypeuKzm6d/t8F0yC7AIYZWDV4nvxiiY8whLZzGawHR2iZz8pfUwb
|
||||
+7URbTvxdsGE27Kq9gstU0PzEJpnU1goCJ7/gA1ECgcBA8w5B6ZM5xV0H5z6nPwDm
|
||||
+IgYmw/HucgV1hU8exfuoK8wxQvTACW4B0yJKkrK11T1899aGG7VYRn9D4j4OLO48
|
||||
+Z9V8esseJXbc1fEezovvymGOci984xiFXtqAQzk44+lmQJJh33VeZApe2eLocvVH
|
||||
+ddEmc1kOuJWFpszf3LeCcG69cnKrXsrLrZ8Frz//g3aa9B0sFi5hGeWHWJxISVN2
|
||||
+c1Nr9IN/57i/GqVTcztjdCAcdM7Tr8phDg7OvRlnxGkCgcEAuYhMFBuulyiSaTff
|
||||
+/3ZvJKYOJ45rPkEFGoD/2ercn+RlvyCYGcoAEjnIYVEGlWwrSH+b0NlbjVkQsD6O
|
||||
+to8CeE/RpgqX8hFCqC7NE/RFp8cpDyXy3j/zqnRMUyhCP1KNuScBBZs9V8gikxv6
|
||||
+ukBWCk3PYbeTySHKRBbB8vmCrMfhM96jaBIQsQO1CcZnVceDo1/bnsAIwaREVMxr
|
||||
+Q8LmG7QOx/Z0x1MMsUFoqzilwccC09/JgxMZPh+h+Nv6jiCxAoHBAOEqQgFAfSdR
|
||||
+ya60LLH55q803NRFMamuKiPbVJLzwiKfbjOiiopmQOS/LxxqIzeMXlYV4OsSvxTo
|
||||
+G7mcTOFRtU5hKCK+t8qeQQpa/dsMpiHllwArnRyBjIVgL5lFKRpHUGLsavU/T1IH
|
||||
+mtgaxZo32dXvcAh1+ndCHVBwbHTOF4conA+g+Usp4bZSSWn5nU4oIizvSVpG7SGe
|
||||
+0GngdxH9Usdqbvzcip1EKeHRTZrHIEYmB+x0LaRIB3dwZNidK3TkKw==
|
||||
+-----END RSA PRIVATE KEY-----
|
||||
+
|
||||
+PublicKey = RSA-3072-PUBLIC
|
||||
+-----BEGIN PUBLIC KEY-----
|
||||
+MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAr9ccqtXp9bjGw2cHCkfx
|
||||
+nX5mrt4YpbJ0H7PE0zQ0VgaSotkJ72iI7GAv9rk68ljudDA8MBr81O2+xDMR3cjd
|
||||
+vwDdu+OG0zuNDiKxtEk23EiYcbhSN7NM50etj9sMTk0dqnqt8HOFxchzLMt9Wkni
|
||||
+5QyIPH16wQ7Wp02ayQ35EpkFoX1KCHIQ/Hi20EseuWlILBGm7recUOWxbz8lT3Vx
|
||||
+UosvFxargW1uygcnveqYBZMpcw64wzznHWHdSsOTtiVuB6wdEk8CANHD4FpMG8fx
|
||||
+7S/IPlcZnP5ZCLEAh+J/vZfSwkIUYZxxR8j778o5vCVnYqaCNTH34jTWjq56DZ+v
|
||||
+EN0V6VI3gMfVrlgJStUlqQY7TDP5XhAG2i6xLTdDaJSVwfICPkBzU8XrPkyhxIz/
|
||||
+gaEJANFIIOuAGvTxpZbEuc6aUx/PilTZ/9ckJYtu7CAQjfb9/XbUrgO6fqWY3LDk
|
||||
+ooCElYcob01/JWzoXl61Z5sdrMH5CVZJty5foHKusAN5AgMBAAE=
|
||||
+-----END PUBLIC KEY-----
|
||||
+
|
||||
+PrivPubKeyPair = RSA-3072:RSA-3072-PUBLIC
|
||||
+
|
||||
+# a random invalid ciphertext that generates an empty synthethic one
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 5e956cd9652f4a2ece902931013e09662b6a9257ad1e987fb75f73a0606df2a4b04789770820c2e02322c4e826f767bd895734a01e20609c3be4517a7a2a589ea1cdc137beb73eb38dac781b52e863de9620f79f9b90fd5b953651fcbfef4a9f1cc07421d511a87dd6942caab6a5a0f4df473e62defb529a7de1509ab99c596e1dff1320402298d8be73a896cc86c38ae3f2f576e9ea70cc28ad575cb0f854f0be43186baa9c18e29c47c6ca77135db79c811231b7c1730955887d321fdc06568382b86643cf089b10e35ab23e827d2e5aa7b4e99ff2e914f302351819eb4d1693243b35f8bf1d42d08f8ec4acafa35f747a4a975a28643ec630d8e4fa5be59d81995660a14bb64c1fea5146d6b11f92da6a3956dd5cb5e0d747cf2ea23f81617769185336263d46ef4c144b754de62a6337342d6c85a95f19f015724546ee3fc4823eca603dbc1dc01c2d5ed50bd72d8e96df2dc048edde0081284068283fc5e73a6139851abf2f29977d0b3d160c883a42a37efba1be05c1a0b1741d7ddf59
|
||||
+Output =
|
||||
+
|
||||
+# a random invalid that has PRF output with a length one byte too long
|
||||
+# in the last value
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 7db0390d75fcf9d4c59cf27b264190d856da9abd11e92334d0e5f71005cfed865a711dfa28b791188374b61916dbc11339bf14b06f5f3f68c206c5607380e13da3129bfb744157e1527dd6fdf6651248b028a496ae1b97702d44706043cdaa7a59c0f41367303f21f268968bf3bd2904db3ae5239b55f8b438d93d7db9d1666c071c0857e2ec37757463769c54e51f052b2a71b04c2869e9e7049a1037b8429206c99726f07289bac18363e7eb2a5b417f47c37a55090cda676517b3549c873f2fe95da9681752ec9864b069089a2ed2f340c8b04ee00079055a817a3355b46ac7dc00d17f4504ccfbcfcadb0c04cb6b22069e179385ae1eafabad5521bac2b8a8ee1dfff59a22eb3fdacfc87175d10d7894cfd869d056057dd9944b869c1784fcc27f731bc46171d39570fbffbadf082d33f6352ecf44aca8d9478e53f5a5b7c852b401e8f5f74da49da91e65bdc97765a9523b7a0885a6f8afe5759d58009fbfa837472a968e6ae92026a5e0202a395483095302d6c3985b5f5831c521a271
|
||||
+Output = 56a3bea054e01338be9b7d7957539c
|
||||
+
|
||||
+# a random invalid that generates a synthethic of maximum size
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 1715065322522dff85049800f6a29ab5f98c465020467414b2a44127fe9446da47fa18047900f99afe67c2df6f50160bb8e90bff296610fde632b3859d4d0d2e644f23835028c46cca01b84b88231d7e03154edec6627bcba23de76740d839851fa12d74c8f92e540c73fe837b91b7d699b311997d5f0f7864c486d499c3a79c111faaacbe4799597a25066c6200215c3d158f3817c1aa57f18bdaad0be1658da9da93f5cc6c3c4dd72788af57adbb6a0c26f42d32d95b8a4f95e8c6feb2f8a5d53b19a50a0b7cbc25e055ad03e5ace8f3f7db13e57759f67b65d143f08cca15992c6b2aae643390483de111c2988d4e76b42596266005103c8de6044fb7398eb3c28a864fa672de5fd8774510ff45e05969a11a4c7d3f343e331190d2dcf24fb9154ba904dc94af98afc5774a9617d0418fe6d13f8245c7d7626c176138dd698a23547c25f27c2b98ea4d8a45c7842b81888e4cc14e5b72e9cf91f56956c93dbf2e5f44a8282a7813157fc481ff1371a0f66b31797e81ebdb09a673d4db96d6
|
||||
+Output = 7b036fcd6243900e4236c894e2462c17738acc87e01a76f4d95cb9a328d9acde81650283b8e8f60a217e3bdee835c7b222ad4c85d0acdb9a309bd2a754609a65dec50f3aa04c6d5891034566b9563d42668ede1f8992b17753a2132e28970584e255efc8b45a41c5dbd7567f014acec5fe6fdb6d484790360a913ebb9defcd74ff377f2a8ba46d2ed85f733c9a3da08eb57ecedfafda806778f03c66b2c5d2874cec1c291b2d49eb194c7b5d0dd2908ae90f4843268a2c45563092ade08acb6ab481a08176102fc803fbb2f8ad11b0e1531bd37df543498daf180b12017f4d4d426ca29b4161075534bfb914968088a9d13785d0adc0e2580d3548494b2a9e91605f2b27e6cc701c796f0de7c6f471f6ab6cb9272a1ed637ca32a60d117505d82af3c1336104afb537d01a8f70b510e1eebf4869cb976c419473795a66c7f5e6e20a8094b1bb603a74330c537c5c0698c31538bd2e138c1275a1bdf24c5fa8ab3b7b526324e7918a382d1363b3d463764222150e04
|
||||
+
|
||||
+# a positive test case that decrypts to 9 byte long value
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 6c60845a854b4571f678941ae35a2ac03f67c21e21146f9db1f2306be9f136453b86ad55647d4f7b5c9e62197aaff0c0e40a3b54c4cde14e774b1c5959b6c2a2302896ffae1f73b00b862a20ff4304fe06cea7ff30ecb3773ca9af27a0b54547350d7c07dfb0a39629c7e71e83fc5af9b2adbaf898e037f1de696a3f328cf45af7ec9aff7173854087fb8fbf34be981efbd8493f9438d1b2ba2a86af082662aa46ae9adfbec51e5f3d9550a4dd1dcb7c8969c9587a6edc82a8cabbc785c40d9fbd12064559fb769450ac3e47e87bc046148130d7eaa843e4b3ccef3675d0630500803cb7ffee3882378c1a404e850c3e20707bb745e42b13c18786c4976076ed9fa8fd0ff15e571bef02cbbe2f90c908ac3734a433b73e778d4d17fcc28f49185ebc6e8536a06d293202d94496453bfdf1c2c7833a3f99fa38ca8a81f42eaa529d603b890308a319c0ab63a35ff8ebac965f6278f5a7e5d622be5d5fe55f0ca3ec993d55430d2bf59c5d3e860e90c16d91a04596f6fdf60d89ed95d88c036dde
|
||||
+Output = "forty two"
|
||||
+
|
||||
+# a positive test case with null padded ciphertext
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 00f4d565a3286784dbb85327db8807ae557ead229f92aba945cecda5225f606a7d6130edeeb6f26724d1eff1110f9eb18dc3248140ee3837e6688391e78796c526791384f045e21b6b853fb6342a11f309eb77962f37ce23925af600847fbd30e6e07e57de50b606e6b7f288cc777c1a6834f27e6edace508452128916eef7788c8bb227e3548c6a761cc4e9dd1a3584176dc053ba3500adb1d5e1611291654f12dfc5722832f635db3002d73f9defc310ace62c63868d341619c7ee15b20243b3371e05078e11219770c701d9f341af35df1bc729de294825ff2e416aa11526612852777eb131f9c45151eb144980d70608d2fc4043477368369aa0fe487a48bd57e66b00c3c58f941549f5ec050fca64449debe7a0c4ac51e55cb71620a70312aa4bd85fac1410c9c7f9d6ec610b7d11bf8faeffa20255d1a1bead9297d0aa8765cd2805847d639bc439f4a6c896e2008f746f9590ff4596de5ddde000ed666c452c978043ff4298461eb5a26d5e63d821438627f91201924bf7f2aeee1727
|
||||
+Output = "forty two"
|
||||
+
|
||||
+# a positive test case with null truncated ciphertext
|
||||
+Decrypt = RSA-3072
|
||||
+Input = f4d565a3286784dbb85327db8807ae557ead229f92aba945cecda5225f606a7d6130edeeb6f26724d1eff1110f9eb18dc3248140ee3837e6688391e78796c526791384f045e21b6b853fb6342a11f309eb77962f37ce23925af600847fbd30e6e07e57de50b606e6b7f288cc777c1a6834f27e6edace508452128916eef7788c8bb227e3548c6a761cc4e9dd1a3584176dc053ba3500adb1d5e1611291654f12dfc5722832f635db3002d73f9defc310ace62c63868d341619c7ee15b20243b3371e05078e11219770c701d9f341af35df1bc729de294825ff2e416aa11526612852777eb131f9c45151eb144980d70608d2fc4043477368369aa0fe487a48bd57e66b00c3c58f941549f5ec050fca64449debe7a0c4ac51e55cb71620a70312aa4bd85fac1410c9c7f9d6ec610b7d11bf8faeffa20255d1a1bead9297d0aa8765cd2805847d639bc439f4a6c896e2008f746f9590ff4596de5ddde000ed666c452c978043ff4298461eb5a26d5e63d821438627f91201924bf7f2aeee1727
|
||||
+Output = "forty two"
|
||||
+
|
||||
+# a positive test case with double null padded ciphertext
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 00001ec97ac981dfd9dcc7a7389fdfa9d361141dac80c23a060410d472c16094e6cdffc0c3684d84aa402d7051dfccb2f6da33f66985d2a259f5b7fbf39ac537e95c5b7050eb18844a0513abef812cc8e74a3c5240009e6e805dcadf532bc1a2702d5acc9e585fad5b89d461fcc1397351cdce35171523758b171dc041f412e42966de7f94856477356d06f2a6b40e3ff0547562a4d91bbf1338e9e049facbee8b20171164505468cd308997447d3dc4b0acb49e7d368fedd8c734251f30a83491d2506f3f87318cc118823244a393dc7c5c739a2733d93e1b13db6840a9429947357f47b23fbe39b7d2d61e5ee26f9946c4632f6c4699e452f412a26641d4751135400713cd56ec66f0370423d55d2af70f5e7ad0adea8e4a0d904a01e4ac272eba4af1a029dd53eb71f115bf31f7a6c8b19a6523adeecc0d4c3c107575e38572a8f8474ccad163e46e2e8b08111132aa97a16fb588c9b7e37b3b3d7490381f3c55d1a9869a0fd42cd86fed59ecec78cb6b2dfd06a497f5afe3419691314ba0
|
||||
+Output = "forty two"
|
||||
+
|
||||
+# a positive test case with double null truncated ciphertext
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 1ec97ac981dfd9dcc7a7389fdfa9d361141dac80c23a060410d472c16094e6cdffc0c3684d84aa402d7051dfccb2f6da33f66985d2a259f5b7fbf39ac537e95c5b7050eb18844a0513abef812cc8e74a3c5240009e6e805dcadf532bc1a2702d5acc9e585fad5b89d461fcc1397351cdce35171523758b171dc041f412e42966de7f94856477356d06f2a6b40e3ff0547562a4d91bbf1338e9e049facbee8b20171164505468cd308997447d3dc4b0acb49e7d368fedd8c734251f30a83491d2506f3f87318cc118823244a393dc7c5c739a2733d93e1b13db6840a9429947357f47b23fbe39b7d2d61e5ee26f9946c4632f6c4699e452f412a26641d4751135400713cd56ec66f0370423d55d2af70f5e7ad0adea8e4a0d904a01e4ac272eba4af1a029dd53eb71f115bf31f7a6c8b19a6523adeecc0d4c3c107575e38572a8f8474ccad163e46e2e8b08111132aa97a16fb588c9b7e37b3b3d7490381f3c55d1a9869a0fd42cd86fed59ecec78cb6b2dfd06a497f5afe3419691314ba0
|
||||
+Output = "forty two"
|
||||
+
|
||||
+# a random negative test case that generates a 9 byte long message
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 5c8555f5cef627c15d37f85c7f5fd6e499264ea4b8e3f9112023aeb722eb38d8eac2be3751fd5a3785ab7f2d59fa3728e5be8c3de78a67464e30b21ee23b5484bb3cd06d0e1c6ad25649c8518165653eb80488bfb491b20c04897a6772f69292222fc5ef50b5cf9efc6d60426a449b6c489569d48c83488df629d695653d409ce49a795447fcec2c58a1a672e4a391401d428baaf781516e11e323d302fcf20f6eab2b2dbe53a48c987e407c4d7e1cb41131329138313d330204173a4f3ff06c6fadf970f0ed1005d0b27e35c3d11693e0429e272d583e57b2c58d24315c397856b34485dcb077665592b747f889d34febf2be8fce66c265fd9fc3575a6286a5ce88b4b413a08efc57a07a8f57a999605a837b0542695c0d189e678b53662ecf7c3d37d9dbeea585eebfaf79141118e06762c2381fe27ca6288edddc19fd67cd64f16b46e06d8a59ac530f22cd83cc0bc4e37feb52015cbb2283043ccf5e78a4eb7146827d7a466b66c8a4a4826c1bad68123a7f2d00fc1736525ff90c058f56
|
||||
+Output = 257906ca6de8307728
|
||||
+
|
||||
+# a random negative test case that generates a 9 byte long message based on
|
||||
+# second to last value from PRF
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 758c215aa6acd61248062b88284bf43c13cb3b3d02410be4238607442f1c0216706e21a03a2c10eb624a63322d854da195c017b76fea83e274fa371834dcd2f3b7accf433fc212ad76c0bac366e1ed32e25b279f94129be7c64d6e162adc08ccebc0cfe8e926f01c33ab9c065f0e0ac83ae5137a4cb66702615ad68a35707d8676d2740d7c1a954680c83980e19778ed11eed3a7c2dbdfc461a9bbef671c1bc00c882d361d29d5f80c42bdf5efec886c34138f83369c6933b2ac4e93e764265351b4a0083f040e14f511f09b22f96566138864e4e6ff24da4810095da98e0585410951538ced2f757a277ff8e17172f06572c9024eeae503f176fd46eb6c5cd9ba07af11cde31dccac12eb3a4249a7bfd3b19797ad1656984bfcbf6f74e8f99d8f1ac420811f3d166d87f935ef15ae858cf9e72c8e2b547bf16c3fb09a8c9bf88fd2e5d38bf24ed610896131a84df76b9f920fe76d71fff938e9199f3b8cd0c11fd0201f9139d7673a871a9e7d4adc3bbe360c8813617cd60a90128fbe34c9d5
|
||||
+Output = 043383c929060374ed
|
||||
+
|
||||
+# a random negative test that generates message based on 3rd last value from
|
||||
+# PRF
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 7b22d5e62d287968c6622171a1f75db4b0fd15cdf3134a1895d235d56f8d8fe619f2bf4868174a91d7601a82975d2255190d28b869141d7c395f0b8c4e2be2b2c1b4ffc12ce749a6f6803d4cfe7fba0a8d6949c04151f981c0d84592aa2ff25d1bd3ce5d10cb03daca6b496c6ad40d30bfa8acdfd02cdb9326c4bdd93b949c9dc46caa8f0e5f429785bce64136a429a3695ee674b647452bea1b0c6de9c5f1e8760d5ef6d5a9cfff40457b023d3c233c1dcb323e7808103e73963b2eafc928c9eeb0ee3294955415c1ddd9a1bb7e138fecd79a3cb89c57bd2305524624814aaf0fd1acbf379f7f5b39421f12f115ba488d380586095bb53f174fae424fa4c8e3b299709cd344b9f949b1ab57f1c645d7ed3c8f81d5594197355029fee8960970ff59710dc0e5eb50ea6f4c3938e3f89ed7933023a2c2ddffaba07be147f686828bd7d520f300507ed6e71bdaee05570b27bc92741108ac2eb433f028e138dd6d63067bc206ea2d826a7f41c0d613daed020f0f30f4e272e9618e0a8c39018a83
|
||||
+Output = 70263fa6050534b9e0
|
||||
+
|
||||
+# an otherwise valid plaintext, but with wrong first byte (0x01 instead of 0x00)
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 6db80adb5ff0a768caf1378ecc382a694e7d1bde2eff4ba12c48aaf794ded7a994a5b2b57acec20dbec4ae385c9dd531945c0f197a5496908725fc99d88601a17d3bb0b2d38d2c1c3100f39955a4cb3dbed5a38bf900f23d91e173640e4ec655c84fdfe71fcdb12a386108fcf718c9b7af37d39703e882436224c877a2235e8344fba6c951eb7e2a4d1d1de81fb463ac1b880f6cc0e59ade05c8ce35179ecd09546731fc07b141d3d6b342a97ae747e61a9130f72d37ac5a2c30215b6cbd66c7db893810df58b4c457b4b54f34428247d584e0fa71062446210db08254fb9ead1ba1a393c724bd291f0cf1a7143f32df849051dc896d7d176fef3b57ab6dffd626d0c3044e9edb2e3d012ace202d2581df01bec7e9aa0727a6650dd373d374f0bc0f4a611f8139dfe97d63e70c6188f4df5b672e47c51d8aa567097293fbff127c75ec690b43407578b73c85451710a0cece58fd497d7f7bd36a8a92783ef7dc6265dff52aac8b70340b996508d39217f2783ce6fc91a1cc94bb2ac487b84f62
|
||||
+Output = 6d8d3a094ff3afff4c
|
||||
+
|
||||
+# an otherwise valid plaintext, but with wrong second byte (0x01 instead of 0x02)
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 417328c034458563079a4024817d0150340c34e25ae16dcad690623f702e5c748a6ebb3419ff48f486f83ba9df35c05efbd7f40613f0fc996c53706c30df6bba6dcd4a40825f96133f3c21638a342bd4663dffbd0073980dac47f8c1dd8e97ce1412e4f91f2a8adb1ac2b1071066efe8d718bbb88ca4a59bd61500e826f2365255a409bece0f972df97c3a55e09289ef5fa815a2353ef393fd1aecfc888d611c16aec532e5148be15ef1bf2834b8f75bb26db08b66d2baad6464f8439d1986b533813321dbb180080910f233bcc4dd784fb21871aef41be08b7bfad4ecc3b68f228cb5317ac6ec1227bc7d0e452037ba918ee1da9fdb8393ae93b1e937a8d4691a17871d5092d2384b6190a53df888f65b951b05ed4ad57fe4b0c6a47b5b22f32a7f23c1a234c9feb5d8713d949686760680da4db454f4acad972470033472b9864d63e8d23eefc87ebcf464ecf33f67fbcdd48eab38c5292586b36aef5981ed2fa07b2f9e23fc57d9eb71bfff4111c857e9fff23ceb31e72592e70c874b4936
|
||||
+Output = c6ae80ffa80bc184b0
|
||||
+
|
||||
+# an otherwise valid plaintext, but with zero byte in first byte of padding
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 8542c626fe533467acffcd4e617692244c9b5a3bf0a215c5d64891ced4bf4f9591b4b2aedff9843057986d81631b0acb3704ec2180e5696e8bd15b217a0ec36d2061b0e2182faa3d1c59bd3f9086a10077a3337a3f5da503ec3753535ffd25b837a12f2541afefd0cffb0224b8f874e4bed13949e105c075ed44e287c5ae03b155e06b90ed247d2c07f1ef3323e3508cce4e4074606c54172ad74d12f8c3a47f654ad671104bf7681e5b061862747d9afd37e07d8e0e2291e01f14a95a1bb4cbb47c304ef067595a3947ee2d722067e38a0f046f43ec29cac6a8801c6e3e9a2331b1d45a7aa2c6af3205be382dd026e389614ee095665a611ab2e8dced2ee1c9d08ac9de11aef5b3803fc9a9ce8231ec87b5fed386fb92ee3db995a89307bcba844bd0a691c29ae51216e949dfc813133cb06a07265fd807bcb3377f6adb0a481d9b7f442003115895939773e6b95371c4febef29edae946fa245e7c50729e2e558cfaad773d1fd5f67b457a6d9d17a847c6fcbdb103a86f35f228cefc06cea0
|
||||
+Output = a8a9301daa01bb25c7
|
||||
+
|
||||
+# an otherwise valid plaintext, but with zero byte in eight byte of padding
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 449dfa237a70a99cb0351793ec8677882021c2aa743580bf6a0ea672055cffe8303ac42855b1d1f3373aae6af09cb9074180fc963e9d1478a4f98b3b4861d3e7f0aa8560cf603711f139db77667ca14ba3a1acdedfca9ef4603d6d7eb0645bfc805304f9ad9d77d34762ce5cd84bd3ec9d35c30e3be72a1e8d355d5674a141b5530659ad64ebb6082e6f73a80832ab6388912538914654d34602f4b3b1c78589b4a5d964b2efcca1dc7004c41f6cafcb5a7159a7fc7c0398604d0edbd4c8f4f04067da6a153a05e7cbeea13b5ee412400ef7d4f3106f4798da707ec37a11286df2b7a204856d5ff773613fd1e453a7114b78e347d3e8078e1cb3276b3562486ba630bf719697e0073a123c3e60ebb5c7a1ccff4279faffa2402bc1109f8d559d6766e73591943dfcf25ba10c3762f02af85187799b8b4b135c3990793a6fd32642f1557405ba55cc7cf7336a0e967073c5fa50743f9cc5e3017c172d9898d2af83345e71b3e0c22ab791eacb6484a32ec60ebc226ec9deaee91b1a0560c2b571
|
||||
+Output = 6c716fe01d44398018
|
||||
+
|
||||
+# an otherwise valid plaintext, but with null separator missing
|
||||
+Decrypt = RSA-3072
|
||||
+Input = a7a5c99e50da48769ecb779d9abe86ef9ec8c38c6f43f17c7f2d7af608a4a1bd6cf695b47e97c191c61fb5a27318d02f495a176b9fae5a55b5d3fabd1d8aae4957e3879cb0c60f037724e11be5f30f08fc51c033731f14b44b414d11278cd3dba7e1c8bfe208d2b2bb7ec36366dacb6c88b24cd79ab394adf19dbbc21dfa5788bacbadc6a62f79cf54fd8cf585c615b5c0eb94c35aa9de25321c8ffefb8916bbaa2697cb2dd82ee98939df9b6704cee77793edd2b4947d82e00e5749664970736c59a84197bd72b5c71e36aae29cd39af6ac73a368edbc1ca792e1309f442aafcd77c992c88f8e4863149f221695cb7b0236e75b2339a02c4ea114854372c306b9412d8eedb600a31532002f2cea07b4df963a093185e4607732e46d753b540974fb5a5c3f9432df22e85bb17611370966c5522fd23f2ad3484341ba7fd8885fc8e6d379a611d13a2aca784fba2073208faad2137bf1979a0fa146c1880d4337db3274269493bab44a1bcd0681f7227ffdf589c2e925ed9d36302509d1109ba4
|
||||
+Output = aa2de6cde4e2442884
|
||||
+
|
||||
# RSA PSS key tests
|
||||
|
||||
# PSS only key, no parameter restrictions
|
||||
--
|
||||
2.34.1
|
||||
|
||||
284
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-5.patch
Normal file
284
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-5.patch
Normal file
@@ -0,0 +1,284 @@
|
||||
From c693522a96b6fb2bb4b55a53d86550811bc0d7df Mon Sep 17 00:00:00 2001
|
||||
From: Hubert Kario <hkario@redhat.com>
|
||||
Date: Thu, 3 Nov 2022 17:45:58 +0100
|
||||
Subject: [PATCH] rsa: Skip the synthethic plaintext test with old FIPS
|
||||
provider
|
||||
|
||||
since the 3.0.0 FIPS provider doesn't implement the Bleichenbacher
|
||||
workaround, the decryption fails instead of providing a synthetic
|
||||
plaintext, so skip them then
|
||||
|
||||
CVE: CVE-2023-50781
|
||||
|
||||
Upstream-Status: Backport [https://github.com/openssl/openssl/commit/ddecbef6e389d263b728b7fa30fd3d9ce13feddb]
|
||||
|
||||
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
|
||||
Reviewed-by: Tim Hudson <tjh@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/13817)
|
||||
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
|
||||
---
|
||||
.../30-test_evp_data/evppkey_rsa_common.txt | 66 ++++++++++++++++++-
|
||||
1 file changed, 63 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/test/recipes/30-test_evp_data/evppkey_rsa_common.txt b/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
index d569e78..4bd7c72 100644
|
||||
--- a/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
+++ b/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
@@ -253,12 +253,12 @@ Decrypt = RSA-2048
|
||||
Input = 550AF55A2904E7B9762352F8FB7FA235A9CB053AACB2D5FCB8CA48453CB2EE3619746C701ABF2D4CC67003471A187900B05AA812BD25ED05C675DFC8C97A24A7BF49BD6214992CAD766D05A9A2B57B74F26A737E0237B8B76C45F1F226A836D7CFBC75BA999BDBE48DBC09227AA46C88F21DCCBA7840141AD5A5D71FD122E6BD6AC3E564780DFE623FC1CA9B995A6037BF0BBD43B205A84AC5444F34202C05CE9113087176432476576DE6FFFF9A52EA57C08BE3EC2F49676CB8E12F762AC71FA3C321E00AC988910C85FF52F93825666CE0D40FFAA0592078919D4493F46D95CCF76364C6D57760DD0B64805F9AFC76A2365A5575CA301D5103F0EA76CB9A78
|
||||
Output = "Hello World"
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# Corrupted ciphertext
|
||||
-FIPSversion = <3.2.0
|
||||
Decrypt = RSA-2048
|
||||
Input = 550AF55A2904E7B9762352F8FB7FA235A9CB053AACB2D5FCB8CA48453CB2EE3619746C701ABF2D4CC67003471A187900B05AA812BD25ED05C675DFC8C97A24A7BF49BD6214992CAD766D05A9A2B57B74F26A737E0237B8B76C45F1F226A836D7CFBC75BA999BDBE48DBC09227AA46C88F21DCCBA7840141AD5A5D71FD122E6BD6AC3E564780DFE623FC1CA9B995A6037BF0BBD43B205A84AC5444F34202C05CE9113087176432476576DE6FFFF9A52EA57C08BE3EC2F49676CB8E12F762AC71FA3C321E00AC988910C85FF52F93825666CE0D40FFAA0592078919D4493F46D95CCF76364C6D57760DD0B64805F9AFC76A2365A5575CA301D5103F0EA76CB9A79
|
||||
-Output = "Hello World"
|
||||
-Result = KEYOP_ERROR
|
||||
+Output = 4cbb988d6a46228379132b0b5f8c249b3860043848c93632fb982c807c7c82fffc7a9ef83f4908f890373ac181ffea6381e103bcaa27e65638b6ecebef38b59ed4226a9d12af675cfcb634d8c40e7a7aff
|
||||
|
||||
# OAEP padding
|
||||
Decrypt = RSA-2048
|
||||
@@ -330,21 +330,29 @@ Decrypt = RSA-2048-2
|
||||
Input = 8bfe264e85d3bdeaa6b8851b8e3b956ee3d226fd3f69063a86880173a273d9f283b2eebdd1ed35f7e02d91c571981b6737d5320bd8396b0f3ad5b019daec1b0aab3cbbc026395f4fd14f13673f2dfc81f9b660ec26ac381e6db3299b4e460b43fab9955df2b3cfaa20e900e19c856238fd371899c2bf2ce8c868b76754e5db3b036533fd603746be13c10d4e3e6022ebc905d20c2a7f32b215a4cd53b3f44ca1c327d2c2b651145821c08396c89071f665349c25e44d2733cd9305985ceef6430c3cf57af5fa224089221218fa34737c79c446d28a94c41c96e4e92ac53fbcf384dea8419ea089f8784445a492c812eb0d409467f75afd7d4d1078886205a066
|
||||
Output = "lorem ipsum dolor sit amet"
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random negative test case decrypting to empty
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 20aaa8adbbc593a924ba1c5c7990b5c2242ae4b99d0fe636a19a4cf754edbcee774e472fe028160ed42634f8864900cb514006da642cae6ae8c7d087caebcfa6dad1551301e130344989a1d462d4164505f6393933450c67bc6d39d8f5160907cabc251b737925a1cf21e5c6aa5781b7769f6a2a583d97cce008c0f8b6add5f0b2bd80bee60237aa39bb20719fe75749f4bc4e42466ef5a861ae3a92395c7d858d430bfe38040f445ea93fa2958b503539800ffa5ce5f8cf51fa8171a91f36cb4f4575e8de6b4d3f096ee140b938fd2f50ee13f0d050222e2a72b0a3069ff3a6738e82c87090caa5aed4fcbe882c49646aa250b98f12f83c8d528113614a29e7
|
||||
Output =
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# invalid decrypting to max length message
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 48cceab10f39a4db32f60074feea473cbcdb7accf92e150417f76b44756b190e843e79ec12aa85083a21f5437e7bad0a60482e601198f9d86923239c8786ee728285afd0937f7dde12717f28389843d7375912b07b991f4fdb0190fced8ba665314367e8c5f9d2981d0f5128feeb46cb50fc237e64438a86df198dd0209364ae3a842d77532b66b7ef263b83b1541ed671b120dfd660462e2107a4ee7b964e734a7bd68d90dda61770658a3c242948532da32648687e0318286473f675b412d6468f013f14d760a358dfcad3cda2afeec5e268a37d250c37f722f468a70dfd92d7294c3c1ee1e7f8843b7d16f9f37ef35748c3ae93aa155cdcdfeb4e78567303
|
||||
Output = 22d850137b9eebe092b24f602dc5bb7918c16bd89ddbf20467b119d205f9c2e4bd7d2592cf1e532106e0f33557565923c73a02d4f09c0c22bea89148183e60317f7028b3aa1f261f91c979393101d7e15f4067e63979b32751658ef769610fe97cf9cef3278b3117d384051c3b1d82c251c2305418c8f6840530e631aad63e70e20e025bcd8efb54c92ec6d3b106a2f8e64eeff7d38495b0fc50c97138af4b1c0a67a1c4e27b077b8439332edfa8608dfeae653cd6a628ac550395f7e74390e42c11682234870925eeaa1fa71b76cf1f2ee3bda69f6717033ff8b7c95c9799e7a3bea5e7e4a1c359772fb6b1c6e6c516661dfe30c3
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# invalid decrypting to message with length specified by second to last value from PRF
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 1439e08c3f84c1a7fec74ce07614b20e01f6fa4e8c2a6cffdc3520d8889e5d9a950c6425798f85d4be38d300ea5695f13ecd4cb389d1ff5b82484b494d6280ab7fa78e645933981cb934cce8bfcd114cc0e6811eefa47aae20af638a1cd163d2d3366186d0a07df0c81f6c9f3171cf3561472e98a6006bf75ddb457bed036dcce199369de7d94ef2c68e8467ee0604eea2b3009479162a7891ba5c40cab17f49e1c438cb6eaea4f76ce23cce0e483ff0e96fa790ea15be67671814342d0a23f4a20262b6182e72f3a67cd289711503c85516a9ed225422f98b116f1ab080a80abd6f0216df88d8cfd67c139243be8dd78502a7aaf6bc99d7da71bcdf627e7354
|
||||
Output = 0f9b
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# invalid decrypting to message with length specified by third to last value from PRF
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 1690ebcceece2ce024f382e467cf8510e74514120937978576caf684d4a02ad569e8d76cbe365a060e00779de2f0865ccf0d923de3b4783a4e2c74f422e2f326086c390b658ba47f31ab013aa80f468c71256e5fa5679b24e83cd82c3d1e05e398208155de2212993cd2b8bab6987cf4cc1293f19909219439d74127545e9ed8a706961b8ee2119f6bfacafbef91b75a789ba65b8b833bc6149cf49b5c4d2c6359f62808659ba6541e1cd24bf7f7410486b5103f6c0ea29334ea6f4975b17387474fe920710ea61568d7b7c0a7916acf21665ad5a31c4eabcde44f8fb6120d8457afa1f3c85d517cda364af620113ae5a3c52a048821731922737307f77a1081
|
||||
@@ -385,23 +393,31 @@ Decrypt = RSA-2048-2
|
||||
Input = 1ea0b50ca65203d0a09280d39704b24fe6e47800189db5033f202761a78bafb270c5e25abd1f7ecc6e7abc4f26d1b0cd9b8c648d529416ee64ccbdd7aa72a771d0353262b543f0e436076f40a1095f5c7dfd10dcf0059ccb30e92dfa5e0156618215f1c3ff3aa997a9d999e506924f5289e3ac72e5e2086cc7b499d71583ed561028671155db4005bee01800a7cdbdae781dd32199b8914b5d4011dd6ff11cd26d46aad54934d293b0bc403dd211bf13b5a5c6836a5e769930f437ffd8634fb7371776f4bc88fa6c271d8aa6013df89ae6470154497c4ac861be2a1c65ebffec139bf7aaba3a81c7c5cdd84da9af5d3edfb957848074686b5837ecbcb6a41c50
|
||||
Output = "lorem ipsum"
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random negative test that generates an 11 byte long message
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 5f02f4b1f46935c742ebe62b6f05aa0a3286aab91a49b34780adde6410ab46f7386e05748331864ac98e1da63686e4babe3a19ed40a7f5ceefb89179596aab07ab1015e03b8f825084dab028b6731288f2e511a4b314b6ea3997d2e8fe2825cef8897cbbdfb6c939d441d6e04948414bb69e682927ef8576c9a7090d4aad0e74c520d6d5ce63a154720f00b76de8cc550b1aa14f016d63a7b6d6eaa1f7dbe9e50200d3159b3d099c900116bf4eba3b94204f18b1317b07529751abf64a26b0a0bf1c8ce757333b3d673211b67cc0653f2fe2620d57c8b6ee574a0323a167eab1106d9bc7fd90d415be5f1e9891a0e6c709f4fc0404e8226f8477b4e939b36eb2
|
||||
Output = af9ac70191c92413cb9f2d
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an otherwise correct plaintext, but with wrong first byte
|
||||
# (0x01 instead of 0x00), generates a random 11 byte long plaintext
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 9b2ec9c0c917c98f1ad3d0119aec6be51ae3106e9af1914d48600ab6a2c0c0c8ae02a2dc3039906ff3aac904af32ec798fd65f3ad1afa2e69400e7c1de81f5728f3b3291f38263bc7a90a0563e43ce7a0d4ee9c0d8a716621ca5d3d081188769ce1b131af7d35b13dea99153579c86db31fe07d5a2c14d621b77854e48a8df41b5798563af489a291e417b6a334c63222627376118c02c53b6e86310f728734ffc86ef9d7c8bf56c0c841b24b82b59f51aee4526ba1c4268506d301e4ebc498c6aebb6fd5258c876bf900bac8ca4d309dd522f6a6343599a8bc3760f422c10c72d0ad527ce4af1874124ace3d99bb74db8d69d2528db22c3a37644640f95c05f
|
||||
Output = a1f8c9255c35cfba403ccc
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an otherwise correct plaintext, but with wrong second byte
|
||||
# (0x01 instead of 0x02), generates a random 11 byte long plaintext
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 782c2b59a21a511243820acedd567c136f6d3090c115232a82a5efb0b178285f55b5ec2d2bac96bf00d6592ea7cdc3341610c8fb07e527e5e2d20cfaf2c7f23e375431f45e998929a02f25fd95354c33838090bca838502259e92d86d568bc2cdb132fab2a399593ca60a015dc2bb1afcd64fef8a3834e17e5358d822980dc446e845b3ab4702b1ee41fe5db716d92348d5091c15d35a110555a35deb4650a5a1d2c98025d42d4544f8b32aa6a5e02dc02deaed9a7313b73b49b0d4772a3768b0ea0db5846ace6569cae677bf67fb0acf3c255dc01ec8400c963b6e49b1067728b4e563d7e1e1515664347b92ee64db7efb5452357a02fff7fcb7437abc2e579
|
||||
Output = e6d700309ca0ed62452254
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an invalid ciphertext, with a zero byte in first byte of
|
||||
# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
# plaintext
|
||||
@@ -409,6 +425,8 @@ Decrypt = RSA-2048-2
|
||||
Input = 0096136621faf36d5290b16bd26295de27f895d1faa51c800dafce73d001d60796cd4e2ac3fa2162131d859cd9da5a0c8a42281d9a63e5f353971b72e36b5722e4ac444d77f892a5443deb3dca49fa732fe855727196e23c26eeac55eeced8267a209ebc0f92f4656d64a6c13f7f7ce544ebeb0f668fe3a6c0f189e4bcd5ea12b73cf63e0c8350ee130dd62f01e5c97a1e13f52fde96a9a1bc9936ce734fdd61f27b18216f1d6de87f49cf4f2ea821fb8efd1f92cdad529baf7e31aff9bff4074f2cad2b4243dd15a711adcf7de900851fbd6bcb53dac399d7c880531d06f25f7002e1aaf1722765865d2c2b902c7736acd27bc6cbd3e38b560e2eecf7d4b576
|
||||
Output = ba27b1842e7c21c0e7ef6a
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an invalid ciphertext, with a zero byte removed from first byte of
|
||||
# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
# plaintext
|
||||
@@ -416,6 +434,8 @@ Decrypt = RSA-2048-2
|
||||
Input = 96136621faf36d5290b16bd26295de27f895d1faa51c800dafce73d001d60796cd4e2ac3fa2162131d859cd9da5a0c8a42281d9a63e5f353971b72e36b5722e4ac444d77f892a5443deb3dca49fa732fe855727196e23c26eeac55eeced8267a209ebc0f92f4656d64a6c13f7f7ce544ebeb0f668fe3a6c0f189e4bcd5ea12b73cf63e0c8350ee130dd62f01e5c97a1e13f52fde96a9a1bc9936ce734fdd61f27b18216f1d6de87f49cf4f2ea821fb8efd1f92cdad529baf7e31aff9bff4074f2cad2b4243dd15a711adcf7de900851fbd6bcb53dac399d7c880531d06f25f7002e1aaf1722765865d2c2b902c7736acd27bc6cbd3e38b560e2eecf7d4b576
|
||||
Output = ba27b1842e7c21c0e7ef6a
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an invalid ciphertext, with two zero bytes in first bytes of
|
||||
# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
# plaintext
|
||||
@@ -423,6 +443,8 @@ Decrypt = RSA-2048-2
|
||||
Input = 0000587cccc6b264bdfe0dc2149a988047fa921801f3502ea64624c510c6033d2f427e3f136c26e88ea9f6519e86a542cec96aad1e5e9013c3cc203b6de15a69183050813af5c9ad79703136d4b92f50ce171eefc6aa7988ecf02f319ffc5eafd6ee7a137f8fce64b255bb1b8dd19cfe767d64fdb468b9b2e9e7a0c24dae03239c8c714d3f40b7ee9c4e59ac15b17e4d328f1100756bce17133e8e7493b54e5006c3cbcdacd134130c5132a1edebdbd01a0c41452d16ed7a0788003c34730d0808e7e14c797a21f2b45a8aa1644357fd5e988f99b017d9df37563a354c788dc0e2f9466045622fa3f3e17db63414d27761f57392623a2bef6467501c63e8d645
|
||||
Output = d5cf555b1d6151029a429a
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an invalid ciphertext, with two zero bytes removed from first bytes of
|
||||
# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
# plaintext
|
||||
@@ -430,24 +452,32 @@ Decrypt = RSA-2048-2
|
||||
Input = 587cccc6b264bdfe0dc2149a988047fa921801f3502ea64624c510c6033d2f427e3f136c26e88ea9f6519e86a542cec96aad1e5e9013c3cc203b6de15a69183050813af5c9ad79703136d4b92f50ce171eefc6aa7988ecf02f319ffc5eafd6ee7a137f8fce64b255bb1b8dd19cfe767d64fdb468b9b2e9e7a0c24dae03239c8c714d3f40b7ee9c4e59ac15b17e4d328f1100756bce17133e8e7493b54e5006c3cbcdacd134130c5132a1edebdbd01a0c41452d16ed7a0788003c34730d0808e7e14c797a21f2b45a8aa1644357fd5e988f99b017d9df37563a354c788dc0e2f9466045622fa3f3e17db63414d27761f57392623a2bef6467501c63e8d645
|
||||
Output = d5cf555b1d6151029a429a
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# and invalid ciphertext, otherwise valid but starting with 000002, decrypts
|
||||
# to random 11 byte long synthethic plaintext
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 1786550ce8d8433052e01ecba8b76d3019f1355b212ac9d0f5191b023325a7e7714b7802f8e9a17c4cb3cd3a84041891471b10ca1fcfb5d041d34c82e6d0011cf4dc76b90e9c2e0743590579d55bcd7857057152c4a8040361343d1d22ba677d62b011407c652e234b1d663af25e2386251d7409190f19fc8ec3f9374fdf1254633874ce2ec2bff40ad0cb473f9761ec7b68da45a4bd5e33f5d7dac9b9a20821df9406b653f78a95a6c0ea0a4d57f867e4db22c17bf9a12c150f809a7b72b6db86c22a8732241ebf3c6a4f2cf82671d917aba8bc61052b40ccddd743a94ea9b538175106201971cca9d136d25081739aaf6cd18b2aecf9ad320ea3f89502f955
|
||||
Output = 3d4a054d9358209e9cbbb9
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# negative test with otherwise valid padding but a zero byte in first byte
|
||||
# of padding
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 179598823812d2c58a7eb50521150a48bcca8b4eb53414018b6bca19f4801456c5e36a940037ac516b0d6412ba44ec6b4f268a55ef1c5ffbf18a2f4e3522bb7b6ed89774b79bffa22f7d3102165565642de0d43a955e96a1f2e80e5430671d7266eb4f905dc8ff5e106dc5588e5b0289e49a4913940e392a97062616d2bda38155471b7d360cfb94681c702f60ed2d4de614ea72bf1c53160e63179f6c5b897b59492bee219108309f0b7b8cb2b136c346a5e98b8b4b8415fb1d713bae067911e3057f1c335b4b7e39101eafd5d28f0189037e4334f4fdb9038427b1d119a6702aa8233319cc97d496cc289ae8c956ddc84042659a2d43d6aa22f12b81ab884e
|
||||
Output = 1f037dd717b07d3e7f7359
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# negative test with otherwise valid padding but a zero byte at the eigth
|
||||
# byte of padding
|
||||
Decrypt = RSA-2048-2
|
||||
Input = a7a340675a82c30e22219a55bc07cdf36d47d01834c1834f917f18b517419ce9de2a96460e745024436470ed85e94297b283537d52189c406a3f533cb405cc6a9dba46b482ce98b6e3dd52d8fce2237425617e38c11fbc46b61897ef200d01e4f25f5f6c4c5b38cd0de38ba11908b86595a8036a08a42a3d05b79600a97ac18ba368a08d6cf6ccb624f6e8002afc75599fba4de3d4f3ba7d208391ebe8d21f8282b18e2c10869eb2702e68f9176b42b0ddc9d763f0c86ba0ff92c957aaeab76d9ab8da52ea297ec11d92d770146faa1b300e0f91ef969b53e7d2907ffc984e9a9c9d11fb7d6cba91972059b46506b035efec6575c46d7114a6b935864858445f
|
||||
Output = 63cb0bf65fc8255dd29e17
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# negative test with an otherwise valid plaintext but with missing separator
|
||||
# byte
|
||||
Decrypt = RSA-2048-2
|
||||
@@ -501,6 +531,8 @@ PrivPubKeyPair = RSA-2049:RSA-2049-PUBLIC
|
||||
|
||||
# RSA decrypt
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# malformed that generates length specified by 3rd last value from PRF
|
||||
Decrypt = RSA-2049
|
||||
Input = 00b26f6404b82649629f2704494282443776929122e279a9cf30b0c6fe8122a0a9042870d97cc8ef65490fe58f031eb2442352191f5fbc311026b5147d32df914599f38b825ebb824af0d63f2d541a245c5775d1c4b78630e4996cc5fe413d38455a776cf4edcc0aa7fccb31c584d60502ed2b77398f536e137ff7ba6430e9258e21c2db5b82f5380f566876110ac4c759178900fbad7ab70ea07b1daf7a1639cbb4196543a6cbe8271f35dddb8120304f6eef83059e1c5c5678710f904a6d760c4d1d8ad076be17904b9e69910040b47914a0176fb7eea0c06444a6c4b86d674d19a556a1de5490373cb01ce31bbd15a5633362d3d2cd7d4af1b4c5121288b894
|
||||
@@ -531,16 +563,22 @@ Decrypt = RSA-2049
|
||||
Input = f36da3b72d8ff6ded74e7efd08c01908f3f5f0de7b55eab92b5f875190809c39d4162e1e6649618f854fd84aeab03970d16bb814e999852c06de38d82b95c0f32e2a7b5714021fe303389be9c0eac24c90a6b7210f929d390fabf903d44e04110bb7a7fd6c383c275804721efa6d7c93aa64c0bb2b18d97c5220a846c66a4895ae52adddbe2a9996825e013585adcec4b32ba61d782737bd343e5fabd68e8a95b8b1340318559860792dd70dffbe05a1052b54cbfb48cfa7bb3c19cea52076bddac5c25ee276f153a610f6d06ed696d192d8ae4507ffae4e5bdda10a625d6b67f32f7cffcd48dee2431fe66f6105f9d17e611cdcc674868e81692a360f4052
|
||||
Output = "lorem ipsum"
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random negative test case that generates an 11 byte long message
|
||||
Decrypt = RSA-2049
|
||||
Input = 00f910200830fc8fff478e99e145f1474b312e2512d0f90b8cef77f8001d09861688c156d1cbaf8a8957f7ebf35f724466952d0524cad48aad4fba1e45ce8ea27e8f3ba44131b7831b62d60c0762661f4c1d1a88cd06263a259abf1ba9e6b0b172069afb86a7e88387726f8ab3adb30bfd6b3f6be6d85d5dfd044e7ef052395474a9cbb1c3667a92780b43a22693015af6c513041bdaf87d43b24ddd244e791eeaea1066e1f4917117b3a468e22e0f7358852bb981248de4d720add2d15dccba6280355935b67c96f9dcb6c419cc38ab9f6fba2d649ef2066e0c34c9f788ae49babd9025fa85b21113e56ce4f43aa134c512b030dd7ac7ce82e76f0be9ce09ebca
|
||||
Output = 1189b6f5498fd6df532b00
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# otherwise correct plaintext, but with wrong first byte (0x01 instead of 0x00)
|
||||
Decrypt = RSA-2049
|
||||
Input = 002c9ddc36ba4cf0038692b2d3a1c61a4bb3786a97ce2e46a3ba74d03158aeef456ce0f4db04dda3fe062268a1711250a18c69778a6280d88e133a16254e1f0e30ce8dac9b57d2e39a2f7d7be3ee4e08aec2fdbe8dadad7fdbf442a29a8fb40857407bf6be35596b8eefb5c2b3f58b894452c2dc54a6123a1a38d642e23751746597e08d71ac92704adc17803b19e131b4d1927881f43b0200e6f95658f559f912c889b4cd51862784364896cd6e8618f485a992f82997ad6a0917e32ae5872eaf850092b2d6c782ad35f487b79682333c1750c685d7d32ab3e1538f31dcaa5e7d5d2825875242c83947308dcf63ba4bfff20334c9c140c837dbdbae7a8dee72ff
|
||||
Output = f6d0f5b78082fe61c04674
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# otherwise correct plaintext, but with wrong second byte (0x01 instead of 0x02)
|
||||
Decrypt = RSA-2049
|
||||
Input = 00c5d77826c1ab7a34d6390f9d342d5dbe848942e2618287952ba0350d7de6726112e9cebc391a0fae1839e2bf168229e3e0d71d4161801509f1f28f6e1487ca52df05c466b6b0a6fbbe57a3268a970610ec0beac39ec0fa67babce1ef2a86bf77466dc127d7d0d2962c20e66593126f276863cd38dc6351428f884c1384f67cad0a0ffdbc2af16711fb68dc559b96b37b4f04cd133ffc7d79c43c42ca4948fa895b9daeb853150c8a5169849b730cc77d68b0217d6c0e3dbf38d751a1998186633418367e7576530566c23d6d4e0da9b038d0bb5169ce40133ea076472d055001f0135645940fd08ea44269af2604c8b1ba225053d6db9ab43577689401bdc0f3
|
||||
@@ -603,17 +641,23 @@ ooCElYcob01/JWzoXl61Z5sdrMH5CVZJty5foHKusAN5AgMBAAE=
|
||||
|
||||
PrivPubKeyPair = RSA-3072:RSA-3072-PUBLIC
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random invalid ciphertext that generates an empty synthethic one
|
||||
Decrypt = RSA-3072
|
||||
Input = 5e956cd9652f4a2ece902931013e09662b6a9257ad1e987fb75f73a0606df2a4b04789770820c2e02322c4e826f767bd895734a01e20609c3be4517a7a2a589ea1cdc137beb73eb38dac781b52e863de9620f79f9b90fd5b953651fcbfef4a9f1cc07421d511a87dd6942caab6a5a0f4df473e62defb529a7de1509ab99c596e1dff1320402298d8be73a896cc86c38ae3f2f576e9ea70cc28ad575cb0f854f0be43186baa9c18e29c47c6ca77135db79c811231b7c1730955887d321fdc06568382b86643cf089b10e35ab23e827d2e5aa7b4e99ff2e914f302351819eb4d1693243b35f8bf1d42d08f8ec4acafa35f747a4a975a28643ec630d8e4fa5be59d81995660a14bb64c1fea5146d6b11f92da6a3956dd5cb5e0d747cf2ea23f81617769185336263d46ef4c144b754de62a6337342d6c85a95f19f015724546ee3fc4823eca603dbc1dc01c2d5ed50bd72d8e96df2dc048edde0081284068283fc5e73a6139851abf2f29977d0b3d160c883a42a37efba1be05c1a0b1741d7ddf59
|
||||
Output =
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random invalid that has PRF output with a length one byte too long
|
||||
# in the last value
|
||||
Decrypt = RSA-3072
|
||||
Input = 7db0390d75fcf9d4c59cf27b264190d856da9abd11e92334d0e5f71005cfed865a711dfa28b791188374b61916dbc11339bf14b06f5f3f68c206c5607380e13da3129bfb744157e1527dd6fdf6651248b028a496ae1b97702d44706043cdaa7a59c0f41367303f21f268968bf3bd2904db3ae5239b55f8b438d93d7db9d1666c071c0857e2ec37757463769c54e51f052b2a71b04c2869e9e7049a1037b8429206c99726f07289bac18363e7eb2a5b417f47c37a55090cda676517b3549c873f2fe95da9681752ec9864b069089a2ed2f340c8b04ee00079055a817a3355b46ac7dc00d17f4504ccfbcfcadb0c04cb6b22069e179385ae1eafabad5521bac2b8a8ee1dfff59a22eb3fdacfc87175d10d7894cfd869d056057dd9944b869c1784fcc27f731bc46171d39570fbffbadf082d33f6352ecf44aca8d9478e53f5a5b7c852b401e8f5f74da49da91e65bdc97765a9523b7a0885a6f8afe5759d58009fbfa837472a968e6ae92026a5e0202a395483095302d6c3985b5f5831c521a271
|
||||
Output = 56a3bea054e01338be9b7d7957539c
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random invalid that generates a synthethic of maximum size
|
||||
Decrypt = RSA-3072
|
||||
Input = 1715065322522dff85049800f6a29ab5f98c465020467414b2a44127fe9446da47fa18047900f99afe67c2df6f50160bb8e90bff296610fde632b3859d4d0d2e644f23835028c46cca01b84b88231d7e03154edec6627bcba23de76740d839851fa12d74c8f92e540c73fe837b91b7d699b311997d5f0f7864c486d499c3a79c111faaacbe4799597a25066c6200215c3d158f3817c1aa57f18bdaad0be1658da9da93f5cc6c3c4dd72788af57adbb6a0c26f42d32d95b8a4f95e8c6feb2f8a5d53b19a50a0b7cbc25e055ad03e5ace8f3f7db13e57759f67b65d143f08cca15992c6b2aae643390483de111c2988d4e76b42596266005103c8de6044fb7398eb3c28a864fa672de5fd8774510ff45e05969a11a4c7d3f343e331190d2dcf24fb9154ba904dc94af98afc5774a9617d0418fe6d13f8245c7d7626c176138dd698a23547c25f27c2b98ea4d8a45c7842b81888e4cc14e5b72e9cf91f56956c93dbf2e5f44a8282a7813157fc481ff1371a0f66b31797e81ebdb09a673d4db96d6
|
||||
@@ -644,43 +688,59 @@ Decrypt = RSA-3072
|
||||
Input = 1ec97ac981dfd9dcc7a7389fdfa9d361141dac80c23a060410d472c16094e6cdffc0c3684d84aa402d7051dfccb2f6da33f66985d2a259f5b7fbf39ac537e95c5b7050eb18844a0513abef812cc8e74a3c5240009e6e805dcadf532bc1a2702d5acc9e585fad5b89d461fcc1397351cdce35171523758b171dc041f412e42966de7f94856477356d06f2a6b40e3ff0547562a4d91bbf1338e9e049facbee8b20171164505468cd308997447d3dc4b0acb49e7d368fedd8c734251f30a83491d2506f3f87318cc118823244a393dc7c5c739a2733d93e1b13db6840a9429947357f47b23fbe39b7d2d61e5ee26f9946c4632f6c4699e452f412a26641d4751135400713cd56ec66f0370423d55d2af70f5e7ad0adea8e4a0d904a01e4ac272eba4af1a029dd53eb71f115bf31f7a6c8b19a6523adeecc0d4c3c107575e38572a8f8474ccad163e46e2e8b08111132aa97a16fb588c9b7e37b3b3d7490381f3c55d1a9869a0fd42cd86fed59ecec78cb6b2dfd06a497f5afe3419691314ba0
|
||||
Output = "forty two"
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random negative test case that generates a 9 byte long message
|
||||
Decrypt = RSA-3072
|
||||
Input = 5c8555f5cef627c15d37f85c7f5fd6e499264ea4b8e3f9112023aeb722eb38d8eac2be3751fd5a3785ab7f2d59fa3728e5be8c3de78a67464e30b21ee23b5484bb3cd06d0e1c6ad25649c8518165653eb80488bfb491b20c04897a6772f69292222fc5ef50b5cf9efc6d60426a449b6c489569d48c83488df629d695653d409ce49a795447fcec2c58a1a672e4a391401d428baaf781516e11e323d302fcf20f6eab2b2dbe53a48c987e407c4d7e1cb41131329138313d330204173a4f3ff06c6fadf970f0ed1005d0b27e35c3d11693e0429e272d583e57b2c58d24315c397856b34485dcb077665592b747f889d34febf2be8fce66c265fd9fc3575a6286a5ce88b4b413a08efc57a07a8f57a999605a837b0542695c0d189e678b53662ecf7c3d37d9dbeea585eebfaf79141118e06762c2381fe27ca6288edddc19fd67cd64f16b46e06d8a59ac530f22cd83cc0bc4e37feb52015cbb2283043ccf5e78a4eb7146827d7a466b66c8a4a4826c1bad68123a7f2d00fc1736525ff90c058f56
|
||||
Output = 257906ca6de8307728
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random negative test case that generates a 9 byte long message based on
|
||||
# second to last value from PRF
|
||||
Decrypt = RSA-3072
|
||||
Input = 758c215aa6acd61248062b88284bf43c13cb3b3d02410be4238607442f1c0216706e21a03a2c10eb624a63322d854da195c017b76fea83e274fa371834dcd2f3b7accf433fc212ad76c0bac366e1ed32e25b279f94129be7c64d6e162adc08ccebc0cfe8e926f01c33ab9c065f0e0ac83ae5137a4cb66702615ad68a35707d8676d2740d7c1a954680c83980e19778ed11eed3a7c2dbdfc461a9bbef671c1bc00c882d361d29d5f80c42bdf5efec886c34138f83369c6933b2ac4e93e764265351b4a0083f040e14f511f09b22f96566138864e4e6ff24da4810095da98e0585410951538ced2f757a277ff8e17172f06572c9024eeae503f176fd46eb6c5cd9ba07af11cde31dccac12eb3a4249a7bfd3b19797ad1656984bfcbf6f74e8f99d8f1ac420811f3d166d87f935ef15ae858cf9e72c8e2b547bf16c3fb09a8c9bf88fd2e5d38bf24ed610896131a84df76b9f920fe76d71fff938e9199f3b8cd0c11fd0201f9139d7673a871a9e7d4adc3bbe360c8813617cd60a90128fbe34c9d5
|
||||
Output = 043383c929060374ed
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random negative test that generates message based on 3rd last value from
|
||||
# PRF
|
||||
Decrypt = RSA-3072
|
||||
Input = 7b22d5e62d287968c6622171a1f75db4b0fd15cdf3134a1895d235d56f8d8fe619f2bf4868174a91d7601a82975d2255190d28b869141d7c395f0b8c4e2be2b2c1b4ffc12ce749a6f6803d4cfe7fba0a8d6949c04151f981c0d84592aa2ff25d1bd3ce5d10cb03daca6b496c6ad40d30bfa8acdfd02cdb9326c4bdd93b949c9dc46caa8f0e5f429785bce64136a429a3695ee674b647452bea1b0c6de9c5f1e8760d5ef6d5a9cfff40457b023d3c233c1dcb323e7808103e73963b2eafc928c9eeb0ee3294955415c1ddd9a1bb7e138fecd79a3cb89c57bd2305524624814aaf0fd1acbf379f7f5b39421f12f115ba488d380586095bb53f174fae424fa4c8e3b299709cd344b9f949b1ab57f1c645d7ed3c8f81d5594197355029fee8960970ff59710dc0e5eb50ea6f4c3938e3f89ed7933023a2c2ddffaba07be147f686828bd7d520f300507ed6e71bdaee05570b27bc92741108ac2eb433f028e138dd6d63067bc206ea2d826a7f41c0d613daed020f0f30f4e272e9618e0a8c39018a83
|
||||
Output = 70263fa6050534b9e0
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an otherwise valid plaintext, but with wrong first byte (0x01 instead of 0x00)
|
||||
Decrypt = RSA-3072
|
||||
Input = 6db80adb5ff0a768caf1378ecc382a694e7d1bde2eff4ba12c48aaf794ded7a994a5b2b57acec20dbec4ae385c9dd531945c0f197a5496908725fc99d88601a17d3bb0b2d38d2c1c3100f39955a4cb3dbed5a38bf900f23d91e173640e4ec655c84fdfe71fcdb12a386108fcf718c9b7af37d39703e882436224c877a2235e8344fba6c951eb7e2a4d1d1de81fb463ac1b880f6cc0e59ade05c8ce35179ecd09546731fc07b141d3d6b342a97ae747e61a9130f72d37ac5a2c30215b6cbd66c7db893810df58b4c457b4b54f34428247d584e0fa71062446210db08254fb9ead1ba1a393c724bd291f0cf1a7143f32df849051dc896d7d176fef3b57ab6dffd626d0c3044e9edb2e3d012ace202d2581df01bec7e9aa0727a6650dd373d374f0bc0f4a611f8139dfe97d63e70c6188f4df5b672e47c51d8aa567097293fbff127c75ec690b43407578b73c85451710a0cece58fd497d7f7bd36a8a92783ef7dc6265dff52aac8b70340b996508d39217f2783ce6fc91a1cc94bb2ac487b84f62
|
||||
Output = 6d8d3a094ff3afff4c
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an otherwise valid plaintext, but with wrong second byte (0x01 instead of 0x02)
|
||||
Decrypt = RSA-3072
|
||||
Input = 417328c034458563079a4024817d0150340c34e25ae16dcad690623f702e5c748a6ebb3419ff48f486f83ba9df35c05efbd7f40613f0fc996c53706c30df6bba6dcd4a40825f96133f3c21638a342bd4663dffbd0073980dac47f8c1dd8e97ce1412e4f91f2a8adb1ac2b1071066efe8d718bbb88ca4a59bd61500e826f2365255a409bece0f972df97c3a55e09289ef5fa815a2353ef393fd1aecfc888d611c16aec532e5148be15ef1bf2834b8f75bb26db08b66d2baad6464f8439d1986b533813321dbb180080910f233bcc4dd784fb21871aef41be08b7bfad4ecc3b68f228cb5317ac6ec1227bc7d0e452037ba918ee1da9fdb8393ae93b1e937a8d4691a17871d5092d2384b6190a53df888f65b951b05ed4ad57fe4b0c6a47b5b22f32a7f23c1a234c9feb5d8713d949686760680da4db454f4acad972470033472b9864d63e8d23eefc87ebcf464ecf33f67fbcdd48eab38c5292586b36aef5981ed2fa07b2f9e23fc57d9eb71bfff4111c857e9fff23ceb31e72592e70c874b4936
|
||||
Output = c6ae80ffa80bc184b0
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an otherwise valid plaintext, but with zero byte in first byte of padding
|
||||
Decrypt = RSA-3072
|
||||
Input = 8542c626fe533467acffcd4e617692244c9b5a3bf0a215c5d64891ced4bf4f9591b4b2aedff9843057986d81631b0acb3704ec2180e5696e8bd15b217a0ec36d2061b0e2182faa3d1c59bd3f9086a10077a3337a3f5da503ec3753535ffd25b837a12f2541afefd0cffb0224b8f874e4bed13949e105c075ed44e287c5ae03b155e06b90ed247d2c07f1ef3323e3508cce4e4074606c54172ad74d12f8c3a47f654ad671104bf7681e5b061862747d9afd37e07d8e0e2291e01f14a95a1bb4cbb47c304ef067595a3947ee2d722067e38a0f046f43ec29cac6a8801c6e3e9a2331b1d45a7aa2c6af3205be382dd026e389614ee095665a611ab2e8dced2ee1c9d08ac9de11aef5b3803fc9a9ce8231ec87b5fed386fb92ee3db995a89307bcba844bd0a691c29ae51216e949dfc813133cb06a07265fd807bcb3377f6adb0a481d9b7f442003115895939773e6b95371c4febef29edae946fa245e7c50729e2e558cfaad773d1fd5f67b457a6d9d17a847c6fcbdb103a86f35f228cefc06cea0
|
||||
Output = a8a9301daa01bb25c7
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an otherwise valid plaintext, but with zero byte in eight byte of padding
|
||||
Decrypt = RSA-3072
|
||||
Input = 449dfa237a70a99cb0351793ec8677882021c2aa743580bf6a0ea672055cffe8303ac42855b1d1f3373aae6af09cb9074180fc963e9d1478a4f98b3b4861d3e7f0aa8560cf603711f139db77667ca14ba3a1acdedfca9ef4603d6d7eb0645bfc805304f9ad9d77d34762ce5cd84bd3ec9d35c30e3be72a1e8d355d5674a141b5530659ad64ebb6082e6f73a80832ab6388912538914654d34602f4b3b1c78589b4a5d964b2efcca1dc7004c41f6cafcb5a7159a7fc7c0398604d0edbd4c8f4f04067da6a153a05e7cbeea13b5ee412400ef7d4f3106f4798da707ec37a11286df2b7a204856d5ff773613fd1e453a7114b78e347d3e8078e1cb3276b3562486ba630bf719697e0073a123c3e60ebb5c7a1ccff4279faffa2402bc1109f8d559d6766e73591943dfcf25ba10c3762f02af85187799b8b4b135c3990793a6fd32642f1557405ba55cc7cf7336a0e967073c5fa50743f9cc5e3017c172d9898d2af83345e71b3e0c22ab791eacb6484a32ec60ebc226ec9deaee91b1a0560c2b571
|
||||
Output = 6c716fe01d44398018
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an otherwise valid plaintext, but with null separator missing
|
||||
Decrypt = RSA-3072
|
||||
Input = a7a5c99e50da48769ecb779d9abe86ef9ec8c38c6f43f17c7f2d7af608a4a1bd6cf695b47e97c191c61fb5a27318d02f495a176b9fae5a55b5d3fabd1d8aae4957e3879cb0c60f037724e11be5f30f08fc51c033731f14b44b414d11278cd3dba7e1c8bfe208d2b2bb7ec36366dacb6c88b24cd79ab394adf19dbbc21dfa5788bacbadc6a62f79cf54fd8cf585c615b5c0eb94c35aa9de25321c8ffefb8916bbaa2697cb2dd82ee98939df9b6704cee77793edd2b4947d82e00e5749664970736c59a84197bd72b5c71e36aae29cd39af6ac73a368edbc1ca792e1309f442aafcd77c992c88f8e4863149f221695cb7b0236e75b2339a02c4ea114854372c306b9412d8eedb600a31532002f2cea07b4df963a093185e4607732e46d753b540974fb5a5c3f9432df22e85bb17611370966c5522fd23f2ad3484341ba7fd8885fc8e6d379a611d13a2aca784fba2073208faad2137bf1979a0fa146c1880d4337db3274269493bab44a1bcd0681f7227ffdf589c2e925ed9d36302509d1109ba4
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
From 455db0c94c0b83083ce8b792982c03aa56fc866f Mon Sep 17 00:00:00 2001
|
||||
From: Hubert Kario <hkario@redhat.com>
|
||||
Date: Tue, 22 Nov 2022 17:42:11 +0100
|
||||
Subject: [PATCH] rsa: add test for the option to disable implicit rejection
|
||||
|
||||
CVE: CVE-2023-50781
|
||||
|
||||
Upstream-Status: Backport [https://github.com/openssl/openssl/commit/455db0c94c0b83083ce8b792982c03aa56fc866f]
|
||||
|
||||
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
|
||||
Reviewed-by: Tim Hudson <tjh@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/13817)
|
||||
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
|
||||
---
|
||||
.../30-test_evp_data/evppkey_rsa_common.txt | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/test/recipes/30-test_evp_data/evppkey_rsa_common.txt b/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
index 0ad654fc60..a3d01eec45 100644
|
||||
--- a/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
+++ b/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
@@ -253,6 +253,14 @@ Decrypt = RSA-2048
|
||||
Input = 550AF55A2904E7B9762352F8FB7FA235A9CB053AACB2D5FCB8CA48453CB2EE3619746C701ABF2D4CC67003471A187900B05AA812BD25ED05C675DFC8C97A24A7BF49BD6214992CAD766D05A9A2B57B74F26A737E0237B8B76C45F1F226A836D7CFBC75BA999BDBE48DBC09227AA46C88F21DCCBA7840141AD5A5D71FD122E6BD6AC3E564780DFE623FC1CA9B995A6037BF0BBD43B205A84AC5444F34202C05CE9113087176432476576DE6FFFF9A52EA57C08BE3EC2F49676CB8E12F762AC71FA3C321E00AC988910C85FF52F93825666CE0D40FFAA0592078919D4493F46D95CCF76364C6D57760DD0B64805F9AFC76A2365A5575CA301D5103F0EA76CB9A78
|
||||
Output = "Hello World"
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
+# Note: disable the Bleichenbacher workaround to see if it passes
|
||||
+Decrypt = RSA-2048
|
||||
+Ctrl = rsa_pkcs1_implicit_rejection:0
|
||||
+Input = 550AF55A2904E7B9762352F8FB7FA235A9CB053AACB2D5FCB8CA48453CB2EE3619746C701ABF2D4CC67003471A187900B05AA812BD25ED05C675DFC8C97A24A7BF49BD6214992CAD766D05A9A2B57B74F26A737E0237B8B76C45F1F226A836D7CFBC75BA999BDBE48DBC09227AA46C88F21DCCBA7840141AD5A5D71FD122E6BD6AC3E564780DFE623FC1CA9B995A6037BF0BBD43B205A84AC5444F34202C05CE9113087176432476576DE6FFFF9A52EA57C08BE3EC2F49676CB8E12F762AC71FA3C321E00AC988910C85FF52F93825666CE0D40FFAA0592078919D4493F46D95CCF76364C6D57760DD0B64805F9AFC76A2365A5575CA301D5103F0EA76CB9A78
|
||||
+Output = "Hello World"
|
||||
+
|
||||
# The old FIPS provider doesn't include the workaround (#13817)
|
||||
FIPSversion = >3.0.0
|
||||
# Corrupted ciphertext
|
||||
@@ -261,6 +269,16 @@ Decrypt = RSA-2048
|
||||
Input = 550AF55A2904E7B9762352F8FB7FA235A9CB053AACB2D5FCB8CA48453CB2EE3619746C701ABF2D4CC67003471A187900B05AA812BD25ED05C675DFC8C97A24A7BF49BD6214992CAD766D05A9A2B57B74F26A737E0237B8B76C45F1F226A836D7CFBC75BA999BDBE48DBC09227AA46C88F21DCCBA7840141AD5A5D71FD122E6BD6AC3E564780DFE623FC1CA9B995A6037BF0BBD43B205A84AC5444F34202C05CE9113087176432476576DE6FFFF9A52EA57C08BE3EC2F49676CB8E12F762AC71FA3C321E00AC988910C85FF52F93825666CE0D40FFAA0592078919D4493F46D95CCF76364C6D57760DD0B64805F9AFC76A2365A5575CA301D5103F0EA76CB9A79
|
||||
Output = 4cbb988d6a46228379132b0b5f8c249b3860043848c93632fb982c807c7c82fffc7a9ef83f4908f890373ac181ffea6381e103bcaa27e65638b6ecebef38b59ed4226a9d12af675cfcb634d8c40e7a7aff
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
+# Corrupted ciphertext
|
||||
+# Note: disable the Bleichenbacher workaround to see if it fails
|
||||
+Decrypt = RSA-2048
|
||||
+Ctrl = rsa_pkcs1_implicit_rejection:0
|
||||
+Input = 550AF55A2904E7B9762352F8FB7FA235A9CB053AACB2D5FCB8CA48453CB2EE3619746C701ABF2D4CC67003471A187900B05AA812BD25ED05C675DFC8C97A24A7BF49BD6214992CAD766D05A9A2B57B74F26A737E0237B8B76C45F1F226A836D7CFBC75BA999BDBE48DBC09227AA46C88F21DCCBA7840141AD5A5D71FD122E6BD6AC3E564780DFE623FC1CA9B995A6037BF0BBD43B205A84AC5444F34202C05CE9113087176432476576DE6FFFF9A52EA57C08BE3EC2F49676CB8E12F762AC71FA3C321E00AC988910C85FF52F93825666CE0D40FFAA0592078919D4493F46D95CCF76364C6D57760DD0B64805F9AFC76A2365A5575CA301D5103F0EA76CB9A79
|
||||
+Output = "Hello World"
|
||||
+Result = KEYOP_ERROR
|
||||
+
|
||||
# OAEP padding
|
||||
Decrypt = RSA-2048
|
||||
Ctrl = rsa_padding_mode:oaep
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -13,13 +13,19 @@ SRC_URI = "https://github.com/openssl/openssl/releases/download/openssl-${PV}/op
|
||||
file://afalg.patch \
|
||||
file://0001-Configure-do-not-tweak-mips-cflags.patch \
|
||||
file://CVE-2024-41996.patch \
|
||||
"
|
||||
file://CVE-2023-50781-1.patch \
|
||||
file://CVE-2023-50781-2.patch \
|
||||
file://CVE-2023-50781-3.patch \
|
||||
file://CVE-2023-50781-4.patch \
|
||||
file://CVE-2023-50781-5.patch \
|
||||
file://CVE-2023-50781-6.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:class-nativesdk = " \
|
||||
file://environment.d-openssl.sh \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "dfdd77e4ea1b57ff3a6dbde6b0bdc3f31db5ac99e7fdd4eaf9e1fbb6ec2db8ce"
|
||||
SRC_URI[sha256sum] = "d80c34f5cf902dccf1f1b5df5ebb86d0392e37049e5d73df1b3abae72e4ffe8b"
|
||||
|
||||
inherit lib_package multilib_header multilib_script ptest perlnative
|
||||
MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
|
||||
@@ -0,0 +1,254 @@
|
||||
From 9d3f347a2b14652e767d51142600206a32676b62 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
Date: Mon, 24 Jan 2022 20:57:19 +0200
|
||||
Subject: [PATCH] DPP3: Add PKEX initiator retries and fallback from v2 to v1
|
||||
for hostapd
|
||||
|
||||
This extends hostapd with the design used in wpa_supplicant for PKEX
|
||||
initiator retries and automatic version fallback from v2 to v1 (the
|
||||
latter is enabled only with CONFIG_DPP3=y).
|
||||
|
||||
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
|
||||
CVE: CVE-2022-37660
|
||||
|
||||
Upstream-Status: Backport [https://git.w1.fi/cgit/hostap/commit/?id=9d3f347a2b14652e767d51142600206a32676b62]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
src/ap/dpp_hostapd.c | 188 +++++++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 171 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c
|
||||
index 13e1fc5..6c30ba3 100644
|
||||
--- a/src/ap/dpp_hostapd.c
|
||||
+++ b/src/ap/dpp_hostapd.c
|
||||
@@ -216,6 +216,163 @@ static void hostapd_dpp_auth_resp_retry(struct hostapd_data *hapd)
|
||||
}
|
||||
|
||||
|
||||
+static int hostapd_dpp_allow_ir(struct hostapd_data *hapd, unsigned int freq)
|
||||
+{
|
||||
+ int i, j;
|
||||
+
|
||||
+ if (!hapd->iface->hw_features)
|
||||
+ return -1;
|
||||
+
|
||||
+ for (i = 0; i < hapd->iface->num_hw_features; i++) {
|
||||
+ struct hostapd_hw_modes *mode = &hapd->iface->hw_features[i];
|
||||
+
|
||||
+ for (j = 0; j < mode->num_channels; j++) {
|
||||
+ struct hostapd_channel_data *chan = &mode->channels[j];
|
||||
+
|
||||
+ if (chan->freq != (int) freq)
|
||||
+ continue;
|
||||
+
|
||||
+ if (chan->flag & (HOSTAPD_CHAN_DISABLED |
|
||||
+ HOSTAPD_CHAN_NO_IR |
|
||||
+ HOSTAPD_CHAN_RADAR))
|
||||
+ continue;
|
||||
+
|
||||
+ return 1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: Frequency %u MHz not supported or does not allow PKEX initiation in the current channel list",
|
||||
+ freq);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int hostapd_dpp_pkex_next_channel(struct hostapd_data *hapd,
|
||||
+ struct dpp_pkex *pkex)
|
||||
+{
|
||||
+ if (pkex->freq == 2437)
|
||||
+ pkex->freq = 5745;
|
||||
+ else if (pkex->freq == 5745)
|
||||
+ pkex->freq = 5220;
|
||||
+ else if (pkex->freq == 5220)
|
||||
+ pkex->freq = 60480;
|
||||
+ else
|
||||
+ return -1; /* no more channels to try */
|
||||
+
|
||||
+ if (hostapd_dpp_allow_ir(hapd, pkex->freq) == 1) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Try to initiate on %u MHz",
|
||||
+ pkex->freq);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ /* Could not use this channel - try the next one */
|
||||
+ return hostapd_dpp_pkex_next_channel(hapd, pkex);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int hostapd_dpp_pkex_init(struct hostapd_data *hapd, bool v2)
|
||||
+{
|
||||
+ struct dpp_pkex *pkex;
|
||||
+ struct wpabuf *msg;
|
||||
+ unsigned int wait_time;
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Initiating PKEXv%d", v2 ? 2 : 1);
|
||||
+ dpp_pkex_free(hapd->dpp_pkex);
|
||||
+ hapd->dpp_pkex = dpp_pkex_init(hapd->msg_ctx, hapd->dpp_pkex_bi,
|
||||
+ hapd->own_addr,
|
||||
+ hapd->dpp_pkex_identifier,
|
||||
+ hapd->dpp_pkex_code, v2);
|
||||
+ pkex = hapd->dpp_pkex;
|
||||
+ if (!pkex)
|
||||
+ return -1;
|
||||
+
|
||||
+ msg = hapd->dpp_pkex->exchange_req;
|
||||
+ wait_time = 2000; /* TODO: hapd->max_remain_on_chan; */
|
||||
+ pkex->freq = 2437;
|
||||
+ wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR
|
||||
+ " freq=%u type=%d", MAC2STR(broadcast), pkex->freq,
|
||||
+ v2 ? DPP_PA_PKEX_EXCHANGE_REQ :
|
||||
+ DPP_PA_PKEX_V1_EXCHANGE_REQ);
|
||||
+ hostapd_drv_send_action(hapd, pkex->freq, 0, broadcast,
|
||||
+ wpabuf_head(msg), wpabuf_len(msg));
|
||||
+ pkex->exch_req_wait_time = wait_time;
|
||||
+ pkex->exch_req_tries = 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static void hostapd_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||
+{
|
||||
+ struct hostapd_data *hapd = eloop_ctx;
|
||||
+ struct dpp_pkex *pkex = hapd->dpp_pkex;
|
||||
+
|
||||
+ if (!pkex || !pkex->exchange_req)
|
||||
+ return;
|
||||
+ if (pkex->exch_req_tries >= 5) {
|
||||
+ if (hostapd_dpp_pkex_next_channel(hapd, pkex) < 0) {
|
||||
+#ifdef CONFIG_DPP3
|
||||
+ if (pkex->v2) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: Fall back to PKEXv1");
|
||||
+ hostapd_dpp_pkex_init(hapd, false);
|
||||
+ return;
|
||||
+ }
|
||||
+#endif /* CONFIG_DPP3 */
|
||||
+ wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_FAIL
|
||||
+ "No response from PKEX peer");
|
||||
+ dpp_pkex_free(pkex);
|
||||
+ hapd->dpp_pkex = NULL;
|
||||
+ return;
|
||||
+ }
|
||||
+ pkex->exch_req_tries = 0;
|
||||
+ }
|
||||
+
|
||||
+ pkex->exch_req_tries++;
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Retransmit PKEX Exchange Request (try %u)",
|
||||
+ pkex->exch_req_tries);
|
||||
+ wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR
|
||||
+ " freq=%u type=%d",
|
||||
+ MAC2STR(broadcast), pkex->freq,
|
||||
+ pkex->v2 ? DPP_PA_PKEX_EXCHANGE_REQ :
|
||||
+ DPP_PA_PKEX_V1_EXCHANGE_REQ);
|
||||
+ hostapd_drv_send_action(hapd, pkex->freq, pkex->exch_req_wait_time,
|
||||
+ broadcast,
|
||||
+ wpabuf_head(pkex->exchange_req),
|
||||
+ wpabuf_len(pkex->exchange_req));
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static void hostapd_dpp_pkex_tx_status(struct hostapd_data *hapd, const u8 *dst,
|
||||
+ const u8 *data, size_t data_len, int ok)
|
||||
+{
|
||||
+ struct dpp_pkex *pkex = hapd->dpp_pkex;
|
||||
+
|
||||
+ if (pkex->failed) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: Terminate PKEX exchange due to an earlier error");
|
||||
+ if (pkex->t > pkex->own_bi->pkex_t)
|
||||
+ pkex->own_bi->pkex_t = pkex->t;
|
||||
+ dpp_pkex_free(pkex);
|
||||
+ hapd->dpp_pkex = NULL;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (pkex->exch_req_wait_time && pkex->exchange_req) {
|
||||
+ /* Wait for PKEX Exchange Response frame and retry request if
|
||||
+ * no response is seen. */
|
||||
+ eloop_cancel_timeout(hostapd_dpp_pkex_retry_timeout, hapd,
|
||||
+ NULL);
|
||||
+ eloop_register_timeout(pkex->exch_req_wait_time / 1000,
|
||||
+ (pkex->exch_req_wait_time % 1000) * 1000,
|
||||
+ hostapd_dpp_pkex_retry_timeout, hapd,
|
||||
+ NULL);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
void hostapd_dpp_tx_status(struct hostapd_data *hapd, const u8 *dst,
|
||||
const u8 *data, size_t data_len, int ok)
|
||||
{
|
||||
@@ -227,6 +384,11 @@ void hostapd_dpp_tx_status(struct hostapd_data *hapd, const u8 *dst,
|
||||
" result=%s", MAC2STR(dst), ok ? "SUCCESS" : "FAILED");
|
||||
|
||||
if (!hapd->dpp_auth) {
|
||||
+ if (hapd->dpp_pkex) {
|
||||
+ hostapd_dpp_pkex_tx_status(hapd, dst, data, data_len,
|
||||
+ ok);
|
||||
+ return;
|
||||
+ }
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Ignore TX status since there is no ongoing authentication exchange");
|
||||
return;
|
||||
@@ -1783,6 +1945,9 @@ hostapd_dpp_rx_pkex_exchange_resp(struct hostapd_data *hapd, const u8 *src,
|
||||
return;
|
||||
}
|
||||
|
||||
+ eloop_cancel_timeout(hostapd_dpp_pkex_retry_timeout, hapd, NULL);
|
||||
+ hapd->dpp_pkex->exch_req_wait_time = 0;
|
||||
+
|
||||
msg = dpp_pkex_rx_exchange_resp(hapd->dpp_pkex, src, buf, len);
|
||||
if (!msg) {
|
||||
wpa_printf(MSG_DEBUG, "DPP: Failed to process the response");
|
||||
@@ -2172,26 +2337,14 @@ int hostapd_dpp_pkex_add(struct hostapd_data *hapd, const char *cmd)
|
||||
return -1;
|
||||
|
||||
if (os_strstr(cmd, " init=1") || os_strstr(cmd, " init=2")) {
|
||||
- struct wpabuf *msg;
|
||||
+#ifdef CONFIG_DPP3
|
||||
+ bool v2 = true;
|
||||
+#else /* CONFIG_DPP3 */
|
||||
bool v2 = os_strstr(cmd, " init=2") != NULL;
|
||||
+#endif /* CONFIG_DPP3 */
|
||||
|
||||
- wpa_printf(MSG_DEBUG, "DPP: Initiating PKEX");
|
||||
- dpp_pkex_free(hapd->dpp_pkex);
|
||||
- hapd->dpp_pkex = dpp_pkex_init(hapd->msg_ctx, own_bi,
|
||||
- hapd->own_addr,
|
||||
- hapd->dpp_pkex_identifier,
|
||||
- hapd->dpp_pkex_code, v2);
|
||||
- if (!hapd->dpp_pkex)
|
||||
+ if (hostapd_dpp_pkex_init(hapd, v2) < 0)
|
||||
return -1;
|
||||
-
|
||||
- msg = hapd->dpp_pkex->exchange_req;
|
||||
- /* TODO: Which channel to use? */
|
||||
- wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR
|
||||
- " freq=%u type=%d", MAC2STR(broadcast), 2437,
|
||||
- v2 ? DPP_PA_PKEX_EXCHANGE_REQ :
|
||||
- DPP_PA_PKEX_V1_EXCHANGE_REQ);
|
||||
- hostapd_drv_send_action(hapd, 2437, 0, broadcast,
|
||||
- wpabuf_head(msg), wpabuf_len(msg));
|
||||
}
|
||||
|
||||
/* TODO: Support multiple PKEX info entries */
|
||||
@@ -2319,6 +2472,7 @@ void hostapd_dpp_deinit(struct hostapd_data *hapd)
|
||||
#endif /* CONFIG_TESTING_OPTIONS */
|
||||
if (!hapd->dpp_init_done)
|
||||
return;
|
||||
+ eloop_cancel_timeout(hostapd_dpp_pkex_retry_timeout, hapd, NULL);
|
||||
eloop_cancel_timeout(hostapd_dpp_reply_wait_timeout, hapd, NULL);
|
||||
eloop_cancel_timeout(hostapd_dpp_auth_conf_wait_timeout, hapd, NULL);
|
||||
eloop_cancel_timeout(hostapd_dpp_init_timeout, hapd, NULL);
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
From 80213629981a21825e4688fde1b590e4c4d4bcea Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
Date: Mon, 24 Jan 2022 20:21:24 +0200
|
||||
Subject: [PATCH] DPP3: Start with PKEXv2 and fall back to v1
|
||||
|
||||
Use automatic PKEX version negotiation as the initiator by starting with
|
||||
PKEXv2 and if no response is received, trying again with PKEXv1. For
|
||||
now, this is enabled only in wpa_supplicant CONFIG_DPP3=y builds.
|
||||
|
||||
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
|
||||
CVE: CVE-2022-37660
|
||||
|
||||
Upstream-Status: Backport [https://git.w1.fi/cgit/hostap/commit/?id=80213629981a21825e4688fde1b590e4c4d4bcea]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
wpa_supplicant/dpp_supplicant.c | 81 +++++++++++++++++++++------------
|
||||
1 file changed, 52 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c
|
||||
index 584654a..43c85d3 100644
|
||||
--- a/wpa_supplicant/dpp_supplicant.c
|
||||
+++ b/wpa_supplicant/dpp_supplicant.c
|
||||
@@ -2557,6 +2557,45 @@ static int wpas_dpp_pkex_next_channel(struct wpa_supplicant *wpa_s,
|
||||
}
|
||||
|
||||
|
||||
+static int wpas_dpp_pkex_init(struct wpa_supplicant *wpa_s, bool v2)
|
||||
+{
|
||||
+ struct dpp_pkex *pkex;
|
||||
+ struct wpabuf *msg;
|
||||
+ unsigned int wait_time;
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Initiating PKEXv%d", v2 ? 2 : 1);
|
||||
+ dpp_pkex_free(wpa_s->dpp_pkex);
|
||||
+ wpa_s->dpp_pkex = dpp_pkex_init(wpa_s, wpa_s->dpp_pkex_bi,
|
||||
+ wpa_s->own_addr,
|
||||
+ wpa_s->dpp_pkex_identifier,
|
||||
+ wpa_s->dpp_pkex_code, v2);
|
||||
+ pkex = wpa_s->dpp_pkex;
|
||||
+ if (!pkex)
|
||||
+ return -1;
|
||||
+
|
||||
+ msg = pkex->exchange_req;
|
||||
+ wait_time = wpa_s->max_remain_on_chan;
|
||||
+ if (wait_time > 2000)
|
||||
+ wait_time = 2000;
|
||||
+ pkex->freq = 2437;
|
||||
+ wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR
|
||||
+ " freq=%u type=%d",
|
||||
+ MAC2STR(broadcast), pkex->freq,
|
||||
+ v2 ? DPP_PA_PKEX_EXCHANGE_REQ :
|
||||
+ DPP_PA_PKEX_V1_EXCHANGE_REQ);
|
||||
+ offchannel_send_action(wpa_s, pkex->freq, broadcast,
|
||||
+ wpa_s->own_addr, broadcast,
|
||||
+ wpabuf_head(msg), wpabuf_len(msg),
|
||||
+ wait_time, wpas_dpp_tx_pkex_status, 0);
|
||||
+ if (wait_time == 0)
|
||||
+ wait_time = 2000;
|
||||
+ pkex->exch_req_wait_time = wait_time;
|
||||
+ pkex->exch_req_tries = 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static void wpas_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = eloop_ctx;
|
||||
@@ -2566,6 +2605,14 @@ static void wpas_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||
return;
|
||||
if (pkex->exch_req_tries >= 5) {
|
||||
if (wpas_dpp_pkex_next_channel(wpa_s, pkex) < 0) {
|
||||
+#ifdef CONFIG_DPP3
|
||||
+ if (pkex->v2) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: Fall back to PKEXv1");
|
||||
+ wpas_dpp_pkex_init(wpa_s, false);
|
||||
+ return;
|
||||
+ }
|
||||
+#endif /* CONFIG_DPP3 */
|
||||
wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_FAIL
|
||||
"No response from PKEX peer");
|
||||
dpp_pkex_free(pkex);
|
||||
@@ -3271,7 +3318,6 @@ int wpas_dpp_pkex_add(struct wpa_supplicant *wpa_s, const char *cmd)
|
||||
{
|
||||
struct dpp_bootstrap_info *own_bi;
|
||||
const char *pos, *end;
|
||||
- unsigned int wait_time;
|
||||
|
||||
pos = os_strstr(cmd, " own=");
|
||||
if (!pos)
|
||||
@@ -3315,37 +3361,14 @@ int wpas_dpp_pkex_add(struct wpa_supplicant *wpa_s, const char *cmd)
|
||||
return -1;
|
||||
|
||||
if (os_strstr(cmd, " init=1") || os_strstr(cmd, " init=2")) {
|
||||
- struct dpp_pkex *pkex;
|
||||
- struct wpabuf *msg;
|
||||
+#ifdef CONFIG_DPP3
|
||||
+ bool v2 = true;
|
||||
+#else /* CONFIG_DPP3 */
|
||||
bool v2 = os_strstr(cmd, " init=2") != NULL;
|
||||
+#endif /* CONFIG_DPP3 */
|
||||
|
||||
- wpa_printf(MSG_DEBUG, "DPP: Initiating PKEX");
|
||||
- dpp_pkex_free(wpa_s->dpp_pkex);
|
||||
- wpa_s->dpp_pkex = dpp_pkex_init(wpa_s, own_bi, wpa_s->own_addr,
|
||||
- wpa_s->dpp_pkex_identifier,
|
||||
- wpa_s->dpp_pkex_code, v2);
|
||||
- pkex = wpa_s->dpp_pkex;
|
||||
- if (!pkex)
|
||||
+ if (wpas_dpp_pkex_init(wpa_s, v2) < 0)
|
||||
return -1;
|
||||
-
|
||||
- msg = pkex->exchange_req;
|
||||
- wait_time = wpa_s->max_remain_on_chan;
|
||||
- if (wait_time > 2000)
|
||||
- wait_time = 2000;
|
||||
- pkex->freq = 2437;
|
||||
- wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR
|
||||
- " freq=%u type=%d",
|
||||
- MAC2STR(broadcast), pkex->freq,
|
||||
- v2 ? DPP_PA_PKEX_EXCHANGE_REQ :
|
||||
- DPP_PA_PKEX_V1_EXCHANGE_REQ);
|
||||
- offchannel_send_action(wpa_s, pkex->freq, broadcast,
|
||||
- wpa_s->own_addr, broadcast,
|
||||
- wpabuf_head(msg), wpabuf_len(msg),
|
||||
- wait_time, wpas_dpp_tx_pkex_status, 0);
|
||||
- if (wait_time == 0)
|
||||
- wait_time = 2000;
|
||||
- pkex->exch_req_wait_time = wait_time;
|
||||
- pkex->exch_req_tries = 1;
|
||||
}
|
||||
|
||||
/* TODO: Support multiple PKEX info entries */
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
From bdcccbc2755dd1a75731496782e02b5435fb9534 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
Date: Tue, 25 Jan 2022 20:06:49 +0200
|
||||
Subject: [PATCH] DPP: Change PKEX version configuration design
|
||||
|
||||
Use a separate ver=<1|2> parameter to DPP_PKEX_ADD instead of
|
||||
overloading init=1 with version indication. This allows additional
|
||||
options for forcing v1-only and v2-only in addition to automatic mode
|
||||
(start with v2 and fall back to v1, if needed).
|
||||
|
||||
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
|
||||
CVE: CVE-2022-37660
|
||||
|
||||
Upstream-Status: Backport [https://git.w1.fi/cgit/hostap/commit/?id=bdcccbc2755dd1a75731496782e02b5435fb9534]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
src/ap/dpp_hostapd.c | 37 ++++++++++++++++++++++++++-------
|
||||
src/common/dpp.h | 1 +
|
||||
wpa_supplicant/dpp_supplicant.c | 37 ++++++++++++++++++++++++++-------
|
||||
3 files changed, 61 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c
|
||||
index 6c30ba3..fdfdcf9 100644
|
||||
--- a/src/ap/dpp_hostapd.c
|
||||
+++ b/src/ap/dpp_hostapd.c
|
||||
@@ -272,11 +272,19 @@ static int hostapd_dpp_pkex_next_channel(struct hostapd_data *hapd,
|
||||
}
|
||||
|
||||
|
||||
-static int hostapd_dpp_pkex_init(struct hostapd_data *hapd, bool v2)
|
||||
+enum hostapd_dpp_pkex_ver {
|
||||
+ PKEX_VER_AUTO,
|
||||
+ PKEX_VER_ONLY_1,
|
||||
+ PKEX_VER_ONLY_2,
|
||||
+};
|
||||
+
|
||||
+static int hostapd_dpp_pkex_init(struct hostapd_data *hapd,
|
||||
+ enum hostapd_dpp_pkex_ver ver)
|
||||
{
|
||||
struct dpp_pkex *pkex;
|
||||
struct wpabuf *msg;
|
||||
unsigned int wait_time;
|
||||
+ bool v2 = ver != PKEX_VER_ONLY_1;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "DPP: Initiating PKEXv%d", v2 ? 2 : 1);
|
||||
dpp_pkex_free(hapd->dpp_pkex);
|
||||
@@ -287,6 +295,7 @@ static int hostapd_dpp_pkex_init(struct hostapd_data *hapd, bool v2)
|
||||
pkex = hapd->dpp_pkex;
|
||||
if (!pkex)
|
||||
return -1;
|
||||
+ pkex->forced_ver = ver != PKEX_VER_AUTO;
|
||||
|
||||
msg = hapd->dpp_pkex->exchange_req;
|
||||
wait_time = 2000; /* TODO: hapd->max_remain_on_chan; */
|
||||
@@ -314,10 +323,10 @@ static void hostapd_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||
if (pkex->exch_req_tries >= 5) {
|
||||
if (hostapd_dpp_pkex_next_channel(hapd, pkex) < 0) {
|
||||
#ifdef CONFIG_DPP3
|
||||
- if (pkex->v2) {
|
||||
+ if (pkex->v2 && !pkex->forced_ver) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Fall back to PKEXv1");
|
||||
- hostapd_dpp_pkex_init(hapd, false);
|
||||
+ hostapd_dpp_pkex_init(hapd, PKEX_VER_ONLY_1);
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_DPP3 */
|
||||
@@ -2336,14 +2345,28 @@ int hostapd_dpp_pkex_add(struct hostapd_data *hapd, const char *cmd)
|
||||
if (!hapd->dpp_pkex_code)
|
||||
return -1;
|
||||
|
||||
- if (os_strstr(cmd, " init=1") || os_strstr(cmd, " init=2")) {
|
||||
+ if (os_strstr(cmd, " init=1")) {
|
||||
#ifdef CONFIG_DPP3
|
||||
- bool v2 = true;
|
||||
+ enum hostapd_dpp_pkex_ver ver = PKEX_VER_AUTO;
|
||||
#else /* CONFIG_DPP3 */
|
||||
- bool v2 = os_strstr(cmd, " init=2") != NULL;
|
||||
+ enum hostapd_dpp_pkex_ver ver = PKEX_VER_ONLY_1;
|
||||
#endif /* CONFIG_DPP3 */
|
||||
|
||||
- if (hostapd_dpp_pkex_init(hapd, v2) < 0)
|
||||
+ pos = os_strstr(cmd, " ver=");
|
||||
+ if (pos) {
|
||||
+ int v;
|
||||
+
|
||||
+ pos += 5;
|
||||
+ v = atoi(pos);
|
||||
+ if (v == 1)
|
||||
+ ver = PKEX_VER_ONLY_1;
|
||||
+ else if (v == 2)
|
||||
+ ver = PKEX_VER_ONLY_2;
|
||||
+ else
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (hostapd_dpp_pkex_init(hapd, ver) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
diff --git a/src/common/dpp.h b/src/common/dpp.h
|
||||
index 8d62a0e..bfea446 100644
|
||||
--- a/src/common/dpp.h
|
||||
+++ b/src/common/dpp.h
|
||||
@@ -177,6 +177,7 @@ struct dpp_pkex {
|
||||
unsigned int exchange_done:1;
|
||||
unsigned int failed:1;
|
||||
unsigned int v2:1;
|
||||
+ unsigned int forced_ver:1;
|
||||
struct dpp_bootstrap_info *own_bi;
|
||||
u8 own_mac[ETH_ALEN];
|
||||
u8 peer_mac[ETH_ALEN];
|
||||
diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c
|
||||
index 43c85d3..61b300f 100644
|
||||
--- a/wpa_supplicant/dpp_supplicant.c
|
||||
+++ b/wpa_supplicant/dpp_supplicant.c
|
||||
@@ -2557,11 +2557,19 @@ static int wpas_dpp_pkex_next_channel(struct wpa_supplicant *wpa_s,
|
||||
}
|
||||
|
||||
|
||||
-static int wpas_dpp_pkex_init(struct wpa_supplicant *wpa_s, bool v2)
|
||||
+enum wpas_dpp_pkex_ver {
|
||||
+ PKEX_VER_AUTO,
|
||||
+ PKEX_VER_ONLY_1,
|
||||
+ PKEX_VER_ONLY_2,
|
||||
+};
|
||||
+
|
||||
+static int wpas_dpp_pkex_init(struct wpa_supplicant *wpa_s,
|
||||
+ enum wpas_dpp_pkex_ver ver)
|
||||
{
|
||||
struct dpp_pkex *pkex;
|
||||
struct wpabuf *msg;
|
||||
unsigned int wait_time;
|
||||
+ bool v2 = ver != PKEX_VER_ONLY_1;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "DPP: Initiating PKEXv%d", v2 ? 2 : 1);
|
||||
dpp_pkex_free(wpa_s->dpp_pkex);
|
||||
@@ -2572,6 +2580,7 @@ static int wpas_dpp_pkex_init(struct wpa_supplicant *wpa_s, bool v2)
|
||||
pkex = wpa_s->dpp_pkex;
|
||||
if (!pkex)
|
||||
return -1;
|
||||
+ pkex->forced_ver = ver != PKEX_VER_AUTO;
|
||||
|
||||
msg = pkex->exchange_req;
|
||||
wait_time = wpa_s->max_remain_on_chan;
|
||||
@@ -2606,10 +2615,10 @@ static void wpas_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||
if (pkex->exch_req_tries >= 5) {
|
||||
if (wpas_dpp_pkex_next_channel(wpa_s, pkex) < 0) {
|
||||
#ifdef CONFIG_DPP3
|
||||
- if (pkex->v2) {
|
||||
+ if (pkex->v2 && !pkex->forced_ver) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Fall back to PKEXv1");
|
||||
- wpas_dpp_pkex_init(wpa_s, false);
|
||||
+ wpas_dpp_pkex_init(wpa_s, PKEX_VER_ONLY_1);
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_DPP3 */
|
||||
@@ -3360,14 +3369,28 @@ int wpas_dpp_pkex_add(struct wpa_supplicant *wpa_s, const char *cmd)
|
||||
if (!wpa_s->dpp_pkex_code)
|
||||
return -1;
|
||||
|
||||
- if (os_strstr(cmd, " init=1") || os_strstr(cmd, " init=2")) {
|
||||
+ if (os_strstr(cmd, " init=1")) {
|
||||
#ifdef CONFIG_DPP3
|
||||
- bool v2 = true;
|
||||
+ enum wpas_dpp_pkex_ver ver = PKEX_VER_AUTO;
|
||||
#else /* CONFIG_DPP3 */
|
||||
- bool v2 = os_strstr(cmd, " init=2") != NULL;
|
||||
+ enum wpas_dpp_pkex_ver ver = PKEX_VER_ONLY_1;
|
||||
#endif /* CONFIG_DPP3 */
|
||||
|
||||
- if (wpas_dpp_pkex_init(wpa_s, v2) < 0)
|
||||
+ pos = os_strstr(cmd, " ver=");
|
||||
+ if (pos) {
|
||||
+ int v;
|
||||
+
|
||||
+ pos += 5;
|
||||
+ v = atoi(pos);
|
||||
+ if (v == 1)
|
||||
+ ver = PKEX_VER_ONLY_1;
|
||||
+ else if (v == 2)
|
||||
+ ver = PKEX_VER_ONLY_2;
|
||||
+ else
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (wpas_dpp_pkex_init(wpa_s, ver) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -0,0 +1,941 @@
|
||||
From d7be749335f2585658cf98c4f0e7d6cd5ac06865 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <jouni@qca.qualcomm.com>
|
||||
Date: Tue, 25 Jan 2022 00:35:36 +0200
|
||||
Subject: [PATCH] DPP3: PKEX over TCP
|
||||
|
||||
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
|
||||
|
||||
CVE: CVE-2022-37660
|
||||
|
||||
Upstream-Status: Backport [https://git.w1.fi/cgit/hostap/commit/?id=d7be749335f2585658cf98c4f0e7d6cd5ac06865]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
src/ap/dpp_hostapd.c | 155 ++++++++++++++--
|
||||
src/common/dpp.h | 13 ++
|
||||
src/common/dpp_pkex.c | 18 +-
|
||||
src/common/dpp_tcp.c | 308 +++++++++++++++++++++++++++++++-
|
||||
wpa_supplicant/dpp_supplicant.c | 122 ++++++++++++-
|
||||
5 files changed, 580 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c
|
||||
index fdfdcf9..d956be9 100644
|
||||
--- a/src/ap/dpp_hostapd.c
|
||||
+++ b/src/ap/dpp_hostapd.c
|
||||
@@ -28,12 +28,16 @@ static void hostapd_dpp_auth_conf_wait_timeout(void *eloop_ctx,
|
||||
static void hostapd_dpp_auth_success(struct hostapd_data *hapd, int initiator);
|
||||
static void hostapd_dpp_init_timeout(void *eloop_ctx, void *timeout_ctx);
|
||||
static int hostapd_dpp_auth_init_next(struct hostapd_data *hapd);
|
||||
+static void hostapd_dpp_set_testing_options(struct hostapd_data *hapd,
|
||||
+ struct dpp_authentication *auth);
|
||||
#ifdef CONFIG_DPP2
|
||||
static void hostapd_dpp_reconfig_reply_wait_timeout(void *eloop_ctx,
|
||||
void *timeout_ctx);
|
||||
static void hostapd_dpp_handle_config_obj(struct hostapd_data *hapd,
|
||||
struct dpp_authentication *auth,
|
||||
struct dpp_config_obj *conf);
|
||||
+static int hostapd_dpp_process_conf_obj(void *ctx,
|
||||
+ struct dpp_authentication *auth);
|
||||
#endif /* CONFIG_DPP2 */
|
||||
|
||||
static const u8 broadcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
@@ -272,6 +276,75 @@ static int hostapd_dpp_pkex_next_channel(struct hostapd_data *hapd,
|
||||
}
|
||||
|
||||
|
||||
+#ifdef CONFIG_DPP2
|
||||
+static int hostapd_dpp_pkex_done(void *ctx, void *conn,
|
||||
+ struct dpp_bootstrap_info *peer_bi)
|
||||
+{
|
||||
+ struct hostapd_data *hapd = ctx;
|
||||
+ const char *cmd = hapd->dpp_pkex_auth_cmd;
|
||||
+ const char *pos;
|
||||
+ u8 allowed_roles = DPP_CAPAB_CONFIGURATOR;
|
||||
+ struct dpp_bootstrap_info *own_bi = NULL;
|
||||
+ struct dpp_authentication *auth;
|
||||
+
|
||||
+ if (!cmd)
|
||||
+ cmd = "";
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Start authentication after PKEX (cmd: %s)",
|
||||
+ cmd);
|
||||
+
|
||||
+ pos = os_strstr(cmd, " own=");
|
||||
+ if (pos) {
|
||||
+ pos += 5;
|
||||
+ own_bi = dpp_bootstrap_get_id(hapd->iface->interfaces->dpp,
|
||||
+ atoi(pos));
|
||||
+ if (!own_bi) {
|
||||
+ wpa_printf(MSG_INFO,
|
||||
+ "DPP: Could not find bootstrapping info for the identified local entry");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (peer_bi->curve != own_bi->curve) {
|
||||
+ wpa_printf(MSG_INFO,
|
||||
+ "DPP: Mismatching curves in bootstrapping info (peer=%s own=%s)",
|
||||
+ peer_bi->curve->name, own_bi->curve->name);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ pos = os_strstr(cmd, " role=");
|
||||
+ if (pos) {
|
||||
+ pos += 6;
|
||||
+ if (os_strncmp(pos, "configurator", 12) == 0)
|
||||
+ allowed_roles = DPP_CAPAB_CONFIGURATOR;
|
||||
+ else if (os_strncmp(pos, "enrollee", 8) == 0)
|
||||
+ allowed_roles = DPP_CAPAB_ENROLLEE;
|
||||
+ else if (os_strncmp(pos, "either", 6) == 0)
|
||||
+ allowed_roles = DPP_CAPAB_CONFIGURATOR |
|
||||
+ DPP_CAPAB_ENROLLEE;
|
||||
+ else
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ auth = dpp_auth_init(hapd->iface->interfaces->dpp, hapd->msg_ctx,
|
||||
+ peer_bi, own_bi, allowed_roles, 0,
|
||||
+ hapd->iface->hw_features,
|
||||
+ hapd->iface->num_hw_features);
|
||||
+ if (!auth)
|
||||
+ return -1;
|
||||
+
|
||||
+ hostapd_dpp_set_testing_options(hapd, auth);
|
||||
+ if (dpp_set_configurator(auth, cmd) < 0) {
|
||||
+ dpp_auth_deinit(auth);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return dpp_tcp_auth(hapd->iface->interfaces->dpp, conn, auth,
|
||||
+ hapd->conf->dpp_name, DPP_NETROLE_AP,
|
||||
+ hostapd_dpp_process_conf_obj);
|
||||
+}
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
+
|
||||
+
|
||||
enum hostapd_dpp_pkex_ver {
|
||||
PKEX_VER_AUTO,
|
||||
PKEX_VER_ONLY_1,
|
||||
@@ -279,7 +352,9 @@ enum hostapd_dpp_pkex_ver {
|
||||
};
|
||||
|
||||
static int hostapd_dpp_pkex_init(struct hostapd_data *hapd,
|
||||
- enum hostapd_dpp_pkex_ver ver)
|
||||
+ enum hostapd_dpp_pkex_ver ver,
|
||||
+ const struct hostapd_ip_addr *ipaddr,
|
||||
+ int tcp_port)
|
||||
{
|
||||
struct dpp_pkex *pkex;
|
||||
struct wpabuf *msg;
|
||||
@@ -288,15 +363,26 @@ static int hostapd_dpp_pkex_init(struct hostapd_data *hapd,
|
||||
|
||||
wpa_printf(MSG_DEBUG, "DPP: Initiating PKEXv%d", v2 ? 2 : 1);
|
||||
dpp_pkex_free(hapd->dpp_pkex);
|
||||
- hapd->dpp_pkex = dpp_pkex_init(hapd->msg_ctx, hapd->dpp_pkex_bi,
|
||||
- hapd->own_addr,
|
||||
- hapd->dpp_pkex_identifier,
|
||||
- hapd->dpp_pkex_code, v2);
|
||||
- pkex = hapd->dpp_pkex;
|
||||
+ hapd->dpp_pkex = NULL;
|
||||
+ pkex = dpp_pkex_init(hapd->msg_ctx, hapd->dpp_pkex_bi, hapd->own_addr,
|
||||
+ hapd->dpp_pkex_identifier,
|
||||
+ hapd->dpp_pkex_code, v2);
|
||||
if (!pkex)
|
||||
return -1;
|
||||
pkex->forced_ver = ver != PKEX_VER_AUTO;
|
||||
|
||||
+ if (ipaddr) {
|
||||
+#ifdef CONFIG_DPP2
|
||||
+ return dpp_tcp_pkex_init(hapd->iface->interfaces->dpp, pkex,
|
||||
+ ipaddr, tcp_port,
|
||||
+ hapd->msg_ctx, hapd,
|
||||
+ hostapd_dpp_pkex_done);
|
||||
+#else /* CONFIG_DPP2 */
|
||||
+ return -1;
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
+ }
|
||||
+
|
||||
+ hapd->dpp_pkex = pkex;
|
||||
msg = hapd->dpp_pkex->exchange_req;
|
||||
wait_time = 2000; /* TODO: hapd->max_remain_on_chan; */
|
||||
pkex->freq = 2437;
|
||||
@@ -326,7 +412,8 @@ static void hostapd_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||
if (pkex->v2 && !pkex->forced_ver) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Fall back to PKEXv1");
|
||||
- hostapd_dpp_pkex_init(hapd, PKEX_VER_ONLY_1);
|
||||
+ hostapd_dpp_pkex_init(hapd, PKEX_VER_ONLY_1,
|
||||
+ NULL, 0);
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_DPP3 */
|
||||
@@ -1883,7 +1970,7 @@ static void hostapd_dpp_rx_peer_disc_req(struct hostapd_data *hapd,
|
||||
|
||||
static void
|
||||
hostapd_dpp_rx_pkex_exchange_req(struct hostapd_data *hapd, const u8 *src,
|
||||
- const u8 *buf, size_t len,
|
||||
+ const u8 *hdr, const u8 *buf, size_t len,
|
||||
unsigned int freq, bool v2)
|
||||
{
|
||||
struct wpabuf *msg;
|
||||
@@ -1897,14 +1984,14 @@ hostapd_dpp_rx_pkex_exchange_req(struct hostapd_data *hapd, const u8 *src,
|
||||
if (!hapd->dpp_pkex_code || !hapd->dpp_pkex_bi) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: No PKEX code configured - ignore request");
|
||||
- return;
|
||||
+ goto try_relay;
|
||||
}
|
||||
|
||||
if (hapd->dpp_pkex) {
|
||||
/* TODO: Support parallel operations */
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Already in PKEX session - ignore new request");
|
||||
- return;
|
||||
+ goto try_relay;
|
||||
}
|
||||
|
||||
hapd->dpp_pkex = dpp_pkex_rx_exchange_req(hapd->msg_ctx,
|
||||
@@ -1916,7 +2003,7 @@ hostapd_dpp_rx_pkex_exchange_req(struct hostapd_data *hapd, const u8 *src,
|
||||
if (!hapd->dpp_pkex) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Failed to process the request - ignore it");
|
||||
- return;
|
||||
+ goto try_relay;
|
||||
}
|
||||
|
||||
msg = hapd->dpp_pkex->exchange_resp;
|
||||
@@ -1933,6 +2020,17 @@ hostapd_dpp_rx_pkex_exchange_req(struct hostapd_data *hapd, const u8 *src,
|
||||
dpp_pkex_free(hapd->dpp_pkex);
|
||||
hapd->dpp_pkex = NULL;
|
||||
}
|
||||
+
|
||||
+ return;
|
||||
+
|
||||
+try_relay:
|
||||
+#ifdef CONFIG_DPP2
|
||||
+ if (v2)
|
||||
+ dpp_relay_rx_action(hapd->iface->interfaces->dpp,
|
||||
+ src, hdr, buf, len, freq, NULL, NULL, hapd);
|
||||
+#else /* CONFIG_DPP2 */
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: No relay functionality included - skip");
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
}
|
||||
|
||||
|
||||
@@ -2132,12 +2230,12 @@ void hostapd_dpp_rx_action(struct hostapd_data *hapd, const u8 *src,
|
||||
/* This is for PKEXv2, but for now, process only with
|
||||
* CONFIG_DPP3 to avoid issues with a capability that has not
|
||||
* been tested with other implementations. */
|
||||
- hostapd_dpp_rx_pkex_exchange_req(hapd, src, buf, len, freq,
|
||||
+ hostapd_dpp_rx_pkex_exchange_req(hapd, src, hdr, buf, len, freq,
|
||||
true);
|
||||
break;
|
||||
#endif /* CONFIG_DPP3 */
|
||||
case DPP_PA_PKEX_V1_EXCHANGE_REQ:
|
||||
- hostapd_dpp_rx_pkex_exchange_req(hapd, src, buf, len, freq,
|
||||
+ hostapd_dpp_rx_pkex_exchange_req(hapd, src, hdr, buf, len, freq,
|
||||
false);
|
||||
break;
|
||||
case DPP_PA_PKEX_EXCHANGE_RESP:
|
||||
@@ -2303,6 +2401,29 @@ int hostapd_dpp_pkex_add(struct hostapd_data *hapd, const char *cmd)
|
||||
{
|
||||
struct dpp_bootstrap_info *own_bi;
|
||||
const char *pos, *end;
|
||||
+ int tcp_port = DPP_TCP_PORT;
|
||||
+ struct hostapd_ip_addr *ipaddr = NULL;
|
||||
+#ifdef CONFIG_DPP2
|
||||
+ struct hostapd_ip_addr ipaddr_buf;
|
||||
+ char *addr;
|
||||
+
|
||||
+ pos = os_strstr(cmd, " tcp_port=");
|
||||
+ if (pos) {
|
||||
+ pos += 10;
|
||||
+ tcp_port = atoi(pos);
|
||||
+ }
|
||||
+
|
||||
+ addr = get_param(cmd, " tcp_addr=");
|
||||
+ if (addr) {
|
||||
+ int res;
|
||||
+
|
||||
+ res = hostapd_parse_ip_addr(addr, &ipaddr_buf);
|
||||
+ os_free(addr);
|
||||
+ if (res)
|
||||
+ return -1;
|
||||
+ ipaddr = &ipaddr_buf;
|
||||
+ }
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
|
||||
pos = os_strstr(cmd, " own=");
|
||||
if (!pos)
|
||||
@@ -2366,8 +2487,14 @@ int hostapd_dpp_pkex_add(struct hostapd_data *hapd, const char *cmd)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (hostapd_dpp_pkex_init(hapd, ver) < 0)
|
||||
+ if (hostapd_dpp_pkex_init(hapd, ver, ipaddr, tcp_port) < 0)
|
||||
return -1;
|
||||
+ } else {
|
||||
+#ifdef CONFIG_DPP2
|
||||
+ dpp_controller_pkex_add(hapd->iface->interfaces->dpp, own_bi,
|
||||
+ hapd->dpp_pkex_code,
|
||||
+ hapd->dpp_pkex_identifier);
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
}
|
||||
|
||||
/* TODO: Support multiple PKEX info entries */
|
||||
diff --git a/src/common/dpp.h b/src/common/dpp.h
|
||||
index bfea446..ca33fe3 100644
|
||||
--- a/src/common/dpp.h
|
||||
+++ b/src/common/dpp.h
|
||||
@@ -550,6 +550,9 @@ int dpp_auth_conf_rx(struct dpp_authentication *auth, const u8 *hdr,
|
||||
const u8 *attr_start, size_t attr_len);
|
||||
int dpp_notify_new_qr_code(struct dpp_authentication *auth,
|
||||
struct dpp_bootstrap_info *peer_bi);
|
||||
+void dpp_controller_pkex_add(struct dpp_global *dpp,
|
||||
+ struct dpp_bootstrap_info *bi,
|
||||
+ const char *code, const char *identifier);
|
||||
struct dpp_configuration * dpp_configuration_alloc(const char *type);
|
||||
int dpp_akm_psk(enum dpp_akm akm);
|
||||
int dpp_akm_sae(enum dpp_akm akm);
|
||||
@@ -688,12 +691,22 @@ struct dpp_authentication * dpp_controller_get_auth(struct dpp_global *dpp,
|
||||
unsigned int id);
|
||||
void dpp_controller_new_qr_code(struct dpp_global *dpp,
|
||||
struct dpp_bootstrap_info *bi);
|
||||
+int dpp_tcp_pkex_init(struct dpp_global *dpp, struct dpp_pkex *pkex,
|
||||
+ const struct hostapd_ip_addr *addr, int port,
|
||||
+ void *msg_ctx, void *cb_ctx,
|
||||
+ int (*pkex_done)(void *ctx, void *conn,
|
||||
+ struct dpp_bootstrap_info *bi));
|
||||
int dpp_tcp_init(struct dpp_global *dpp, struct dpp_authentication *auth,
|
||||
const struct hostapd_ip_addr *addr, int port,
|
||||
const char *name, enum dpp_netrole netrole, void *msg_ctx,
|
||||
void *cb_ctx,
|
||||
int (*process_conf_obj)(void *ctx,
|
||||
struct dpp_authentication *auth));
|
||||
+int dpp_tcp_auth(struct dpp_global *dpp, void *_conn,
|
||||
+ struct dpp_authentication *auth, const char *name,
|
||||
+ enum dpp_netrole netrole,
|
||||
+ int (*process_conf_obj)(void *ctx,
|
||||
+ struct dpp_authentication *auth));
|
||||
|
||||
struct wpabuf * dpp_build_presence_announcement(struct dpp_bootstrap_info *bi);
|
||||
void dpp_notify_chirp_received(void *msg_ctx, int id, const u8 *src,
|
||||
diff --git a/src/common/dpp_pkex.c b/src/common/dpp_pkex.c
|
||||
index 38349fa..72084d9 100644
|
||||
--- a/src/common/dpp_pkex.c
|
||||
+++ b/src/common/dpp_pkex.c
|
||||
@@ -469,8 +469,10 @@ struct dpp_pkex * dpp_pkex_rx_exchange_req(void *msg_ctx,
|
||||
pkex->t = bi->pkex_t;
|
||||
pkex->msg_ctx = msg_ctx;
|
||||
pkex->own_bi = bi;
|
||||
- os_memcpy(pkex->own_mac, own_mac, ETH_ALEN);
|
||||
- os_memcpy(pkex->peer_mac, peer_mac, ETH_ALEN);
|
||||
+ if (own_mac)
|
||||
+ os_memcpy(pkex->own_mac, own_mac, ETH_ALEN);
|
||||
+ if (peer_mac)
|
||||
+ os_memcpy(pkex->peer_mac, peer_mac, ETH_ALEN);
|
||||
if (identifier) {
|
||||
pkex->identifier = os_strdup(identifier);
|
||||
if (!pkex->identifier)
|
||||
@@ -742,7 +744,8 @@ struct wpabuf * dpp_pkex_rx_exchange_resp(struct dpp_pkex *pkex,
|
||||
}
|
||||
#endif /* CONFIG_DPP2 */
|
||||
|
||||
- os_memcpy(pkex->peer_mac, peer_mac, ETH_ALEN);
|
||||
+ if (peer_mac)
|
||||
+ os_memcpy(pkex->peer_mac, peer_mac, ETH_ALEN);
|
||||
|
||||
attr_status = dpp_get_attr(buf, buflen, DPP_ATTR_STATUS,
|
||||
&attr_status_len);
|
||||
@@ -1341,9 +1344,12 @@ dpp_pkex_finish(struct dpp_global *dpp, struct dpp_pkex *pkex, const u8 *peer,
|
||||
return NULL;
|
||||
bi->id = dpp_next_id(dpp);
|
||||
bi->type = DPP_BOOTSTRAP_PKEX;
|
||||
- os_memcpy(bi->mac_addr, peer, ETH_ALEN);
|
||||
- bi->num_freq = 1;
|
||||
- bi->freq[0] = freq;
|
||||
+ if (peer)
|
||||
+ os_memcpy(bi->mac_addr, peer, ETH_ALEN);
|
||||
+ if (freq) {
|
||||
+ bi->num_freq = 1;
|
||||
+ bi->freq[0] = freq;
|
||||
+ }
|
||||
bi->curve = pkex->own_bi->curve;
|
||||
bi->pubkey = pkex->peer_bootstrap_key;
|
||||
pkex->peer_bootstrap_key = NULL;
|
||||
diff --git a/src/common/dpp_tcp.c b/src/common/dpp_tcp.c
|
||||
index fb8ef1c..1a8a7c7 100644
|
||||
--- a/src/common/dpp_tcp.c
|
||||
+++ b/src/common/dpp_tcp.c
|
||||
@@ -24,10 +24,12 @@ struct dpp_connection {
|
||||
struct dpp_controller *ctrl;
|
||||
struct dpp_relay_controller *relay;
|
||||
struct dpp_global *global;
|
||||
+ struct dpp_pkex *pkex;
|
||||
struct dpp_authentication *auth;
|
||||
void *msg_ctx;
|
||||
void *cb_ctx;
|
||||
int (*process_conf_obj)(void *ctx, struct dpp_authentication *auth);
|
||||
+ int (*pkex_done)(void *ctx, void *conn, struct dpp_bootstrap_info *bi);
|
||||
int sock;
|
||||
u8 mac_addr[ETH_ALEN];
|
||||
unsigned int freq;
|
||||
@@ -71,6 +73,9 @@ struct dpp_controller {
|
||||
struct dl_list conn; /* struct dpp_connection */
|
||||
char *configurator_params;
|
||||
enum dpp_netrole netrole;
|
||||
+ struct dpp_bootstrap_info *pkex_bi;
|
||||
+ char *pkex_code;
|
||||
+ char *pkex_identifier;
|
||||
void *msg_ctx;
|
||||
void *cb_ctx;
|
||||
int (*process_conf_obj)(void *ctx, struct dpp_authentication *auth);
|
||||
@@ -102,6 +107,7 @@ static void dpp_connection_free(struct dpp_connection *conn)
|
||||
wpabuf_free(conn->msg);
|
||||
wpabuf_free(conn->msg_out);
|
||||
dpp_auth_deinit(conn->auth);
|
||||
+ dpp_pkex_free(conn->pkex);
|
||||
os_free(conn->name);
|
||||
os_free(conn);
|
||||
}
|
||||
@@ -525,6 +531,8 @@ int dpp_relay_rx_action(struct dpp_global *dpp, const u8 *src, const u8 *hdr,
|
||||
/* TODO: Could send this to all configured Controllers. For now,
|
||||
* only the first Controller is supported. */
|
||||
ctrl = dpp_relay_controller_get_ctx(dpp, cb_ctx);
|
||||
+ } else if (type == DPP_PA_PKEX_EXCHANGE_REQ) {
|
||||
+ ctrl = dpp_relay_controller_get_ctx(dpp, cb_ctx);
|
||||
} else {
|
||||
if (!r_bootstrap)
|
||||
return -1;
|
||||
@@ -609,6 +617,8 @@ static void dpp_controller_free(struct dpp_controller *ctrl)
|
||||
eloop_unregister_sock(ctrl->sock, EVENT_TYPE_READ);
|
||||
}
|
||||
os_free(ctrl->configurator_params);
|
||||
+ os_free(ctrl->pkex_code);
|
||||
+ os_free(ctrl->pkex_identifier);
|
||||
os_free(ctrl);
|
||||
}
|
||||
|
||||
@@ -955,6 +965,143 @@ static int dpp_controller_rx_reconfig_auth_resp(struct dpp_connection *conn,
|
||||
}
|
||||
|
||||
|
||||
+static int dpp_controller_rx_pkex_exchange_req(struct dpp_connection *conn,
|
||||
+ const u8 *hdr, const u8 *buf,
|
||||
+ size_t len)
|
||||
+{
|
||||
+ struct dpp_controller *ctrl = conn->ctrl;
|
||||
+
|
||||
+ if (!ctrl)
|
||||
+ return 0;
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: PKEX Exchange Request");
|
||||
+
|
||||
+ /* TODO: Support multiple PKEX codes by iterating over all the enabled
|
||||
+ * values here */
|
||||
+
|
||||
+ if (!ctrl->pkex_code || !ctrl->pkex_bi) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: No PKEX code configured - ignore request");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (conn->pkex || conn->auth) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: Already in PKEX/Authentication session - ignore new PKEX request");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ conn->pkex = dpp_pkex_rx_exchange_req(conn->ctrl->global, ctrl->pkex_bi,
|
||||
+ NULL, NULL,
|
||||
+ ctrl->pkex_identifier,
|
||||
+ ctrl->pkex_code,
|
||||
+ buf, len, true);
|
||||
+ if (!conn->pkex) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: Failed to process the request");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return dpp_tcp_send_msg(conn, conn->pkex->exchange_resp);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int dpp_controller_rx_pkex_exchange_resp(struct dpp_connection *conn,
|
||||
+ const u8 *hdr, const u8 *buf,
|
||||
+ size_t len)
|
||||
+{
|
||||
+ struct dpp_pkex *pkex = conn->pkex;
|
||||
+ struct wpabuf *msg;
|
||||
+ int res;
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: PKEX Exchange Response");
|
||||
+
|
||||
+ if (!pkex || !pkex->initiator || pkex->exchange_done) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: No matching PKEX session");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ msg = dpp_pkex_rx_exchange_resp(pkex, NULL, buf, len);
|
||||
+ if (!msg) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Failed to process the response");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Send PKEX Commit-Reveal Request");
|
||||
+ res = dpp_tcp_send_msg(conn, msg);
|
||||
+ wpabuf_free(msg);
|
||||
+ return res;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int dpp_controller_rx_pkex_commit_reveal_req(struct dpp_connection *conn,
|
||||
+ const u8 *hdr,
|
||||
+ const u8 *buf, size_t len)
|
||||
+{
|
||||
+ struct dpp_pkex *pkex = conn->pkex;
|
||||
+ struct wpabuf *msg;
|
||||
+ int res;
|
||||
+ struct dpp_bootstrap_info *bi;
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: PKEX Commit-Reveal Request");
|
||||
+
|
||||
+ if (!pkex || pkex->initiator || !pkex->exchange_done) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: No matching PKEX session");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ msg = dpp_pkex_rx_commit_reveal_req(pkex, hdr, buf, len);
|
||||
+ if (!msg) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Failed to process the request");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Send PKEX Commit-Reveal Response");
|
||||
+ res = dpp_tcp_send_msg(conn, msg);
|
||||
+ wpabuf_free(msg);
|
||||
+ if (res < 0)
|
||||
+ return res;
|
||||
+ bi = dpp_pkex_finish(conn->global, pkex, NULL, 0);
|
||||
+ if (!bi)
|
||||
+ return -1;
|
||||
+ conn->pkex = NULL;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int
|
||||
+dpp_controller_rx_pkex_commit_reveal_resp(struct dpp_connection *conn,
|
||||
+ const u8 *hdr,
|
||||
+ const u8 *buf, size_t len)
|
||||
+{
|
||||
+ struct dpp_pkex *pkex = conn->pkex;
|
||||
+ int res;
|
||||
+ struct dpp_bootstrap_info *bi;
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: PKEX Commit-Reveal Response");
|
||||
+
|
||||
+ if (!pkex || !pkex->initiator || !pkex->exchange_done) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: No matching PKEX session");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ res = dpp_pkex_rx_commit_reveal_resp(pkex, hdr, buf, len);
|
||||
+ if (res < 0) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Failed to process the response");
|
||||
+ return res;
|
||||
+ }
|
||||
+
|
||||
+ bi = dpp_pkex_finish(conn->global, pkex, NULL, 0);
|
||||
+ if (!bi)
|
||||
+ return -1;
|
||||
+ conn->pkex = NULL;
|
||||
+
|
||||
+ if (!conn->pkex_done)
|
||||
+ return -1;
|
||||
+ return conn->pkex_done(conn->cb_ctx, conn, bi);
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int dpp_controller_rx_action(struct dpp_connection *conn, const u8 *msg,
|
||||
size_t len)
|
||||
{
|
||||
@@ -1014,6 +1161,22 @@ static int dpp_controller_rx_action(struct dpp_connection *conn, const u8 *msg,
|
||||
case DPP_PA_RECONFIG_AUTH_RESP:
|
||||
return dpp_controller_rx_reconfig_auth_resp(conn, msg, pos,
|
||||
end - pos);
|
||||
+ case DPP_PA_PKEX_V1_EXCHANGE_REQ:
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: Ignore PKEXv1 Exchange Request - not supported over TCP");
|
||||
+ return -1;
|
||||
+ case DPP_PA_PKEX_EXCHANGE_REQ:
|
||||
+ return dpp_controller_rx_pkex_exchange_req(conn, msg, pos,
|
||||
+ end - pos);
|
||||
+ case DPP_PA_PKEX_EXCHANGE_RESP:
|
||||
+ return dpp_controller_rx_pkex_exchange_resp(conn, msg, pos,
|
||||
+ end - pos);
|
||||
+ case DPP_PA_PKEX_COMMIT_REVEAL_REQ:
|
||||
+ return dpp_controller_rx_pkex_commit_reveal_req(conn, msg, pos,
|
||||
+ end - pos);
|
||||
+ case DPP_PA_PKEX_COMMIT_REVEAL_RESP:
|
||||
+ return dpp_controller_rx_pkex_commit_reveal_resp(conn, msg, pos,
|
||||
+ end - pos);
|
||||
default:
|
||||
/* TODO: missing messages types */
|
||||
wpa_printf(MSG_DEBUG,
|
||||
@@ -1559,6 +1722,101 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
+int dpp_tcp_pkex_init(struct dpp_global *dpp, struct dpp_pkex *pkex,
|
||||
+ const struct hostapd_ip_addr *addr, int port,
|
||||
+ void *msg_ctx, void *cb_ctx,
|
||||
+ int (*pkex_done)(void *ctx, void *conn,
|
||||
+ struct dpp_bootstrap_info *bi))
|
||||
+{
|
||||
+ struct dpp_connection *conn;
|
||||
+ struct sockaddr_storage saddr;
|
||||
+ socklen_t addrlen;
|
||||
+ const u8 *hdr, *pos, *end;
|
||||
+ char txt[100];
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Initialize TCP connection to %s port %d",
|
||||
+ hostapd_ip_txt(addr, txt, sizeof(txt)), port);
|
||||
+ if (dpp_ipaddr_to_sockaddr((struct sockaddr *) &saddr, &addrlen,
|
||||
+ addr, port) < 0) {
|
||||
+ dpp_pkex_free(pkex);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ conn = os_zalloc(sizeof(*conn));
|
||||
+ if (!conn) {
|
||||
+ dpp_pkex_free(pkex);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ conn->msg_ctx = msg_ctx;
|
||||
+ conn->cb_ctx = cb_ctx;
|
||||
+ conn->pkex_done = pkex_done;
|
||||
+ conn->global = dpp;
|
||||
+ conn->pkex = pkex;
|
||||
+ conn->sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
+ if (conn->sock < 0)
|
||||
+ goto fail;
|
||||
+
|
||||
+ if (fcntl(conn->sock, F_SETFL, O_NONBLOCK) != 0) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: fnctl(O_NONBLOCK) failed: %s",
|
||||
+ strerror(errno));
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ if (connect(conn->sock, (struct sockaddr *) &saddr, addrlen) < 0) {
|
||||
+ if (errno != EINPROGRESS) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Failed to connect: %s",
|
||||
+ strerror(errno));
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Continue connecting in the background; eloop will call us
|
||||
+ * once the connection is ready (or failed).
|
||||
+ */
|
||||
+ }
|
||||
+
|
||||
+ if (eloop_register_sock(conn->sock, EVENT_TYPE_WRITE,
|
||||
+ dpp_conn_tx_ready, conn, NULL) < 0)
|
||||
+ goto fail;
|
||||
+ conn->write_eloop = 1;
|
||||
+
|
||||
+ hdr = wpabuf_head(pkex->exchange_req);
|
||||
+ end = hdr + wpabuf_len(pkex->exchange_req);
|
||||
+ hdr += 2; /* skip Category and Actiom */
|
||||
+ pos = hdr + DPP_HDR_LEN;
|
||||
+ conn->msg_out = dpp_tcp_encaps(hdr, pos, end - pos);
|
||||
+ if (!conn->msg_out)
|
||||
+ goto fail;
|
||||
+ /* Message will be sent in dpp_conn_tx_ready() */
|
||||
+
|
||||
+ /* TODO: eloop timeout to clear a connection if it does not complete
|
||||
+ * properly */
|
||||
+ dl_list_add(&dpp->tcp_init, &conn->list);
|
||||
+ return 0;
|
||||
+fail:
|
||||
+ dpp_connection_free(conn);
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int dpp_tcp_auth_start(struct dpp_connection *conn,
|
||||
+ struct dpp_authentication *auth)
|
||||
+{
|
||||
+ const u8 *hdr, *pos, *end;
|
||||
+
|
||||
+ hdr = wpabuf_head(auth->req_msg);
|
||||
+ end = hdr + wpabuf_len(auth->req_msg);
|
||||
+ hdr += 2; /* skip Category and Actiom */
|
||||
+ pos = hdr + DPP_HDR_LEN;
|
||||
+ conn->msg_out = dpp_tcp_encaps(hdr, pos, end - pos);
|
||||
+ if (!conn->msg_out)
|
||||
+ return -1;
|
||||
+ /* Message will be sent in dpp_conn_tx_ready() */
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
int dpp_tcp_init(struct dpp_global *dpp, struct dpp_authentication *auth,
|
||||
const struct hostapd_ip_addr *addr, int port, const char *name,
|
||||
enum dpp_netrole netrole, void *msg_ctx, void *cb_ctx,
|
||||
@@ -1568,7 +1826,6 @@ int dpp_tcp_init(struct dpp_global *dpp, struct dpp_authentication *auth,
|
||||
struct dpp_connection *conn;
|
||||
struct sockaddr_storage saddr;
|
||||
socklen_t addrlen;
|
||||
- const u8 *hdr, *pos, *end;
|
||||
char txt[100];
|
||||
|
||||
wpa_printf(MSG_DEBUG, "DPP: Initialize TCP connection to %s port %d",
|
||||
@@ -1620,14 +1877,8 @@ int dpp_tcp_init(struct dpp_global *dpp, struct dpp_authentication *auth,
|
||||
goto fail;
|
||||
conn->write_eloop = 1;
|
||||
|
||||
- hdr = wpabuf_head(auth->req_msg);
|
||||
- end = hdr + wpabuf_len(auth->req_msg);
|
||||
- hdr += 2; /* skip Category and Actiom */
|
||||
- pos = hdr + DPP_HDR_LEN;
|
||||
- conn->msg_out = dpp_tcp_encaps(hdr, pos, end - pos);
|
||||
- if (!conn->msg_out)
|
||||
+ if (dpp_tcp_auth_start(conn, auth) < 0)
|
||||
goto fail;
|
||||
- /* Message will be sent in dpp_conn_tx_ready() */
|
||||
|
||||
/* TODO: eloop timeout to clear a connection if it does not complete
|
||||
* properly */
|
||||
@@ -1639,6 +1890,30 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
+int dpp_tcp_auth(struct dpp_global *dpp, void *_conn,
|
||||
+ struct dpp_authentication *auth, const char *name,
|
||||
+ enum dpp_netrole netrole,
|
||||
+ int (*process_conf_obj)(void *ctx,
|
||||
+ struct dpp_authentication *auth))
|
||||
+{
|
||||
+ struct dpp_connection *conn = _conn;
|
||||
+
|
||||
+ /* Continue with Authentication exchange on an existing TCP connection.
|
||||
+ */
|
||||
+ conn->process_conf_obj = process_conf_obj;
|
||||
+ os_free(conn->name);
|
||||
+ conn->name = os_strdup(name ? name : "Test");
|
||||
+ conn->netrole = netrole;
|
||||
+ conn->auth = auth;
|
||||
+
|
||||
+ if (dpp_tcp_auth_start(conn, auth) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ dpp_conn_tx_ready(conn->sock, conn, NULL);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
int dpp_controller_start(struct dpp_global *dpp,
|
||||
struct dpp_controller_config *config)
|
||||
{
|
||||
@@ -1789,6 +2064,23 @@ void dpp_controller_new_qr_code(struct dpp_global *dpp,
|
||||
}
|
||||
|
||||
|
||||
+void dpp_controller_pkex_add(struct dpp_global *dpp,
|
||||
+ struct dpp_bootstrap_info *bi,
|
||||
+ const char *code, const char *identifier)
|
||||
+{
|
||||
+ struct dpp_controller *ctrl = dpp->controller;
|
||||
+
|
||||
+ if (!ctrl)
|
||||
+ return;
|
||||
+
|
||||
+ ctrl->pkex_bi = bi;
|
||||
+ os_free(ctrl->pkex_code);
|
||||
+ ctrl->pkex_code = code ? os_strdup(code) : NULL;
|
||||
+ os_free(ctrl->pkex_identifier);
|
||||
+ ctrl->pkex_identifier = identifier ? os_strdup(identifier) : NULL;
|
||||
+}
|
||||
+
|
||||
+
|
||||
void dpp_tcp_init_flush(struct dpp_global *dpp)
|
||||
{
|
||||
struct dpp_connection *conn, *tmp;
|
||||
diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c
|
||||
index 61b300f..aab94cb 100644
|
||||
--- a/wpa_supplicant/dpp_supplicant.c
|
||||
+++ b/wpa_supplicant/dpp_supplicant.c
|
||||
@@ -2557,6 +2557,71 @@ static int wpas_dpp_pkex_next_channel(struct wpa_supplicant *wpa_s,
|
||||
}
|
||||
|
||||
|
||||
+#ifdef CONFIG_DPP2
|
||||
+static int wpas_dpp_pkex_done(void *ctx, void *conn,
|
||||
+ struct dpp_bootstrap_info *peer_bi)
|
||||
+{
|
||||
+ struct wpa_supplicant *wpa_s = ctx;
|
||||
+ const char *cmd = wpa_s->dpp_pkex_auth_cmd;
|
||||
+ const char *pos;
|
||||
+ u8 allowed_roles = DPP_CAPAB_CONFIGURATOR;
|
||||
+ struct dpp_bootstrap_info *own_bi = NULL;
|
||||
+ struct dpp_authentication *auth;
|
||||
+
|
||||
+ if (!cmd)
|
||||
+ cmd = "";
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Start authentication after PKEX (cmd: %s)",
|
||||
+ cmd);
|
||||
+
|
||||
+ pos = os_strstr(cmd, " own=");
|
||||
+ if (pos) {
|
||||
+ pos += 5;
|
||||
+ own_bi = dpp_bootstrap_get_id(wpa_s->dpp, atoi(pos));
|
||||
+ if (!own_bi) {
|
||||
+ wpa_printf(MSG_INFO,
|
||||
+ "DPP: Could not find bootstrapping info for the identified local entry");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (peer_bi->curve != own_bi->curve) {
|
||||
+ wpa_printf(MSG_INFO,
|
||||
+ "DPP: Mismatching curves in bootstrapping info (peer=%s own=%s)",
|
||||
+ peer_bi->curve->name, own_bi->curve->name);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ pos = os_strstr(cmd, " role=");
|
||||
+ if (pos) {
|
||||
+ pos += 6;
|
||||
+ if (os_strncmp(pos, "configurator", 12) == 0)
|
||||
+ allowed_roles = DPP_CAPAB_CONFIGURATOR;
|
||||
+ else if (os_strncmp(pos, "enrollee", 8) == 0)
|
||||
+ allowed_roles = DPP_CAPAB_ENROLLEE;
|
||||
+ else if (os_strncmp(pos, "either", 6) == 0)
|
||||
+ allowed_roles = DPP_CAPAB_CONFIGURATOR |
|
||||
+ DPP_CAPAB_ENROLLEE;
|
||||
+ else
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ auth = dpp_auth_init(wpa_s->dpp, wpa_s, peer_bi, own_bi, allowed_roles,
|
||||
+ 0, wpa_s->hw.modes, wpa_s->hw.num_modes);
|
||||
+ if (!auth)
|
||||
+ return -1;
|
||||
+
|
||||
+ wpas_dpp_set_testing_options(wpa_s, auth);
|
||||
+ if (dpp_set_configurator(auth, cmd) < 0) {
|
||||
+ dpp_auth_deinit(auth);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return dpp_tcp_auth(wpa_s->dpp, conn, auth, wpa_s->conf->dpp_name,
|
||||
+ DPP_NETROLE_STA, wpas_dpp_process_conf_obj);
|
||||
+}
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
+
|
||||
+
|
||||
enum wpas_dpp_pkex_ver {
|
||||
PKEX_VER_AUTO,
|
||||
PKEX_VER_ONLY_1,
|
||||
@@ -2564,7 +2629,9 @@ enum wpas_dpp_pkex_ver {
|
||||
};
|
||||
|
||||
static int wpas_dpp_pkex_init(struct wpa_supplicant *wpa_s,
|
||||
- enum wpas_dpp_pkex_ver ver)
|
||||
+ enum wpas_dpp_pkex_ver ver,
|
||||
+ const struct hostapd_ip_addr *ipaddr,
|
||||
+ int tcp_port)
|
||||
{
|
||||
struct dpp_pkex *pkex;
|
||||
struct wpabuf *msg;
|
||||
@@ -2573,15 +2640,24 @@ static int wpas_dpp_pkex_init(struct wpa_supplicant *wpa_s,
|
||||
|
||||
wpa_printf(MSG_DEBUG, "DPP: Initiating PKEXv%d", v2 ? 2 : 1);
|
||||
dpp_pkex_free(wpa_s->dpp_pkex);
|
||||
- wpa_s->dpp_pkex = dpp_pkex_init(wpa_s, wpa_s->dpp_pkex_bi,
|
||||
- wpa_s->own_addr,
|
||||
- wpa_s->dpp_pkex_identifier,
|
||||
- wpa_s->dpp_pkex_code, v2);
|
||||
- pkex = wpa_s->dpp_pkex;
|
||||
+ wpa_s->dpp_pkex = NULL;
|
||||
+ pkex = dpp_pkex_init(wpa_s, wpa_s->dpp_pkex_bi, wpa_s->own_addr,
|
||||
+ wpa_s->dpp_pkex_identifier,
|
||||
+ wpa_s->dpp_pkex_code, v2);
|
||||
if (!pkex)
|
||||
return -1;
|
||||
pkex->forced_ver = ver != PKEX_VER_AUTO;
|
||||
|
||||
+ if (ipaddr) {
|
||||
+#ifdef CONFIG_DPP2
|
||||
+ return dpp_tcp_pkex_init(wpa_s->dpp, pkex, ipaddr, tcp_port,
|
||||
+ wpa_s, wpa_s, wpas_dpp_pkex_done);
|
||||
+#else /* CONFIG_DPP2 */
|
||||
+ return -1;
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
+ }
|
||||
+
|
||||
+ wpa_s->dpp_pkex = pkex;
|
||||
msg = pkex->exchange_req;
|
||||
wait_time = wpa_s->max_remain_on_chan;
|
||||
if (wait_time > 2000)
|
||||
@@ -2618,7 +2694,8 @@ static void wpas_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||
if (pkex->v2 && !pkex->forced_ver) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Fall back to PKEXv1");
|
||||
- wpas_dpp_pkex_init(wpa_s, PKEX_VER_ONLY_1);
|
||||
+ wpas_dpp_pkex_init(wpa_s, PKEX_VER_ONLY_1,
|
||||
+ NULL, 0);
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_DPP3 */
|
||||
@@ -3327,6 +3404,29 @@ int wpas_dpp_pkex_add(struct wpa_supplicant *wpa_s, const char *cmd)
|
||||
{
|
||||
struct dpp_bootstrap_info *own_bi;
|
||||
const char *pos, *end;
|
||||
+ int tcp_port = DPP_TCP_PORT;
|
||||
+ struct hostapd_ip_addr *ipaddr = NULL;
|
||||
+#ifdef CONFIG_DPP2
|
||||
+ struct hostapd_ip_addr ipaddr_buf;
|
||||
+ char *addr;
|
||||
+
|
||||
+ pos = os_strstr(cmd, " tcp_port=");
|
||||
+ if (pos) {
|
||||
+ pos += 10;
|
||||
+ tcp_port = atoi(pos);
|
||||
+ }
|
||||
+
|
||||
+ addr = get_param(cmd, " tcp_addr=");
|
||||
+ if (addr) {
|
||||
+ int res;
|
||||
+
|
||||
+ res = hostapd_parse_ip_addr(addr, &ipaddr_buf);
|
||||
+ os_free(addr);
|
||||
+ if (res)
|
||||
+ return -1;
|
||||
+ ipaddr = &ipaddr_buf;
|
||||
+ }
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
|
||||
pos = os_strstr(cmd, " own=");
|
||||
if (!pos)
|
||||
@@ -3390,8 +3490,14 @@ int wpas_dpp_pkex_add(struct wpa_supplicant *wpa_s, const char *cmd)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (wpas_dpp_pkex_init(wpa_s, ver) < 0)
|
||||
+ if (wpas_dpp_pkex_init(wpa_s, ver, ipaddr, tcp_port) < 0)
|
||||
return -1;
|
||||
+ } else {
|
||||
+#ifdef CONFIG_DPP2
|
||||
+ dpp_controller_pkex_add(wpa_s->dpp, own_bi,
|
||||
+ wpa_s->dpp_pkex_code,
|
||||
+ wpa_s->dpp_pkex_identifier);
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
}
|
||||
|
||||
/* TODO: Support multiple PKEX info entries */
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
From 15af83cf1846870873a011ed4d714732f01cd2e4 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
Date: Tue, 19 Jul 2022 21:23:04 +0300
|
||||
Subject: [PATCH] DPP: Delete PKEX code and identifier on success completion of
|
||||
PKEX
|
||||
|
||||
We are not supposed to reuse these without being explicitly requested to
|
||||
perform PKEX again. There is not a strong use case for being able to
|
||||
provision an Enrollee multiple times with PKEX, so this should have no
|
||||
issues on the Enrollee. For a Configurator, there might be some use
|
||||
cases that would benefit from being able to use the same code with
|
||||
multiple Enrollee devices, e.g., for guess access with a laptop and a
|
||||
smart phone. That case will now require a new DPP_PKEX_ADD command on
|
||||
the Configurator after each completion of the provisioning exchange.
|
||||
|
||||
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
|
||||
CVE: CVE-2022-37660
|
||||
|
||||
Upstream-Status: Backport [https://git.w1.fi/cgit/hostap/commit/?id=15af83cf1846870873a011ed4d714732f01cd2e4]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
src/ap/dpp_hostapd.c | 22 +++++++++++++++++++++-
|
||||
wpa_supplicant/dpp_supplicant.c | 21 ++++++++++++++++++++-
|
||||
2 files changed, 41 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c
|
||||
index d956be9..73b09ba 100644
|
||||
--- a/src/ap/dpp_hostapd.c
|
||||
+++ b/src/ap/dpp_hostapd.c
|
||||
@@ -276,6 +276,22 @@ static int hostapd_dpp_pkex_next_channel(struct hostapd_data *hapd,
|
||||
}
|
||||
|
||||
|
||||
+static void hostapd_dpp_pkex_clear_code(struct hostapd_data *hapd)
|
||||
+{
|
||||
+ if (!hapd->dpp_pkex_code && !hapd->dpp_pkex_identifier)
|
||||
+ return;
|
||||
+
|
||||
+ /* Delete PKEX code and identifier on successful completion of
|
||||
+ * PKEX. We are not supposed to reuse these without being
|
||||
+ * explicitly requested to perform PKEX again. */
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Delete PKEX code/identifier");
|
||||
+ os_free(hapd->dpp_pkex_code);
|
||||
+ hapd->dpp_pkex_code = NULL;
|
||||
+ os_free(hapd->dpp_pkex_identifier);
|
||||
+ hapd->dpp_pkex_identifier = NULL;
|
||||
+}
|
||||
+
|
||||
+
|
||||
#ifdef CONFIG_DPP2
|
||||
static int hostapd_dpp_pkex_done(void *ctx, void *conn,
|
||||
struct dpp_bootstrap_info *peer_bi)
|
||||
@@ -287,6 +303,8 @@ static int hostapd_dpp_pkex_done(void *ctx, void *conn,
|
||||
struct dpp_bootstrap_info *own_bi = NULL;
|
||||
struct dpp_authentication *auth;
|
||||
|
||||
+ hostapd_dpp_pkex_clear_code(hapd);
|
||||
+
|
||||
if (!cmd)
|
||||
cmd = "";
|
||||
wpa_printf(MSG_DEBUG, "DPP: Start authentication after PKEX (cmd: %s)",
|
||||
@@ -2114,6 +2132,7 @@ hostapd_dpp_rx_pkex_commit_reveal_req(struct hostapd_data *hapd, const u8 *src,
|
||||
wpabuf_head(msg), wpabuf_len(msg));
|
||||
wpabuf_free(msg);
|
||||
|
||||
+ hostapd_dpp_pkex_clear_code(hapd);
|
||||
bi = dpp_pkex_finish(hapd->iface->interfaces->dpp, pkex, src, freq);
|
||||
if (!bi)
|
||||
return;
|
||||
@@ -2145,6 +2164,7 @@ hostapd_dpp_rx_pkex_commit_reveal_resp(struct hostapd_data *hapd, const u8 *src,
|
||||
return;
|
||||
}
|
||||
|
||||
+ hostapd_dpp_pkex_clear_code(hapd);
|
||||
bi = dpp_pkex_finish(hapd->iface->interfaces->dpp, pkex, src, freq);
|
||||
if (!bi)
|
||||
return;
|
||||
@@ -2518,7 +2538,7 @@ int hostapd_dpp_pkex_remove(struct hostapd_data *hapd, const char *id)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if ((id_val != 0 && id_val != 1) || !hapd->dpp_pkex_code)
|
||||
+ if ((id_val != 0 && id_val != 1))
|
||||
return -1;
|
||||
|
||||
/* TODO: Support multiple PKEX entries */
|
||||
diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c
|
||||
index aab94cb..015ae66 100644
|
||||
--- a/wpa_supplicant/dpp_supplicant.c
|
||||
+++ b/wpa_supplicant/dpp_supplicant.c
|
||||
@@ -2557,6 +2557,22 @@ static int wpas_dpp_pkex_next_channel(struct wpa_supplicant *wpa_s,
|
||||
}
|
||||
|
||||
|
||||
+static void wpas_dpp_pkex_clear_code(struct wpa_supplicant *wpa_s)
|
||||
+{
|
||||
+ if (!wpa_s->dpp_pkex_code && !wpa_s->dpp_pkex_identifier)
|
||||
+ return;
|
||||
+
|
||||
+ /* Delete PKEX code and identifier on successful completion of
|
||||
+ * PKEX. We are not supposed to reuse these without being
|
||||
+ * explicitly requested to perform PKEX again. */
|
||||
+ os_free(wpa_s->dpp_pkex_code);
|
||||
+ wpa_s->dpp_pkex_code = NULL;
|
||||
+ os_free(wpa_s->dpp_pkex_identifier);
|
||||
+ wpa_s->dpp_pkex_identifier = NULL;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+
|
||||
#ifdef CONFIG_DPP2
|
||||
static int wpas_dpp_pkex_done(void *ctx, void *conn,
|
||||
struct dpp_bootstrap_info *peer_bi)
|
||||
@@ -2568,6 +2584,8 @@ static int wpas_dpp_pkex_done(void *ctx, void *conn,
|
||||
struct dpp_bootstrap_info *own_bi = NULL;
|
||||
struct dpp_authentication *auth;
|
||||
|
||||
+ wpas_dpp_pkex_clear_code(wpa_s);
|
||||
+
|
||||
if (!cmd)
|
||||
cmd = "";
|
||||
wpa_printf(MSG_DEBUG, "DPP: Start authentication after PKEX (cmd: %s)",
|
||||
@@ -2872,6 +2890,7 @@ wpas_dpp_pkex_finish(struct wpa_supplicant *wpa_s, const u8 *peer,
|
||||
{
|
||||
struct dpp_bootstrap_info *bi;
|
||||
|
||||
+ wpas_dpp_pkex_clear_code(wpa_s);
|
||||
bi = dpp_pkex_finish(wpa_s->dpp, wpa_s->dpp_pkex, peer, freq);
|
||||
if (!bi)
|
||||
return NULL;
|
||||
@@ -3521,7 +3540,7 @@ int wpas_dpp_pkex_remove(struct wpa_supplicant *wpa_s, const char *id)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if ((id_val != 0 && id_val != 1) || !wpa_s->dpp_pkex_code)
|
||||
+ if ((id_val != 0 && id_val != 1))
|
||||
return -1;
|
||||
|
||||
/* TODO: Support multiple PKEX entries */
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
From 726432d7622cc0088ac353d073b59628b590ea44 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Sat, 25 Jan 2025 11:21:16 +0200
|
||||
Subject: [PATCH] RADIUS: Drop pending request only when accepting the response
|
||||
|
||||
The case of an invalid authenticator in a RADIUS response could imply
|
||||
that the response is not from the correct RADIUS server and as such,
|
||||
such a response should be discarded without changing internal state for
|
||||
the pending request. The case of an unknown response (RADIUS_RX_UNKNOWN)
|
||||
is somewhat more complex since it could have been indicated before
|
||||
validating the authenticator. In any case, it seems better to change the
|
||||
state for the pending request only when we have fully accepted the
|
||||
response.
|
||||
|
||||
Allowing the internal state of pending RADIUS request to change based on
|
||||
responses that are not fully validation could have allow at least a
|
||||
theoretical DoS attack if an attacker were to have means for injecting
|
||||
RADIUS messages to the network using the IP address of the real RADIUS
|
||||
server and being able to do so more quickly than the real server and
|
||||
with the matching identifier from the request header (i.e., either by
|
||||
flooding 256 responses quickly or by having means to capture the RADIUS
|
||||
request). These should not really be realistic options in a properly
|
||||
protected deployment, but nevertheless it is good to be more careful in
|
||||
processing RADIUS responses.
|
||||
|
||||
Remove a pending RADIUS request from the internal list only when having
|
||||
fully accepted a matching RADIUS response, i.e., after one of the
|
||||
registered handlers has confirmed that the authenticator is valid and
|
||||
processing of the response has succeeded.
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
|
||||
CVE: CVE-2025-24912
|
||||
Upstream-Status: Backport [https://w1.fi/cgit/hostap/commit/?id=726432d7622cc0088ac353d073b59628b590ea44]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
src/radius/radius_client.c | 15 +++++++--------
|
||||
1 file changed, 7 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c
|
||||
index 2a7f36170..7909b29a7 100644
|
||||
--- a/src/radius/radius_client.c
|
||||
+++ b/src/radius/radius_client.c
|
||||
@@ -922,13 +922,6 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
roundtrip / 100, roundtrip % 100);
|
||||
rconf->round_trip_time = roundtrip;
|
||||
|
||||
- /* Remove ACKed RADIUS packet from retransmit list */
|
||||
- if (prev_req)
|
||||
- prev_req->next = req->next;
|
||||
- else
|
||||
- radius->msgs = req->next;
|
||||
- radius->num_msgs--;
|
||||
-
|
||||
for (i = 0; i < num_handlers; i++) {
|
||||
RadiusRxResult res;
|
||||
res = handlers[i].handler(msg, req->msg, req->shared_secret,
|
||||
@@ -939,6 +932,13 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
radius_msg_free(msg);
|
||||
/* fall through */
|
||||
case RADIUS_RX_QUEUED:
|
||||
+ /* Remove ACKed RADIUS packet from retransmit list */
|
||||
+ if (prev_req)
|
||||
+ prev_req->next = req->next;
|
||||
+ else
|
||||
+ radius->msgs = req->next;
|
||||
+ radius->num_msgs--;
|
||||
+
|
||||
radius_client_msg_free(req);
|
||||
return;
|
||||
case RADIUS_RX_INVALID_AUTHENTICATOR:
|
||||
@@ -960,7 +960,6 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
msg_type, hdr->code, hdr->identifier,
|
||||
invalid_authenticator ? " [INVALID AUTHENTICATOR]" :
|
||||
"");
|
||||
- radius_client_msg_free(req);
|
||||
|
||||
fail:
|
||||
radius_msg_free(msg);
|
||||
@@ -0,0 +1,70 @@
|
||||
From 339a334551ca911187cc870f4f97ef08e11db109 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
Date: Wed, 5 Feb 2025 19:23:39 +0200
|
||||
Subject: [PATCH] RADIUS: Fix pending request dropping
|
||||
|
||||
A recent change to this moved the place where the processed RADIUS
|
||||
request was removed from the pending list to happen after the message
|
||||
handler had been called. This did not take into account possibility of
|
||||
the handler adding a new pending request in the list and the prev_req
|
||||
pointer not necessarily pointing to the correct entry anymore. As such,
|
||||
some of the pending requests could have been lost and that would result
|
||||
in not being able to process responses to those requests and also, to a
|
||||
memory leak.
|
||||
|
||||
Fix this by determining prev_req at the point when the pending request
|
||||
is being removed, i.e., after the handler function has already added a
|
||||
new entry.
|
||||
|
||||
Fixes: 726432d7622c ("RADIUS: Drop pending request only when accepting the response")
|
||||
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
|
||||
CVE: CVE-2025-24912
|
||||
Upstream-Status: Backport [https://w1.fi/cgit/hostap/commit/?id=339a334551ca911187cc870f4f97ef08e11db109]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
src/radius/radius_client.c | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c
|
||||
index 7909b29a7..d4faa7936 100644
|
||||
--- a/src/radius/radius_client.c
|
||||
+++ b/src/radius/radius_client.c
|
||||
@@ -824,7 +824,7 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
struct radius_hdr *hdr;
|
||||
struct radius_rx_handler *handlers;
|
||||
size_t num_handlers, i;
|
||||
- struct radius_msg_list *req, *prev_req;
|
||||
+ struct radius_msg_list *req, *prev_req, *r;
|
||||
struct os_reltime now;
|
||||
struct hostapd_radius_server *rconf;
|
||||
int invalid_authenticator = 0;
|
||||
@@ -887,7 +887,6 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
break;
|
||||
}
|
||||
|
||||
- prev_req = NULL;
|
||||
req = radius->msgs;
|
||||
while (req) {
|
||||
/* TODO: also match by src addr:port of the packet when using
|
||||
@@ -899,7 +898,6 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
hdr->identifier)
|
||||
break;
|
||||
|
||||
- prev_req = req;
|
||||
req = req->next;
|
||||
}
|
||||
|
||||
@@ -933,6 +931,12 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
/* fall through */
|
||||
case RADIUS_RX_QUEUED:
|
||||
/* Remove ACKed RADIUS packet from retransmit list */
|
||||
+ prev_req = NULL;
|
||||
+ for (r = radius->msgs; r; r = r->next) {
|
||||
+ if (r == req)
|
||||
+ break;
|
||||
+ prev_req = r;
|
||||
+ }
|
||||
if (prev_req)
|
||||
prev_req->next = req->next;
|
||||
else
|
||||
@@ -38,6 +38,13 @@ SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \
|
||||
file://0001-SAE-Check-for-invalid-Rejected-Groups-element-length.patch \
|
||||
file://0002-SAE-Check-for-invalid-Rejected-Groups-element-length.patch \
|
||||
file://0003-SAE-Reject-invalid-Rejected-Groups-element-in-the-pa.patch \
|
||||
file://CVE-2022-37660-0001.patch \
|
||||
file://CVE-2022-37660-0002.patch \
|
||||
file://CVE-2022-37660-0003.patch \
|
||||
file://CVE-2022-37660-0004.patch \
|
||||
file://CVE-2022-37660-0005.patch \
|
||||
file://CVE-2025-24912-01.patch \
|
||||
file://CVE-2025-24912-02.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "20df7ae5154b3830355f8ab4269123a87affdea59fe74fe9292a91d0d7e17b2f"
|
||||
|
||||
|
||||
57
meta/recipes-core/busybox/busybox/CVE-2025-46394-01.patch
Normal file
57
meta/recipes-core/busybox/busybox/CVE-2025-46394-01.patch
Normal file
@@ -0,0 +1,57 @@
|
||||
From f5e1bf966b19ea1821f00a8c9ecd7774598689b4 Mon Sep 17 00:00:00 2001
|
||||
From: Denys Vlasenko <vda.linux@googlemail.com>
|
||||
Date: Wed, 24 Sep 2025 03:28:47 +0200
|
||||
Subject: [PATCH] archival/libarchive: sanitize filenames on output (prevent
|
||||
control sequence attacks
|
||||
|
||||
This fixes CVE-2025-46394 (terminal escape sequence injection)
|
||||
|
||||
Original credit: Ian.Norton at entrust.com
|
||||
|
||||
function old new delta
|
||||
header_list 9 15 +6
|
||||
header_verbose_list 239 244 +5
|
||||
------------------------------------------------------------------------------
|
||||
(add/remove: 0/0 grow/shrink: 2/0 up/down: 11/0) Total: 11 bytes
|
||||
|
||||
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
||||
|
||||
CVE: CVE-2025-46394
|
||||
Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=f5e1bf966b19ea1821f00a8c9ecd7774598689b4]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
archival/libarchive/header_list.c | 2 +-
|
||||
archival/libarchive/header_verbose_list.c | 4 ++--
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/archival/libarchive/header_list.c b/archival/libarchive/header_list.c
|
||||
index 0621aa406..9490b3635 100644
|
||||
--- a/archival/libarchive/header_list.c
|
||||
+++ b/archival/libarchive/header_list.c
|
||||
@@ -8,5 +8,5 @@
|
||||
void FAST_FUNC header_list(const file_header_t *file_header)
|
||||
{
|
||||
//TODO: cpio -vp DIR should output "DIR/NAME", not just "NAME" */
|
||||
- puts(file_header->name);
|
||||
+ puts(printable_string(file_header->name));
|
||||
}
|
||||
diff --git a/archival/libarchive/header_verbose_list.c b/archival/libarchive/header_verbose_list.c
|
||||
index a575a08a0..e7a09430d 100644
|
||||
--- a/archival/libarchive/header_verbose_list.c
|
||||
+++ b/archival/libarchive/header_verbose_list.c
|
||||
@@ -57,13 +57,13 @@ void FAST_FUNC header_verbose_list(const file_header_t *file_header)
|
||||
ptm->tm_hour,
|
||||
ptm->tm_min,
|
||||
ptm->tm_sec,
|
||||
- file_header->name);
|
||||
+ printable_string(file_header->name));
|
||||
|
||||
#endif /* FEATURE_TAR_UNAME_GNAME */
|
||||
|
||||
/* NB: GNU tar shows "->" for symlinks and "link to" for hardlinks */
|
||||
if (file_header->link_target) {
|
||||
- printf(" -> %s", file_header->link_target);
|
||||
+ printf(" -> %s", printable_string(file_header->link_target));
|
||||
}
|
||||
bb_putchar('\n');
|
||||
}
|
||||
32
meta/recipes-core/busybox/busybox/CVE-2025-46394-02.patch
Normal file
32
meta/recipes-core/busybox/busybox/CVE-2025-46394-02.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
From 7378db981d87b4a2264e14d60340a7fb5c67ae59 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Marko <peter.marko@siemens.com>
|
||||
Date: Fri, 3 Oct 2025 16:12:56 +0200
|
||||
Subject: [PATCH] testsuite/tar.tests: fix test after CVE-2025-46394
|
||||
|
||||
tar now sanitizes output and this test needs to expect that.
|
||||
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
|
||||
CVE: CVE-2025-46394
|
||||
Upstream-Status: Submitted [https://lists.busybox.net/pipermail/busybox/2025-October/091743.html]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
testsuite/tar.tests | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/testsuite/tar.tests b/testsuite/tar.tests
|
||||
index 0f2e89112..48fc38114 100755
|
||||
--- a/testsuite/tar.tests
|
||||
+++ b/testsuite/tar.tests
|
||||
@@ -325,9 +325,9 @@ unset LANG
|
||||
rm -rf etc usr
|
||||
' "\
|
||||
etc/ssl/certs/3b2716e5.0
|
||||
-etc/ssl/certs/EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.pem
|
||||
+etc/ssl/certs/EBG_Elektronik_Sertifika_Hizmet_Sa??lay??c??s??.pem
|
||||
etc/ssl/certs/f80cc7f6.0
|
||||
-usr/share/ca-certificates/mozilla/EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.crt
|
||||
+usr/share/ca-certificates/mozilla/EBG_Elektronik_Sertifika_Hizmet_Sa??lay??c??s??.crt
|
||||
0
|
||||
etc/ssl/certs/3b2716e5.0 -> EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.pem
|
||||
etc/ssl/certs/EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.pem -> /usr/share/ca-certificates/mozilla/EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.crt
|
||||
@@ -59,6 +59,8 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
|
||||
file://CVE-2023-42366.patch \
|
||||
file://0001-cut-Fix-s-flag-to-omit-blank-lines.patch \
|
||||
file://CVE-2023-39810.patch \
|
||||
file://CVE-2025-46394-01.patch \
|
||||
file://CVE-2025-46394-02.patch \
|
||||
"
|
||||
SRC_URI:append:libc-musl = " file://musl.cfg "
|
||||
|
||||
|
||||
40
meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-01.patch
Normal file
40
meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-01.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
From 285db475ecaa4d2cc39ce326b4c63aacb87ca6ad Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Kanavin <alex@linutronix.de>
|
||||
Date: Tue, 22 Aug 2023 19:57:48 +0200
|
||||
Subject: [PATCH] glib/gfileutils.c: use 64 bits for value in get_tmp_file()
|
||||
|
||||
On 32 bit systems 'long' value will overflow in 2038 and become negative.
|
||||
As it is used to index into letters array, and % operation preserves signs,
|
||||
data corruption will then occur.
|
||||
|
||||
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
|
||||
|
||||
CVE: CVE-2025-7039
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/285db475ecaa4d2cc39ce326b4c63aacb87ca6ad]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
glib/gfileutils.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/glib/gfileutils.c b/glib/gfileutils.c
|
||||
index 9646c696e..bd3cc179a 100644
|
||||
--- a/glib/gfileutils.c
|
||||
+++ b/glib/gfileutils.c
|
||||
@@ -1475,7 +1475,7 @@ get_tmp_file (gchar *tmpl,
|
||||
static const char letters[] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
static const int NLETTERS = sizeof (letters) - 1;
|
||||
- glong value;
|
||||
+ gint64 value;
|
||||
gint64 now_us;
|
||||
static int counter = 0;
|
||||
|
||||
@@ -1496,7 +1496,7 @@ get_tmp_file (gchar *tmpl,
|
||||
|
||||
for (count = 0; count < 100; value += 7777, ++count)
|
||||
{
|
||||
- glong v = value;
|
||||
+ gint64 v = value;
|
||||
|
||||
/* Fill in the random bits. */
|
||||
XXXXXX[0] = letters[v % NLETTERS];
|
||||
43
meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-02.patch
Normal file
43
meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-02.patch
Normal file
@@ -0,0 +1,43 @@
|
||||
From 61e963284889ddb4544e6f1d5261c16120f6fcc3 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Catanzaro <mcatanzaro@redhat.com>
|
||||
Date: Tue, 1 Jul 2025 10:58:07 -0500
|
||||
Subject: [PATCH] gfileutils: fix computation of temporary file name
|
||||
|
||||
We need to ensure that the value we use to index into the letters array
|
||||
is always positive.
|
||||
|
||||
Fixes #3716
|
||||
|
||||
CVE: CVE-2025-7039
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/61e963284889ddb4544e6f1d5261c16120f6fcc3]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
glib/gfileutils.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/glib/gfileutils.c b/glib/gfileutils.c
|
||||
index c7d3339d1..286b1b154 100644
|
||||
--- a/glib/gfileutils.c
|
||||
+++ b/glib/gfileutils.c
|
||||
@@ -1475,9 +1475,9 @@ get_tmp_file (gchar *tmpl,
|
||||
static const char letters[] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
static const int NLETTERS = sizeof (letters) - 1;
|
||||
- gint64 value;
|
||||
- gint64 now_us;
|
||||
- static int counter = 0;
|
||||
+ guint64 value;
|
||||
+ guint64 now_us;
|
||||
+ static guint counter = 0;
|
||||
|
||||
g_return_val_if_fail (tmpl != NULL, -1);
|
||||
|
||||
@@ -1496,7 +1496,7 @@ get_tmp_file (gchar *tmpl,
|
||||
|
||||
for (count = 0; count < 100; value += 7777, ++count)
|
||||
{
|
||||
- gint64 v = value;
|
||||
+ guint64 v = value;
|
||||
|
||||
/* Fill in the random bits. */
|
||||
XXXXXX[0] = letters[v % NLETTERS];
|
||||
@@ -62,6 +62,8 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
|
||||
file://CVE-2025-3360-06.patch \
|
||||
file://CVE-2025-4373-01.patch \
|
||||
file://CVE-2025-4373-02.patch \
|
||||
file://CVE-2025-7039-01.patch \
|
||||
file://CVE-2025-7039-02.patch \
|
||||
"
|
||||
SRC_URI:append:class-native = " file://relocate-modules.patch"
|
||||
|
||||
@@ -97,3 +99,6 @@ def find_meson_cross_files(d):
|
||||
python () {
|
||||
find_meson_cross_files(d)
|
||||
}
|
||||
|
||||
# not-applicable-platform: Issue only applies on Windows
|
||||
CVE_CHECK_IGNORE += "CVE-2025-4056"
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
From 4dd540505d40babe488404f3174ec39f49a84485 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Catanzaro <mcatanzaro@redhat.com>
|
||||
Date: Mon, 4 Aug 2025 15:10:21 -0500
|
||||
Subject: [PATCH] openssl: properly check return value when writing to BIO
|
||||
objects
|
||||
|
||||
In particular, we will read out of bounds, and then write the invalid
|
||||
memory, if BIO_write() fails when getting the PROP_CERTIFICATE_PEM
|
||||
property. Here we attempt to check the return value, but the check is
|
||||
not correct.
|
||||
|
||||
This also fixes a leak of the BIO in the same place.
|
||||
|
||||
Also add error checking to PROP_SUBJECT_NAME and PROP_ISSUER_NAME, for
|
||||
good measure.
|
||||
|
||||
Fixes #226
|
||||
|
||||
CVE: CVE-2025-60018
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib-networking/-/commit/4dd540505d40babe488404f3174ec39f49a84485]
|
||||
|
||||
Signed-off-by: Rajeshkumar Ramasamy <rajeshkumar.ramasamy@windriver.com>
|
||||
---
|
||||
tls/openssl/gtlscertificate-openssl.c | 25 +++++++++++++++----------
|
||||
1 file changed, 15 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/tls/openssl/gtlscertificate-openssl.c b/tls/openssl/gtlscertificate-openssl.c
|
||||
index 648f3e8..b536559 100644
|
||||
--- a/tls/openssl/gtlscertificate-openssl.c
|
||||
+++ b/tls/openssl/gtlscertificate-openssl.c
|
||||
@@ -362,15 +362,12 @@ g_tls_certificate_openssl_get_property (GObject *object,
|
||||
case PROP_CERTIFICATE_PEM:
|
||||
bio = BIO_new (BIO_s_mem ());
|
||||
|
||||
- if (!PEM_write_bio_X509 (bio, openssl->cert) || !BIO_write (bio, "\0", 1))
|
||||
- certificate_pem = NULL;
|
||||
- else
|
||||
+ if (PEM_write_bio_X509 (bio, openssl->cert) == 1 && BIO_write (bio, "\0", 1) == 1)
|
||||
{
|
||||
BIO_get_mem_data (bio, &certificate_pem);
|
||||
g_value_set_string (value, certificate_pem);
|
||||
-
|
||||
- BIO_free_all (bio);
|
||||
}
|
||||
+ BIO_free_all (bio);
|
||||
break;
|
||||
|
||||
case PROP_PRIVATE_KEY:
|
||||
@@ -411,8 +408,12 @@ g_tls_certificate_openssl_get_property (GObject *object,
|
||||
case PROP_SUBJECT_NAME:
|
||||
bio = BIO_new (BIO_s_mem ());
|
||||
name = X509_get_subject_name (openssl->cert);
|
||||
- X509_NAME_print_ex (bio, name, 0, XN_FLAG_SEP_COMMA_PLUS);
|
||||
- BIO_write (bio, "\0", 1);
|
||||
+ if (X509_NAME_print_ex (bio, name, 0, XN_FLAG_SEP_COMMA_PLUS) < 0 ||
|
||||
+ BIO_write (bio, "\0", 1) != 1)
|
||||
+ {
|
||||
+ BIO_free_all (bio);
|
||||
+ break;
|
||||
+ }
|
||||
BIO_get_mem_data (bio, (char **)&name_string);
|
||||
g_value_set_string (value, name_string);
|
||||
BIO_free_all (bio);
|
||||
@@ -421,9 +422,13 @@ g_tls_certificate_openssl_get_property (GObject *object,
|
||||
case PROP_ISSUER_NAME:
|
||||
bio = BIO_new (BIO_s_mem ());
|
||||
name = X509_get_issuer_name (openssl->cert);
|
||||
- X509_NAME_print_ex (bio, name, 0, XN_FLAG_SEP_COMMA_PLUS);
|
||||
- BIO_write (bio, "\0", 1);
|
||||
- BIO_get_mem_data (bio, &name_string);
|
||||
+ if (X509_NAME_print_ex (bio, name, 0, XN_FLAG_SEP_COMMA_PLUS) < 0 ||
|
||||
+ BIO_write (bio, "\0", 1) != 1)
|
||||
+ {
|
||||
+ BIO_free_all (bio);
|
||||
+ break;
|
||||
+ }
|
||||
+ BIO_get_mem_data (bio, (char **)&name_string);
|
||||
g_value_set_string (value, name_string);
|
||||
BIO_free_all (bio);
|
||||
break;
|
||||
--
|
||||
2.48.1
|
||||
@@ -0,0 +1,137 @@
|
||||
From 70df675dd4f5e4a593b2f95406c1aac031aa8bc7 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Catanzaro <mcatanzaro@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 17:21:01 -0500
|
||||
Subject: [PATCH] openssl: check return values of BIO_new()
|
||||
|
||||
We probably need to check even more return values of even more OpenSSL
|
||||
functions, but these ones allocate memory and that's particularly
|
||||
important to get right.
|
||||
|
||||
CVE: CVE-2025-60019
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib-networking/-/commit/70df675dd4f5e4a593b2f95406c1aac031aa8bc7]
|
||||
|
||||
Signed-off-by: Rajeshkumar Ramasamy <rajeshkumar.ramasamy@windriver.com>
|
||||
---
|
||||
tls/openssl/gtlscertificate-openssl.c | 39 ++++++++++++++++++++-------
|
||||
1 file changed, 29 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/tls/openssl/gtlscertificate-openssl.c b/tls/openssl/gtlscertificate-openssl.c
|
||||
index 8f828a7..f7fde51 100644
|
||||
--- a/tls/openssl/gtlscertificate-openssl.c
|
||||
+++ b/tls/openssl/gtlscertificate-openssl.c
|
||||
@@ -156,6 +156,9 @@ export_privkey_to_der (GTlsCertificateOpenssl *openssl,
|
||||
goto err;
|
||||
|
||||
bio = BIO_new (BIO_s_mem ());
|
||||
+ if (!bio)
|
||||
+ goto err;
|
||||
+
|
||||
if (i2d_PKCS8_PRIV_KEY_INFO_bio (bio, pkcs8) == 0)
|
||||
goto err;
|
||||
|
||||
@@ -189,6 +192,9 @@ export_privkey_to_pem (GTlsCertificateOpenssl *openssl)
|
||||
return NULL;
|
||||
|
||||
bio = BIO_new (BIO_s_mem ());
|
||||
+ if (!bio)
|
||||
+ goto out;
|
||||
+
|
||||
ret = PEM_write_bio_PKCS8PrivateKey (bio, openssl->key, NULL, NULL, 0, NULL, NULL);
|
||||
if (ret == 0)
|
||||
goto out;
|
||||
@@ -201,7 +207,7 @@ export_privkey_to_pem (GTlsCertificateOpenssl *openssl)
|
||||
result = g_strdup (data);
|
||||
|
||||
out:
|
||||
- BIO_free_all (bio);
|
||||
+ g_clear_pointer (&bio, BIO_free_all);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -216,7 +222,7 @@ g_tls_certificate_openssl_get_property (GObject *object,
|
||||
guint8 *data;
|
||||
BIO *bio;
|
||||
GByteArray *byte_array;
|
||||
- char *certificate_pem;
|
||||
+ const char *certificate_pem;
|
||||
long size;
|
||||
|
||||
const ASN1_TIME *time_asn1;
|
||||
@@ -251,12 +257,12 @@ g_tls_certificate_openssl_get_property (GObject *object,
|
||||
case PROP_CERTIFICATE_PEM:
|
||||
bio = BIO_new (BIO_s_mem ());
|
||||
|
||||
- if (PEM_write_bio_X509 (bio, openssl->cert) == 1 && BIO_write (bio, "\0", 1) == 1)
|
||||
+ if (bio && PEM_write_bio_X509 (bio, openssl->cert) == 1 && BIO_write (bio, "\0", 1) == 1)
|
||||
{
|
||||
BIO_get_mem_data (bio, &certificate_pem);
|
||||
g_value_set_string (value, certificate_pem);
|
||||
}
|
||||
- BIO_free_all (bio);
|
||||
+ g_clear_pointer (&bio, BIO_free_all);
|
||||
break;
|
||||
|
||||
case PROP_PRIVATE_KEY:
|
||||
@@ -296,6 +302,8 @@ g_tls_certificate_openssl_get_property (GObject *object,
|
||||
|
||||
case PROP_SUBJECT_NAME:
|
||||
bio = BIO_new (BIO_s_mem ());
|
||||
+ if (!bio)
|
||||
+ break;
|
||||
name = X509_get_subject_name (openssl->cert);
|
||||
if (X509_NAME_print_ex (bio, name, 0, XN_FLAG_SEP_COMMA_PLUS) < 0 ||
|
||||
BIO_write (bio, "\0", 1) != 1)
|
||||
@@ -310,6 +318,8 @@ g_tls_certificate_openssl_get_property (GObject *object,
|
||||
|
||||
case PROP_ISSUER_NAME:
|
||||
bio = BIO_new (BIO_s_mem ());
|
||||
+ if (!bio)
|
||||
+ break;
|
||||
name = X509_get_issuer_name (openssl->cert);
|
||||
if (X509_NAME_print_ex (bio, name, 0, XN_FLAG_SEP_COMMA_PLUS) < 0 ||
|
||||
BIO_write (bio, "\0", 1) != 1)
|
||||
@@ -377,8 +387,11 @@ g_tls_certificate_openssl_set_property (GObject *object,
|
||||
break;
|
||||
g_return_if_fail (openssl->have_cert == FALSE);
|
||||
bio = BIO_new_mem_buf ((gpointer)string, -1);
|
||||
- openssl->cert = PEM_read_bio_X509 (bio, NULL, NULL, NULL);
|
||||
- BIO_free (bio);
|
||||
+ if (bio)
|
||||
+ {
|
||||
+ openssl->cert = PEM_read_bio_X509 (bio, NULL, NULL, NULL);
|
||||
+ BIO_free (bio);
|
||||
+ }
|
||||
if (openssl->cert)
|
||||
openssl->have_cert = TRUE;
|
||||
else if (!openssl->construct_error)
|
||||
@@ -397,8 +410,11 @@ g_tls_certificate_openssl_set_property (GObject *object,
|
||||
break;
|
||||
g_return_if_fail (openssl->have_key == FALSE);
|
||||
bio = BIO_new_mem_buf (bytes->data, bytes->len);
|
||||
- openssl->key = d2i_PrivateKey_bio (bio, NULL);
|
||||
- BIO_free (bio);
|
||||
+ if (bio)
|
||||
+ {
|
||||
+ openssl->key = d2i_PrivateKey_bio (bio, NULL);
|
||||
+ BIO_free (bio);
|
||||
+ }
|
||||
if (openssl->key)
|
||||
openssl->have_key = TRUE;
|
||||
else if (!openssl->construct_error)
|
||||
@@ -417,8 +433,11 @@ g_tls_certificate_openssl_set_property (GObject *object,
|
||||
break;
|
||||
g_return_if_fail (openssl->have_key == FALSE);
|
||||
bio = BIO_new_mem_buf ((gpointer)string, -1);
|
||||
- openssl->key = PEM_read_bio_PrivateKey (bio, NULL, NULL, NULL);
|
||||
- BIO_free (bio);
|
||||
+ if (bio)
|
||||
+ {
|
||||
+ openssl->key = PEM_read_bio_PrivateKey (bio, NULL, NULL, NULL);
|
||||
+ BIO_free (bio);
|
||||
+ }
|
||||
if (openssl->key)
|
||||
openssl->have_key = TRUE;
|
||||
else if (!openssl->construct_error)
|
||||
--
|
||||
2.48.1
|
||||
@@ -24,6 +24,8 @@ GNOMEBASEBUILDCLASS = "meson"
|
||||
inherit gnomebase gettext upstream-version-is-even gio-module-cache ptest-gnome
|
||||
|
||||
SRC_URI += "file://run-ptest"
|
||||
SRC_URI += "file://CVE-2025-60018.patch"
|
||||
SRC_URI += "file://CVE-2025-60019.patch"
|
||||
|
||||
FILES:${PN} += "\
|
||||
${libdir}/gio/modules/libgio*.so \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
SRCBRANCH ?= "release/2.35/master"
|
||||
PV = "2.35"
|
||||
SRCREV_glibc ?= "a66bc3941ff298e474d5f02d0c3303401951141f"
|
||||
SRCREV_glibc ?= "4e50046821f05ada5f14c76803845125ddb3ed7d"
|
||||
SRCREV_localedef ?= "794da69788cbf9bf57b59a852f9f11307663fa87"
|
||||
|
||||
GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
From 31d9848830e496f57d4182b518467c4c63bfd4bd Mon Sep 17 00:00:00 2001
|
||||
From 0402999b82f697011de388f61bad68da26060bef Mon Sep 17 00:00:00 2001
|
||||
From: Frank Barrus <frankbarrus_sw@shaggy.cc>
|
||||
Date: Mon, 16 Jun 2025 22:37:54 -0700
|
||||
Date: Tue, 14 Oct 2025 03:55:17 -0700
|
||||
Subject: [PATCH] pthreads NPTL: lost wakeup fix 2
|
||||
|
||||
This fixes the lost wakeup (from a bug in signal stealing) with a change
|
||||
@@ -65,18 +65,19 @@ full wakeup from a G1/G2 switch.
|
||||
|
||||
The following commits have been cherry-picked from Glibc master branch:
|
||||
Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847
|
||||
Commit : 1db84775f831a1494993ce9c118deaf9537cc50a
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://sourceware.org/git/?p=glibc.git;a=commit;h=1db84775f831a1494993ce9c118deaf9537cc50a]
|
||||
Upstream-Status: Submitted
|
||||
[https://sourceware.org/pipermail/libc-stable/2025-July/002277.html]
|
||||
|
||||
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
|
||||
---
|
||||
nptl/pthread_cond_common.c | 106 +++++++++------------------
|
||||
nptl/pthread_cond_common.c | 105 +++++++++------------------
|
||||
nptl/pthread_cond_wait.c | 144 ++++++++++++-------------------------
|
||||
2 files changed, 81 insertions(+), 169 deletions(-)
|
||||
2 files changed, 81 insertions(+), 168 deletions(-)
|
||||
|
||||
diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c
|
||||
index fb035f72c3..8dd7037923 100644
|
||||
index fb035f72..a55eee3e 100644
|
||||
--- a/nptl/pthread_cond_common.c
|
||||
+++ b/nptl/pthread_cond_common.c
|
||||
@@ -201,7 +201,6 @@ static bool __attribute__ ((unused))
|
||||
@@ -87,7 +88,7 @@ index fb035f72c3..8dd7037923 100644
|
||||
unsigned int g1 = *g1index;
|
||||
|
||||
/* If there is no waiter in G2, we don't do anything. The expression may
|
||||
@@ -222,85 +221,46 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
@@ -222,84 +221,46 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
* New waiters arriving concurrently with the group switching will all go
|
||||
into G2 until we atomically make the switch. Waiters existing in G2
|
||||
are not affected.
|
||||
@@ -176,7 +177,6 @@ index fb035f72c3..8dd7037923 100644
|
||||
- that this is now a new group (see __pthread_cond_wait_common for the
|
||||
- matching acquire MO loads). */
|
||||
- atomic_store_release (cond->__data.__g_signals + g1, 0);
|
||||
-
|
||||
+ unsigned int lowseq = ((old_g1_start + old_orig_size) << 1) & ~1U;
|
||||
+
|
||||
+ /* If any waiters still hold group references (and thus could be blocked),
|
||||
@@ -201,10 +201,10 @@ index fb035f72c3..8dd7037923 100644
|
||||
+
|
||||
+ futex_wake (cond->__data.__g_signals + g1, INT_MAX, private);
|
||||
+ }
|
||||
|
||||
/* At this point, the old G1 is now a valid new G2 (but not in use yet).
|
||||
No old waiter can neither grab a signal nor acquire a reference without
|
||||
noticing that __g1_start is larger.
|
||||
@@ -311,6 +271,10 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
@@ -311,6 +272,10 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
g1 ^= 1;
|
||||
*g1index ^= 1;
|
||||
|
||||
@@ -216,7 +216,7 @@ index fb035f72c3..8dd7037923 100644
|
||||
lock. */
|
||||
unsigned int orig_size = wseq - (old_g1_start + old_orig_size);
|
||||
diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
|
||||
index 20c348a503..1cb3dbf7b0 100644
|
||||
index 20c348a5..1cb3dbf7 100644
|
||||
--- a/nptl/pthread_cond_wait.c
|
||||
+++ b/nptl/pthread_cond_wait.c
|
||||
@@ -238,9 +238,7 @@ __condvar_cleanup_waiting (void *arg)
|
||||
|
||||
54
meta/recipes-core/glibc/glibc/0026-PR25847-10.patch
Normal file
54
meta/recipes-core/glibc/glibc/0026-PR25847-10.patch
Normal file
@@ -0,0 +1,54 @@
|
||||
From 4f78382dd671f381db6d1f452e6f1593d17b177e Mon Sep 17 00:00:00 2001
|
||||
From: Florian Weimer <fweimer@redhat.com>
|
||||
Date: Tue, 14 Oct 2025 06:53:40 -0700
|
||||
Subject: [PATCH] nptl: PTHREAD_COND_INITIALIZER compatibility with pre-2.41
|
||||
versions (bug 32786)
|
||||
|
||||
The new initializer and struct layout does not initialize the
|
||||
__g_signals field in the old struct layout before the change in
|
||||
commit c36fc50781995e6758cae2b6927839d0157f213c ("nptl: Remove
|
||||
g_refs from condition variables"). Bring back fields at the end
|
||||
of struct __pthread_cond_s, so that they are again zero-initialized.
|
||||
|
||||
The following commits have been cherry-picked from Glibc master branch:
|
||||
Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847
|
||||
commit: dbc5a50d12eff4cb3f782129029d04b8a76f58e7
|
||||
|
||||
Upstream-Status: Submitted
|
||||
[https://sourceware.org/pipermail/libc-stable/2025-July/002282.html]
|
||||
|
||||
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
|
||||
---
|
||||
sysdeps/nptl/bits/thread-shared-types.h | 2 ++
|
||||
sysdeps/nptl/pthread.h | 2 +-
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sysdeps/nptl/bits/thread-shared-types.h b/sysdeps/nptl/bits/thread-shared-types.h
|
||||
index 6f17afa4..2354ea21 100644
|
||||
--- a/sysdeps/nptl/bits/thread-shared-types.h
|
||||
+++ b/sysdeps/nptl/bits/thread-shared-types.h
|
||||
@@ -99,6 +99,8 @@ struct __pthread_cond_s
|
||||
unsigned int __g1_orig_size;
|
||||
unsigned int __wrefs;
|
||||
unsigned int __g_signals[2];
|
||||
+ unsigned int __unused_initialized_1;
|
||||
+ unsigned int __unused_initialized_2;
|
||||
};
|
||||
|
||||
typedef unsigned int __tss_t;
|
||||
diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
|
||||
index bbb36540..8d6d24ff 100644
|
||||
--- a/sysdeps/nptl/pthread.h
|
||||
+++ b/sysdeps/nptl/pthread.h
|
||||
@@ -152,7 +152,7 @@ enum
|
||||
|
||||
|
||||
/* Conditional variable handling. */
|
||||
-#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, 0, 0, {0, 0} } }
|
||||
+#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, 0, 0, {0, 0}, 0, 0 } }
|
||||
|
||||
|
||||
/* Cleanup buffers */
|
||||
--
|
||||
2.49.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
From 6aab1191e35a3da66e8c49d95178a9d77c119a1f Mon Sep 17 00:00:00 2001
|
||||
From 306ea7810f5f6709ef3942a7be75077203b5d201 Mon Sep 17 00:00:00 2001
|
||||
From: Malte Skarupke <malteskarupke@fastmail.fm>
|
||||
Date: Mon, 16 Jun 2025 23:17:53 -0700
|
||||
Date: Tue, 14 Oct 2025 04:27:19 -0700
|
||||
Subject: [PATCH] nptl: Update comments and indentation for new condvar
|
||||
implementation
|
||||
|
||||
@@ -9,9 +9,10 @@ Also fixing indentation where it was using spaces instead of tabs.
|
||||
|
||||
The following commits have been cherry-picked from Glibc master branch:
|
||||
Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847
|
||||
commit: 0cc973160c23bb67f895bc887dd6942d29f8fee3
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://sourceware.org/git/?p=glibc.git;a=commit;h=0cc973160c23bb67f895bc887dd6942d29f8fee3]
|
||||
Upstream-Status: Submitted
|
||||
[https://sourceware.org/pipermail/libc-stable/2025-July/002275.html]
|
||||
|
||||
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
|
||||
---
|
||||
@@ -20,7 +21,7 @@ Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
|
||||
2 files changed, 22 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c
|
||||
index 8dd7037923..306a207dd6 100644
|
||||
index a55eee3e..350a16fa 100644
|
||||
--- a/nptl/pthread_cond_common.c
|
||||
+++ b/nptl/pthread_cond_common.c
|
||||
@@ -221,8 +221,9 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
@@ -36,7 +37,7 @@ index 8dd7037923..306a207dd6 100644
|
||||
__g_signals since it provides enough signals for all possible
|
||||
remaining waiters. As a result, they can each consume a signal
|
||||
diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
|
||||
index 1cb3dbf7b0..cee1968756 100644
|
||||
index 1cb3dbf7..cee19687 100644
|
||||
--- a/nptl/pthread_cond_wait.c
|
||||
+++ b/nptl/pthread_cond_wait.c
|
||||
@@ -249,7 +249,7 @@ __condvar_cleanup_waiting (void *arg)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
From 28a5082045429fdc5a4744d45fdc5b5202528eaa Mon Sep 17 00:00:00 2001
|
||||
From 5f22e8cf95cf6b3b2e16ddb03820ae3e77fd420d Mon Sep 17 00:00:00 2001
|
||||
From: Malte Skarupke <malteskarupke@fastmail.fm>
|
||||
Date: Mon, 16 Jun 2025 23:29:49 -0700
|
||||
Date: Tue, 14 Oct 2025 04:47:48 -0700
|
||||
Subject: [PATCH] nptl: Remove unnecessary catch-all-wake in condvar group
|
||||
switch
|
||||
|
||||
@@ -15,17 +15,18 @@ switch g1 when it should, so we wouldn't even have entered this code path.
|
||||
|
||||
The following commits have been cherry-picked from Glibc master branch:
|
||||
Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847
|
||||
commit: b42cc6af11062c260c7dfa91f1c89891366fed3e
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://sourceware.org/git/?p=glibc.git;a=commit;h=b42cc6af11062c260c7dfa91f1c89891366fed3e]
|
||||
Upstream-Status: Submitted
|
||||
[https://sourceware.org/pipermail/libc-stable/2025-July/002274.html]
|
||||
|
||||
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
|
||||
---
|
||||
nptl/pthread_cond_common.c | 30 +-----------------------------
|
||||
1 file changed, 1 insertion(+), 29 deletions(-)
|
||||
nptl/pthread_cond_common.c | 31 +------------------------------
|
||||
1 file changed, 1 insertion(+), 30 deletions(-)
|
||||
|
||||
diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c
|
||||
index 306a207dd6..f976a533a1 100644
|
||||
index 350a16fa..f976a533 100644
|
||||
--- a/nptl/pthread_cond_common.c
|
||||
+++ b/nptl/pthread_cond_common.c
|
||||
@@ -221,13 +221,7 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
@@ -43,7 +44,7 @@ index 306a207dd6..f976a533a1 100644
|
||||
|
||||
/* Update __g1_start, which finishes closing this group. The value we add
|
||||
will never be negative because old_orig_size can only be zero when we
|
||||
@@ -240,28 +234,6 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
@@ -240,29 +234,6 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
|
||||
unsigned int lowseq = ((old_g1_start + old_orig_size) << 1) & ~1U;
|
||||
|
||||
@@ -69,6 +70,7 @@ index 306a207dd6..f976a533a1 100644
|
||||
-
|
||||
- futex_wake (cond->__data.__g_signals + g1, INT_MAX, private);
|
||||
- }
|
||||
-
|
||||
/* At this point, the old G1 is now a valid new G2 (but not in use yet).
|
||||
No old waiter can neither grab a signal nor acquire a reference without
|
||||
noticing that __g1_start is larger.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
From 16b9af737c77b153fca4f36cbdbe94f7416c0b42 Mon Sep 17 00:00:00 2001
|
||||
From d714165c8bb3cac420077cfa61e3df87ea7f8b2c Mon Sep 17 00:00:00 2001
|
||||
From: Malte Skarupke <malteskarupke@fastmail.fm>
|
||||
Date: Mon, 16 Jun 2025 23:38:40 -0700
|
||||
Date: Tue, 14 Oct 2025 05:34:06 -0700
|
||||
Subject: [PATCH] nptl: Remove unnecessary quadruple check in pthread_cond_wait
|
||||
|
||||
pthread_cond_wait was checking whether it was in a closed group no less than
|
||||
@@ -22,9 +22,10 @@ Removing the duplicate checks clarifies the code.
|
||||
|
||||
The following commits have been cherry-picked from Glibc master branch:
|
||||
Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847
|
||||
commit: 4f7b051f8ee3feff1b53b27a906f245afaa9cee1
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://sourceware.org/git/?p=glibc.git;a=commit;h=4f7b051f8ee3feff1b53b27a906f245afaa9cee1]
|
||||
Upstream-Status: Submitted
|
||||
[https://sourceware.org/pipermail/libc-stable/2025-July/002276.html]
|
||||
|
||||
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
|
||||
---
|
||||
@@ -32,7 +33,7 @@ Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
|
||||
1 file changed, 49 deletions(-)
|
||||
|
||||
diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
|
||||
index cee1968756..47e834cade 100644
|
||||
index cee19687..47e834ca 100644
|
||||
--- a/nptl/pthread_cond_wait.c
|
||||
+++ b/nptl/pthread_cond_wait.c
|
||||
@@ -366,7 +366,6 @@ static __always_inline int
|
||||
|
||||
@@ -1,105 +1,188 @@
|
||||
From d9ffb50dc55f77e584a5d0275eea758c7a6b04e3 Mon Sep 17 00:00:00 2001
|
||||
From f904a81ff8d0469ceaf3220329e716c03fcbd2d3 Mon Sep 17 00:00:00 2001
|
||||
From: Malte Skarupke <malteskarupke@fastmail.fm>
|
||||
Date: Mon, 16 Jun 2025 23:53:35 -0700
|
||||
Subject: [PATCH] nptl: Use a single loop in pthread_cond_wait instaed of a
|
||||
nested loop
|
||||
Date: Tue, 14 Oct 2025 05:59:02 -0700
|
||||
Subject: [PATCH] nptl: Remove g_refs from condition variables
|
||||
|
||||
The loop was a little more complicated than necessary. There was only one
|
||||
break statement out of the inner loop, and the outer loop was nearly empty.
|
||||
So just remove the outer loop, moving its code to the one break statement in
|
||||
the inner loop. This allows us to replace all gotos with break statements.
|
||||
This variable used to be needed to wait in group switching until all sleepers
|
||||
have confirmed that they have woken. This is no longer needed. Nothing waits
|
||||
on this variable so there is no need to track how many threads are currently
|
||||
asleep in each group.
|
||||
|
||||
The following commits have been cherry-picked from Glibc master branch:
|
||||
Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847
|
||||
cmmit: c36fc50781995e6758cae2b6927839d0157f213c
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://sourceware.org/git/?p=glibc.git;a=commit;h=929a4764ac90382616b6a21f099192b2475da674]
|
||||
Upstream-Status: Submitted
|
||||
[https://sourceware.org/pipermail/libc-stable/2025-July/002278.html]
|
||||
|
||||
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
|
||||
---
|
||||
nptl/pthread_cond_wait.c | 41 +++++++++++++++++++---------------------
|
||||
1 file changed, 19 insertions(+), 22 deletions(-)
|
||||
nptl/pthread_cond_wait.c | 52 +------------------------
|
||||
nptl/tst-cond22.c | 12 +++---
|
||||
sysdeps/nptl/bits/thread-shared-types.h | 3 +-
|
||||
sysdeps/nptl/pthread.h | 2 +-
|
||||
4 files changed, 9 insertions(+), 60 deletions(-)
|
||||
|
||||
diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
|
||||
index 47e834cade..5c86880105 100644
|
||||
index 47e834ca..8a9219e0 100644
|
||||
--- a/nptl/pthread_cond_wait.c
|
||||
+++ b/nptl/pthread_cond_wait.c
|
||||
@@ -410,17 +410,15 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
return err;
|
||||
@@ -143,23 +143,6 @@ __condvar_cancel_waiting (pthread_cond_t *cond, uint64_t seq, unsigned int g,
|
||||
}
|
||||
}
|
||||
|
||||
- /* Now wait until a signal is available in our group or it is closed.
|
||||
- Acquire MO so that if we observe (signals == lowseq) after group
|
||||
- switching in __condvar_quiesce_and_switch_g1, we synchronize with that
|
||||
- store and will see the prior update of __g1_start done while switching
|
||||
- groups too. */
|
||||
- unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||
-
|
||||
- do
|
||||
-/* Wake up any signalers that might be waiting. */
|
||||
-static void
|
||||
-__condvar_dec_grefs (pthread_cond_t *cond, unsigned int g, int private)
|
||||
-{
|
||||
- /* Release MO to synchronize-with the acquire load in
|
||||
- __condvar_quiesce_and_switch_g1. */
|
||||
- if (atomic_fetch_add_release (cond->__data.__g_refs + g, -2) == 3)
|
||||
- {
|
||||
+
|
||||
while (1)
|
||||
{
|
||||
+ /* Now wait until a signal is available in our group or it is closed.
|
||||
+ Acquire MO so that if we observe (signals == lowseq) after group
|
||||
+ switching in __condvar_quiesce_and_switch_g1, we synchronize with that
|
||||
+ store and will see the prior update of __g1_start done while switching
|
||||
+ groups too. */
|
||||
+ unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||
uint64_t g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||
unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U;
|
||||
|
||||
@@ -429,7 +427,7 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
/* If the group is closed already,
|
||||
then this waiter originally had enough extra signals to
|
||||
consume, up until the time its group was closed. */
|
||||
- goto done;
|
||||
+ break;
|
||||
}
|
||||
|
||||
/* If there is an available signal, don't block.
|
||||
@@ -438,8 +436,16 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
G2, but in either case we're allowed to consume the available
|
||||
signal and should not block anymore. */
|
||||
if ((int)(signals - lowseq) >= 2)
|
||||
- break;
|
||||
- /* Clear the wake-up request flag before waking up. We do not need more
|
||||
- than relaxed MO and it doesn't matter if we apply this for an aliased
|
||||
- group because we wake all futex waiters right after clearing the
|
||||
- flag. */
|
||||
- atomic_fetch_and_relaxed (cond->__data.__g_refs + g, ~(unsigned int) 1);
|
||||
- futex_wake (cond->__data.__g_refs + g, INT_MAX, private);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
+ {
|
||||
+ /* Try to grab a signal. See above for MO. (if we do another loop
|
||||
+ iteration we need to see the correct value of g1_start) */
|
||||
+ if (atomic_compare_exchange_weak_acquire (
|
||||
+ cond->__data.__g_signals + g,
|
||||
+ &signals, signals - 2))
|
||||
+ break;
|
||||
+ else
|
||||
+ continue;
|
||||
+ }
|
||||
/* No signals available after spinning, so prepare to block.
|
||||
We first acquire a group reference and use acquire MO for that so
|
||||
that we synchronize with the dummy read-modify-write in
|
||||
@@ -479,21 +485,12 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
the lock during cancellation is not possible. */
|
||||
/* Clean-up for cancellation of waiters waiting for normal signals. We cancel
|
||||
our registration as a waiter, confirm we have woken up, and re-acquire the
|
||||
mutex. */
|
||||
@@ -171,8 +154,6 @@ __condvar_cleanup_waiting (void *arg)
|
||||
pthread_cond_t *cond = cbuffer->cond;
|
||||
unsigned g = cbuffer->wseq & 1;
|
||||
|
||||
- __condvar_dec_grefs (cond, g, cbuffer->private);
|
||||
-
|
||||
__condvar_cancel_waiting (cond, cbuffer->wseq >> 1, g, cbuffer->private);
|
||||
/* FIXME With the current cancellation implementation, it is possible that
|
||||
a thread is cancelled after it has returned from a syscall. This could
|
||||
@@ -327,15 +308,6 @@ __condvar_cleanup_waiting (void *arg)
|
||||
sufficient because if a waiter can see a sufficiently large value, it could
|
||||
have also consume a signal in the waiters group.
|
||||
|
||||
- It is essential that the last field in pthread_cond_t is __g_signals[1]:
|
||||
- The previous condvar used a pointer-sized field in pthread_cond_t, so a
|
||||
- PTHREAD_COND_INITIALIZER from that condvar implementation might only
|
||||
- initialize 4 bytes to zero instead of the 8 bytes we need (i.e., 44 bytes
|
||||
- in total instead of the 48 we need). __g_signals[1] is not accessed before
|
||||
- the first group switch (G2 starts at index 0), which will set its value to
|
||||
- zero after a harmless fetch-or whose return value is ignored. This
|
||||
- effectively completes initialization.
|
||||
-
|
||||
|
||||
Limitations:
|
||||
* This condvar isn't designed to allow for more than
|
||||
@@ -440,21 +412,6 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
if ((int)(signals - lowseq) >= 2)
|
||||
break;
|
||||
|
||||
- /* No signals available after spinning, so prepare to block.
|
||||
- We first acquire a group reference and use acquire MO for that so
|
||||
- that we synchronize with the dummy read-modify-write in
|
||||
- __condvar_quiesce_and_switch_g1 if we read from that. In turn,
|
||||
- in this case this will make us see the advancement of __g_signals
|
||||
- to the upcoming new g1_start that occurs with a concurrent
|
||||
- attempt to reuse the group's slot.
|
||||
- We use acquire MO for the __g_signals check to make the
|
||||
- __g1_start check work (see spinning above).
|
||||
- Note that the group reference acquisition will not mask the
|
||||
- release MO when decrementing the reference count because we use
|
||||
- an atomic read-modify-write operation and thus extend the release
|
||||
- sequence. */
|
||||
- atomic_fetch_add_acquire (cond->__data.__g_refs + g, 2);
|
||||
-
|
||||
// Now block.
|
||||
struct _pthread_cleanup_buffer buffer;
|
||||
struct _condvar_cleanup_buffer cbuffer;
|
||||
@@ -471,18 +428,11 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
|
||||
if (__glibc_unlikely (err == ETIMEDOUT || err == EOVERFLOW))
|
||||
{
|
||||
- __condvar_dec_grefs (cond, g, private);
|
||||
- /* If we timed out, we effectively cancel waiting. Note that
|
||||
- we have decremented __g_refs before cancellation, so that a
|
||||
- deadlock between waiting for quiescence of our group in
|
||||
- __condvar_quiesce_and_switch_g1 and us trying to acquire
|
||||
- the lock during cancellation is not possible. */
|
||||
+ /* If we timed out, we effectively cancel waiting. */
|
||||
__condvar_cancel_waiting (cond, seq, g, private);
|
||||
result = err;
|
||||
- goto done;
|
||||
+ break;
|
||||
goto done;
|
||||
}
|
||||
else
|
||||
__condvar_dec_grefs (cond, g, private);
|
||||
- else
|
||||
- __condvar_dec_grefs (cond, g, private);
|
||||
|
||||
- /* Reload signals. See above for MO. */
|
||||
- signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||
}
|
||||
- }
|
||||
- /* Try to grab a signal. See above for MO. (if we do another loop
|
||||
- iteration we need to see the correct value of g1_start) */
|
||||
- while (!atomic_compare_exchange_weak_acquire (cond->__data.__g_signals + g,
|
||||
- &signals, signals - 2));
|
||||
-
|
||||
- done:
|
||||
/* Reload signals. See above for MO. */
|
||||
signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||
diff --git a/nptl/tst-cond22.c b/nptl/tst-cond22.c
|
||||
index 1336e9c7..bdcb45c5 100644
|
||||
--- a/nptl/tst-cond22.c
|
||||
+++ b/nptl/tst-cond22.c
|
||||
@@ -106,13 +106,13 @@ do_test (void)
|
||||
status = 1;
|
||||
}
|
||||
|
||||
/* Confirm that we have been woken. We do that before acquiring the mutex
|
||||
to allow for execution of pthread_cond_destroy while having acquired the
|
||||
- printf ("cond = { 0x%x:%x, 0x%x:%x, %u/%u/%u, %u/%u/%u, %u, %u }\n",
|
||||
+ printf ("cond = { 0x%x:%x, 0x%x:%x, %u/%u, %u/%u, %u, %u }\n",
|
||||
c.__data.__wseq.__value32.__high,
|
||||
c.__data.__wseq.__value32.__low,
|
||||
c.__data.__g1_start.__value32.__high,
|
||||
c.__data.__g1_start.__value32.__low,
|
||||
- c.__data.__g_signals[0], c.__data.__g_refs[0], c.__data.__g_size[0],
|
||||
- c.__data.__g_signals[1], c.__data.__g_refs[1], c.__data.__g_size[1],
|
||||
+ c.__data.__g_signals[0], c.__data.__g_size[0],
|
||||
+ c.__data.__g_signals[1], c.__data.__g_size[1],
|
||||
c.__data.__g1_orig_size, c.__data.__wrefs);
|
||||
|
||||
if (pthread_create (&th, NULL, tf, (void *) 1l) != 0)
|
||||
@@ -152,13 +152,13 @@ do_test (void)
|
||||
status = 1;
|
||||
}
|
||||
|
||||
- printf ("cond = { 0x%x:%x, 0x%x:%x, %u/%u/%u, %u/%u/%u, %u, %u }\n",
|
||||
+ printf ("cond = { 0x%x:%x, 0x%x:%x, %u/%u, %u/%u, %u, %u }\n",
|
||||
c.__data.__wseq.__value32.__high,
|
||||
c.__data.__wseq.__value32.__low,
|
||||
c.__data.__g1_start.__value32.__high,
|
||||
c.__data.__g1_start.__value32.__low,
|
||||
- c.__data.__g_signals[0], c.__data.__g_refs[0], c.__data.__g_size[0],
|
||||
- c.__data.__g_signals[1], c.__data.__g_refs[1], c.__data.__g_size[1],
|
||||
+ c.__data.__g_signals[0], c.__data.__g_size[0],
|
||||
+ c.__data.__g_signals[1], c.__data.__g_size[1],
|
||||
c.__data.__g1_orig_size, c.__data.__wrefs);
|
||||
|
||||
return status;
|
||||
diff --git a/sysdeps/nptl/bits/thread-shared-types.h b/sysdeps/nptl/bits/thread-shared-types.h
|
||||
index 5653507e..6f17afa4 100644
|
||||
--- a/sysdeps/nptl/bits/thread-shared-types.h
|
||||
+++ b/sysdeps/nptl/bits/thread-shared-types.h
|
||||
@@ -95,8 +95,7 @@ struct __pthread_cond_s
|
||||
{
|
||||
__atomic_wide_counter __wseq;
|
||||
__atomic_wide_counter __g1_start;
|
||||
- unsigned int __g_refs[2] __LOCK_ALIGNMENT;
|
||||
- unsigned int __g_size[2];
|
||||
+ unsigned int __g_size[2] __LOCK_ALIGNMENT;
|
||||
unsigned int __g1_orig_size;
|
||||
unsigned int __wrefs;
|
||||
unsigned int __g_signals[2];
|
||||
diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
|
||||
index dedad4ec..bbb36540 100644
|
||||
--- a/sysdeps/nptl/pthread.h
|
||||
+++ b/sysdeps/nptl/pthread.h
|
||||
@@ -152,7 +152,7 @@ enum
|
||||
|
||||
|
||||
/* Conditional variable handling. */
|
||||
-#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, {0, 0}, 0, 0, {0, 0} } }
|
||||
+#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, 0, 0, {0, 0} } }
|
||||
|
||||
|
||||
/* Cleanup buffers */
|
||||
--
|
||||
2.49.0
|
||||
|
||||
|
||||
@@ -1,166 +1,100 @@
|
||||
From a2faee6d0dac6e5232255da9afda4d9ed6cfb6e5 Mon Sep 17 00:00:00 2001
|
||||
From bbd7c84a1a14bf93bf1e5976d8a1540aabbf901b Mon Sep 17 00:00:00 2001
|
||||
From: Malte Skarupke <malteskarupke@fastmail.fm>
|
||||
Date: Tue, 17 Jun 2025 01:37:12 -0700
|
||||
Subject: [PATCH] nptl: Fix indentation
|
||||
Date: Tue, 14 Oct 2025 06:19:02 -0700
|
||||
Subject: [PATCH] nptl: Use a single loop in pthread_cond_wait instaed of a
|
||||
nested loop
|
||||
|
||||
In my previous change I turned a nested loop into a simple loop. I'm doing
|
||||
the resulting indentation changes in a separate commit to make the diff on
|
||||
the previous commit easier to review.
|
||||
The loop was a little more complicated than necessary. There was only one
|
||||
break statement out of the inner loop, and the outer loop was nearly empty.
|
||||
So just remove the outer loop, moving its code to the one break statement in
|
||||
the inner loop. This allows us to replace all gotos with break statements.
|
||||
|
||||
The following commits have been cherry-picked from Glibc master branch:
|
||||
Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847
|
||||
commit: 929a4764ac90382616b6a21f099192b2475da674
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://sourceware.org/git/?p=glibc.git;a=commit;h=ee6c14ed59d480720721aaacc5fb03213dc153da]
|
||||
Upstream-Status: Submitted
|
||||
[https://sourceware.org/pipermail/libc-stable/2025-July/002279.html]
|
||||
|
||||
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
|
||||
---
|
||||
nptl/pthread_cond_wait.c | 132 ++++++++++++++++-----------------------
|
||||
1 file changed, 54 insertions(+), 78 deletions(-)
|
||||
nptl/pthread_cond_wait.c | 41 +++++++++++++++++++---------------------
|
||||
1 file changed, 19 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
|
||||
index 5c86880105..104ebd48ca 100644
|
||||
index 8a9219e0..c8c99bbf 100644
|
||||
--- a/nptl/pthread_cond_wait.c
|
||||
+++ b/nptl/pthread_cond_wait.c
|
||||
@@ -410,87 +410,63 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
@@ -382,17 +382,15 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
return err;
|
||||
}
|
||||
|
||||
- /* Now wait until a signal is available in our group or it is closed.
|
||||
- Acquire MO so that if we observe (signals == lowseq) after group
|
||||
- switching in __condvar_quiesce_and_switch_g1, we synchronize with that
|
||||
- store and will see the prior update of __g1_start done while switching
|
||||
- groups too. */
|
||||
- unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||
-
|
||||
- while (1)
|
||||
- {
|
||||
- /* Now wait until a signal is available in our group or it is closed.
|
||||
- Acquire MO so that if we observe (signals == lowseq) after group
|
||||
- switching in __condvar_quiesce_and_switch_g1, we synchronize with that
|
||||
- store and will see the prior update of __g1_start done while switching
|
||||
- groups too. */
|
||||
- unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||
- uint64_t g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||
- unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U;
|
||||
-
|
||||
- if (seq < (g1_start >> 1))
|
||||
- {
|
||||
- /* If the group is closed already,
|
||||
- then this waiter originally had enough extra signals to
|
||||
- consume, up until the time its group was closed. */
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- /* If there is an available signal, don't block.
|
||||
- If __g1_start has advanced at all, then we must be in G1
|
||||
- by now, perhaps in the process of switching back to an older
|
||||
- G2, but in either case we're allowed to consume the available
|
||||
- signal and should not block anymore. */
|
||||
- if ((int)(signals - lowseq) >= 2)
|
||||
- {
|
||||
- /* Try to grab a signal. See above for MO. (if we do another loop
|
||||
- iteration we need to see the correct value of g1_start) */
|
||||
- if (atomic_compare_exchange_weak_acquire (
|
||||
- cond->__data.__g_signals + g,
|
||||
+ while (1)
|
||||
+ {
|
||||
+ /* Now wait until a signal is available in our group or it is closed.
|
||||
+ Acquire MO so that if we observe (signals == lowseq) after group
|
||||
+ switching in __condvar_quiesce_and_switch_g1, we synchronize with that
|
||||
+ store and will see the prior update of __g1_start done while switching
|
||||
+ groups too. */
|
||||
+ unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||
+ uint64_t g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||
+ unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U;
|
||||
- do
|
||||
- {
|
||||
+
|
||||
+ if (seq < (g1_start >> 1))
|
||||
+ {
|
||||
+ /* If the group is closed already,
|
||||
+ then this waiter originally had enough extra signals to
|
||||
+ consume, up until the time its group was closed. */
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /* If there is an available signal, don't block.
|
||||
+ If __g1_start has advanced at all, then we must be in G1
|
||||
+ by now, perhaps in the process of switching back to an older
|
||||
+ G2, but in either case we're allowed to consume the available
|
||||
+ signal and should not block anymore. */
|
||||
+ if ((int)(signals - lowseq) >= 2)
|
||||
+ {
|
||||
+ /* Try to grab a signal. See above for MO. (if we do another loop
|
||||
+ iteration we need to see the correct value of g1_start) */
|
||||
+ if (atomic_compare_exchange_weak_acquire (
|
||||
+ cond->__data.__g_signals + g,
|
||||
&signals, signals - 2))
|
||||
- break;
|
||||
- else
|
||||
- continue;
|
||||
- }
|
||||
- /* No signals available after spinning, so prepare to block.
|
||||
- We first acquire a group reference and use acquire MO for that so
|
||||
- that we synchronize with the dummy read-modify-write in
|
||||
- __condvar_quiesce_and_switch_g1 if we read from that. In turn,
|
||||
- in this case this will make us see the advancement of __g_signals
|
||||
- to the upcoming new g1_start that occurs with a concurrent
|
||||
- attempt to reuse the group's slot.
|
||||
- We use acquire MO for the __g_signals check to make the
|
||||
- __g1_start check work (see spinning above).
|
||||
- Note that the group reference acquisition will not mask the
|
||||
- release MO when decrementing the reference count because we use
|
||||
- an atomic read-modify-write operation and thus extend the release
|
||||
- sequence. */
|
||||
- atomic_fetch_add_acquire (cond->__data.__g_refs + g, 2);
|
||||
while (1)
|
||||
{
|
||||
+ /* Now wait until a signal is available in our group or it is closed.
|
||||
+ Acquire MO so that if we observe (signals == lowseq) after group
|
||||
+ switching in __condvar_quiesce_and_switch_g1, we synchronize with that
|
||||
+ store and will see the prior update of __g1_start done while switching
|
||||
+ groups too. */
|
||||
+ unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||
uint64_t g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||
unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U;
|
||||
|
||||
@@ -401,7 +399,7 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
/* If the group is closed already,
|
||||
then this waiter originally had enough extra signals to
|
||||
consume, up until the time its group was closed. */
|
||||
- goto done;
|
||||
+ break;
|
||||
}
|
||||
|
||||
/* If there is an available signal, don't block.
|
||||
@@ -410,7 +408,16 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
G2, but in either case we're allowed to consume the available
|
||||
signal and should not block anymore. */
|
||||
if ((int)(signals - lowseq) >= 2)
|
||||
- break;
|
||||
+ {
|
||||
+ /* Try to grab a signal. See above for MO. (if we do another loop
|
||||
+ iteration we need to see the correct value of g1_start) */
|
||||
+ if (atomic_compare_exchange_weak_acquire (
|
||||
+ cond->__data.__g_signals + g,
|
||||
+ &signals, signals - 2))
|
||||
+ break;
|
||||
+ else
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
// Now block.
|
||||
struct _pthread_cleanup_buffer buffer;
|
||||
@@ -431,19 +438,9 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
/* If we timed out, we effectively cancel waiting. */
|
||||
__condvar_cancel_waiting (cond, seq, g, private);
|
||||
result = err;
|
||||
- goto done;
|
||||
+ break;
|
||||
}
|
||||
-
|
||||
- // Now block.
|
||||
- struct _pthread_cleanup_buffer buffer;
|
||||
- struct _condvar_cleanup_buffer cbuffer;
|
||||
- cbuffer.wseq = wseq;
|
||||
- cbuffer.cond = cond;
|
||||
- cbuffer.mutex = mutex;
|
||||
- cbuffer.private = private;
|
||||
- __pthread_cleanup_push (&buffer, __condvar_cleanup_waiting, &cbuffer);
|
||||
-
|
||||
- err = __futex_abstimed_wait_cancelable64 (
|
||||
- cond->__data.__g_signals + g, signals, clockid, abstime, private);
|
||||
-
|
||||
- __pthread_cleanup_pop (&buffer, 0);
|
||||
-
|
||||
- if (__glibc_unlikely (err == ETIMEDOUT || err == EOVERFLOW))
|
||||
- {
|
||||
- __condvar_dec_grefs (cond, g, private);
|
||||
- /* If we timed out, we effectively cancel waiting. Note that
|
||||
- we have decremented __g_refs before cancellation, so that a
|
||||
- deadlock between waiting for quiescence of our group in
|
||||
- __condvar_quiesce_and_switch_g1 and us trying to acquire
|
||||
- the lock during cancellation is not possible. */
|
||||
- __condvar_cancel_waiting (cond, seq, g, private);
|
||||
- result = err;
|
||||
break;
|
||||
- }
|
||||
- else
|
||||
- __condvar_dec_grefs (cond, g, private);
|
||||
-
|
||||
+ else
|
||||
+ continue;
|
||||
- /* Reload signals. See above for MO. */
|
||||
- signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||
}
|
||||
+ // Now block.
|
||||
+ struct _pthread_cleanup_buffer buffer;
|
||||
+ struct _condvar_cleanup_buffer cbuffer;
|
||||
+ cbuffer.wseq = wseq;
|
||||
+ cbuffer.cond = cond;
|
||||
+ cbuffer.mutex = mutex;
|
||||
+ cbuffer.private = private;
|
||||
+ __pthread_cleanup_push (&buffer, __condvar_cleanup_waiting, &cbuffer);
|
||||
+
|
||||
+ err = __futex_abstimed_wait_cancelable64 (
|
||||
+ cond->__data.__g_signals + g, signals, clockid, abstime, private);
|
||||
+
|
||||
+ __pthread_cleanup_pop (&buffer, 0);
|
||||
+
|
||||
+ if (__glibc_unlikely (err == ETIMEDOUT || err == EOVERFLOW))
|
||||
+ {
|
||||
+ /* If we timed out, we effectively cancel waiting. */
|
||||
+ __condvar_cancel_waiting (cond, seq, g, private);
|
||||
+ result = err;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
- }
|
||||
- /* Try to grab a signal. See above for MO. (if we do another loop
|
||||
- iteration we need to see the correct value of g1_start) */
|
||||
- while (!atomic_compare_exchange_weak_acquire (cond->__data.__g_signals + g,
|
||||
- &signals, signals - 2));
|
||||
-
|
||||
- done:
|
||||
|
||||
/* Confirm that we have been woken. We do that before acquiring the mutex
|
||||
to allow for execution of pthread_cond_destroy while having acquired the
|
||||
|
||||
@@ -1,160 +1,149 @@
|
||||
From 2a601ac9041e2ca645acad2c174b1c545cfceafe Mon Sep 17 00:00:00 2001
|
||||
From 1077953950d1e8864c63222967141c67f51297f8 Mon Sep 17 00:00:00 2001
|
||||
From: Malte Skarupke <malteskarupke@fastmail.fm>
|
||||
Date: Tue, 17 Jun 2025 01:53:25 -0700
|
||||
Subject: [PATCH] nptl: rename __condvar_quiesce_and_switch_g1
|
||||
Date: Tue, 14 Oct 2025 06:27:04 -0700
|
||||
Subject: [PATCH] nptl: Fix indentation
|
||||
|
||||
This function no longer waits for threads to leave g1, so rename it to
|
||||
__condvar_switch_g1
|
||||
In my previous change I turned a nested loop into a simple loop. I'm doing
|
||||
the resulting indentation changes in a separate commit to make the diff on
|
||||
the previous commit easier to review.
|
||||
|
||||
The following commits have been cherry-picked from Glibc master branch:
|
||||
Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847
|
||||
commit: ee6c14ed59d480720721aaacc5fb03213dc153da
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://sourceware.org/git/?p=glibc.git;a=commit;h=4b79e27a5073c02f6bff9aa8f4791230a0ab1867]
|
||||
Upstream-Status: Submitted
|
||||
[https://sourceware.org/pipermail/libc-stable/2025-July/002280.html]
|
||||
|
||||
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
|
||||
---
|
||||
nptl/pthread_cond_broadcast.c | 4 ++--
|
||||
nptl/pthread_cond_common.c | 26 ++++++++++++--------------
|
||||
nptl/pthread_cond_signal.c | 17 ++++++++---------
|
||||
nptl/pthread_cond_wait.c | 9 ++++-----
|
||||
4 files changed, 26 insertions(+), 30 deletions(-)
|
||||
nptl/pthread_cond_wait.c | 110 +++++++++++++++++++--------------------
|
||||
1 file changed, 55 insertions(+), 55 deletions(-)
|
||||
|
||||
diff --git a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c
|
||||
index 5ae141ac81..a07435589a 100644
|
||||
--- a/nptl/pthread_cond_broadcast.c
|
||||
+++ b/nptl/pthread_cond_broadcast.c
|
||||
@@ -60,7 +60,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond)
|
||||
cond->__data.__g_size[g1] << 1);
|
||||
cond->__data.__g_size[g1] = 0;
|
||||
|
||||
- /* We need to wake G1 waiters before we quiesce G1 below. */
|
||||
+ /* We need to wake G1 waiters before we switch G1 below. */
|
||||
/* TODO Only set it if there are indeed futex waiters. We could
|
||||
also try to move this out of the critical section in cases when
|
||||
G2 is empty (and we don't need to quiesce). */
|
||||
@@ -69,7 +69,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond)
|
||||
|
||||
/* G1 is complete. Step (2) is next unless there are no waiters in G2, in
|
||||
which case we can stop. */
|
||||
- if (__condvar_quiesce_and_switch_g1 (cond, wseq, &g1, private))
|
||||
+ if (__condvar_switch_g1 (cond, wseq, &g1, private))
|
||||
{
|
||||
/* Step (3): Send signals to all waiters in the old G2 / new G1. */
|
||||
atomic_fetch_add_relaxed (cond->__data.__g_signals + g1,
|
||||
diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c
|
||||
index f976a533a1..3baac4dabc 100644
|
||||
--- a/nptl/pthread_cond_common.c
|
||||
+++ b/nptl/pthread_cond_common.c
|
||||
@@ -189,16 +189,15 @@ __condvar_get_private (int flags)
|
||||
return FUTEX_SHARED;
|
||||
}
|
||||
|
||||
-/* This closes G1 (whose index is in G1INDEX), waits for all futex waiters to
|
||||
- leave G1, converts G1 into a fresh G2, and then switches group roles so that
|
||||
- the former G2 becomes the new G1 ending at the current __wseq value when we
|
||||
- eventually make the switch (WSEQ is just an observation of __wseq by the
|
||||
- signaler).
|
||||
+/* This closes G1 (whose index is in G1INDEX), converts G1 into a fresh G2,
|
||||
+ and then switches group roles so that the former G2 becomes the new G1
|
||||
+ ending at the current __wseq value when we eventually make the switch
|
||||
+ (WSEQ is just an observation of __wseq by the signaler).
|
||||
If G2 is empty, it will not switch groups because then it would create an
|
||||
empty G1 which would require switching groups again on the next signal.
|
||||
Returns false iff groups were not switched because G2 was empty. */
|
||||
static bool __attribute__ ((unused))
|
||||
-__condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
+__condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
unsigned int *g1index, int private)
|
||||
{
|
||||
unsigned int g1 = *g1index;
|
||||
@@ -214,8 +213,7 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
+ cond->__data.__g_size[g1 ^ 1]) == 0)
|
||||
return false;
|
||||
|
||||
- /* Now try to close and quiesce G1. We have to consider the following kinds
|
||||
- of waiters:
|
||||
+ /* We have to consider the following kinds of waiters:
|
||||
* Waiters from less recent groups than G1 are not affected because
|
||||
nothing will change for them apart from __g1_start getting larger.
|
||||
* New waiters arriving concurrently with the group switching will all go
|
||||
@@ -223,12 +221,12 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
are not affected.
|
||||
* Waiters in G1 have already received a signal and been woken. */
|
||||
|
||||
- /* Update __g1_start, which finishes closing this group. The value we add
|
||||
- will never be negative because old_orig_size can only be zero when we
|
||||
- switch groups the first time after a condvar was initialized, in which
|
||||
- case G1 will be at index 1 and we will add a value of 1.
|
||||
- Relaxed MO is fine because the change comes with no additional
|
||||
- constraints that others would have to observe. */
|
||||
+ /* Update __g1_start, which closes this group. The value we add will never
|
||||
+ be negative because old_orig_size can only be zero when we switch groups
|
||||
+ the first time after a condvar was initialized, in which case G1 will be
|
||||
+ at index 1 and we will add a value of 1. Relaxed MO is fine because the
|
||||
+ change comes with no additional constraints that others would have to
|
||||
+ observe. */
|
||||
__condvar_add_g1_start_relaxed (cond,
|
||||
(old_orig_size << 1) + (g1 == 1 ? 1 : - 1));
|
||||
|
||||
diff --git a/nptl/pthread_cond_signal.c b/nptl/pthread_cond_signal.c
|
||||
index 14800ba00b..a9bc10dcca 100644
|
||||
--- a/nptl/pthread_cond_signal.c
|
||||
+++ b/nptl/pthread_cond_signal.c
|
||||
@@ -69,18 +69,17 @@ ___pthread_cond_signal (pthread_cond_t *cond)
|
||||
bool do_futex_wake = false;
|
||||
|
||||
/* If G1 is still receiving signals, we put the signal there. If not, we
|
||||
- check if G2 has waiters, and if so, quiesce and switch G1 to the former
|
||||
- G2; if this results in a new G1 with waiters (G2 might have cancellations
|
||||
- already, see __condvar_quiesce_and_switch_g1), we put the signal in the
|
||||
- new G1. */
|
||||
+ check if G2 has waiters, and if so, switch G1 to the former G2; if this
|
||||
+ results in a new G1 with waiters (G2 might have cancellations already,
|
||||
+ see __condvar_switch_g1), we put the signal in the new G1. */
|
||||
if ((cond->__data.__g_size[g1] != 0)
|
||||
- || __condvar_quiesce_and_switch_g1 (cond, wseq, &g1, private))
|
||||
+ || __condvar_switch_g1 (cond, wseq, &g1, private))
|
||||
{
|
||||
/* Add a signal. Relaxed MO is fine because signaling does not need to
|
||||
- establish a happens-before relation (see above). We do not mask the
|
||||
- release-MO store when initializing a group in
|
||||
- __condvar_quiesce_and_switch_g1 because we use an atomic
|
||||
- read-modify-write and thus extend that store's release sequence. */
|
||||
+ establish a happens-before relation (see above). We do not mask the
|
||||
+ release-MO store when initializing a group in __condvar_switch_g1
|
||||
+ because we use an atomic read-modify-write and thus extend that
|
||||
+ store's release sequence. */
|
||||
atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, 2);
|
||||
cond->__data.__g_size[g1]--;
|
||||
/* TODO Only set it if there are indeed futex waiters. */
|
||||
diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
|
||||
index 104ebd48ca..bb46f3605d 100644
|
||||
index c8c99bbf..adf26a80 100644
|
||||
--- a/nptl/pthread_cond_wait.c
|
||||
+++ b/nptl/pthread_cond_wait.c
|
||||
@@ -382,8 +382,7 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
because we do not need to establish any happens-before relation with
|
||||
signalers (see __pthread_cond_signal); modification order alone
|
||||
establishes a total order of waiters/signals. We do need acquire MO
|
||||
- to synchronize with group reinitialization in
|
||||
- __condvar_quiesce_and_switch_g1. */
|
||||
+ to synchronize with group reinitialization in __condvar_switch_g1. */
|
||||
uint64_t wseq = __condvar_fetch_add_wseq_acquire (cond, 2);
|
||||
/* Find our group's index. We always go into what was G2 when we acquired
|
||||
our position. */
|
||||
@@ -414,9 +413,9 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
{
|
||||
/* Now wait until a signal is available in our group or it is closed.
|
||||
Acquire MO so that if we observe (signals == lowseq) after group
|
||||
- switching in __condvar_quiesce_and_switch_g1, we synchronize with that
|
||||
- store and will see the prior update of __g1_start done while switching
|
||||
- groups too. */
|
||||
+ switching in __condvar_switch_g1, we synchronize with that store and
|
||||
+ will see the prior update of __g1_start done while switching groups
|
||||
+ too. */
|
||||
unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||
uint64_t g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||
unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U;
|
||||
@@ -383,65 +383,65 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
}
|
||||
|
||||
|
||||
- while (1)
|
||||
- {
|
||||
- /* Now wait until a signal is available in our group or it is closed.
|
||||
- Acquire MO so that if we observe (signals == lowseq) after group
|
||||
- switching in __condvar_quiesce_and_switch_g1, we synchronize with that
|
||||
- store and will see the prior update of __g1_start done while switching
|
||||
- groups too. */
|
||||
- unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||
- uint64_t g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||
- unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U;
|
||||
-
|
||||
- if (seq < (g1_start >> 1))
|
||||
- {
|
||||
- /* If the group is closed already,
|
||||
- then this waiter originally had enough extra signals to
|
||||
- consume, up until the time its group was closed. */
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- /* If there is an available signal, don't block.
|
||||
- If __g1_start has advanced at all, then we must be in G1
|
||||
- by now, perhaps in the process of switching back to an older
|
||||
- G2, but in either case we're allowed to consume the available
|
||||
- signal and should not block anymore. */
|
||||
- if ((int)(signals - lowseq) >= 2)
|
||||
- {
|
||||
- /* Try to grab a signal. See above for MO. (if we do another loop
|
||||
- iteration we need to see the correct value of g1_start) */
|
||||
- if (atomic_compare_exchange_weak_acquire (
|
||||
- cond->__data.__g_signals + g,
|
||||
+ while (1)
|
||||
+ {
|
||||
+ /* Now wait until a signal is available in our group or it is closed.
|
||||
+ Acquire MO so that if we observe (signals == lowseq) after group
|
||||
+ switching in __condvar_quiesce_and_switch_g1, we synchronize with that
|
||||
+ store and will see the prior update of __g1_start done while switching
|
||||
+ groups too. */
|
||||
+ unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||
+ uint64_t g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||
+ unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U;
|
||||
+
|
||||
+ if (seq < (g1_start >> 1))
|
||||
+ {
|
||||
+ /* If the group is closed already,
|
||||
+ then this waiter originally had enough extra signals to
|
||||
+ consume, up until the time its group was closed. */
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /* If there is an available signal, don't block.
|
||||
+ If __g1_start has advanced at all, then we must be in G1
|
||||
+ by now, perhaps in the process of switching back to an older
|
||||
+ G2, but in either case we're allowed to consume the available
|
||||
+ signal and should not block anymore. */
|
||||
+ if ((int)(signals - lowseq) >= 2)
|
||||
+ {
|
||||
+ /* Try to grab a signal. See above for MO. (if we do another loop
|
||||
+ iteration we need to see the correct value of g1_start) */
|
||||
+ if (atomic_compare_exchange_weak_acquire (
|
||||
+ cond->__data.__g_signals + g,
|
||||
&signals, signals - 2))
|
||||
- break;
|
||||
- else
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- // Now block.
|
||||
- struct _pthread_cleanup_buffer buffer;
|
||||
- struct _condvar_cleanup_buffer cbuffer;
|
||||
- cbuffer.wseq = wseq;
|
||||
- cbuffer.cond = cond;
|
||||
- cbuffer.mutex = mutex;
|
||||
- cbuffer.private = private;
|
||||
- __pthread_cleanup_push (&buffer, __condvar_cleanup_waiting, &cbuffer);
|
||||
-
|
||||
- err = __futex_abstimed_wait_cancelable64 (
|
||||
- cond->__data.__g_signals + g, signals, clockid, abstime, private);
|
||||
-
|
||||
- __pthread_cleanup_pop (&buffer, 0);
|
||||
-
|
||||
- if (__glibc_unlikely (err == ETIMEDOUT || err == EOVERFLOW))
|
||||
- {
|
||||
- /* If we timed out, we effectively cancel waiting. */
|
||||
- __condvar_cancel_waiting (cond, seq, g, private);
|
||||
- result = err;
|
||||
break;
|
||||
- }
|
||||
+ else
|
||||
+ continue;
|
||||
}
|
||||
|
||||
+ // Now block.
|
||||
+ struct _pthread_cleanup_buffer buffer;
|
||||
+ struct _condvar_cleanup_buffer cbuffer;
|
||||
+ cbuffer.wseq = wseq;
|
||||
+ cbuffer.cond = cond;
|
||||
+ cbuffer.mutex = mutex;
|
||||
+ cbuffer.private = private;
|
||||
+ __pthread_cleanup_push (&buffer, __condvar_cleanup_waiting, &cbuffer);
|
||||
+
|
||||
+ err = __futex_abstimed_wait_cancelable64 (
|
||||
+ cond->__data.__g_signals + g, signals, clockid, abstime, private);
|
||||
+
|
||||
+ __pthread_cleanup_pop (&buffer, 0);
|
||||
+
|
||||
+ if (__glibc_unlikely (err == ETIMEDOUT || err == EOVERFLOW))
|
||||
+ {
|
||||
+ /* If we timed out, we effectively cancel waiting. */
|
||||
+ __condvar_cancel_waiting (cond, seq, g, private);
|
||||
+ result = err;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* Confirm that we have been woken. We do that before acquiring the mutex
|
||||
to allow for execution of pthread_cond_destroy while having acquired the
|
||||
mutex. */
|
||||
--
|
||||
2.49.0
|
||||
|
||||
|
||||
@@ -1,192 +1,161 @@
|
||||
From fc074de88796eb2036fbe9bade638e00adfd5cb2 Mon Sep 17 00:00:00 2001
|
||||
From 20d84dfa0b9a32f88259269bbeaae588744ae4ae Mon Sep 17 00:00:00 2001
|
||||
From: Malte Skarupke <malteskarupke@fastmail.fm>
|
||||
Date: Tue, 17 Jun 2025 02:08:36 -0700
|
||||
Subject: [PATCH] nptl: Use all of g1_start and g_signals
|
||||
Date: Tue, 14 Oct 2025 06:33:50 -0700
|
||||
Subject: [PATCH] nptl: rename __condvar_quiesce_and_switch_g1
|
||||
|
||||
The LSB of g_signals was unused. The LSB of g1_start was used to indicate
|
||||
which group is G2. This was used to always go to sleep in pthread_cond_wait
|
||||
if a waiter is in G2. A comment earlier in the file says that this is not
|
||||
correct to do:
|
||||
|
||||
"Waiters cannot determine whether they are currently in G2 or G1 -- but they
|
||||
do not have to because all they are interested in is whether there are
|
||||
available signals"
|
||||
|
||||
I either would have had to update the comment, or get rid of the check. I
|
||||
chose to get rid of the check. In fact I don't quite know why it was there.
|
||||
There will never be available signals for group G2, so we didn't need the
|
||||
special case. Even if there were, this would just be a spurious wake. This
|
||||
might have caught some cases where the count has wrapped around, but it
|
||||
wouldn't reliably do that, (and even if it did, why would you want to force a
|
||||
sleep in that case?) and we don't support that many concurrent waiters
|
||||
anyway. Getting rid of it allows us to use one more bit, making us more
|
||||
robust to wraparound.
|
||||
This function no longer waits for threads to leave g1, so rename it to
|
||||
__condvar_switch_g1
|
||||
|
||||
The following commits have been cherry-picked from Glibc master branch:
|
||||
Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847
|
||||
commit: 4b79e27a5073c02f6bff9aa8f4791230a0ab1867
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://sourceware.org/git/?p=glibc.git;a=commit;h=91bb902f58264a2fd50fbce8f39a9a290dd23706]
|
||||
Upstream-Status: Submitted
|
||||
[https://sourceware.org/pipermail/libc-stable/2025-July/002281.html]
|
||||
|
||||
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
|
||||
---
|
||||
nptl/pthread_cond_broadcast.c | 4 ++--
|
||||
nptl/pthread_cond_common.c | 26 ++++++++++----------------
|
||||
nptl/pthread_cond_signal.c | 2 +-
|
||||
nptl/pthread_cond_wait.c | 14 +++++---------
|
||||
4 files changed, 18 insertions(+), 28 deletions(-)
|
||||
nptl/pthread_cond_common.c | 26 ++++++++++++--------------
|
||||
nptl/pthread_cond_signal.c | 17 ++++++++---------
|
||||
nptl/pthread_cond_wait.c | 9 ++++-----
|
||||
4 files changed, 26 insertions(+), 30 deletions(-)
|
||||
|
||||
diff --git a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c
|
||||
index a07435589a..ef0943cdc5 100644
|
||||
index 5ae141ac..a0743558 100644
|
||||
--- a/nptl/pthread_cond_broadcast.c
|
||||
+++ b/nptl/pthread_cond_broadcast.c
|
||||
@@ -57,7 +57,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond)
|
||||
{
|
||||
/* Add as many signals as the remaining size of the group. */
|
||||
atomic_fetch_add_relaxed (cond->__data.__g_signals + g1,
|
||||
- cond->__data.__g_size[g1] << 1);
|
||||
+ cond->__data.__g_size[g1]);
|
||||
@@ -60,7 +60,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond)
|
||||
cond->__data.__g_size[g1] << 1);
|
||||
cond->__data.__g_size[g1] = 0;
|
||||
|
||||
/* We need to wake G1 waiters before we switch G1 below. */
|
||||
@@ -73,7 +73,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond)
|
||||
- /* We need to wake G1 waiters before we quiesce G1 below. */
|
||||
+ /* We need to wake G1 waiters before we switch G1 below. */
|
||||
/* TODO Only set it if there are indeed futex waiters. We could
|
||||
also try to move this out of the critical section in cases when
|
||||
G2 is empty (and we don't need to quiesce). */
|
||||
@@ -69,7 +69,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond)
|
||||
|
||||
/* G1 is complete. Step (2) is next unless there are no waiters in G2, in
|
||||
which case we can stop. */
|
||||
- if (__condvar_quiesce_and_switch_g1 (cond, wseq, &g1, private))
|
||||
+ if (__condvar_switch_g1 (cond, wseq, &g1, private))
|
||||
{
|
||||
/* Step (3): Send signals to all waiters in the old G2 / new G1. */
|
||||
atomic_fetch_add_relaxed (cond->__data.__g_signals + g1,
|
||||
- cond->__data.__g_size[g1] << 1);
|
||||
+ cond->__data.__g_size[g1]);
|
||||
cond->__data.__g_size[g1] = 0;
|
||||
/* TODO Only set it if there are indeed futex waiters. */
|
||||
do_futex_wake = true;
|
||||
diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c
|
||||
index 3baac4dabc..e48f914321 100644
|
||||
index f976a533..3baac4da 100644
|
||||
--- a/nptl/pthread_cond_common.c
|
||||
+++ b/nptl/pthread_cond_common.c
|
||||
@@ -208,9 +208,9 @@ __condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
behavior.
|
||||
Note that this works correctly for a zero-initialized condvar too. */
|
||||
unsigned int old_orig_size = __condvar_get_orig_size (cond);
|
||||
- uint64_t old_g1_start = __condvar_load_g1_start_relaxed (cond) >> 1;
|
||||
- if (((unsigned) (wseq - old_g1_start - old_orig_size)
|
||||
- + cond->__data.__g_size[g1 ^ 1]) == 0)
|
||||
+ uint64_t old_g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||
+ uint64_t new_g1_start = old_g1_start + old_orig_size;
|
||||
+ if (((unsigned) (wseq - new_g1_start) + cond->__data.__g_size[g1 ^ 1]) == 0)
|
||||
@@ -189,16 +189,15 @@ __condvar_get_private (int flags)
|
||||
return FUTEX_SHARED;
|
||||
}
|
||||
|
||||
-/* This closes G1 (whose index is in G1INDEX), waits for all futex waiters to
|
||||
- leave G1, converts G1 into a fresh G2, and then switches group roles so that
|
||||
- the former G2 becomes the new G1 ending at the current __wseq value when we
|
||||
- eventually make the switch (WSEQ is just an observation of __wseq by the
|
||||
- signaler).
|
||||
+/* This closes G1 (whose index is in G1INDEX), converts G1 into a fresh G2,
|
||||
+ and then switches group roles so that the former G2 becomes the new G1
|
||||
+ ending at the current __wseq value when we eventually make the switch
|
||||
+ (WSEQ is just an observation of __wseq by the signaler).
|
||||
If G2 is empty, it will not switch groups because then it would create an
|
||||
empty G1 which would require switching groups again on the next signal.
|
||||
Returns false iff groups were not switched because G2 was empty. */
|
||||
static bool __attribute__ ((unused))
|
||||
-__condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
+__condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
unsigned int *g1index, int private)
|
||||
{
|
||||
unsigned int g1 = *g1index;
|
||||
@@ -214,8 +213,7 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
+ cond->__data.__g_size[g1 ^ 1]) == 0)
|
||||
return false;
|
||||
|
||||
/* We have to consider the following kinds of waiters:
|
||||
@@ -221,16 +221,10 @@ __condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
- /* Now try to close and quiesce G1. We have to consider the following kinds
|
||||
- of waiters:
|
||||
+ /* We have to consider the following kinds of waiters:
|
||||
* Waiters from less recent groups than G1 are not affected because
|
||||
nothing will change for them apart from __g1_start getting larger.
|
||||
* New waiters arriving concurrently with the group switching will all go
|
||||
@@ -223,12 +221,12 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
are not affected.
|
||||
* Waiters in G1 have already received a signal and been woken. */
|
||||
|
||||
- /* Update __g1_start, which closes this group. The value we add will never
|
||||
- be negative because old_orig_size can only be zero when we switch groups
|
||||
- the first time after a condvar was initialized, in which case G1 will be
|
||||
- at index 1 and we will add a value of 1. Relaxed MO is fine because the
|
||||
- change comes with no additional constraints that others would have to
|
||||
- observe. */
|
||||
- __condvar_add_g1_start_relaxed (cond,
|
||||
- (old_orig_size << 1) + (g1 == 1 ? 1 : - 1));
|
||||
-
|
||||
- unsigned int lowseq = ((old_g1_start + old_orig_size) << 1) & ~1U;
|
||||
+ /* Update __g1_start, which closes this group. Relaxed MO is fine because
|
||||
+ the change comes with no additional constraints that others would have
|
||||
+ to observe. */
|
||||
+ __condvar_add_g1_start_relaxed (cond, old_orig_size);
|
||||
- /* Update __g1_start, which finishes closing this group. The value we add
|
||||
- will never be negative because old_orig_size can only be zero when we
|
||||
- switch groups the first time after a condvar was initialized, in which
|
||||
- case G1 will be at index 1 and we will add a value of 1.
|
||||
- Relaxed MO is fine because the change comes with no additional
|
||||
- constraints that others would have to observe. */
|
||||
+ /* Update __g1_start, which closes this group. The value we add will never
|
||||
+ be negative because old_orig_size can only be zero when we switch groups
|
||||
+ the first time after a condvar was initialized, in which case G1 will be
|
||||
+ at index 1 and we will add a value of 1. Relaxed MO is fine because the
|
||||
+ change comes with no additional constraints that others would have to
|
||||
+ observe. */
|
||||
__condvar_add_g1_start_relaxed (cond,
|
||||
(old_orig_size << 1) + (g1 == 1 ? 1 : - 1));
|
||||
|
||||
/* At this point, the old G1 is now a valid new G2 (but not in use yet).
|
||||
No old waiter can neither grab a signal nor acquire a reference without
|
||||
@@ -242,13 +236,13 @@ __condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
g1 ^= 1;
|
||||
*g1index ^= 1;
|
||||
|
||||
- /* Now advance the new G1 g_signals to the new lowseq, giving it
|
||||
+ /* Now advance the new G1 g_signals to the new g1_start, giving it
|
||||
an effective signal count of 0 to start. */
|
||||
- atomic_store_release (cond->__data.__g_signals + g1, lowseq);
|
||||
+ atomic_store_release (cond->__data.__g_signals + g1, (unsigned)new_g1_start);
|
||||
|
||||
/* These values are just observed by signalers, and thus protected by the
|
||||
lock. */
|
||||
- unsigned int orig_size = wseq - (old_g1_start + old_orig_size);
|
||||
+ unsigned int orig_size = wseq - new_g1_start;
|
||||
__condvar_set_orig_size (cond, orig_size);
|
||||
/* Use and addition to not loose track of cancellations in what was
|
||||
previously G2. */
|
||||
diff --git a/nptl/pthread_cond_signal.c b/nptl/pthread_cond_signal.c
|
||||
index a9bc10dcca..07427369aa 100644
|
||||
index 14800ba0..a9bc10dc 100644
|
||||
--- a/nptl/pthread_cond_signal.c
|
||||
+++ b/nptl/pthread_cond_signal.c
|
||||
@@ -80,7 +80,7 @@ ___pthread_cond_signal (pthread_cond_t *cond)
|
||||
release-MO store when initializing a group in __condvar_switch_g1
|
||||
because we use an atomic read-modify-write and thus extend that
|
||||
store's release sequence. */
|
||||
- atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, 2);
|
||||
+ atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, 1);
|
||||
@@ -69,18 +69,17 @@ ___pthread_cond_signal (pthread_cond_t *cond)
|
||||
bool do_futex_wake = false;
|
||||
|
||||
/* If G1 is still receiving signals, we put the signal there. If not, we
|
||||
- check if G2 has waiters, and if so, quiesce and switch G1 to the former
|
||||
- G2; if this results in a new G1 with waiters (G2 might have cancellations
|
||||
- already, see __condvar_quiesce_and_switch_g1), we put the signal in the
|
||||
- new G1. */
|
||||
+ check if G2 has waiters, and if so, switch G1 to the former G2; if this
|
||||
+ results in a new G1 with waiters (G2 might have cancellations already,
|
||||
+ see __condvar_switch_g1), we put the signal in the new G1. */
|
||||
if ((cond->__data.__g_size[g1] != 0)
|
||||
- || __condvar_quiesce_and_switch_g1 (cond, wseq, &g1, private))
|
||||
+ || __condvar_switch_g1 (cond, wseq, &g1, private))
|
||||
{
|
||||
/* Add a signal. Relaxed MO is fine because signaling does not need to
|
||||
- establish a happens-before relation (see above). We do not mask the
|
||||
- release-MO store when initializing a group in
|
||||
- __condvar_quiesce_and_switch_g1 because we use an atomic
|
||||
- read-modify-write and thus extend that store's release sequence. */
|
||||
+ establish a happens-before relation (see above). We do not mask the
|
||||
+ release-MO store when initializing a group in __condvar_switch_g1
|
||||
+ because we use an atomic read-modify-write and thus extend that
|
||||
+ store's release sequence. */
|
||||
atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, 2);
|
||||
cond->__data.__g_size[g1]--;
|
||||
/* TODO Only set it if there are indeed futex waiters. */
|
||||
do_futex_wake = true;
|
||||
diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
|
||||
index bb46f3605d..430cbe8a35 100644
|
||||
index adf26a80..40a74342 100644
|
||||
--- a/nptl/pthread_cond_wait.c
|
||||
+++ b/nptl/pthread_cond_wait.c
|
||||
@@ -84,7 +84,7 @@ __condvar_cancel_waiting (pthread_cond_t *cond, uint64_t seq, unsigned int g,
|
||||
not hold a reference on the group. */
|
||||
__condvar_acquire_lock (cond, private);
|
||||
|
||||
- uint64_t g1_start = __condvar_load_g1_start_relaxed (cond) >> 1;
|
||||
+ uint64_t g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||
if (g1_start > seq)
|
||||
@@ -354,8 +354,7 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
because we do not need to establish any happens-before relation with
|
||||
signalers (see __pthread_cond_signal); modification order alone
|
||||
establishes a total order of waiters/signals. We do need acquire MO
|
||||
- to synchronize with group reinitialization in
|
||||
- __condvar_quiesce_and_switch_g1. */
|
||||
+ to synchronize with group reinitialization in __condvar_switch_g1. */
|
||||
uint64_t wseq = __condvar_fetch_add_wseq_acquire (cond, 2);
|
||||
/* Find our group's index. We always go into what was G2 when we acquired
|
||||
our position. */
|
||||
@@ -387,9 +386,9 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
{
|
||||
/* Our group is closed, so someone provided enough signals for it.
|
||||
@@ -278,7 +278,6 @@ __condvar_cleanup_waiting (void *arg)
|
||||
* Waiters fetch-add while having acquire the mutex associated with the
|
||||
condvar. Signalers load it and fetch-xor it concurrently.
|
||||
__g1_start: Starting position of G1 (inclusive)
|
||||
- * LSB is index of current G2.
|
||||
* Modified by signalers while having acquired the condvar-internal lock
|
||||
and observed concurrently by waiters.
|
||||
__g1_orig_size: Initial size of G1
|
||||
@@ -299,11 +298,9 @@ __condvar_cleanup_waiting (void *arg)
|
||||
* Reference count used by waiters concurrently with signalers that have
|
||||
acquired the condvar-internal lock.
|
||||
__g_signals: The number of signals that can still be consumed, relative to
|
||||
- the current g1_start. (i.e. bits 31 to 1 of __g_signals are bits
|
||||
- 31 to 1 of g1_start with the signal count added)
|
||||
+ the current g1_start. (i.e. g1_start with the signal count added)
|
||||
* Used as a futex word by waiters. Used concurrently by waiters and
|
||||
signalers.
|
||||
- * LSB is currently reserved and 0.
|
||||
__g_size: Waiters remaining in this group (i.e., which have not been
|
||||
signaled yet.
|
||||
* Accessed by signalers and waiters that cancel waiting (both do so only
|
||||
@@ -418,9 +415,8 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
too. */
|
||||
/* Now wait until a signal is available in our group or it is closed.
|
||||
Acquire MO so that if we observe (signals == lowseq) after group
|
||||
- switching in __condvar_quiesce_and_switch_g1, we synchronize with that
|
||||
- store and will see the prior update of __g1_start done while switching
|
||||
- groups too. */
|
||||
+ switching in __condvar_switch_g1, we synchronize with that store and
|
||||
+ will see the prior update of __g1_start done while switching groups
|
||||
+ too. */
|
||||
unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||
uint64_t g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||
- unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U;
|
||||
|
||||
- if (seq < (g1_start >> 1))
|
||||
+ if (seq < g1_start)
|
||||
{
|
||||
/* If the group is closed already,
|
||||
then this waiter originally had enough extra signals to
|
||||
@@ -433,13 +429,13 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
by now, perhaps in the process of switching back to an older
|
||||
G2, but in either case we're allowed to consume the available
|
||||
signal and should not block anymore. */
|
||||
- if ((int)(signals - lowseq) >= 2)
|
||||
+ if ((int)(signals - (unsigned int)g1_start) > 0)
|
||||
{
|
||||
/* Try to grab a signal. See above for MO. (if we do another loop
|
||||
iteration we need to see the correct value of g1_start) */
|
||||
if (atomic_compare_exchange_weak_acquire (
|
||||
cond->__data.__g_signals + g,
|
||||
- &signals, signals - 2))
|
||||
+ &signals, signals - 1))
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U;
|
||||
--
|
||||
2.49.0
|
||||
|
||||
|
||||
193
meta/recipes-core/glibc/glibc/0026-PR25847-9.patch
Normal file
193
meta/recipes-core/glibc/glibc/0026-PR25847-9.patch
Normal file
@@ -0,0 +1,193 @@
|
||||
From c2677e68956bb9677d8de4ee6c5341b1a744d490 Mon Sep 17 00:00:00 2001
|
||||
From: Malte Skarupke <malteskarupke@fastmail.fm>
|
||||
Date: Tue, 14 Oct 2025 06:40:57 -0700
|
||||
Subject: [PATCH] nptl: Use all of g1_start and g_signals
|
||||
|
||||
The LSB of g_signals was unused. The LSB of g1_start was used to indicate
|
||||
which group is G2. This was used to always go to sleep in pthread_cond_wait
|
||||
if a waiter is in G2. A comment earlier in the file says that this is not
|
||||
correct to do:
|
||||
|
||||
"Waiters cannot determine whether they are currently in G2 or G1 -- but they
|
||||
do not have to because all they are interested in is whether there are
|
||||
available signals"
|
||||
|
||||
I either would have had to update the comment, or get rid of the check. I
|
||||
chose to get rid of the check. In fact I don't quite know why it was there.
|
||||
There will never be available signals for group G2, so we didn't need the
|
||||
special case. Even if there were, this would just be a spurious wake. This
|
||||
might have caught some cases where the count has wrapped around, but it
|
||||
wouldn't reliably do that, (and even if it did, why would you want to force a
|
||||
sleep in that case?) and we don't support that many concurrent waiters
|
||||
anyway. Getting rid of it allows us to use one more bit, making us more
|
||||
robust to wraparound.
|
||||
|
||||
The following commits have been cherry-picked from Glibc master branch:
|
||||
Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847
|
||||
commit: 91bb902f58264a2fd50fbce8f39a9a290dd23706
|
||||
|
||||
Upstream-Status: Submitted
|
||||
[https://sourceware.org/pipermail/libc-stable/2025-July/002283.html]
|
||||
|
||||
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
|
||||
---
|
||||
nptl/pthread_cond_broadcast.c | 4 ++--
|
||||
nptl/pthread_cond_common.c | 26 ++++++++++----------------
|
||||
nptl/pthread_cond_signal.c | 2 +-
|
||||
nptl/pthread_cond_wait.c | 14 +++++---------
|
||||
4 files changed, 18 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c
|
||||
index a0743558..ef0943cd 100644
|
||||
--- a/nptl/pthread_cond_broadcast.c
|
||||
+++ b/nptl/pthread_cond_broadcast.c
|
||||
@@ -57,7 +57,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond)
|
||||
{
|
||||
/* Add as many signals as the remaining size of the group. */
|
||||
atomic_fetch_add_relaxed (cond->__data.__g_signals + g1,
|
||||
- cond->__data.__g_size[g1] << 1);
|
||||
+ cond->__data.__g_size[g1]);
|
||||
cond->__data.__g_size[g1] = 0;
|
||||
|
||||
/* We need to wake G1 waiters before we switch G1 below. */
|
||||
@@ -73,7 +73,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond)
|
||||
{
|
||||
/* Step (3): Send signals to all waiters in the old G2 / new G1. */
|
||||
atomic_fetch_add_relaxed (cond->__data.__g_signals + g1,
|
||||
- cond->__data.__g_size[g1] << 1);
|
||||
+ cond->__data.__g_size[g1]);
|
||||
cond->__data.__g_size[g1] = 0;
|
||||
/* TODO Only set it if there are indeed futex waiters. */
|
||||
do_futex_wake = true;
|
||||
diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c
|
||||
index 3baac4da..e48f9143 100644
|
||||
--- a/nptl/pthread_cond_common.c
|
||||
+++ b/nptl/pthread_cond_common.c
|
||||
@@ -208,9 +208,9 @@ __condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
behavior.
|
||||
Note that this works correctly for a zero-initialized condvar too. */
|
||||
unsigned int old_orig_size = __condvar_get_orig_size (cond);
|
||||
- uint64_t old_g1_start = __condvar_load_g1_start_relaxed (cond) >> 1;
|
||||
- if (((unsigned) (wseq - old_g1_start - old_orig_size)
|
||||
- + cond->__data.__g_size[g1 ^ 1]) == 0)
|
||||
+ uint64_t old_g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||
+ uint64_t new_g1_start = old_g1_start + old_orig_size;
|
||||
+ if (((unsigned) (wseq - new_g1_start) + cond->__data.__g_size[g1 ^ 1]) == 0)
|
||||
return false;
|
||||
|
||||
/* We have to consider the following kinds of waiters:
|
||||
@@ -221,16 +221,10 @@ __condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
are not affected.
|
||||
* Waiters in G1 have already received a signal and been woken. */
|
||||
|
||||
- /* Update __g1_start, which closes this group. The value we add will never
|
||||
- be negative because old_orig_size can only be zero when we switch groups
|
||||
- the first time after a condvar was initialized, in which case G1 will be
|
||||
- at index 1 and we will add a value of 1. Relaxed MO is fine because the
|
||||
- change comes with no additional constraints that others would have to
|
||||
- observe. */
|
||||
- __condvar_add_g1_start_relaxed (cond,
|
||||
- (old_orig_size << 1) + (g1 == 1 ? 1 : - 1));
|
||||
-
|
||||
- unsigned int lowseq = ((old_g1_start + old_orig_size) << 1) & ~1U;
|
||||
+ /* Update __g1_start, which closes this group. Relaxed MO is fine because
|
||||
+ the change comes with no additional constraints that others would have
|
||||
+ to observe. */
|
||||
+ __condvar_add_g1_start_relaxed (cond, old_orig_size);
|
||||
|
||||
/* At this point, the old G1 is now a valid new G2 (but not in use yet).
|
||||
No old waiter can neither grab a signal nor acquire a reference without
|
||||
@@ -242,13 +236,13 @@ __condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
|
||||
g1 ^= 1;
|
||||
*g1index ^= 1;
|
||||
|
||||
- /* Now advance the new G1 g_signals to the new lowseq, giving it
|
||||
+ /* Now advance the new G1 g_signals to the new g1_start, giving it
|
||||
an effective signal count of 0 to start. */
|
||||
- atomic_store_release (cond->__data.__g_signals + g1, lowseq);
|
||||
+ atomic_store_release (cond->__data.__g_signals + g1, (unsigned)new_g1_start);
|
||||
|
||||
/* These values are just observed by signalers, and thus protected by the
|
||||
lock. */
|
||||
- unsigned int orig_size = wseq - (old_g1_start + old_orig_size);
|
||||
+ unsigned int orig_size = wseq - new_g1_start;
|
||||
__condvar_set_orig_size (cond, orig_size);
|
||||
/* Use and addition to not loose track of cancellations in what was
|
||||
previously G2. */
|
||||
diff --git a/nptl/pthread_cond_signal.c b/nptl/pthread_cond_signal.c
|
||||
index a9bc10dc..07427369 100644
|
||||
--- a/nptl/pthread_cond_signal.c
|
||||
+++ b/nptl/pthread_cond_signal.c
|
||||
@@ -80,7 +80,7 @@ ___pthread_cond_signal (pthread_cond_t *cond)
|
||||
release-MO store when initializing a group in __condvar_switch_g1
|
||||
because we use an atomic read-modify-write and thus extend that
|
||||
store's release sequence. */
|
||||
- atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, 2);
|
||||
+ atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, 1);
|
||||
cond->__data.__g_size[g1]--;
|
||||
/* TODO Only set it if there are indeed futex waiters. */
|
||||
do_futex_wake = true;
|
||||
diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
|
||||
index 40a74342..d7e073ab 100644
|
||||
--- a/nptl/pthread_cond_wait.c
|
||||
+++ b/nptl/pthread_cond_wait.c
|
||||
@@ -84,7 +84,7 @@ __condvar_cancel_waiting (pthread_cond_t *cond, uint64_t seq, unsigned int g,
|
||||
not hold a reference on the group. */
|
||||
__condvar_acquire_lock (cond, private);
|
||||
|
||||
- uint64_t g1_start = __condvar_load_g1_start_relaxed (cond) >> 1;
|
||||
+ uint64_t g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||
if (g1_start > seq)
|
||||
{
|
||||
/* Our group is closed, so someone provided enough signals for it.
|
||||
@@ -259,7 +259,6 @@ __condvar_cleanup_waiting (void *arg)
|
||||
* Waiters fetch-add while having acquire the mutex associated with the
|
||||
condvar. Signalers load it and fetch-xor it concurrently.
|
||||
__g1_start: Starting position of G1 (inclusive)
|
||||
- * LSB is index of current G2.
|
||||
* Modified by signalers while having acquired the condvar-internal lock
|
||||
and observed concurrently by waiters.
|
||||
__g1_orig_size: Initial size of G1
|
||||
@@ -280,11 +279,9 @@ __condvar_cleanup_waiting (void *arg)
|
||||
* Reference count used by waiters concurrently with signalers that have
|
||||
acquired the condvar-internal lock.
|
||||
__g_signals: The number of signals that can still be consumed, relative to
|
||||
- the current g1_start. (i.e. bits 31 to 1 of __g_signals are bits
|
||||
- 31 to 1 of g1_start with the signal count added)
|
||||
+ the current g1_start. (i.e. g1_start with the signal count added)
|
||||
* Used as a futex word by waiters. Used concurrently by waiters and
|
||||
signalers.
|
||||
- * LSB is currently reserved and 0.
|
||||
__g_size: Waiters remaining in this group (i.e., which have not been
|
||||
signaled yet.
|
||||
* Accessed by signalers and waiters that cancel waiting (both do so only
|
||||
@@ -391,9 +388,8 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
too. */
|
||||
unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||
uint64_t g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||
- unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U;
|
||||
|
||||
- if (seq < (g1_start >> 1))
|
||||
+ if (seq < g1_start)
|
||||
{
|
||||
/* If the group is closed already,
|
||||
then this waiter originally had enough extra signals to
|
||||
@@ -406,13 +402,13 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
by now, perhaps in the process of switching back to an older
|
||||
G2, but in either case we're allowed to consume the available
|
||||
signal and should not block anymore. */
|
||||
- if ((int)(signals - lowseq) >= 2)
|
||||
+ if ((int)(signals - (unsigned int)g1_start) > 0)
|
||||
{
|
||||
/* Try to grab a signal. See above for MO. (if we do another loop
|
||||
iteration we need to see the correct value of g1_start) */
|
||||
if (atomic_compare_exchange_weak_acquire (
|
||||
cond->__data.__g_signals + g,
|
||||
- &signals, signals - 2))
|
||||
+ &signals, signals - 1))
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
--
|
||||
2.49.0
|
||||
|
||||
@@ -70,6 +70,8 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
|
||||
file://0026-PR25847-6.patch \
|
||||
file://0026-PR25847-7.patch \
|
||||
file://0026-PR25847-8.patch \
|
||||
file://0026-PR25847-9.patch \
|
||||
file://0026-PR25847-10.patch \
|
||||
\
|
||||
file://0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \
|
||||
file://0002-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch \
|
||||
|
||||
@@ -24,7 +24,7 @@ IMAGE_FSTYPES = "wic.vmdk wic.vhd wic.vhdx"
|
||||
|
||||
inherit core-image setuptools3
|
||||
|
||||
SRCREV ?= "3c825671cb8f30e6205f1bcf177f3432161295f5"
|
||||
SRCREV ?= "cb1206dd8460f2701df03b1e9224825bad23a90e"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=kirkstone \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
|
||||
802
meta/recipes-core/libxml/libxml2/CVE-2025-7425.patch
Normal file
802
meta/recipes-core/libxml/libxml2/CVE-2025-7425.patch
Normal file
@@ -0,0 +1,802 @@
|
||||
From 87786d6200ae1f5ac98d21f04d451e17ff25a216 Mon Sep 17 00:00:00 2001
|
||||
From: David Kilzer <ddkilzer@apple.com>
|
||||
Reviewed-By: Aron Xu <aron@debian.org>
|
||||
Date: Mon, 23 Jun 2025 14:41:56 -0700
|
||||
Subject: [PATCH] libxslt: heap-use-after-free in xmlFreeID caused by `atype`
|
||||
corruption
|
||||
|
||||
* include/libxml/tree.h:
|
||||
(XML_ATTR_CLEAR_ATYPE): Add.
|
||||
(XML_ATTR_GET_ATYPE): Add.
|
||||
(XML_ATTR_SET_ATYPE): Add.
|
||||
(XML_NODE_ADD_EXTRA): Add.
|
||||
(XML_NODE_CLEAR_EXTRA): Add.
|
||||
(XML_NODE_GET_EXTRA): Add.
|
||||
(XML_NODE_SET_EXTRA): Add.
|
||||
(XML_DOC_ADD_PROPERTIES): Add.
|
||||
(XML_DOC_CLEAR_PROPERTIES): Add.
|
||||
(XML_DOC_GET_PROPERTIES): Add.
|
||||
(XML_DOC_SET_PROPERTIES): Add.
|
||||
- Add macros for accessing fields with upper bits that may be set by
|
||||
libxslt.
|
||||
|
||||
* HTMLparser.c:
|
||||
(htmlNewDocNoDtD):
|
||||
* SAX2.c:
|
||||
(xmlSAX2StartDocument):
|
||||
(xmlSAX2EndDocument):
|
||||
* parser.c:
|
||||
(xmlParseEntityDecl):
|
||||
(xmlParseExternalSubset):
|
||||
(xmlParseReference):
|
||||
(xmlCtxtParseDtd):
|
||||
* runxmlconf.c:
|
||||
(xmlconfTestInvalid):
|
||||
(xmlconfTestValid):
|
||||
* tree.c:
|
||||
(xmlNewDoc):
|
||||
(xmlFreeProp):
|
||||
(xmlNodeSetDoc):
|
||||
(xmlSetNsProp):
|
||||
(xmlDOMWrapAdoptBranch):
|
||||
* valid.c:
|
||||
(xmlFreeID):
|
||||
(xmlAddIDInternal):
|
||||
(xmlValidateAttributeValueInternal):
|
||||
(xmlValidateOneAttribute):
|
||||
(xmlValidateRef):
|
||||
* xmlreader.c:
|
||||
(xmlTextReaderStartElement):
|
||||
(xmlTextReaderStartElementNs):
|
||||
(xmlTextReaderValidateEntity):
|
||||
(xmlTextReaderRead):
|
||||
(xmlTextReaderNext):
|
||||
(xmlTextReaderIsEmptyElement):
|
||||
(xmlTextReaderPreserve):
|
||||
* xmlschemas.c:
|
||||
(xmlSchemaPValAttrNodeID):
|
||||
* xmlschemastypes.c:
|
||||
(xmlSchemaValAtomicType):
|
||||
- Adopt macros by renaming the struct fields, recompiling and fixing
|
||||
compiler failures, then changing the struct field names back.
|
||||
Origin: https://launchpad.net/ubuntu/+source/libxml2/2.9.14+dfsg-1.3ubuntu3.6
|
||||
Ref : https://security-tracker.debian.org/tracker/CVE-2025-7425
|
||||
|
||||
CVE: CVE-2025-7425
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxslt/-/issues/140]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
HTMLparser.c | 1 +
|
||||
SAX2.c | 6 ++--
|
||||
include/libxml/tree.h | 14 ++++++++-
|
||||
parser.c | 8 ++---
|
||||
runxmlconf.c | 4 +--
|
||||
tree.c | 20 ++++++-------
|
||||
valid.c | 68 +++++++++++++++++++++----------------------
|
||||
xmlreader.c | 30 +++++++++----------
|
||||
xmlschemas.c | 4 +--
|
||||
xmlschemastypes.c | 12 ++++----
|
||||
10 files changed, 90 insertions(+), 77 deletions(-)
|
||||
|
||||
diff --git a/HTMLparser.c b/HTMLparser.c
|
||||
index e720bb2..1307f71 100644
|
||||
--- a/HTMLparser.c
|
||||
+++ b/HTMLparser.c
|
||||
@@ -2514,6 +2514,7 @@ htmlNewDocNoDtD(const xmlChar *URI, const xmlChar *ExternalID) {
|
||||
cur->refs = NULL;
|
||||
cur->_private = NULL;
|
||||
cur->charset = XML_CHAR_ENCODING_UTF8;
|
||||
+ XML_DOC_SET_PROPERTIES(cur, XML_DOC_HTML | XML_DOC_USERBUILT);
|
||||
cur->properties = XML_DOC_HTML | XML_DOC_USERBUILT;
|
||||
if ((ExternalID != NULL) ||
|
||||
(URI != NULL))
|
||||
diff --git a/SAX2.c b/SAX2.c
|
||||
index f7c77c2..0d8e84a 100644
|
||||
--- a/SAX2.c
|
||||
+++ b/SAX2.c
|
||||
@@ -970,7 +970,7 @@ xmlSAX2StartDocument(void *ctx)
|
||||
xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument");
|
||||
return;
|
||||
}
|
||||
- ctxt->myDoc->properties = XML_DOC_HTML;
|
||||
+ XML_DOC_SET_PROPERTIES(ctxt->myDoc, XML_DOC_HTML);
|
||||
ctxt->myDoc->parseFlags = ctxt->options;
|
||||
#else
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
@@ -983,9 +983,9 @@ xmlSAX2StartDocument(void *ctx)
|
||||
} else {
|
||||
doc = ctxt->myDoc = xmlNewDoc(ctxt->version);
|
||||
if (doc != NULL) {
|
||||
- doc->properties = 0;
|
||||
+ XML_DOC_CLEAR_PROPERTIES(doc);
|
||||
if (ctxt->options & XML_PARSE_OLD10)
|
||||
- doc->properties |= XML_DOC_OLD10;
|
||||
+ XML_DOC_ADD_PROPERTIES(doc, XML_DOC_OLD10);
|
||||
doc->parseFlags = ctxt->options;
|
||||
if (ctxt->encoding != NULL)
|
||||
doc->encoding = xmlStrdup(ctxt->encoding);
|
||||
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
|
||||
index 1e79be9..61178b2 100644
|
||||
--- a/include/libxml/tree.h
|
||||
+++ b/include/libxml/tree.h
|
||||
@@ -365,7 +365,6 @@ struct _xmlElement {
|
||||
#endif
|
||||
};
|
||||
|
||||
-
|
||||
/**
|
||||
* XML_LOCAL_NAMESPACE:
|
||||
*
|
||||
@@ -446,6 +445,10 @@ struct _xmlAttr {
|
||||
void *psvi; /* for type/PSVI information */
|
||||
};
|
||||
|
||||
+#define XML_ATTR_CLEAR_ATYPE(attr) (((attr)->atype) = 0)
|
||||
+#define XML_ATTR_GET_ATYPE(attr) (((attr)->atype) & ~(15U << 27))
|
||||
+#define XML_ATTR_SET_ATYPE(attr, type) ((attr)->atype = ((((attr)->atype) & (15U << 27)) | ((type) & ~(15U << 27))))
|
||||
+
|
||||
/**
|
||||
* xmlID:
|
||||
*
|
||||
@@ -507,6 +510,11 @@ struct _xmlNode {
|
||||
unsigned short extra; /* extra data for XPath/XSLT */
|
||||
};
|
||||
|
||||
+#define XML_NODE_ADD_EXTRA(node, type) ((node)->extra |= ((type) & ~(15U << 12)))
|
||||
+#define XML_NODE_CLEAR_EXTRA(node) (((node)->extra) = 0)
|
||||
+#define XML_NODE_GET_EXTRA(node) (((node)->extra) & ~(15U << 12))
|
||||
+#define XML_NODE_SET_EXTRA(node, type) ((node)->extra = ((((node)->extra) & (15U << 12)) | ((type) & ~(15U << 12))))
|
||||
+
|
||||
/**
|
||||
* XML_GET_CONTENT:
|
||||
*
|
||||
@@ -585,6 +593,10 @@ struct _xmlDoc {
|
||||
set at the end of parsing */
|
||||
};
|
||||
|
||||
+#define XML_DOC_ADD_PROPERTIES(doc, type) ((doc)->properties |= ((type) & ~(15U << 27)))
|
||||
+#define XML_DOC_CLEAR_PROPERTIES(doc) (((doc)->properties) = 0)
|
||||
+#define XML_DOC_GET_PROPERTIES(doc) (((doc)->properties) & ~(15U << 27))
|
||||
+#define XML_DOC_SET_PROPERTIES(doc, type) ((doc)->properties = ((((doc)->properties) & (15U << 27)) | ((type) & ~(15U << 27))))
|
||||
|
||||
typedef struct _xmlDOMWrapCtxt xmlDOMWrapCtxt;
|
||||
typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr;
|
||||
diff --git a/parser.c b/parser.c
|
||||
index 738dbee..772d883 100644
|
||||
--- a/parser.c
|
||||
+++ b/parser.c
|
||||
@@ -5523,7 +5523,7 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
|
||||
xmlErrMemory(ctxt, "New Doc failed");
|
||||
return;
|
||||
}
|
||||
- ctxt->myDoc->properties = XML_DOC_INTERNAL;
|
||||
+ XML_DOC_SET_PROPERTIES(ctxt->myDoc, XML_DOC_INTERNAL);
|
||||
}
|
||||
if (ctxt->myDoc->intSubset == NULL)
|
||||
ctxt->myDoc->intSubset = xmlNewDtd(ctxt->myDoc,
|
||||
@@ -5594,7 +5594,7 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
|
||||
xmlErrMemory(ctxt, "New Doc failed");
|
||||
return;
|
||||
}
|
||||
- ctxt->myDoc->properties = XML_DOC_INTERNAL;
|
||||
+ XML_DOC_SET_PROPERTIES(ctxt->myDoc, XML_DOC_INTERNAL);
|
||||
}
|
||||
|
||||
if (ctxt->myDoc->intSubset == NULL)
|
||||
@@ -7035,7 +7035,7 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID,
|
||||
xmlErrMemory(ctxt, "New Doc failed");
|
||||
return;
|
||||
}
|
||||
- ctxt->myDoc->properties = XML_DOC_INTERNAL;
|
||||
+ XML_DOC_SET_PROPERTIES(ctxt->myDoc, XML_DOC_INTERNAL);
|
||||
}
|
||||
if ((ctxt->myDoc != NULL) && (ctxt->myDoc->intSubset == NULL))
|
||||
xmlCreateIntSubset(ctxt->myDoc, NULL, ExternalID, SystemID);
|
||||
@@ -7419,7 +7419,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
|
||||
(nw != NULL) &&
|
||||
(nw->type == XML_ELEMENT_NODE) &&
|
||||
(nw->children == NULL))
|
||||
- nw->extra = 1;
|
||||
+ XML_NODE_SET_EXTRA(nw, 1);
|
||||
|
||||
break;
|
||||
}
|
||||
diff --git a/runxmlconf.c b/runxmlconf.c
|
||||
index f43fdd3..82b7241 100644
|
||||
--- a/runxmlconf.c
|
||||
+++ b/runxmlconf.c
|
||||
@@ -197,7 +197,7 @@ xmlconfTestInvalid(const char *id, const char *filename, int options) {
|
||||
id, filename);
|
||||
} else {
|
||||
/* invalidity should be reported both in the context and in the document */
|
||||
- if ((ctxt->valid != 0) || (doc->properties & XML_DOC_DTDVALID)) {
|
||||
+ if ((ctxt->valid != 0) || (XML_DOC_GET_PROPERTIES(doc) & XML_DOC_DTDVALID)) {
|
||||
test_log("test %s : %s failed to detect invalid document\n",
|
||||
id, filename);
|
||||
nb_errors++;
|
||||
@@ -229,7 +229,7 @@ xmlconfTestValid(const char *id, const char *filename, int options) {
|
||||
ret = 0;
|
||||
} else {
|
||||
/* validity should be reported both in the context and in the document */
|
||||
- if ((ctxt->valid == 0) || ((doc->properties & XML_DOC_DTDVALID) == 0)) {
|
||||
+ if ((ctxt->valid == 0) || ((XML_DOC_GET_PROPERTIES(doc) & XML_DOC_DTDVALID) == 0)) {
|
||||
test_log("test %s : %s failed to validate a valid document\n",
|
||||
id, filename);
|
||||
nb_errors++;
|
||||
diff --git a/tree.c b/tree.c
|
||||
index cdf863c..3bac0b8 100644
|
||||
--- a/tree.c
|
||||
+++ b/tree.c
|
||||
@@ -1192,7 +1192,7 @@ xmlNewDoc(const xmlChar *version) {
|
||||
cur->compression = -1; /* not initialized */
|
||||
cur->doc = cur;
|
||||
cur->parseFlags = 0;
|
||||
- cur->properties = XML_DOC_USERBUILT;
|
||||
+ XML_DOC_SET_PROPERTIES(cur, XML_DOC_USERBUILT);
|
||||
/*
|
||||
* The in memory encoding is always UTF8
|
||||
* This field will never change and would
|
||||
@@ -2119,7 +2119,7 @@ xmlFreeProp(xmlAttrPtr cur) {
|
||||
xmlDeregisterNodeDefaultValue((xmlNodePtr)cur);
|
||||
|
||||
/* Check for ID removal -> leading to invalid references ! */
|
||||
- if ((cur->doc != NULL) && (cur->atype == XML_ATTRIBUTE_ID)) {
|
||||
+ if ((cur->doc != NULL) && (XML_ATTR_GET_ATYPE(cur) == XML_ATTRIBUTE_ID)) {
|
||||
xmlRemoveID(cur->doc, cur);
|
||||
}
|
||||
if (cur->children != NULL) xmlFreeNodeList(cur->children);
|
||||
@@ -2838,7 +2838,7 @@ xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) {
|
||||
if(tree->type == XML_ELEMENT_NODE) {
|
||||
prop = tree->properties;
|
||||
while (prop != NULL) {
|
||||
- if (prop->atype == XML_ATTRIBUTE_ID) {
|
||||
+ if (XML_ATTR_GET_ATYPE(prop) == XML_ATTRIBUTE_ID) {
|
||||
xmlRemoveID(tree->doc, prop);
|
||||
}
|
||||
|
||||
@@ -6953,9 +6953,9 @@ xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name,
|
||||
/*
|
||||
* Modify the attribute's value.
|
||||
*/
|
||||
- if (prop->atype == XML_ATTRIBUTE_ID) {
|
||||
+ if (XML_ATTR_GET_ATYPE(prop) == XML_ATTRIBUTE_ID) {
|
||||
xmlRemoveID(node->doc, prop);
|
||||
- prop->atype = XML_ATTRIBUTE_ID;
|
||||
+ XML_ATTR_SET_ATYPE(prop, XML_ATTRIBUTE_ID);
|
||||
}
|
||||
if (prop->children != NULL)
|
||||
xmlFreeNodeList(prop->children);
|
||||
@@ -6975,7 +6975,7 @@ xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name,
|
||||
tmp = tmp->next;
|
||||
}
|
||||
}
|
||||
- if (prop->atype == XML_ATTRIBUTE_ID)
|
||||
+ if (XML_ATTR_GET_ATYPE(prop) == XML_ATTRIBUTE_ID)
|
||||
xmlAddID(NULL, node->doc, value, prop);
|
||||
return(prop);
|
||||
}
|
||||
@@ -9252,7 +9252,7 @@ ns_end:
|
||||
if (cur->type == XML_ELEMENT_NODE) {
|
||||
cur->psvi = NULL;
|
||||
cur->line = 0;
|
||||
- cur->extra = 0;
|
||||
+ XML_NODE_CLEAR_EXTRA(cur);
|
||||
/*
|
||||
* Walk attributes.
|
||||
*/
|
||||
@@ -9268,11 +9268,11 @@ ns_end:
|
||||
* Attributes.
|
||||
*/
|
||||
if ((sourceDoc != NULL) &&
|
||||
- (((xmlAttrPtr) cur)->atype == XML_ATTRIBUTE_ID))
|
||||
+ (XML_ATTR_GET_ATYPE((xmlAttrPtr) cur) == XML_ATTRIBUTE_ID))
|
||||
{
|
||||
xmlRemoveID(sourceDoc, (xmlAttrPtr) cur);
|
||||
}
|
||||
- ((xmlAttrPtr) cur)->atype = 0;
|
||||
+ XML_ATTR_CLEAR_ATYPE((xmlAttrPtr) cur);
|
||||
((xmlAttrPtr) cur)->psvi = NULL;
|
||||
}
|
||||
break;
|
||||
@@ -9992,7 +9992,7 @@ xmlDOMWrapAdoptAttr(xmlDOMWrapCtxtPtr ctxt,
|
||||
}
|
||||
|
||||
XML_TREE_ADOPT_STR(attr->name);
|
||||
- attr->atype = 0;
|
||||
+ XML_ATTR_CLEAR_ATYPE(attr);
|
||||
attr->psvi = NULL;
|
||||
/*
|
||||
* Walk content.
|
||||
diff --git a/valid.c b/valid.c
|
||||
index 36a0435..8e76cfa 100644
|
||||
--- a/valid.c
|
||||
+++ b/valid.c
|
||||
@@ -1906,7 +1906,7 @@ xmlScanIDAttributeDecl(xmlValidCtxtPtr ctxt, xmlElementPtr elem, int err) {
|
||||
if (elem == NULL) return(0);
|
||||
cur = elem->attributes;
|
||||
while (cur != NULL) {
|
||||
- if (cur->atype == XML_ATTRIBUTE_ID) {
|
||||
+ if (XML_ATTR_GET_ATYPE(cur) == XML_ATTRIBUTE_ID) {
|
||||
ret ++;
|
||||
if ((ret > 1) && (err))
|
||||
xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_MULTIPLE_ID,
|
||||
@@ -2279,7 +2279,7 @@ xmlDumpAttributeDecl(xmlBufferPtr buf, xmlAttributePtr attr) {
|
||||
xmlBufferWriteChar(buf, ":");
|
||||
}
|
||||
xmlBufferWriteCHAR(buf, attr->name);
|
||||
- switch (attr->atype) {
|
||||
+ switch (XML_ATTR_GET_ATYPE(attr)) {
|
||||
case XML_ATTRIBUTE_CDATA:
|
||||
xmlBufferWriteChar(buf, " CDATA");
|
||||
break;
|
||||
@@ -2758,7 +2758,7 @@ xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value,
|
||||
return(NULL);
|
||||
}
|
||||
if (attr != NULL)
|
||||
- attr->atype = XML_ATTRIBUTE_ID;
|
||||
+ XML_ATTR_SET_ATYPE(attr, XML_ATTRIBUTE_ID);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@@ -2837,7 +2837,7 @@ xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) {
|
||||
if ((fullelemname != felem) && (fullelemname != elem->name))
|
||||
xmlFree(fullelemname);
|
||||
|
||||
- if ((attrDecl != NULL) && (attrDecl->atype == XML_ATTRIBUTE_ID))
|
||||
+ if ((attrDecl != NULL) && (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_ID))
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
@@ -2878,7 +2878,7 @@ xmlRemoveID(xmlDocPtr doc, xmlAttrPtr attr) {
|
||||
|
||||
xmlHashRemoveEntry(table, ID, xmlFreeIDTableEntry);
|
||||
xmlFree(ID);
|
||||
- attr->atype = 0;
|
||||
+ XML_ATTR_CLEAR_ATYPE(attr);
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -3157,8 +3157,8 @@ xmlIsRef(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) {
|
||||
elem->name, attr->name);
|
||||
|
||||
if ((attrDecl != NULL) &&
|
||||
- (attrDecl->atype == XML_ATTRIBUTE_IDREF ||
|
||||
- attrDecl->atype == XML_ATTRIBUTE_IDREFS))
|
||||
+ (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_IDREF ||
|
||||
+ XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_IDREFS))
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
@@ -3532,7 +3532,7 @@ xmlIsMixedElement(xmlDocPtr doc, const xmlChar *name) {
|
||||
|
||||
static int
|
||||
xmlIsDocNameStartChar(xmlDocPtr doc, int c) {
|
||||
- if ((doc == NULL) || (doc->properties & XML_DOC_OLD10) == 0) {
|
||||
+ if ((doc == NULL) || (XML_DOC_GET_PROPERTIES(doc) & XML_DOC_OLD10) == 0) {
|
||||
/*
|
||||
* Use the new checks of production [4] [4a] amd [5] of the
|
||||
* Update 5 of XML-1.0
|
||||
@@ -3562,7 +3562,7 @@ xmlIsDocNameStartChar(xmlDocPtr doc, int c) {
|
||||
|
||||
static int
|
||||
xmlIsDocNameChar(xmlDocPtr doc, int c) {
|
||||
- if ((doc == NULL) || (doc->properties & XML_DOC_OLD10) == 0) {
|
||||
+ if ((doc == NULL) || (XML_DOC_GET_PROPERTIES(doc) & XML_DOC_OLD10) == 0) {
|
||||
/*
|
||||
* Use the new checks of production [4] [4a] amd [5] of the
|
||||
* Update 5 of XML-1.0
|
||||
@@ -4112,7 +4112,7 @@ xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
|
||||
if (attrDecl == NULL)
|
||||
return(NULL);
|
||||
- if (attrDecl->atype == XML_ATTRIBUTE_CDATA)
|
||||
+ if (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_CDATA)
|
||||
return(NULL);
|
||||
|
||||
ret = xmlStrdup(value);
|
||||
@@ -4174,7 +4174,7 @@ xmlValidNormalizeAttributeValue(xmlDocPtr doc, xmlNodePtr elem,
|
||||
|
||||
if (attrDecl == NULL)
|
||||
return(NULL);
|
||||
- if (attrDecl->atype == XML_ATTRIBUTE_CDATA)
|
||||
+ if (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_CDATA)
|
||||
return(NULL);
|
||||
|
||||
ret = xmlStrdup(value);
|
||||
@@ -4189,7 +4189,7 @@ xmlValidateAttributeIdCallback(void *payload, void *data,
|
||||
const xmlChar *name ATTRIBUTE_UNUSED) {
|
||||
xmlAttributePtr attr = (xmlAttributePtr) payload;
|
||||
int *count = (int *) data;
|
||||
- if (attr->atype == XML_ATTRIBUTE_ID) (*count)++;
|
||||
+ if (XML_ATTR_GET_ATYPE(attr) == XML_ATTRIBUTE_ID) (*count)++;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4221,7 +4221,7 @@ xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
/* Attribute Default Legal */
|
||||
/* Enumeration */
|
||||
if (attr->defaultValue != NULL) {
|
||||
- val = xmlValidateAttributeValueInternal(doc, attr->atype,
|
||||
+ val = xmlValidateAttributeValueInternal(doc, XML_ATTR_GET_ATYPE(attr),
|
||||
attr->defaultValue);
|
||||
if (val == 0) {
|
||||
xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ATTRIBUTE_DEFAULT,
|
||||
@@ -4232,7 +4232,7 @@ xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
}
|
||||
|
||||
/* ID Attribute Default */
|
||||
- if ((attr->atype == XML_ATTRIBUTE_ID)&&
|
||||
+ if ((XML_ATTR_GET_ATYPE(attr) == XML_ATTRIBUTE_ID)&&
|
||||
(attr->def != XML_ATTRIBUTE_IMPLIED) &&
|
||||
(attr->def != XML_ATTRIBUTE_REQUIRED)) {
|
||||
xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ID_FIXED,
|
||||
@@ -4242,7 +4242,7 @@ xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
}
|
||||
|
||||
/* One ID per Element Type */
|
||||
- if (attr->atype == XML_ATTRIBUTE_ID) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attr) == XML_ATTRIBUTE_ID) {
|
||||
int nbId;
|
||||
|
||||
/* the trick is that we parse DtD as their own internal subset */
|
||||
@@ -4501,9 +4501,9 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
attr->name, elem->name, NULL);
|
||||
return(0);
|
||||
}
|
||||
- attr->atype = attrDecl->atype;
|
||||
+ XML_ATTR_SET_ATYPE(attr, attrDecl->atype);
|
||||
|
||||
- val = xmlValidateAttributeValueInternal(doc, attrDecl->atype, value);
|
||||
+ val = xmlValidateAttributeValueInternal(doc, XML_ATTR_GET_ATYPE(attrDecl), value);
|
||||
if (val == 0) {
|
||||
xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
|
||||
"Syntax of value for attribute %s of %s is not valid\n",
|
||||
@@ -4522,19 +4522,19 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
}
|
||||
|
||||
/* Validity Constraint: ID uniqueness */
|
||||
- if (attrDecl->atype == XML_ATTRIBUTE_ID) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_ID) {
|
||||
if (xmlAddID(ctxt, doc, value, attr) == NULL)
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
- if ((attrDecl->atype == XML_ATTRIBUTE_IDREF) ||
|
||||
- (attrDecl->atype == XML_ATTRIBUTE_IDREFS)) {
|
||||
+ if ((XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_IDREF) ||
|
||||
+ (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_IDREFS)) {
|
||||
if (xmlAddRef(ctxt, doc, value, attr) == NULL)
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
/* Validity Constraint: Notation Attributes */
|
||||
- if (attrDecl->atype == XML_ATTRIBUTE_NOTATION) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_NOTATION) {
|
||||
xmlEnumerationPtr tree = attrDecl->tree;
|
||||
xmlNotationPtr nota;
|
||||
|
||||
@@ -4564,7 +4564,7 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
}
|
||||
|
||||
/* Validity Constraint: Enumeration */
|
||||
- if (attrDecl->atype == XML_ATTRIBUTE_ENUMERATION) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_ENUMERATION) {
|
||||
xmlEnumerationPtr tree = attrDecl->tree;
|
||||
while (tree != NULL) {
|
||||
if (xmlStrEqual(tree->name, value)) break;
|
||||
@@ -4589,7 +4589,7 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
|
||||
/* Extra check for the attribute value */
|
||||
ret &= xmlValidateAttributeValue2(ctxt, doc, attr->name,
|
||||
- attrDecl->atype, value);
|
||||
+ XML_ATTR_GET_ATYPE(attrDecl), value);
|
||||
|
||||
return(ret);
|
||||
}
|
||||
@@ -4688,7 +4688,7 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
- val = xmlValidateAttributeValueInternal(doc, attrDecl->atype, value);
|
||||
+ val = xmlValidateAttributeValueInternal(doc, XML_ATTR_GET_ATYPE(attrDecl), value);
|
||||
if (val == 0) {
|
||||
if (ns->prefix != NULL) {
|
||||
xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_DEFAULT,
|
||||
@@ -4738,7 +4738,7 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) {
|
||||
#endif
|
||||
|
||||
/* Validity Constraint: Notation Attributes */
|
||||
- if (attrDecl->atype == XML_ATTRIBUTE_NOTATION) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_NOTATION) {
|
||||
xmlEnumerationPtr tree = attrDecl->tree;
|
||||
xmlNotationPtr nota;
|
||||
|
||||
@@ -4780,7 +4780,7 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) {
|
||||
}
|
||||
|
||||
/* Validity Constraint: Enumeration */
|
||||
- if (attrDecl->atype == XML_ATTRIBUTE_ENUMERATION) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attrDecl) == XML_ATTRIBUTE_ENUMERATION) {
|
||||
xmlEnumerationPtr tree = attrDecl->tree;
|
||||
while (tree != NULL) {
|
||||
if (xmlStrEqual(tree->name, value)) break;
|
||||
@@ -4818,10 +4818,10 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) {
|
||||
/* Extra check for the attribute value */
|
||||
if (ns->prefix != NULL) {
|
||||
ret &= xmlValidateAttributeValue2(ctxt, doc, ns->prefix,
|
||||
- attrDecl->atype, value);
|
||||
+ XML_ATTR_GET_ATYPE(attrDecl), value);
|
||||
} else {
|
||||
ret &= xmlValidateAttributeValue2(ctxt, doc, BAD_CAST "xmlns",
|
||||
- attrDecl->atype, value);
|
||||
+ XML_ATTR_GET_ATYPE(attrDecl), value);
|
||||
}
|
||||
|
||||
return(ret);
|
||||
@@ -6574,7 +6574,7 @@ xmlValidateRef(xmlRefPtr ref, xmlValidCtxtPtr ctxt,
|
||||
while (IS_BLANK_CH(*cur)) cur++;
|
||||
}
|
||||
xmlFree(dup);
|
||||
- } else if (attr->atype == XML_ATTRIBUTE_IDREF) {
|
||||
+ } else if (XML_ATTR_GET_ATYPE(attr) == XML_ATTRIBUTE_IDREF) {
|
||||
id = xmlGetID(ctxt->doc, name);
|
||||
if (id == NULL) {
|
||||
xmlErrValidNode(ctxt, attr->parent, XML_DTD_UNKNOWN_ID,
|
||||
@@ -6582,7 +6582,7 @@ xmlValidateRef(xmlRefPtr ref, xmlValidCtxtPtr ctxt,
|
||||
attr->name, name, NULL);
|
||||
ctxt->valid = 0;
|
||||
}
|
||||
- } else if (attr->atype == XML_ATTRIBUTE_IDREFS) {
|
||||
+ } else if (XML_ATTR_GET_ATYPE(attr) == XML_ATTRIBUTE_IDREFS) {
|
||||
xmlChar *dup, *str = NULL, *cur, save;
|
||||
|
||||
dup = xmlStrdup(name);
|
||||
@@ -6782,7 +6782,7 @@ xmlValidateAttributeCallback(void *payload, void *data,
|
||||
|
||||
if (cur == NULL)
|
||||
return;
|
||||
- switch (cur->atype) {
|
||||
+ switch (XML_ATTR_GET_ATYPE(cur)) {
|
||||
case XML_ATTRIBUTE_CDATA:
|
||||
case XML_ATTRIBUTE_ID:
|
||||
case XML_ATTRIBUTE_IDREF :
|
||||
@@ -6797,7 +6797,7 @@ xmlValidateAttributeCallback(void *payload, void *data,
|
||||
if (cur->defaultValue != NULL) {
|
||||
|
||||
ret = xmlValidateAttributeValue2(ctxt, ctxt->doc, cur->name,
|
||||
- cur->atype, cur->defaultValue);
|
||||
+ XML_ATTR_GET_ATYPE(cur), cur->defaultValue);
|
||||
if ((ret == 0) && (ctxt->valid == 1))
|
||||
ctxt->valid = 0;
|
||||
}
|
||||
@@ -6805,14 +6805,14 @@ xmlValidateAttributeCallback(void *payload, void *data,
|
||||
xmlEnumerationPtr tree = cur->tree;
|
||||
while (tree != NULL) {
|
||||
ret = xmlValidateAttributeValue2(ctxt, ctxt->doc,
|
||||
- cur->name, cur->atype, tree->name);
|
||||
+ cur->name, XML_ATTR_GET_ATYPE(cur), tree->name);
|
||||
if ((ret == 0) && (ctxt->valid == 1))
|
||||
ctxt->valid = 0;
|
||||
tree = tree->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
- if (cur->atype == XML_ATTRIBUTE_NOTATION) {
|
||||
+ if (XML_ATTR_GET_ATYPE(cur) == XML_ATTRIBUTE_NOTATION) {
|
||||
doc = cur->doc;
|
||||
if (cur->elem == NULL) {
|
||||
xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR,
|
||||
diff --git a/xmlreader.c b/xmlreader.c
|
||||
index 67ff2cd..2a1a66a 100644
|
||||
--- a/xmlreader.c
|
||||
+++ b/xmlreader.c
|
||||
@@ -753,7 +753,7 @@ xmlTextReaderStartElement(void *ctx, const xmlChar *fullname,
|
||||
if ((ctxt->node != NULL) && (ctxt->input != NULL) &&
|
||||
(ctxt->input->cur != NULL) && (ctxt->input->cur[0] == '/') &&
|
||||
(ctxt->input->cur[1] == '>'))
|
||||
- ctxt->node->extra = NODE_IS_EMPTY;
|
||||
+ XML_NODE_SET_EXTRA(ctxt->node, NODE_IS_EMPTY);
|
||||
}
|
||||
if (reader != NULL)
|
||||
reader->state = XML_TEXTREADER_ELEMENT;
|
||||
@@ -818,7 +818,7 @@ xmlTextReaderStartElementNs(void *ctx,
|
||||
if ((ctxt->node != NULL) && (ctxt->input != NULL) &&
|
||||
(ctxt->input->cur != NULL) && (ctxt->input->cur[0] == '/') &&
|
||||
(ctxt->input->cur[1] == '>'))
|
||||
- ctxt->node->extra = NODE_IS_EMPTY;
|
||||
+ XML_NODE_SET_EXTRA(ctxt->node, NODE_IS_EMPTY);
|
||||
}
|
||||
if (reader != NULL)
|
||||
reader->state = XML_TEXTREADER_ELEMENT;
|
||||
@@ -1216,7 +1216,7 @@ skip_children:
|
||||
xmlNodePtr tmp;
|
||||
if (reader->entNr == 0) {
|
||||
while ((tmp = node->last) != NULL) {
|
||||
- if ((tmp->extra & NODE_IS_PRESERVED) == 0) {
|
||||
+ if ((XML_NODE_GET_EXTRA(tmp) & NODE_IS_PRESERVED) == 0) {
|
||||
xmlUnlinkNode(tmp);
|
||||
xmlTextReaderFreeNode(reader, tmp);
|
||||
} else
|
||||
@@ -1467,7 +1467,7 @@ get_next_node:
|
||||
if ((oldstate == XML_TEXTREADER_ELEMENT) &&
|
||||
(reader->node->type == XML_ELEMENT_NODE) &&
|
||||
(reader->node->children == NULL) &&
|
||||
- ((reader->node->extra & NODE_IS_EMPTY) == 0)
|
||||
+ ((XML_NODE_GET_EXTRA(reader->node) & NODE_IS_EMPTY) == 0)
|
||||
#ifdef LIBXML_XINCLUDE_ENABLED
|
||||
&& (reader->in_xinclude <= 0)
|
||||
#endif
|
||||
@@ -1481,7 +1481,7 @@ get_next_node:
|
||||
xmlTextReaderValidatePop(reader);
|
||||
#endif /* LIBXML_REGEXP_ENABLED */
|
||||
if ((reader->preserves > 0) &&
|
||||
- (reader->node->extra & NODE_IS_SPRESERVED))
|
||||
+ (XML_NODE_GET_EXTRA(reader->node) & NODE_IS_SPRESERVED))
|
||||
reader->preserves--;
|
||||
reader->node = reader->node->next;
|
||||
reader->state = XML_TEXTREADER_ELEMENT;
|
||||
@@ -1497,7 +1497,7 @@ get_next_node:
|
||||
(reader->node->prev != NULL) &&
|
||||
(reader->node->prev->type != XML_DTD_NODE)) {
|
||||
xmlNodePtr tmp = reader->node->prev;
|
||||
- if ((tmp->extra & NODE_IS_PRESERVED) == 0) {
|
||||
+ if ((XML_NODE_GET_EXTRA(tmp) & NODE_IS_PRESERVED) == 0) {
|
||||
if (oldnode == tmp)
|
||||
oldnode = NULL;
|
||||
xmlUnlinkNode(tmp);
|
||||
@@ -1510,7 +1510,7 @@ get_next_node:
|
||||
if ((oldstate == XML_TEXTREADER_ELEMENT) &&
|
||||
(reader->node->type == XML_ELEMENT_NODE) &&
|
||||
(reader->node->children == NULL) &&
|
||||
- ((reader->node->extra & NODE_IS_EMPTY) == 0)) {;
|
||||
+ ((XML_NODE_GET_EXTRA(reader->node) & NODE_IS_EMPTY) == 0)) {;
|
||||
reader->state = XML_TEXTREADER_END;
|
||||
goto node_found;
|
||||
}
|
||||
@@ -1519,7 +1519,7 @@ get_next_node:
|
||||
xmlTextReaderValidatePop(reader);
|
||||
#endif /* LIBXML_REGEXP_ENABLED */
|
||||
if ((reader->preserves > 0) &&
|
||||
- (reader->node->extra & NODE_IS_SPRESERVED))
|
||||
+ (XML_NODE_GET_EXTRA(reader->node) & NODE_IS_SPRESERVED))
|
||||
reader->preserves--;
|
||||
reader->node = reader->node->parent;
|
||||
if ((reader->node == NULL) ||
|
||||
@@ -1546,7 +1546,7 @@ get_next_node:
|
||||
#endif
|
||||
(reader->entNr == 0) &&
|
||||
(oldnode->type != XML_DTD_NODE) &&
|
||||
- ((oldnode->extra & NODE_IS_PRESERVED) == 0)) {
|
||||
+ ((XML_NODE_GET_EXTRA(oldnode) & NODE_IS_PRESERVED) == 0)) {
|
||||
xmlUnlinkNode(oldnode);
|
||||
xmlTextReaderFreeNode(reader, oldnode);
|
||||
}
|
||||
@@ -1559,7 +1559,7 @@ get_next_node:
|
||||
#endif
|
||||
(reader->entNr == 0) &&
|
||||
(reader->node->last != NULL) &&
|
||||
- ((reader->node->last->extra & NODE_IS_PRESERVED) == 0)) {
|
||||
+ ((XML_NODE_GET_EXTRA(reader->node->last) & NODE_IS_PRESERVED) == 0)) {
|
||||
xmlNodePtr tmp = reader->node->last;
|
||||
xmlUnlinkNode(tmp);
|
||||
xmlTextReaderFreeNode(reader, tmp);
|
||||
@@ -1741,7 +1741,7 @@ xmlTextReaderNext(xmlTextReaderPtr reader) {
|
||||
return(xmlTextReaderRead(reader));
|
||||
if (reader->state == XML_TEXTREADER_END || reader->state == XML_TEXTREADER_BACKTRACK)
|
||||
return(xmlTextReaderRead(reader));
|
||||
- if (cur->extra & NODE_IS_EMPTY)
|
||||
+ if (XML_NODE_GET_EXTRA(cur) & NODE_IS_EMPTY)
|
||||
return(xmlTextReaderRead(reader));
|
||||
do {
|
||||
ret = xmlTextReaderRead(reader);
|
||||
@@ -3167,7 +3167,7 @@ xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader) {
|
||||
if (reader->in_xinclude > 0)
|
||||
return(1);
|
||||
#endif
|
||||
- return((reader->node->extra & NODE_IS_EMPTY) != 0);
|
||||
+ return((XML_NODE_GET_EXTRA(reader->node) & NODE_IS_EMPTY) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4035,15 +4035,15 @@ xmlTextReaderPreserve(xmlTextReaderPtr reader) {
|
||||
return(NULL);
|
||||
|
||||
if ((cur->type != XML_DOCUMENT_NODE) && (cur->type != XML_DTD_NODE)) {
|
||||
- cur->extra |= NODE_IS_PRESERVED;
|
||||
- cur->extra |= NODE_IS_SPRESERVED;
|
||||
+ XML_NODE_ADD_EXTRA(cur, NODE_IS_PRESERVED);
|
||||
+ XML_NODE_ADD_EXTRA(cur, NODE_IS_SPRESERVED);
|
||||
}
|
||||
reader->preserves++;
|
||||
|
||||
parent = cur->parent;;
|
||||
while (parent != NULL) {
|
||||
if (parent->type == XML_ELEMENT_NODE)
|
||||
- parent->extra |= NODE_IS_PRESERVED;
|
||||
+ XML_NODE_ADD_EXTRA(parent, NODE_IS_PRESERVED);
|
||||
parent = parent->parent;
|
||||
}
|
||||
return(cur);
|
||||
diff --git a/xmlschemas.c b/xmlschemas.c
|
||||
index a2dd6cf..2e6c349 100644
|
||||
--- a/xmlschemas.c
|
||||
+++ b/xmlschemas.c
|
||||
@@ -6024,7 +6024,7 @@ xmlSchemaPValAttrNodeID(xmlSchemaParserCtxtPtr ctxt, xmlAttrPtr attr)
|
||||
/*
|
||||
* NOTE: the IDness might have already be declared in the DTD
|
||||
*/
|
||||
- if (attr->atype != XML_ATTRIBUTE_ID) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attr) != XML_ATTRIBUTE_ID) {
|
||||
xmlIDPtr res;
|
||||
xmlChar *strip;
|
||||
|
||||
@@ -6047,7 +6047,7 @@ xmlSchemaPValAttrNodeID(xmlSchemaParserCtxtPtr ctxt, xmlAttrPtr attr)
|
||||
NULL, NULL, "Duplicate value '%s' of simple "
|
||||
"type 'xs:ID'", value, NULL);
|
||||
} else
|
||||
- attr->atype = XML_ATTRIBUTE_ID;
|
||||
+ XML_ATTR_SET_ATYPE(attr, XML_ATTRIBUTE_ID);
|
||||
}
|
||||
} else if (ret > 0) {
|
||||
ret = XML_SCHEMAP_S4S_ATTR_INVALID_VALUE;
|
||||
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
|
||||
index af31be5..d40da49 100644
|
||||
--- a/xmlschemastypes.c
|
||||
+++ b/xmlschemastypes.c
|
||||
@@ -2867,7 +2867,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
/*
|
||||
* NOTE: the IDness might have already be declared in the DTD
|
||||
*/
|
||||
- if (attr->atype != XML_ATTRIBUTE_ID) {
|
||||
+ if (XML_ATTR_GET_ATYPE(attr) != XML_ATTRIBUTE_ID) {
|
||||
xmlIDPtr res;
|
||||
xmlChar *strip;
|
||||
|
||||
@@ -2880,7 +2880,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
if (res == NULL) {
|
||||
ret = 2;
|
||||
} else {
|
||||
- attr->atype = XML_ATTRIBUTE_ID;
|
||||
+ XML_ATTR_SET_ATYPE(attr, XML_ATTRIBUTE_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2905,7 +2905,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
xmlFree(strip);
|
||||
} else
|
||||
xmlAddRef(NULL, node->doc, value, attr);
|
||||
- attr->atype = XML_ATTRIBUTE_IDREF;
|
||||
+ XML_ATTR_SET_ATYPE(attr, XML_ATTRIBUTE_IDREF);
|
||||
}
|
||||
goto done;
|
||||
case XML_SCHEMAS_IDREFS:
|
||||
@@ -2919,7 +2919,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
(node->type == XML_ATTRIBUTE_NODE)) {
|
||||
xmlAttrPtr attr = (xmlAttrPtr) node;
|
||||
|
||||
- attr->atype = XML_ATTRIBUTE_IDREFS;
|
||||
+ XML_ATTR_SET_ATYPE(attr, XML_ATTRIBUTE_IDREFS);
|
||||
}
|
||||
goto done;
|
||||
case XML_SCHEMAS_ENTITY:{
|
||||
@@ -2950,7 +2950,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
(node->type == XML_ATTRIBUTE_NODE)) {
|
||||
xmlAttrPtr attr = (xmlAttrPtr) node;
|
||||
|
||||
- attr->atype = XML_ATTRIBUTE_ENTITY;
|
||||
+ XML_ATTR_SET_ATYPE(attr, XML_ATTRIBUTE_ENTITY);
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
@@ -2967,7 +2967,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
(node->type == XML_ATTRIBUTE_NODE)) {
|
||||
xmlAttrPtr attr = (xmlAttrPtr) node;
|
||||
|
||||
- attr->atype = XML_ATTRIBUTE_ENTITIES;
|
||||
+ XML_ATTR_SET_ATYPE(attr, XML_ATTRIBUTE_ENTITIES);
|
||||
}
|
||||
goto done;
|
||||
case XML_SCHEMAS_NOTATION:{
|
||||
--
|
||||
2.50.1
|
||||
|
||||
117
meta/recipes-core/libxml/libxml2/CVE-2025-9714.patch
Normal file
117
meta/recipes-core/libxml/libxml2/CVE-2025-9714.patch
Normal file
@@ -0,0 +1,117 @@
|
||||
From 6ef8b9f05cc21d3fc28156fe5d1251834c29c7d7 Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Thu, 28 Jul 2022 20:21:24 +0200
|
||||
Subject: [PATCH] Make XPath depth check work with recursive invocations
|
||||
|
||||
EXSLT functions like dyn:map or dyn:evaluate invoke xmlXPathRunEval
|
||||
recursively. Don't set depth to zero but keep and restore the original
|
||||
value to avoid stack overflows when abusing these functions.
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/677a42645ef22b5a50741bad5facf9d8a8bc6d21]
|
||||
CVE: CVE-2025-9714
|
||||
|
||||
Signed-off-by: Theo GAIGE <tgaige.opensource@witekio.com>
|
||||
---
|
||||
xpath.c | 23 +++++++++++++++++------
|
||||
1 file changed, 17 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/xpath.c b/xpath.c
|
||||
index c2d845888..028471d53 100644
|
||||
--- a/xpath.c
|
||||
+++ b/xpath.c
|
||||
@@ -13883,12 +13883,11 @@ static int
|
||||
xmlXPathRunEval(xmlXPathParserContextPtr ctxt, int toBool)
|
||||
{
|
||||
xmlXPathCompExprPtr comp;
|
||||
+ int oldDepth;
|
||||
|
||||
if ((ctxt == NULL) || (ctxt->comp == NULL))
|
||||
return(-1);
|
||||
|
||||
- ctxt->context->depth = 0;
|
||||
-
|
||||
if (ctxt->valueTab == NULL) {
|
||||
/* Allocate the value stack */
|
||||
ctxt->valueTab = (xmlXPathObjectPtr *)
|
||||
@@ -13942,11 +13941,13 @@ xmlXPathRunEval(xmlXPathParserContextPtr ctxt, int toBool)
|
||||
"xmlXPathRunEval: last is less than zero\n");
|
||||
return(-1);
|
||||
}
|
||||
+ oldDepth = ctxt->context->depth;
|
||||
if (toBool)
|
||||
return(xmlXPathCompOpEvalToBoolean(ctxt,
|
||||
&comp->steps[comp->last], 0));
|
||||
else
|
||||
xmlXPathCompOpEval(ctxt, &comp->steps[comp->last]);
|
||||
+ ctxt->context->depth = oldDepth;
|
||||
|
||||
return(0);
|
||||
}
|
||||
@@ -14217,6 +14218,7 @@ xmlXPathCompExprPtr
|
||||
xmlXPathCtxtCompile(xmlXPathContextPtr ctxt, const xmlChar *str) {
|
||||
xmlXPathParserContextPtr pctxt;
|
||||
xmlXPathCompExprPtr comp;
|
||||
+ int oldDepth = 0;
|
||||
|
||||
#ifdef XPATH_STREAMING
|
||||
comp = xmlXPathTryStreamCompile(ctxt, str);
|
||||
@@ -14230,8 +14232,10 @@ xmlXPathCtxtCompile(xmlXPathContextPtr ctxt, const xmlChar *str) {
|
||||
if (pctxt == NULL)
|
||||
return NULL;
|
||||
if (ctxt != NULL)
|
||||
- ctxt->depth = 0;
|
||||
+ oldDepth = ctxt->depth;
|
||||
xmlXPathCompileExpr(pctxt, 1);
|
||||
+ if (ctxt != NULL)
|
||||
+ ctxt->depth = oldDepth;
|
||||
|
||||
if( pctxt->error != XPATH_EXPRESSION_OK )
|
||||
{
|
||||
@@ -14252,8 +14256,10 @@ xmlXPathCtxtCompile(xmlXPathContextPtr ctxt, const xmlChar *str) {
|
||||
comp = pctxt->comp;
|
||||
if ((comp->nbStep > 1) && (comp->last >= 0)) {
|
||||
if (ctxt != NULL)
|
||||
- ctxt->depth = 0;
|
||||
+ oldDepth = ctxt->depth;
|
||||
xmlXPathOptimizeExpression(pctxt, &comp->steps[comp->last]);
|
||||
+ if (ctxt != NULL)
|
||||
+ ctxt->depth = oldDepth;
|
||||
}
|
||||
pctxt->comp = NULL;
|
||||
}
|
||||
@@ -14409,6 +14415,7 @@ xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt) {
|
||||
#ifdef XPATH_STREAMING
|
||||
xmlXPathCompExprPtr comp;
|
||||
#endif
|
||||
+ int oldDepth = 0;
|
||||
|
||||
if (ctxt == NULL) return;
|
||||
|
||||
@@ -14422,8 +14429,10 @@ xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt) {
|
||||
#endif
|
||||
{
|
||||
if (ctxt->context != NULL)
|
||||
- ctxt->context->depth = 0;
|
||||
+ oldDepth = ctxt->context->depth;
|
||||
xmlXPathCompileExpr(ctxt, 1);
|
||||
+ if (ctxt->context != NULL)
|
||||
+ ctxt->context->depth = oldDepth;
|
||||
CHECK_ERROR;
|
||||
|
||||
/* Check for trailing characters. */
|
||||
@@ -14432,9 +14441,11 @@ xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt) {
|
||||
|
||||
if ((ctxt->comp->nbStep > 1) && (ctxt->comp->last >= 0)) {
|
||||
if (ctxt->context != NULL)
|
||||
- ctxt->context->depth = 0;
|
||||
+ oldDepth = ctxt->context->depth;
|
||||
xmlXPathOptimizeExpression(ctxt,
|
||||
&ctxt->comp->steps[ctxt->comp->last]);
|
||||
+ if (ctxt->context != NULL)
|
||||
+ ctxt->context->depth = oldDepth;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -42,6 +42,8 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar;subdir=${BP};name=testt
|
||||
file://CVE-2025-6021.patch \
|
||||
file://CVE-2025-49794-CVE-2025-49796.patch \
|
||||
file://CVE-2025-6170.patch \
|
||||
file://CVE-2025-9714.patch \
|
||||
file://CVE-2025-7425.patch \
|
||||
"
|
||||
|
||||
SRC_URI[archive.sha256sum] = "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee"
|
||||
|
||||
39
meta/recipes-core/musl/musl/CVE-2025-26519-1.patch
Normal file
39
meta/recipes-core/musl/musl/CVE-2025-26519-1.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
From 345d2a053c32f3443dbfdd313f49346ce30b92f8 Mon Sep 17 00:00:00 2001
|
||||
From: Rich Felker <dalias@aerifal.cx>
|
||||
Date: Wed, 19 Nov 2025 13:23:38 +0100
|
||||
Subject: [PATCH] iconv: fix erroneous input validation in EUC-KR decoder
|
||||
|
||||
as a result of incorrect bounds checking on the lead byte being
|
||||
decoded, certain invalid inputs which should produce an encoding
|
||||
error, such as "\xc8\x41", instead produced out-of-bounds loads from
|
||||
the ksc table.
|
||||
|
||||
in a worst case, the loaded value may not be a valid unicode scalar
|
||||
value, in which case, if the output encoding was UTF-8, wctomb would
|
||||
return (size_t)-1, causing an overflow in the output pointer and
|
||||
remaining buffer size which could clobber memory outside of the output
|
||||
buffer.
|
||||
|
||||
bug report was submitted in private by Nick Wellnhofer on account of
|
||||
potential security implications.
|
||||
|
||||
CVE: CVE-2025-26519
|
||||
Upstream-Status: Backport [https://git.musl-libc.org/cgit/musl/commit/?id=e5adcd97b5196e29991b524237381a0202a60659]
|
||||
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
|
||||
---
|
||||
src/locale/iconv.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/locale/iconv.c b/src/locale/iconv.c
|
||||
index 3047c27b..1fb66bc8 100644
|
||||
--- a/src/locale/iconv.c
|
||||
+++ b/src/locale/iconv.c
|
||||
@@ -495,7 +495,7 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
|
||||
if (c >= 93 || d >= 94) {
|
||||
c += (0xa1-0x81);
|
||||
d += 0xa1;
|
||||
- if (c >= 93 || c>=0xc6-0x81 && d>0x52)
|
||||
+ if (c > 0xc6-0x81 || c==0xc6-0x81 && d>0x52)
|
||||
goto ilseq;
|
||||
if (d-'A'<26) d = d-'A';
|
||||
else if (d-'a'<26) d = d-'a'+26;
|
||||
38
meta/recipes-core/musl/musl/CVE-2025-26519-2.patch
Normal file
38
meta/recipes-core/musl/musl/CVE-2025-26519-2.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From b81230050f6c3348038fe470d260028824b9a9e5 Mon Sep 17 00:00:00 2001
|
||||
From: Rich Felker <dalias@aerifal.cx>
|
||||
Date: Wed, 19 Nov 2025 13:27:15 +0100
|
||||
Subject: [PATCH] iconv: harden UTF-8 output code path against input decoder
|
||||
bugs
|
||||
|
||||
the UTF-8 output code was written assuming an invariant that iconv's
|
||||
decoders only emit valid Unicode Scalar Values which wctomb can encode
|
||||
successfully, thereby always returning a value between 1 and 4.
|
||||
|
||||
if this invariant is not satisfied, wctomb returns (size_t)-1, and the
|
||||
subsequent adjustments to the output buffer pointer and remaining
|
||||
output byte count overflow, moving the output position backwards,
|
||||
potentially past the beginning of the buffer, without storing any
|
||||
bytes.
|
||||
|
||||
CVE: CVE-2025-26519
|
||||
Upstream-Status: Backport [https://git.musl-libc.org/cgit/musl/commit/?id=c47ad25ea3b484e10326f933e927c0bc8cded3da]
|
||||
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
|
||||
---
|
||||
src/locale/iconv.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/locale/iconv.c b/src/locale/iconv.c
|
||||
index 1fb66bc8..fb1d3217 100644
|
||||
--- a/src/locale/iconv.c
|
||||
+++ b/src/locale/iconv.c
|
||||
@@ -538,6 +538,10 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
|
||||
if (*outb < k) goto toobig;
|
||||
memcpy(*out, tmp, k);
|
||||
} else k = wctomb_utf8(*out, c);
|
||||
+ /* This failure condition should be unreachable, but
|
||||
+ * is included to prevent decoder bugs from translating
|
||||
+ * into advancement outside the output buffer range. */
|
||||
+ if (k>4) goto ilseq;
|
||||
*out += k;
|
||||
*outb -= k;
|
||||
break;
|
||||
@@ -15,7 +15,9 @@ PV = "${BASEVER}+git${SRCPV}"
|
||||
SRC_URI = "git://git.musl-libc.org/musl;branch=master \
|
||||
file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \
|
||||
file://0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch \
|
||||
"
|
||||
file://CVE-2025-26519-1.patch \
|
||||
file://CVE-2025-26519-2.patch \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
|
||||
@@ -33,16 +33,16 @@ Upstream-Status: Backport [https://github.com/systemd/systemd-stable/commit/2eb4
|
||||
|
||||
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||
---
|
||||
man/systemd-coredump.xml | 12 ++++++++++++
|
||||
man/systemd-coredump.xml | 11 +++++++++++
|
||||
src/coredump/coredump.c | 21 ++++++++++++++++++---
|
||||
sysctl.d/50-coredump.conf.in | 2 +-
|
||||
3 files changed, 31 insertions(+), 4 deletions(-)
|
||||
3 files changed, 30 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/man/systemd-coredump.xml b/man/systemd-coredump.xml
|
||||
index cb9f47745b..ba7cad12bc 100644
|
||||
--- a/man/systemd-coredump.xml
|
||||
+++ b/man/systemd-coredump.xml
|
||||
@@ -259,6 +259,18 @@ COREDUMP_FILENAME=/var/lib/systemd/coredump/core.Web….552351.….zst
|
||||
@@ -259,6 +259,17 @@ COREDUMP_FILENAME=/var/lib/systemd/coredump/core.Web….552351.….zst
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -54,7 +54,6 @@ index cb9f47745b..ba7cad12bc 100644
|
||||
+ project='man-pages'><refentrytitle>prctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>.
|
||||
+ </para>
|
||||
+
|
||||
+ <xi:include href="version-info.xml" xpointer="v258"/>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
|
||||
@@ -235,6 +235,7 @@ EXTRA_OEMESON += "-Dnobody-user=nobody \
|
||||
-Dmode=release \
|
||||
-Dsystem-alloc-uid-min=101 \
|
||||
-Dsystem-uid-max=999 \
|
||||
-Dtranslations=${@'false' if d.getVar('USE_NLS') == 'no' else 'true'} \
|
||||
-Dsystem-alloc-gid-min=101 \
|
||||
-Dsystem-gid-max=999 \
|
||||
"
|
||||
|
||||
@@ -80,5 +80,11 @@ SRC_URI = "\
|
||||
file://0042-CVE-2025-5245.patch \
|
||||
file://0043-CVE-2025-7546.patch \
|
||||
file://0043-CVE-2025-7545.patch \
|
||||
file://0044-CVE-2025-11082.patch \
|
||||
file://0045-CVE-2025-11083.patch \
|
||||
file://0046-CVE-2025-11081.patch \
|
||||
file://0047-CVE-2025-8225.patch \
|
||||
file://CVE-2025-11412.patch \
|
||||
file://CVE-2025-11413.patch \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From ea1a0737c7692737a644af0486b71e4a392cbca8 Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Mon, 22 Sep 2025 15:20:34 +0800
|
||||
Subject: [PATCH] elf: Don't read beyond .eh_frame section size
|
||||
|
||||
PR ld/33464
|
||||
* elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't read beyond
|
||||
.eh_frame section size.
|
||||
|
||||
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
||||
|
||||
CVE: CVE-2025-11082
|
||||
Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ea1a0737c7692737a644af0486b71e4a392cbca8]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
bfd/elf-eh-frame.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
|
||||
index dc0d2e097f5..30bb313489c 100644
|
||||
--- a/bfd/elf-eh-frame.c
|
||||
+++ b/bfd/elf-eh-frame.c
|
||||
@@ -733,6 +733,7 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
|
||||
if (hdr_id == 0)
|
||||
{
|
||||
unsigned int initial_insn_length;
|
||||
+ char *null_byte;
|
||||
|
||||
/* CIE */
|
||||
this_inf->cie = 1;
|
||||
@@ -749,10 +750,13 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
|
||||
REQUIRE (cie->version == 1
|
||||
|| cie->version == 3
|
||||
|| cie->version == 4);
|
||||
- REQUIRE (strlen ((char *) buf) < sizeof (cie->augmentation));
|
||||
+ null_byte = memchr ((char *) buf, 0, end - buf);
|
||||
+ REQUIRE (null_byte != NULL);
|
||||
+ REQUIRE ((size_t) (null_byte - (char *) buf)
|
||||
+ < sizeof (cie->augmentation));
|
||||
|
||||
strcpy (cie->augmentation, (char *) buf);
|
||||
- buf = (bfd_byte *) strchr ((char *) buf, '\0') + 1;
|
||||
+ buf = (bfd_byte *) null_byte + 1;
|
||||
this_inf->u.cie.aug_str_len = buf - start - 1;
|
||||
ENSURE_NO_RELOCS (buf);
|
||||
if (buf[0] == 'e' && buf[1] == 'h')
|
||||
@@ -0,0 +1,77 @@
|
||||
From 9ca499644a21ceb3f946d1c179c38a83be084490 Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Thu, 18 Sep 2025 16:59:25 -0700
|
||||
Subject: [PATCH] elf: Don't match corrupt section header in linker input
|
||||
|
||||
Don't swap in nor match corrupt section header in linker input to avoid
|
||||
linker crash later.
|
||||
|
||||
PR ld/33457
|
||||
* elfcode.h (elf_swap_shdr_in): Changed to return bool. Return
|
||||
false for corrupt section header in linker input.
|
||||
(elf_object_p): Reject if elf_swap_shdr_in returns false.
|
||||
|
||||
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
||||
|
||||
CVE: CVE-2025-11083
|
||||
Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9ca499644a21ceb3f946d1c179c38a83be084490]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
bfd/elfcode.h | 14 +++++++++-----
|
||||
1 file changed, 9 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
|
||||
index 9c65852e103..5224a1abee6 100644
|
||||
--- a/bfd/elfcode.h
|
||||
+++ b/bfd/elfcode.h
|
||||
@@ -298,7 +298,7 @@ elf_swap_ehdr_out (bfd *abfd,
|
||||
/* Translate an ELF section header table entry in external format into an
|
||||
ELF section header table entry in internal format. */
|
||||
|
||||
-static void
|
||||
+static bool
|
||||
elf_swap_shdr_in (bfd *abfd,
|
||||
const Elf_External_Shdr *src,
|
||||
Elf_Internal_Shdr *dst)
|
||||
@@ -328,6 +328,9 @@ elf_swap_shdr_in (bfd *abfd,
|
||||
if (!abfd->read_only)
|
||||
_bfd_error_handler (_("warning: %pB has a section "
|
||||
"extending past end of file"), abfd);
|
||||
+ /* PR ld/33457: Don't match corrupt section header. */
|
||||
+ if (abfd->is_linker_input)
|
||||
+ return false;
|
||||
abfd->read_only = 1;
|
||||
}
|
||||
}
|
||||
@@ -337,6 +340,7 @@ elf_swap_shdr_in (bfd *abfd,
|
||||
dst->sh_entsize = H_GET_WORD (abfd, src->sh_entsize);
|
||||
dst->bfd_section = NULL;
|
||||
dst->contents = NULL;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
/* Translate an ELF section header table entry in internal format into an
|
||||
@@ -629,9 +633,9 @@ elf_object_p (bfd *abfd)
|
||||
|
||||
/* Read the first section header at index 0, and convert to internal
|
||||
form. */
|
||||
- if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr))
|
||||
+ if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr)
|
||||
+ || !elf_swap_shdr_in (abfd, &x_shdr, &i_shdr))
|
||||
goto got_no_match;
|
||||
- elf_swap_shdr_in (abfd, &x_shdr, &i_shdr);
|
||||
|
||||
/* If the section count is zero, the actual count is in the first
|
||||
section header. */
|
||||
@@ -717,9 +721,9 @@ elf_object_p (bfd *abfd)
|
||||
to internal form. */
|
||||
for (shindex = 1; shindex < i_ehdrp->e_shnum; shindex++)
|
||||
{
|
||||
- if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr))
|
||||
+ if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr)
|
||||
+ || !elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex))
|
||||
goto got_no_match;
|
||||
- elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex);
|
||||
|
||||
/* Sanity check sh_link and sh_info. */
|
||||
if (i_shdrp[shindex].sh_link >= num_sec)
|
||||
@@ -0,0 +1,84 @@
|
||||
From f87a66db645caf8cc0e6fc87b0c28c78a38af59b Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Tue, 9 Sep 2025 18:32:09 +0930
|
||||
Subject: [PATCH] PR 33406 SEGV in dump_dwarf_section
|
||||
|
||||
Trying to dump .sframe in a PE file results in a segfault accessing
|
||||
elf_section_data.
|
||||
|
||||
* objdump (dump_sframe_section, dump_dwarf_section): Don't access
|
||||
elf_section_type without first checking the file is ELF.
|
||||
---
|
||||
binutils/objdump.c | 10 ++++++----
|
||||
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=f87a66db645caf8cc0e6fc87b0c28c78a38af59b]
|
||||
CVE: CVE-2025-11081
|
||||
|
||||
Signed-off-by: Alan Modra <amodra@gmail.com>
|
||||
Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
|
||||
|
||||
diff --git a/binutils/objdump.c b/binutils/objdump.c
|
||||
index 290f7e51f66..ee8823da05a 100644
|
||||
--- a/binutils/objdump.c
|
||||
+++ b/binutils/objdump.c
|
||||
@@ -4418,6 +4418,10 @@
|
||||
else
|
||||
match = name;
|
||||
|
||||
+ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
|
||||
+ && elf_section_type (section) == SHT_GNU_SFRAME)
|
||||
+ match = ".sframe";
|
||||
+
|
||||
for (i = 0; i < max; i++)
|
||||
if ((strcmp (debug_displays [i].section.uncompressed_name, match) == 0
|
||||
|| strcmp (debug_displays [i].section.compressed_name, match) == 0
|
||||
@@ -4923,6 +4927,36 @@
|
||||
}
|
||||
|
||||
+static void
|
||||
+dump_sframe_section (bfd *abfd, const char *sect_name, bool is_mainfile)
|
||||
+
|
||||
+{
|
||||
+ /* Error checking for user provided SFrame section name, if any. */
|
||||
+ if (sect_name)
|
||||
+ {
|
||||
+ asection *sec = bfd_get_section_by_name (abfd, sect_name);
|
||||
+ if (sec == NULL)
|
||||
+ {
|
||||
+ printf (_("No %s section present\n\n"), sanitize_string (sect_name));
|
||||
+ return;
|
||||
+ }
|
||||
+ /* Starting with Binutils 2.45, SFrame sections have section type
|
||||
+ SHT_GNU_SFRAME. For SFrame sections from Binutils 2.44 or earlier,
|
||||
+ check explcitly for SFrame sections of type SHT_PROGBITS and name
|
||||
+ ".sframe" to allow them. */
|
||||
+ else if (bfd_get_flavour (abfd) != bfd_target_elf_flavour
|
||||
+ || (elf_section_type (sec) != SHT_GNU_SFRAME
|
||||
+ && !(elf_section_type (sec) == SHT_PROGBITS
|
||||
+ && strcmp (sect_name, ".sframe") == 0)))
|
||||
+ {
|
||||
+ printf (_("Section %s does not contain SFrame data\n\n"),
|
||||
+ sanitize_string (sect_name));
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ dump_dwarf (abfd, is_mainfile);
|
||||
+}
|
||||
+
|
||||
static void
|
||||
dump_target_specific (bfd *abfd)
|
||||
{
|
||||
const struct objdump_private_desc * const *desc;
|
||||
diff --git a/include/elf/common.h b/include/elf/common.h
|
||||
--- a/include/elf/common.h
|
||||
+++ b/include/elf/common.h
|
||||
@@ -528,6 +528,8 @@
|
||||
#define SHT_LOOS 0x60000000 /* First of OS specific semantics */
|
||||
#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */
|
||||
|
||||
+#define SHT_GNU_SFRAME 0x6ffffff4 /* SFrame stack trace information. */
|
||||
+
|
||||
#define SHT_GNU_INCREMENTAL_INPUTS 0x6fff4700 /* incremental build data */
|
||||
#define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* Object attributes */
|
||||
#define SHT_GNU_HASH 0x6ffffff6 /* GNU style symbol hash table */
|
||||
@@ -0,0 +1,47 @@
|
||||
From e51fdff7d2e538c0e5accdd65649ac68e6e0ddd4 Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Wed, 19 Feb 2025 22:45:29 +1030
|
||||
Subject: [PATCH] binutils/dwarf.c debug_information leak
|
||||
|
||||
It is possible with fuzzed files to have num_debug_info_entries zero
|
||||
after allocating space for debug_information, leading to multiple
|
||||
allocations.
|
||||
|
||||
* dwarf.c (process_debug_info): Don't test num_debug_info_entries
|
||||
to determine whether debug_information has been allocated,
|
||||
test alloc_num_debug_info_entries.
|
||||
---
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=e51fdff7d2e538c0e5accdd65649ac68e6e0ddd4]
|
||||
CVE: CVE-2025-8225
|
||||
|
||||
binutils/dwarf.c | 8 +++-----
|
||||
1 file changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
Signed-off-by: Alan Modra <amodra@gmail.com>
|
||||
Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
|
||||
|
||||
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
|
||||
index 8e004cea839..bfbf83ec9f4 100644
|
||||
--- a/binutils/dwarf.c
|
||||
+++ b/binutils/dwarf.c
|
||||
@@ -3807,13 +3807,11 @@ process_debug_info (struct dwarf_section * section,
|
||||
}
|
||||
|
||||
if ((do_loc || do_debug_loc || do_debug_ranges || do_debug_info)
|
||||
- && num_debug_info_entries == 0
|
||||
- && ! do_types)
|
||||
+ && alloc_num_debug_info_entries == 0
|
||||
+ && !do_types)
|
||||
{
|
||||
-
|
||||
/* Then allocate an array to hold the information. */
|
||||
- debug_information = (debug_info *) cmalloc (num_units,
|
||||
- sizeof (* debug_information));
|
||||
+ debug_information = cmalloc (num_units, sizeof (*debug_information));
|
||||
if (debug_information == NULL)
|
||||
{
|
||||
error (_("Not enough memory for a debug info array of %u entries\n"),
|
||||
--
|
||||
2.43.7
|
||||
|
||||
35
meta/recipes-devtools/binutils/binutils/CVE-2025-11412.patch
Normal file
35
meta/recipes-devtools/binutils/binutils/CVE-2025-11412.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
From 047435dd988a3975d40c6626a8f739a0b2e154bc Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Thu, 25 Sep 2025 08:22:24 +0930
|
||||
Subject: [PATCH] PR 33452 SEGV in bfd_elf_gc_record_vtentry
|
||||
|
||||
Limit addends on vtentry relocs, otherwise ld might attempt to
|
||||
allocate a stupidly large array. This also fixes the expression
|
||||
overflow leading to pr33452. A vtable of 33M entries on a 64-bit
|
||||
host is surely large enough, especially considering that VTINHERIT
|
||||
and VTENTRY relocations are to support -fvtable-gc that disappeared
|
||||
from gcc over 20 years ago.
|
||||
|
||||
PR ld/33452
|
||||
* elflink.c (bfd_elf_gc_record_vtentry): Sanity check addend.
|
||||
|
||||
CVE: CVE-2025-11412
|
||||
Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=047435dd988a3975d40c6626a8f739a0b2e154bc]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
bfd/elflink.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/bfd/elflink.c b/bfd/elflink.c
|
||||
index 54f0d6e957e..0a0456177c2 100644
|
||||
--- a/bfd/elflink.c
|
||||
+++ b/bfd/elflink.c
|
||||
@@ -14407,7 +14407,7 @@ bfd_elf_gc_record_vtentry (bfd *abfd, asection *sec,
|
||||
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
|
||||
unsigned int log_file_align = bed->s->log_file_align;
|
||||
|
||||
- if (!h)
|
||||
+ if (!h || addend > 1u << 28)
|
||||
{
|
||||
/* xgettext:c-format */
|
||||
_bfd_error_handler (_("%pB: section '%pA': corrupt VTENTRY entry"),
|
||||
38
meta/recipes-devtools/binutils/binutils/CVE-2025-11413.patch
Normal file
38
meta/recipes-devtools/binutils/binutils/CVE-2025-11413.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From 72efdf166aa0ed72ecc69fc2349af6591a7a19c0 Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Thu, 25 Sep 2025 10:41:32 +0930
|
||||
Subject: [PATCH] Re: elf: Disallow the empty global symbol name
|
||||
|
||||
sparc64-linux-gnu +FAIL: selective2
|
||||
sparc64-linux-gnu +FAIL: selective3
|
||||
|
||||
PR ld/33456
|
||||
* elflink.c (elf_link_add_object_symbols): Move new check later
|
||||
to give the backend add_symbol_hook a chance to remove symbols
|
||||
with empty names.
|
||||
|
||||
CVE: CVE-2025-11413
|
||||
Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=72efdf166aa0ed72ecc69fc2349af6591a7a19c0]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
bfd/elflink.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/bfd/elflink.c b/bfd/elflink.c
|
||||
index 0a0456177c2..5c8b822e36a 100644
|
||||
--- a/bfd/elflink.c
|
||||
+++ b/bfd/elflink.c
|
||||
@@ -4931,6 +4931,13 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
continue;
|
||||
}
|
||||
|
||||
+ if (name[0] == '\0')
|
||||
+ {
|
||||
+ _bfd_error_handler (_("%pB: corrupt symbol table"), abfd);
|
||||
+ bfd_set_error (bfd_error_bad_value);
|
||||
+ goto error_free_vers;
|
||||
+ }
|
||||
+
|
||||
/* Sanity check that all possibilities were handled. */
|
||||
if (sec == NULL)
|
||||
abort ();
|
||||
71
meta/recipes-devtools/cmake/cmake/CVE-2025-9301.patch
Normal file
71
meta/recipes-devtools/cmake/cmake/CVE-2025-9301.patch
Normal file
@@ -0,0 +1,71 @@
|
||||
From 37e27f71bc356d880c908040cd0cb68fa2c371b8 Mon Sep 17 00:00:00 2001
|
||||
From: Tyler Yankee <tyler.yankee@kitware.com>
|
||||
Date: Wed, 13 Aug 2025 15:22:28 -0400
|
||||
Subject: [PATCH] foreach: Explicitly skip replay without iterations
|
||||
|
||||
As written, foreach loops with a trailing `IN` (i.e., no loop
|
||||
variable(s) given) lead to an assertion error. Handle this case by
|
||||
exiting early when we know the loop won't execute anything.
|
||||
|
||||
Fixes: #27135
|
||||
|
||||
CVE: CVE-2025-9301
|
||||
|
||||
Upstream-Status: Backport
|
||||
https://gitlab.kitware.com/cmake/cmake/-/commit/37e27f71bc356d880c908040cd0cb68fa2c371b8
|
||||
|
||||
Signed-off-by: Tyler Yankee <tyler.yankee@kitware.com>
|
||||
Signed-off-by: Saravanan <saravanan.kadambathursubramaniyam@windriver.com>
|
||||
---
|
||||
Source/cmForEachCommand.cxx | 3 +++
|
||||
Tests/RunCMake/foreach/RunCMakeTest.cmake | 1 +
|
||||
Tests/RunCMake/foreach/TrailingIn-result.txt | 1 +
|
||||
Tests/RunCMake/foreach/TrailingIn.cmake | 5 +++++
|
||||
4 files changed, 10 insertions(+)
|
||||
create mode 100644 Tests/RunCMake/foreach/TrailingIn-result.txt
|
||||
create mode 100644 Tests/RunCMake/foreach/TrailingIn.cmake
|
||||
|
||||
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
|
||||
index dcb36265..35b59960 100644
|
||||
--- a/Source/cmForEachCommand.cxx
|
||||
+++ b/Source/cmForEachCommand.cxx
|
||||
@@ -100,6 +100,9 @@ bool cmForEachFunctionBlocker::ArgumentsMatch(cmListFileFunction const& lff,
|
||||
bool cmForEachFunctionBlocker::Replay(
|
||||
std::vector<cmListFileFunction> functions, cmExecutionStatus& inStatus)
|
||||
{
|
||||
+ if (this->Args.size() == this->IterationVarsCount) {
|
||||
+ return true;
|
||||
+ }
|
||||
return this->ZipLists ? this->ReplayZipLists(functions, inStatus)
|
||||
: this->ReplayItems(functions, inStatus);
|
||||
}
|
||||
diff --git a/Tests/RunCMake/foreach/RunCMakeTest.cmake b/Tests/RunCMake/foreach/RunCMakeTest.cmake
|
||||
index 15ca4770..acfc742e 100644
|
||||
--- a/Tests/RunCMake/foreach/RunCMakeTest.cmake
|
||||
+++ b/Tests/RunCMake/foreach/RunCMakeTest.cmake
|
||||
@@ -22,3 +22,4 @@ run_cmake(foreach-RANGE-invalid-test)
|
||||
run_cmake(foreach-RANGE-out-of-range-test)
|
||||
run_cmake(foreach-var-scope-CMP0124-OLD)
|
||||
run_cmake(foreach-var-scope-CMP0124-NEW)
|
||||
+run_cmake(TrailingIn)
|
||||
diff --git a/Tests/RunCMake/foreach/TrailingIn-result.txt b/Tests/RunCMake/foreach/TrailingIn-result.txt
|
||||
new file mode 100644
|
||||
index 00000000..573541ac
|
||||
--- /dev/null
|
||||
+++ b/Tests/RunCMake/foreach/TrailingIn-result.txt
|
||||
@@ -0,0 +1 @@
|
||||
+0
|
||||
diff --git a/Tests/RunCMake/foreach/TrailingIn.cmake b/Tests/RunCMake/foreach/TrailingIn.cmake
|
||||
new file mode 100644
|
||||
index 00000000..e2b5b2f2
|
||||
--- /dev/null
|
||||
+++ b/Tests/RunCMake/foreach/TrailingIn.cmake
|
||||
@@ -0,0 +1,5 @@
|
||||
+foreach(v IN)
|
||||
+endforeach()
|
||||
+
|
||||
+foreach(v1 v2 IN)
|
||||
+endforeach()
|
||||
--
|
||||
2.35.5
|
||||
|
||||
@@ -12,6 +12,7 @@ SRC_URI:append:class-nativesdk = " \
|
||||
file://0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch \
|
||||
file://0001-ctest-Allow-arbitrary-characters-in-test-names-of-CT.patch \
|
||||
"
|
||||
SRC_URI += "file://CVE-2025-9301.patch"
|
||||
|
||||
LICENSE:append = " & BSD-1-Clause & MIT"
|
||||
LIC_FILES_CHKSUM:append = " \
|
||||
|
||||
125
meta/recipes-devtools/dpkg/dpkg/CVE-2025-6297.patch
Normal file
125
meta/recipes-devtools/dpkg/dpkg/CVE-2025-6297.patch
Normal file
@@ -0,0 +1,125 @@
|
||||
From 98c623c8d6814ae46a3b30ca22e584c77d47d86b Mon Sep 17 00:00:00 2001
|
||||
From: Guillem Jover <guillem@debian.org>
|
||||
Date: Sat, 7 Jun 2025 14:17:07 +0200
|
||||
Subject: [PATCH] dpkg-deb: Fix cleanup for control member with restricted
|
||||
directories
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When extracting a control member into a temporary directory, which is
|
||||
documented as being a safe operation even on untrusted data, the code
|
||||
in charge of the temporary directory cleanup does not sanitize the
|
||||
directory permissions, which is then unable to perform the «rm -rf»
|
||||
when running as a non-root user, leaving temporary files behind.
|
||||
|
||||
Given automated and repeated execution of dpkg-deb commands on
|
||||
adversarial .deb packages or with well compressible files, placed
|
||||
inside a directory with permissions not allowing removal by a non-root
|
||||
user, this can end up with a DoS scenario due to causing disk quota
|
||||
exhaustion or disk full conditions.
|
||||
|
||||
This is considered a minor issue, given the required conditions to
|
||||
trigger a problem with it, but an issue non the less given the
|
||||
documented security guarantees of the command. This has been an
|
||||
issue since the initial commit introducing dpkg-deb in C.
|
||||
|
||||
We use an existing string for the error message to avoid new strings
|
||||
needing translation for stable branches, which make the error message
|
||||
less descriptive than what would be ideal. This will be improved in
|
||||
git HEAD.
|
||||
|
||||
Reported-by: zhutyra on HackerOne
|
||||
Fixes: CVE-2025-6297
|
||||
Stable-Candidate: 1.20.x 1.21.x 1.22.x
|
||||
(cherry picked from commit ed6bbd445dd8800308c67236ba35d08004c98e82)
|
||||
(cherry picked from commit 02ad0532bd490cbc95b344f670e622a38eecfbf6)
|
||||
(cherry picked from commit d8a76551e22abe76eefd7fef5c7f51f4118eb40e)
|
||||
|
||||
CVE: CVE-2025-6297
|
||||
Upstream-Status: Backport [https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=98c623c8d6814ae46a3b30ca22e584c77d47d86b]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
src/at/deb-content.at | 32 ++++++++++++++++++++++++++++++++
|
||||
src/deb/info.c | 20 ++++++++++++++++++++
|
||||
2 files changed, 52 insertions(+)
|
||||
|
||||
diff --git a/src/at/deb-content.at b/src/at/deb-content.at
|
||||
index a192c9493..d48eed72b 100644
|
||||
--- a/src/at/deb-content.at
|
||||
+++ b/src/at/deb-content.at
|
||||
@@ -127,3 +127,35 @@ newline'
|
||||
])
|
||||
|
||||
AT_CLEANUP
|
||||
+
|
||||
+AT_SETUP([dpkg-deb .deb extraction cleanup])
|
||||
+AT_KEYWORDS([dpkg-deb deb extraction])
|
||||
+
|
||||
+DPKG_GEN_CONTROL([pkg-ctrl-dir-perms])
|
||||
+AT_CHECK([
|
||||
+dpkg-deb --root-owner-group -Znone -b pkg-ctrl-dir-perms
|
||||
+DPKG_AR_EXTRACT([pkg-ctrl-dir-perms.deb])
|
||||
+dpkg-deb -R pkg-ctrl-dir-perms.deb pkg-ctrl-dir-perms-bad
|
||||
+mkdir -p pkg-ctrl-dir-perms-bad/DEBIAN/rx-subdir/inner
|
||||
+touch pkg-ctrl-dir-perms-bad/DEBIAN/rx-subdir/inner/file
|
||||
+chmod 0555 pkg-ctrl-dir-perms-bad/DEBIAN
|
||||
+chmod 0555 pkg-ctrl-dir-perms-bad/DEBIAN/rx-subdir
|
||||
+chmod 0555 pkg-ctrl-dir-perms-bad/DEBIAN/rx-subdir/inner
|
||||
+$TAR cf control.tar --format=gnu --sort=name --mtime @0 --clamp-mtime --owner root:0 --group root:0 -C pkg-ctrl-dir-perms-bad/DEBIAN .
|
||||
+DPKG_AR_GEN([pkg-ctrl-dir-perms.deb], [debian-binary control.tar data.tar])
|
||||
+], [0], [dpkg-deb: building package 'pkg-ctrl-dir-perms' in 'pkg-ctrl-dir-perms.deb'.
|
||||
+])
|
||||
+AT_CHECK([
|
||||
+dpkg-deb --ctrl-tarfile pkg-ctrl-dir-perms.deb | $TAR tvf -
|
||||
+], [0], [dr-xr-xr-x root/root 0 1970-01-01 00:00 ./
|
||||
+-rw-r--r-- root/root 176 1970-01-01 00:00 ./control
|
||||
+dr-xr-xr-x root/root 0 1970-01-01 00:00 ./rx-subdir/
|
||||
+dr-xr-xr-x root/root 0 1970-01-01 00:00 ./rx-subdir/inner/
|
||||
+-rw-r--r-- root/root 0 1970-01-01 00:00 ./rx-subdir/inner/file
|
||||
+])
|
||||
+# Check that we can cleanup the temporarily extracted control.tar member.
|
||||
+AT_CHECK([
|
||||
+dpkg-deb -I pkg-ctrl-dir-perms.deb
|
||||
+], [0], [ignore])
|
||||
+
|
||||
+AT_CLEANUP
|
||||
diff --git a/src/deb/info.c b/src/deb/info.c
|
||||
index f3d57e2ce..396ea4d14 100644
|
||||
--- a/src/deb/info.c
|
||||
+++ b/src/deb/info.c
|
||||
@@ -45,14 +45,34 @@
|
||||
#include <dpkg/pkg-format.h>
|
||||
#include <dpkg/buffer.h>
|
||||
#include <dpkg/path.h>
|
||||
+#include <dpkg/treewalk.h>
|
||||
#include <dpkg/options.h>
|
||||
|
||||
#include "dpkg-deb.h"
|
||||
|
||||
+static int
|
||||
+cu_info_treewalk_fixup_dir(struct treenode *node)
|
||||
+{
|
||||
+ const char *nodename;
|
||||
+
|
||||
+ if (!S_ISDIR(treenode_get_mode(node)))
|
||||
+ return 0;
|
||||
+
|
||||
+ nodename = treenode_get_pathname(node);
|
||||
+ if (chmod(nodename, 0755) < 0)
|
||||
+ ohshite(_("error setting permissions of '%.255s'"), nodename);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void cu_info_prepare(int argc, void **argv) {
|
||||
char *dir;
|
||||
+ struct treewalk_funcs cu_info_treewalk_funcs = {
|
||||
+ .visit = cu_info_treewalk_fixup_dir,
|
||||
+ };
|
||||
|
||||
dir = argv[0];
|
||||
+ treewalk(dir, TREEWALK_NONE, &cu_info_treewalk_funcs);
|
||||
path_remove_tree(dir);
|
||||
free(dir);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user