Compare commits

..

73 Commits

Author SHA1 Message Date
Steve Sakoman
4cdc553814 build-appliance-image: Update to kirkstone head revision
(From OE-Core rev: c40a3fec49942ac6d25ba33e57e801a550e252c9)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-07 05:42:08 -07:00
Steve Sakoman
940c885c23 poky.conf: bump version for 4.0.21
(From meta-yocto rev: 10911ca9695f096a6415ac026d6aefe3ea78adea)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-07 05:38:17 -07:00
Wang Mingyu
3dd7b3edae wireless-regdb: upgrade 2024.05.08 -> 2024.07.04
(From OE-Core rev: f1dc8f8b95aeba1edb92d960074538239d9f643d)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b460d2d55a35450564ea04255153b0a3bf715530)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-07 05:38:17 -07:00
Vijay Anusuri
62de516d0e apr: upgrade 1.7.2 -> 1.7.5
Refreshed patch 0001-configure-Remove-runtime-test-for-mmap-that-can-map-.patch

Includes security fix
CVE-2023-49582

changelog:
https://downloads.apache.org/apr/CHANGES-APR-1.7

(From OE-Core rev: 4eb12d8683bd22b6503a64070b81b52f0d2f373a)

Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-07 05:38:17 -07:00
Rohini Sangam
630e7d6000 python3: Security fix for CVE-2024-8088
CVE fixed:
- CVE-2024-8088: python: cpython: denial of service in zipfile
Upstream-Status: Backport from e0264a6111

(From OE-Core rev: 295addec33c83443423a3ef87905c3a70f44a4e7)

Signed-off-by: Rohini Sangam <rsangam@mvista.com>
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-07 05:38:17 -07:00
Vrushti Dabhi
dd123d8eda sqlite3: Rename patch for CVE-2022-35737
The patch "0001-sqlite-Increased-the-size-of-loop-variables-in-the-printf-implementation.patch"
fixes CVE-2022-35737.

(From OE-Core rev: 9a875873e566a6673a65a8264fd0868c568e2a2c)

Signed-off-by: Vrushti Dabhi <vrushti.dabhi@einfochips.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-07 05:38:17 -07:00
Vrushti Dabhi
bf6aca4b29 sqlite3: CVE-ID correction for CVE-2023-7104
- The commit [https://sqlite.org/src/info/0e4e7a05c4204b47]
  ("Fix a buffer overread in the sessions extension that could occur when processing a corrupt changeset.")
  fixes CVE-2023-7104 instead of CVE-2022-46908.
- Hence, corrected the CVE-ID in CVE-2023-7104.patch.
- Reference: https://nvd.nist.gov/vuln/detail/CVE-2023-7104

(From OE-Core rev: 9d7f21f3d0ae24d0005076396e9a929bb32d648e)

Signed-off-by: Vrushti Dabhi <vrushti.dabhi@einfochips.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-07 05:38:17 -07:00
Hitendra Prajapati
a952dec3e4 qemu: fix CVE-2024-7409
A flaw was found in the QEMU NBD Server. This vulnerability allows a denial of service (DoS) attack
via improper synchronization during socket closure when a client keeps a socket open as the server
is taken offline.

Reference:
https://nvd.nist.gov/vuln/detail/CVE-2024-7409

Upstream Patches:
fb1c2aaa98
c8a76dbd90
b9b72cb3ce
3e7ef738c8

(From OE-Core rev: d84ab04dc66cb83638f96fcd2f4c67e67489c410)

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-07 05:38:17 -07:00
Ming Liu
0ae3b2bd49 grub: fs/fat: Don't error when mtime is 0
A issue was found when I run "runqemu genericx86-64 ovmf", grub failed
to boot, it's a known issue has been fixed in grub upstream, backport
the fix.

(From OE-Core rev: 6992437d725f9cc88da4261814b69aaadc5ef0f2)

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 51eab4bb0cae46c9c32d28986eb97badf47594b7)
Signed-off-by: Chaitanya Vadrevu <chaitanya.vadrevu@ni.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-04 05:57:57 -07:00
Hugo SIMELIERE
e9d17c4dee cryptodev-module: Fix build for linux 5.10.220
Upstream-Status: Backport [157a624d7a]

(From OE-Core rev: 047ee2fe7bc9920038213d014a920518a264ef17)

Signed-off-by: Hugo SIMELIERE <hsimeliere.opensource@witekio.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-04 05:57:57 -07:00
Divya Chellam
e318cce49c bind: Upgrade 9.18.24 -> 9.18.28
Includes security fixes for CVE-2024-4076, CVE-2024-1737,
CVE-2024-0760, CVE-2024-1975 and other bug fixes

Release Notes:
https://downloads.isc.org/isc/bind9/9.18.28/doc/arm/html/notes.html#notes-for-bind-9-18-28
https://downloads.isc.org/isc/bind9/9.18.28/doc/arm/html/notes.html#notes-for-bind-9-18-27
https://downloads.isc.org/isc/bind9/9.18.28/doc/arm/html/notes.html#notes-for-bind-9-18-26
https://downloads.isc.org/isc/bind9/9.18.28/doc/arm/html/notes.html#notes-for-bind-9-18-25

(From OE-Core rev: 1f065d8358ab0fb6c08b2aad2145786c31294721)

Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-04 05:57:57 -07:00
Siddharth Doshi
cada1f30e8 vim: Upgrade 9.1.0114 -> 9.1.0682
This includes CVE-fix for CVE-2024-41957, CVE-2024-41965 and CVE-2024-43374

Changes between 9.1.0114 -> 9.1.0682
====================================
https://github.com/vim/vim/compare/v9.1.0114...v9.1.0682

Note:
====
Removed patch "vim-add-knob-whether-elf.h-are-checked.patch" as libelf checks are removed from configure.ac as per
commit 1acc67ac44

(From OE-Core rev: 3312a57ce631ea6235055b3d4b4ac31d06c8a2ae)

Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 6d2938e53cad5d9bf2e78a5403e9f9fab1db77b4)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-04 05:57:57 -07:00
Hitendra Prajapati
92cb089717 vim: upgrade from 9.0.2190 -> 9.1.0114
https://www.vim.org/vim-9.1-released.php

Vim 9.1 is available

The Vim project is happy to announce that Vim 9.1 has finally been released.
This release is dedicated to Bram Moolenaar, Vim's lead developer for more
than 30 years, who passed away half a year ago. The Vim project wouldn't
exist without his work!

Vim 9.1 is mainly a bug fix release, it contains hundreds of bug fixes, a
few new features and there are many minor improvements.

Changes:
https://github.com/vim/vim/compare/v9.0.2190...v9.1.0114

CVE: CVE-2024-22667
(includes commit b39b240c38)

(From OE-Core rev: d5ae0ec5eca9324cffaa8f95d2cbdd8475979c45)

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-04 05:57:57 -07:00
Peter Marko
1f5be803ee curl: Ignore CVE-2024-32928
This CVE affects google cloud services that utilize libcurl wrongly.

(From OE-Core rev: 27ac7879711e7119b4ec8b190b0a9da5b3ede269)
Changed CVE ignore syntax

(From OE-Core rev: ad703de483258f459acc6a40385ad00a5182eb64)

Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-04 05:57:57 -07:00
Peter Marko
da07e6ee34 libyaml: Ignore CVE-2024-35325
This is similar CVE as the previous ones from the same author.
https://github.com/yaml/libyaml/issues/303 explain why this is misuse
(or wrong use) of libyaml.

(From OE-Core rev: a28240d49c111050e253e373507ac3094b74f6e1)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-04 05:57:57 -07:00
Guocai He
2b5ca6638e libsoup: fix compile error on centos7
Backport a patch [1] to fix the below build failure.

FAILED: libsoup/libsoup-2.4.so.1.11.0.p/soup-address.c.o
In file included from /usr/include/glib-2.0/gio/gnetworking.h:40,
                 from ../libsoup-2.72.0/libsoup/soup-address.c:14:
/usr/include/resolv.h:75:15: error: unknown type name ‘u_char’
         const u_char **__query,
               ^~~~~~

[1] 5c3d431bdb

(From OE-Core rev: 963085afced737863cf4ff8515a1cf08365d5d87)

Signed-off-by: Guocai He <guocai.he.cn@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-28 06:49:22 -07:00
Niko Mauno
2640cecd2f image_types.bbclass: Use --force also with lz4,lzop
Several conversion commands already make use of 'force' option in the
compression, which enables overwriting existing files without
prompting.

Since occasionally an existing residual destination file from a
previously aborted or failed task can prevent the re-execution of the
conversion command task, by enabling the 'force' option also for lz4
and lzop compression commands we can avoid following kind of BitBake
failures with these compressors:

  | DEBUG: Executing shell function do_image_cpio
  | 117685 blocks
  | 2 blocks
  | example-image.cpio.lz4 already exists; do you want to overwrite (y/N) ?     not overwritten
  | Error 20 : example-image.cpio : open file error
  | WARNING: exit code 20 from a shell command.
  ERROR: Task (.../recipes-core/images/example-image.bb:do_image_cpio) failed with exit code '1'

(From OE-Core rev: 623ab22434909f10aaf613cd3032cc2a2c6e3ff9)

(From OE-Core rev: 35a92023766b562dab9f8561cc3adb4938b03692)

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-28 06:49:22 -07:00
Leon Anavi
1c798dccd1 python3: add PACKAGECONFIG[editline]
Backport PACKAGECONFIG[editline] from Scarthgap to Kirkstone
because libedit has feature parity with readline but is more
permissively licensed (BSD verses GPLv3). This patch provides
means of enabling editline in a distribution without GPLv3 and
in this case improves Python REPL keyboard support.

(From OE-Core rev: 12dc7d2081a1aaec90ffb3ed6718d757ce14b5ab)

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-28 06:49:22 -07:00
Siddharth Doshi
da71261344 curl: Security fix for CVE-2024-7264
Upstream-Status: Backport from [27959ecce7]

CVE's Fixed:
============
CVE-2024-7264 libcurl: ASN.1 date parser overread

(From OE-Core rev: cf0b1ed6c4cd9f61e39befb9c9785b1433777988)

Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-28 06:49:22 -07:00
Siddharth Doshi
784646063b Tiff: Security fix for CVE-2024-7006
Upstream-Status: Backport from [818fb8ce88]

CVE's Fixed:
CVE-2024-7006 libtiff: NULL pointer dereference in tif_dirinfo.c

(From OE-Core rev: bacab52b3d101ee99753f14542a56340dd589425)

Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-28 06:49:22 -07:00
Peter Marko
0d356a401d libyaml: ignore CVE-2024-35326
This is the same problem as already ignored CVE-2024-35328.
See laso this comment in addition:
https://github.com/yaml/libyaml/issues/298#issuecomment-2167684233

(From OE-Core rev: 18e011245dd978985eecc368c503822f61d52f21)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-28 06:49:22 -07:00
Lee Chee Yang
48ef389f91 migration-guide: add release notes for 4.0.20
(From yocto-docs rev: 512025edd9b3b6b8d0938b35bb6188c9f3b7f17d)

Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-23 14:51:51 -07:00
Matthias Pritschet
fbba5a616d ref-manual: fix typo and move SYSROOT_DIRS example
1. Changed one letter (s/B/A), so the sentence is correct again.
2. Moved example from SYSROOT_DIRS_IGNORE into SYSROOT_DIRS section.

(From yocto-docs rev: 9fcd6d6ef4a87f69b8a00907051c1ece41e75a82)

Signed-off-by: Matthias Pritschet <matthias@pritschet.eu>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-23 14:51:51 -07:00
Robert Yang
54d061affe bitbake: data_smart: Improve performance for VariableHistory
Fixed:
- BBMULTICONFIG = "qemux86-64 qemuarm64" and more than 70 layers in BBLAYERS
$ bitbake -p -P
Check profile.log.processed, the record() cost more than 20 seconds, it is less
than 1 second when multiconfig is not enabled, and there would be the following
error when more muticonfigs are enabled:

Timeout while waiting for a reply from the bitbake server

Don't change the type of loginfo['detail'] or re-assign it can make record()
back to less than 1 second, this won't affect COW since loginfo is a mutable
type.

The time mainly affected by two factors:
1) The number of enabled layers, nearly 1 second added per layer when the
   number is larger than 50.

2) The global var such as USER_CLASSES, about 1 ~ 2 seconds added per layer
   when the layers number is larger than 50.

(Bitbake rev: ec2a99a077da9aa0e99e8b05e0c65dcbd45864b1)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 0596aa0d5b0e4ed3db11b5bd560f1d3439963a41)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-23 14:51:51 -07:00
Ross Burton
7db7a86fbc python3-pycryptodome(x): use python_setuptools_build_meta build class
This package can be built using pep517 classes now.

(From OE-Core rev: 6c1000a2bbfe5e618e42bc5be2058332337d4177)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a32fa3e64d1daf5846c29403e9f258aea42212d3)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-16 08:09:14 -07:00
Vijay Anusuri
13707e4b1a orc: upgrade 0.4.32 -> 0.4.39
Include security fix CVE-2024-40897

Ref: https://github.com/GStreamer/orc/blob/0.4.39/RELEASE

(From OE-Core rev: 4fc3f804c0963e4421b8066425cc6780a6901ace)

Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-16 08:09:14 -07:00
Soumya Sambu
cc7068b99a python3-certifi: Fix CVE-2024-39689
Certifi is a curated collection of Root Certificates for validating the
trustworthiness of SSL certificates while verifying the identity of TLS
hosts. Certifi starting in 2021.05.30 and prior to 2024.07.4 recognized
root certificates from `GLOBALTRUST`. Certifi 2024.07.04 removes root
certificates from `GLOBALTRUST` from the root store. These are in the
process of being removed from Mozilla's trust store. `GLOBALTRUST`'s root
certificates are being removed pursuant to an investigation which
identified "long-running and unresolved compliance issues."Certifi is a
curated collection of Root Certificates for validating the trustworthiness
of SSL certificates while verifying the identity of TLS hosts. Certifi
starting in 2021.05.30 and prior to 2024.07.4 recognized root certificates
from `GLOBALTRUST`. Certifi 2024.07.04 removes root certificates from
`GLOBALTRUST` from the root store. These are in the process of being removed
from Mozilla's trust store. `GLOBALTRUST`'s root certificates are being
removed pursuant to an investigation which identified "long-running and
unresolved compliance issues."

References:
https://nvd.nist.gov/vuln/detail/CVE-2024-39689

Upstream-patch:
bd8153872e

(From OE-Core rev: 96c1e12dc6cb4c321a09a6ddcc4c9f27c30b4564)

Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-16 08:09:14 -07:00
Hitendra Prajapati
5bdf0b4c3a busybox: CVE-2023-42364, CVE-2023-42365, CVE-2023-42366 fixes
backport upstream fix for CVEs and fix the regression that introduced [1]

[1] http://lists.busybox.net/pipermail/busybox/2024-May/090766.html

(From OE-Core rev: 4bc3dcb0be97f7fecb34950015b4335d6ddc512c)

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-16 08:09:14 -07:00
Archana Polampalli
3be2b60b66 go: fix CVE-2024-24791
(From OE-Core rev: f012f6a6e1d3111d6cae74c9c846d8bd0fca5dd5)

Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-16 08:09:14 -07:00
Archana Polampalli
5c036f07cc ghostscript: fix CVE-2024-29506
(From OE-Core rev: 68a6482244532e61bc467e1ef23661260bac8572)

Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-16 08:09:14 -07:00
Archana Polampalli
52cfc78696 ghostscript: fix CVE-2024-29509
(From OE-Core rev: 18c55a131b0627b906de29f8c4cbd1526154cd60)

Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-16 08:09:14 -07:00
Yogita Urade
204b28c419 ofono: fix CVE-2023-2794
A flaw was found in ofono, an Open Source Telephony on Linux.
A stack overflow bug is triggered within the decode_deliver()
function during the SMS decoding. It is assumed that the attack
scenario is accessible from a compromised modem, a malicious
base station, or just SMS. There is a bound check for this
memcpy length in decode_submit(), but it was forgotten in
decode_deliver().

Reference:
https://nvd.nist.gov/vuln/detail/CVE-2023-2794

Upstream patches:
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=a90421d8e45d63b304dc010baba24633e7869682
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=7f2adfa22fbae824f8e2c3ae86a3f51da31ee400
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=07f48b23e3877ef7d15a7b0b8b79d32ad0a3607e
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=8fa1fdfcb54e1edb588c6a5e2688880b065a39c9

(From OE-Core rev: 5114e9064dbabd5258f512cd97c79fc40f848b98)

Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-16 08:09:14 -07:00
Archana Polampalli
6313a595f9 ghostscript: fix CVE-2024-29511
(From OE-Core rev: 1710676f80df2ba1ee77d15b4e0e532df10be5a5)

Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-16 08:09:14 -07:00
Peter Marko
25a9b7b70c libyaml: Update status of CVE-2024-35328
This is open yet but seems to be disputed
This has not yet been disputed officially

Based on:
OE-Core rev: 4cba8ad405b1728afda3873f99ac88711ab85644
OE-Core rev: 7ec7384837f3e3fb68b25a6108ed7ec0f261a4aa
OE-Core rev: c66d9a2a0d197498fa21ee8ca51a4afb59f75473
Squashed and converted to CVE_CHECK_IGNORE syntax

(From OE-Core rev: 70489234bff3f2b8613ce6f8069bae448fbc61ed)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-16 08:09:14 -07:00
Siddharth Doshi
bba60774f7 lttng-modules: Upgrade 2.13.9 -> 2.13.14
License-Update: Upstream cleaned stale file paths in License file and updated LICENSES/LGPL-2.1 and LICENSES/GPL-2.0 -> LICENSES/LGPL-2.1-only.txt and LICENSES/GPL-2.0-only.txt causing md5 to change.
(ref commit ->
b972ef5708
and
61baff6e8d (diff-c693279643b8cd5d248172d9c22cb7cf4ed163a3c98c8a3f69c2717edd3eacb7))

Note: Upgrade lttng-modules to 2.13.14 to fix fcheck error which occurs
with commit 782202de6478f68caaed4567017095ad906c4eef in kernel "file: Rename fcheck
lookup_fd_rcu" which does replaces fcheck with lookup_fd_rcu.

(From OE-Core rev: 2721f84ba755ceea5780e44feb0713ad8c4d0217)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-08 09:03:46 -07:00
Bruce Ashfield
e932b53647 linux-yocto/5.15: update to v5.15.164
Updating linux-yocto/5.15 to the latest korg -stable release that comprises
the following commits:

    7e89efd3ae1c Linux 5.15.164
    e5e5e63c506b tap: add missing verification for short frame
    589382f50b4a tun: add missing verification for short frame
    2d3cef3d7a5d wifi: rt2x00: use explicitly signed or unsigned types
    53e21cfa68a7 filelock: Fix fcntl/close race recovery compat path
    2a6c1811f806 ALSA: pcm_dmaengine: Don't synchronize DMA channel when DMA is paused
    3390c35a2fe4 arm64: dts: qcom: sdm630: Disable SS instance in Parkmode for USB
    01a1bb207e96 arm64: dts: qcom: msm8996: Disable SS instance in Parkmode for USB
    0b71bad5f49f ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360
    8f83ba8d0642 ALSA: hda/realtek: Enable headset mic on Positivo SU C1400
    35652dfa8cc9 fs/ntfs3: Validate ff offset
    7e21574195a4 jfs: don't walk off the end of ealist
    53de17ad01cb ocfs2: add bounds checking to ocfs2_check_dir_entry()
    21c14c556ccc net: relax socket state check at accept time.
    243b1b2f139b Add gitignore file for samples/fanotify/ subdirectory
    057aca5c4c0c docs: Fix formatting of literal sections in fanotify docs
    9b4e471059a2 samples: Make fs-monitor depend on libc and headers
    11874ffea7b0 samples: Add fs error monitoring example
    544fa213f15d drm/amdgpu: Fix signedness bug in sdma_v4_0_process_trap_irq()
    b0f923261647 wifi: mac80211: disable softirqs for queued frame handling
    1e865019cef3 mm/damon/core: merge regions aggressively when max_nr_regions is unmet
    22f7794ef5a3 minmax: relax check to allow comparison between unsigned arguments and signed constants
    7ed91c5560df minmax: allow comparisons of 'int' against 'unsigned char/short'
    d53b5d862acd minmax: allow min()/max()/clamp() if the arguments have the same signedness.
    1c2ee5bc9f11 minmax: fix header inclusions
    d470787b25e6 minmax: clamp more efficiently by avoiding extra comparison
    998f03984e25 minmax: sanity check constant bounds when clamping
    ed6e37e30826 tracing: Define the is_signed_type() macro once
    6efc874e7dec spi: mux: set ctlr->bits_per_word_mask
    d02d8c1dacaf hfsplus: fix uninit-value in copy_name
    119aa28dc296 selftests/vDSO: fix clang build errors and warnings
    77737885d55b spi: imx: Don't expect DMA for i.MX{25,35,50,51,53} cspi devices
    52fb34cf68f6 riscv: stacktrace: fix usage of ftrace_graph_ret_addr()
    5f569a230160 fs: better handle deep ancestor chains in is_subdir()
    a2b201f83971 drm/radeon: check bo_va->bo is non-NULL before using it
    d2ce562a5aff Bluetooth: hci_core: cancel all works upon hci_unregister_dev()
    30095db9fde5 scsi: libsas: Fix exp-attached device scan after probe failure scanned in again after probe failed
    4fad7fef847b powerpc/eeh: avoid possible crash when edev->pdev changes
    e59822f9d700 powerpc/pseries: Whitelist dtl slub object for copying to userspace
    144563729741 net: mac802154: Fix racy device stats updates by DEV_STATS_INC() and DEV_STATS_ADD()
    7d562640dfe3 net: usb: qmi_wwan: add Telit FN912 compositions
    2f0f5d8b70d6 ALSA: dmaengine_pcm: terminate dmaengine before synchronize
    e8c3061cb064 ALSA: hda/relatek: Enable Mute LED on HP Laptop 15-gw0xxx
    8a69529f2259 btrfs: qgroup: fix quota root leak after quota disable failure
    6a0a5134b811 platform/x86: lg-laptop: Use ACPI device handle when evaluating WMAB/WMBB
    c71589ef09be platform/x86: lg-laptop: Change ACPI device id
    cb7b8762fa59 platform/x86: lg-laptop: Remove LGEX0815 hotkey handling
    b87e028350b0 platform/x86: wireless-hotkey: Add support for LG Airplane Button
    cf521049fcd0 s390/sclp: Fix sclp_init() cleanup on failure
    9adc74c11a0e can: kvaser_usb: fix return value for hif_usb_send_regout
    47b807eacc43 ASoC: ti: omap-hdmi: Fix too long driver name
    d04dff8e6419 ASoC: ti: davinci-mcasp: Set min period size using FIFO config
    6114985177db ALSA: dmaengine: Synchronize dma channel after drop()
    c4bbeb8f129f bytcr_rt5640 : inverse jack detect for Archos 101 cesium
    7fc6558e274e Input: i8042 - add Ayaneo Kun to i8042 quirk table
    079deeff7285 Input: elantech - fix touchpad state on resume for Lenovo N24
    ff53b50bb2c2 mips: fix compat_sys_lseek syscall
    e3316c1ab38d ALSA: hda/realtek: Add more codec ID to no shutup pins list
    0e566b1d3f6d drm/vmwgfx: Fix missing HYPERVISOR_GUEST dependency
    b26c8c85463e KVM: PPC: Book3S HV: Prevent UAF in kvm_spapr_tce_attach_iommu_group()
    a43cc0558530 wifi: cfg80211: wext: add extra SIOCSIWSCAN data check
    c5942a14f795 nvme: avoid double free special payload
    7d5b199be28e mei: demote client disconnect warning on suspend to debug
    2ffe891b8df2 fs/file: fix the check in find_next_fd()
    da0fec30a73f kconfig: remove wrong expr_trans_bool()
    f6ea77184d70 kconfig: gconf: give a proper initial state to the Save button
    9b873bdaae64 null_blk: fix validation of block size
    91c203d37e69 arm64: armv8_deprecated: Fix warning in isndep cpuhp starting process
    feac2391e26b ila: block BH in ila_output()
    7b40527d2e25 net: ipv6: rpl_iptunnel: block BH in rpl_output() and rpl_input()
    502b144d8805 Input: silead - Always support 10 fingers
    07fb3ed9f8de selftests/openat2: Fix build warnings on ppc64
    a0d2c3a6bbca wifi: mac80211: fix UBSAN noise in ieee80211_prep_hw_scan()
    eaa06c9daea9 wifi: iwlwifi: mvm: properly set 6 GHz channel direct probe option
    36d6128a7f6a wifi: iwlwifi: mvm: Handle BIGTK cipher in kek_kck cmd
    aa74f7e51279 wifi: iwlwifi: mvm: d3: fix WoWLAN command version lookup
    38219c50a3a6 wifi: mac80211: handle tasklet frames before stopping
    34dbc62992f8 wifi: mac80211: mesh: init nonpeer_pm to active by default in mesh sdata
    a3c944359fa0 tools/power/cpupower: Fix Pstate frequency reporting on AMD Family 1Ah CPUs
    044a7bfca888 ACPI: EC: Avoid returning AE_OK on errors in address space handler
    284daacf260b ACPI: EC: Abort address space access upon error
    22413eee9c4e scsi: qedf: Set qed_slowpath_params to zero before use
    c3cbe53d9467 scsi: qedf: Wait for stag work during unload
    ab66639f72df scsi: qedf: Don't process stag work during unload and recovery
    9ffd72041f04 scsi: core: alua: I/O errors for ALUA state transitions
    f818708eeeae scsi: core: Fix a use-after-free
    0f98f40eb1ed bpf: Fix overrunning reservations in ringbuf
    48ec3929916f ACPI: processor_idle: Fix invalid comparison with insertion sort for latency
    903a9ab8a087 ARM: 9324/1: fix get_user() broken with veneer
    52c87ab18c76 filelock: Remove locks reliably when fcntl/close race is detected
    05bbd8d1e92b gcc-plugins: Rename last_stmt() for GCC 14+
    7c6d66f0266f Linux 5.15.163
    f0655a5c8f3e i2c: rcar: fix error code in probe()
    181a157af8a4 kbuild: Make ld-version.sh more robust against version string changes
    db56615e96c4 x86/bhi: Avoid warning in #DB handler due to BHI mitigation
    c4dbe18342b7 x86/entry/64: Remove obsolete comment on tracing vs. SYSRET
    9877f867929d i2c: rcar: clear NO_RXDMA flag after resetting
    7e44655c1fc5 i2c: testunit: avoid re-issued work after read message
    ec1bba809f7c i2c: rcar: ensure Gen3+ reset does not disturb local targets
    02268d026499 i2c: rcar: introduce Gen4 devices
    ff7879da5368 i2c: rcar: reset controller is mandatory for Gen3+
    504cc0036286 i2c: rcar: Add R-Car Gen4 support
    f42afb065917 i2c: mark HostNotify target address as used
    72dd9b813fa3 i2c: rcar: bring hardware to known state when probing
    7000b438dda9 nilfs2: fix kernel bug on rename operation of broken directory
    e30bc19a9ee8 bpf: Allow reads from uninit stack
    2272e2db38f2 ipv6: prevent NULL dereference in ip6_output()
    e79f46ba8e55 ipv6: annotate data-races around cnf.disable_ipv6
    6f98a223d696 wireguard: send: annotate intentional data race in checking empty queue
    21a0f8567f75 wireguard: queueing: annotate intentional data race in cpu round robin
    b4764f0ad3d6 wireguard: allowedips: avoid unaligned 64-bit memory accesses
    20cf67dcb7db libceph: fix race between delayed_work() and ceph_monc_stop()
    519547760f16 Fix userfaultfd_api to return EINVAL as expected
    b3e1890bc34d ALSA: hda/realtek: Limit mic boost on VAIO PRO PX
    26af2ccfc62d ALSA: hda/realtek: Enable Mute LED on HP 250 G7
    fb9e1ee1aec1 ALSA: hda/realtek: add quirk for Clevo V5[46]0TU
    679df0bcd5c4 nvmem: core: only change name to fram for current attribute
    d2135fbc0566 nvmem: meson-efuse: Fix return value of nvmem callbacks
    da5989e5eb35 nvmem: rmem: Fix return value of rmem_read()
    ae3808a85a92 hpet: Support 32-bit userspace
    2bd8534a1b83 USB: core: Fix duplicate endpoint bug by clearing reserved bits in the descriptor
    72b8ee0d9826 usb: gadget: configfs: Prevent OOB read/write in usb_string_copy()
    840940bfb3a1 USB: Add USB_QUIRK_NO_SET_INTF quirk for START BP-850k
    b14aa5673e0a USB: serial: mos7840: fix crash on resume
    e75428344a1a USB: serial: option: add Rolling RW350-GL variants
    9d672c574208 USB: serial: option: add Netprisma LCUK54 series modules
    d2e942dc1cf0 USB: serial: option: add support for Foxconn T99W651
    8c2bf484186a USB: serial: option: add Fibocom FM350-GL
    3fc4c03f7cba USB: serial: option: add Telit FN912 rmnet compositions
    e068685443cf USB: serial: option: add Telit generic core-dump composition
    c0d03cdd8ac8 net: ks8851: Fix potential TX stall after interface reopen
    04317a2471c2 tcp: avoid too many retransmit packets
    3c65bfcbf075 tcp: use signed arithmetic in tcp_rtx_probe0_timed_out()
    15c010d365f8 octeontx2-af: fix issue with IPv4 match for RSS
    ab3a1c3888f3 octeontx2-af: fix issue with IPv6 ext match for RSS
    71d0f15894b8 octeontx2-af: extend RSS supported offload types
    74c5bc3394bb octeontx2-af: fix detection of IP layer
    b65406f56e7d octeontx2-af: fix a issue with cpt_lf_alloc mailbox
    bacb3fc5ed55 octeontx2-af: update cpt lf alloc mailbox
    e4dc9e89f45f octeontx2-af: replace cpt slot with lf id on reg write
    8cd976031e0d ARM: davinci: Convert comma to semicolon
    8338f57eb16b s390: Mark psw in __load_psw_mask() as __unitialized
    2b4d68df3f57 net/sched: Fix UAF when resolving a clash
    ddf516e50bf8 udp: Set SOCK_RCU_FREE earlier in udp_lib_get_port().
    7320fbdf46b9 ethtool: netlink: do not return SQI value if link is down
    ebc5c6304577 ppp: reject claimed-as-LCP but actually malformed packets
    a4a4c03ec069 net: ethernet: mtk-star-emac: set mac_managed_pm when probing
    69ad5fa0ce7c net: ethernet: lantiq_etop: fix double free in detach
    15298ff0f6d2 net: lantiq_etop: add blank line after declaration
    b399a68054df i40e: Fix XDP program unloading while removing the driver
    19904d03dbb8 net: fix rc7's __skb_datagram_iter()
    02ad323fa248 octeontx2-af: Fix incorrect value output on error path in rvu_check_rsrc_availability()
    195b7bcdfc5a skmsg: Skip zero length skb in sk_msg_recvmsg
    bd5b2b612211 tcp: fix incorrect undo caused by DSACK of TLP retransmit
    ba719855a854 vfs: don't mod negative dentry count when on shrinker list
    b422e6335f12 fs/dcache: Re-use value stored to dentry->d_flags instead of re-reading
    02a896426075 filelock: fix potential use-after-free in posix_lock_inode
    bc17f2377818 mm: prevent derefencing NULL ptr in pfn_section_valid()
    88fb258f1baf nilfs2: fix incorrect inode allocation from reserved inodes
    6d1108b041d3 null_blk: Do not allow runt zone with zone capacity smaller then zone size
    f07bcd8bba80 nfc/nci: Add the inconsistency check between the input data length and count
    f44608dd0211 kbuild: fix short log for AS in link-vmlinux.sh
    b4fed1443a65 nvmet: fix a possible leak when destroy a ctrl during qp establishment
    5f7bf7660300 platform/x86: touchscreen_dmi: Add info for the EZpad 6s Pro
    cf628b9279c6 platform/x86: touchscreen_dmi: Add info for GlobalSpace SolT IVW 11.6" tablet
    f8f08fba924e regmap-i2c: Subtract reg size from max_write
    397bfe1bd928 nvme: adjust multiples of NVME_CTRL_PAGE_SIZE in offset
    0d30f73012a3 dma-mapping: benchmark: avoid needless copy_to_user if benchmark fails
    9668700a039d nvme-multipath: find NUMA path only for online numa-node
    0959e10fa346 ALSA: hda/realtek: Enable headset mic of JP-IK LEAP W502 with ALC897
    6b521f82cb2e fs/ntfs3: Mark volume as dirty if xattr is broken
    3503372d0bf7 i2c: pnx: Fix potential deadlock warning from del_timer_sync() call in isr
    1dda25e2415c clk: qcom: gcc-sm6350: Fix gpll6* & gpll7 parents
    feef460321a5 media: dw2102: fix a potential buffer overflow
    a38e02265c68 ima: Avoid blocking in RCU read-side critical section
    0edae06b4c22 bnx2x: Fix multiple UBSAN array-index-out-of-bounds
    ddc382f7d1a6 mtd: rawnand: rockchip: ensure NVDDR timings are rejected
    e8a8ee4c3c34 mtd: rawnand: Bypass a couple of sanity checks during NAND identification
    56ca9e7f80cf mtd: rawnand: Ensure ECC configuration is propagated to upper layers
    452e09c57444 drm/amdgpu/atomfirmware: silence UBSAN warning
    f48dd3f19614 drm/nouveau: fix null pointer dereference in nouveau_connector_get_modes
    2820005edae1 Revert "mm/writeback: fix possible divide-by-zero in wb_dirty_limits(), again"
    0b15ed086a68 fsnotify: Do not generate events for O_PATH file descriptors
    bf47bedf8dd7 can: kvaser_usb: Explicitly initialize family in leafimx driver_info struct
    4ca6013cd18e Bluetooth: qca: Fix BT enable failure again for QCA6390 after warm reboot
    522b39bd7163 btrfs: fix adding block group to a reclaim list and the unused list during reclaim
    a25e85361845 mm: avoid overflows in dirty throttling logic
    df13f3cb4af3 mm: optimize the redundant loop of mm_update_owner_next()
    b11e8fb93ea5 nilfs2: add missing check for inode numbers on directory entries
    3be4dcc8d7be nilfs2: fix inode number range checks
    96839f3f5882 Revert "igc: fix a log entry using uninitialized netdev"
    663e1b693b5c gpiolib: of: add polarity quirk for TSC2005
    03b2e1c9de47 gpiolib: of: add a quirk for reset line polarity for Himax LCDs
    caee6db7e811 gpiolib: of: factor out code overriding gpio line polarity
    8366720519ea inet_diag: Initialize pad field in struct inet_diag_req_v2
    f48b0cd338cf selftests: make order checking verbose in msg_zerocopy selftest
    ab52b1141648 selftests: fix OOM in msg_zerocopy selftest
    bfd14e5915c2 bonding: Fix out-of-bounds read in bond_option_arp_ip_targets_set()
    3325628cb36b netfilter: nf_tables: unconditionally flush pending work before notifier
    bb80a7911218 riscv: kexec: Avoid deadlock in kexec crash path
    15185f6d5ac3 wifi: wilc1000: fix ies_len type in connect path
    ccdc8fa32f79 net: allow skb_datagram_iter to be called from any context
    9de67fb2faf9 e1000e: Fix S0ix residency on corporate systems
    e19fa952c2c1 KVM: s390: fix LPSWEY handling
    ef7c428b425b tcp_metrics: validate source addr length
    b340526c9ef3 UPSTREAM: tcp: fix DSACK undo in fast recovery to call tcp_try_to_open()
    8786e4786181 tools/power turbostat: Remember global max_die_id
    4889f117755b s390/pkey: Wipe sensitive data on failure
    5ca26334fc8a jffs2: Fix potential illegal address access in jffs2_free_inode
    3364c2ed1c24 bpf: Avoid uninitialized value in BPF_CORE_READ_BITFIELD
    c7196357b22a igc: fix a log entry using uninitialized netdev
    b185e48079fe powerpc/xmon: Check cpu id in commands "c#", "dp#" and "dx#"
    7955c2e2399b kunit: Fix timeout message
    137a06dc0ff8 orangefs: fix out-of-bounds fsid access
    eb28c161b926 powerpc/64: Set _IO_BASE to POISON_POINTER_DELTA not 0 for CONFIG_PCI=n
    abc10b55a6f5 i2c: i801: Annotate apanel_addr as __ro_after_init
    bd5620439959 media: dvb-frontends: tda10048: Fix integer overflow
    70c9219effc5 media: s2255: Use refcount_t instead of atomic_t for num_channels
    cdb63c962fd3 media: dvb-frontends: tda18271c2dd: Remove casting during div
    8c2c3cca816d net: dsa: mv88e6xxx: Correct check for empty list
    dc7f14d00d0c wifi: mt76: replace skb_put with skb_put_zero
    2e2980458888 Input: ff-core - prefer struct_size over open coded arithmetic
    292edf27c19c firmware: dmi: Stop decoding on broken entry
    21e8f5b88a6f sctp: prefer struct_size over open coded arithmetic
    3367598d65cd media: dw2102: Don't translate i2c read into write
    afaaebdee9bb drm/amd/display: Skip finding free audio for unknown engine_id
    0b3702f9d43d drm/amd/display: Check pipe offset before setting vblank
    fbb0701af973 drm/amd/display: Check index msg_id before read or write
    c6e777356f54 drm/amdgpu: Initialize timestamp for some legacy SOCs
    71dd42861537 crypto: aead,cipher - zeroize key buffer after use
    0a8a91932b27 scsi: qedf: Make qedf_execute_tmf() non-preemptible
    d73cb8862e4d IB/core: Implement a limit on UMAD receive List
    ecdcf002d1fc media: dvb-usb: dib0700_devices: Add missing release_firmware()
    fb007bc69acb media: dvb: as102-fe: Fix as10x_register_addr packing
    17fe8b75aaf0 drm/lima: fix shared irq handling on driver remove
    e8053aa2ecc4 locking/mutex: Introduce devm_mutex_init()
    5e3070adafca Compiler Attributes: Add __uninitialized macro
    b8086c3c1548 reiserfs: Avoid touching renamed directory if parent does not change
    ea091017ef62 ipv6: Fix data races around sk->sk_prot.
    ff8710da80ee ipv6: annotate some data-races around sk->sk_prot
    e8c2eafaaa6a tcp: Fix data races around icsk->icsk_af_ops.
    8d1bab770956 locking/rwsem: Disable preemption while trying for rwsem lock
    7c82dac02886 block, loop: support partitions without scanning
    45f504f301d4 bpftool: Fix pretty print dump for maps without BTF loaded
    1f24338cb789 jbd2: Drop the merge conflicted hunk
    e1d0e3c51bde tpm: tis_i2c: Limit write bursts to I2C_SMBUS_BLOCK_MAX (32) bytes
    1abe841fe331 tpm: tis_i2c: Limit read bursts to I2C_SMBUS_BLOCK_MAX (32) bytes
    6224acfc1d56 tpm: Add flag to use default cancellation policy
    1cd19d48fb90 tpm: tis_i2c: Fix sanity check interrupt enable mask
    a883da132fa8 tpm: Add tpm_tis_i2c backend for tpm_tis_core
    a742ac8a1c51 tpm: Add tpm_tis_verify_crc to the tpm_tis_phy_ops protocol layer
    ef495c5f45f2 tpm: Remove read16/read32/write32 calls from tpm_tis_phy_ops
    1f3be2e23aa6 gcc-plugins: Reorganize gimple includes for GCC 13
    24615a3b932a ata: ahci: fix enum constants for gcc-13
    5d6cb145541a net: stmmac: Enable mac_managed_pm phylink config
    fd93aabb4287 tools/resolve_btfids: Use pkg-config to locate libelf
    130f9da78406 tools/resolve_btfids: Build with host flags
    00f2f1a782f9 tools/resolve_btfids: Support cross-building the kernel with clang
    17776a4ba9c2 tools/resolve_btfids: Install libbpf headers when building
    7c9808380d70 libbpf: Make libbpf_version.h non-auto-generated
    37ae1ba791ac libbpf: Add LIBBPF_DEPRECATED_SINCE macro for scheduling API deprecations
    a2667e6d7314 drm/radeon: free iio for atombios when driver shutdown
    f100c753aa1f powerpc: Fix reschedule bug in KUAP-unlocked user copy
    da5513f30187 libbpf: Fix build warning on ref_ctr_off
    4c5a089621a8 perf python: Account for multiple words in CC
    1c5699ee85d4 fs: move S_ISGID stripping into the vfs_*() helpers
    838f5d0701d8 fs: add mode_strip_sgid() helper
    d97172683641 squashfs: provide backing_dev_info in order to disable read-ahead
    ed037d7be40c irq_work: use kasan_record_aux_stack_noalloc() record callstack
    1363bd7dbde3 ixgbevf: add disable link state
    e5601ae2bd24 ixgbe: add improvement for MDD response functionality
    caa57cd80575 ixgbe: add the ability for the PF to disable VF link state
    16a77bfcc7df Check /dev/console using init_stat()
    04574fd5579a tracing/arm: Have max stack tracer handle the case of return address after data
    0e51e5717018 gpiolib: cdev: Set lineevent_state::irq after IRQ register successfully
    1e6b7da6ddba drivers/base: Fix unsigned comparison to -1 in CPUMAP_FILE_MAX_BYTES
    493160901320 mtd_blkdevs: add mtd_table_mutex lock back to blktrans_{open, release} to avoid race condition
    04224f725aa3 irqchip/gic-v3-its: Skip HP notifier when no ITS is registered
    6f6c2996a81c irqchip/gic-v3-its: Postpone LPI pending table freeing and memreserve
    1fa94473423f irqchip/gic-v3-its: Give the percpu rdist struct its own flags field
    6013d1ae5feb cert host tools: Stop complaining about deprecated OpenSSL functions
    efe20512212b init/Kconfig: fix CC_HAS_ASM_GOTO_TIED_OUTPUT test with dash
    a40d2daf2795 pnmtologo: use relocatable file name
    3b40d5b41155 of: configfs: remove unused variable overlay_lock
    6c085baf1838 tools: use basename to identify file in gen-mach-types
    2fca0fd71981 lib/build_OID_registry: fix reproducibility issues
    0f586f4ee8ad vt/conmakehash: improve reproducibility
    a75774679f28 OF: DT-Overlay configfs interface (v8)
    d179c639b30b x86/boot: Wrap literal addresses in absolute_pointer()
    856ec356cf91 ACPI: thermal: drop an always true check
    7614af249993 xfs: Fix -Werror=dangling-pointer work-around for older GCC
    41470215f97e xfs: Work around GCC 12 -Werror=dangling-pointer for xfs_attr_remote.o
    44a445c1922d virtio-pci: Remove wrong address verification in vp_del_vqs()
    77aa9e489eaf bpf: Disallow unprivileged bpf by default
    ebfb1822e9f9 fs/aufs: fixup 5.15.36 fixups
    4eba9348d3e2 Revert "Revert "fbdev: Hot-unplug firmware fb devices on forced removal""
    5df6d1b00f95 jbd2: fix use-after-free of transaction_t race
    2d83e8196487 jbd2: refactor wait logic for transaction updates into a common function
    07a63f760793 netfilter: conntrack: avoid useless indirection during conntrack destruction
    4e7122625996 Revert "fbdev: Hot-unplug firmware fb devices on forced removal"
    7ba4cb36fd4f rcu: Avoid alloc_pages() when recording stack
    f78574dee71e kasan: test: silence intentional read overflow warnings
    d313cb89b6b1 kasan: arm64: fix pcpu_page_first_chunk crash with KASAN_VMALLOC
    5e279d5647cc arm64: support page mapping percpu first chunk allocator
    e5bf16752dca vmalloc: choose a better start address in vm_area_register_early()
    660b3d21b46f kasan: test: bypass __alloc_size checks
    00aa7573e53a kasan: test: add memcpy test that avoids out-of-bounds write
    67becf0b1bd4 kasan: fix tag for large allocations when using CONFIG_SLAB
    bedf1e033213 workqueue, kasan: avoid alloc_pages() when recording stack
    7195b67ce69b kasan: generic: introduce kasan_record_aux_stack_noalloc()
    bdff763f0e29 kasan: common: provide can_alloc in kasan_save_stack()
    51423ebb36ad lib/stackdepot: introduce __stack_depot_save()
    85373e66d847 lib/stackdepot: remove unused function argument
    5b6cc9b251f3 lib/stackdepot: include gfp.h
    c9f3902d8069 aufs: reduce overhead for "code present but disabled" use case.
    b98d189df02c aufs: bugfix, umount passes NULL to ->parse_monolithic()
    13b883cbbbd9 aufs standalone: cosmetic, missing copyright sentence
    21f8b0d81898 aufs: 5.15.5-20220117 ---> 5.15.5-20220221
    6199fd896645 aufs: tiny, headers after fs_context
    8ddb40e31c29 aufs: fs_context 7/7, finally remount
    69035f71c6fd aufs: fs_context 6/7, now mount
    bc841b970697 aufs: fs_context 5/7, parse all other mount options
    435188053da2 aufs: fs_context 4/7, parse xino options
    9af1f1825cbd aufs: fs_context 3/7, parse the branch-management options
    1c05eb767f8c aufs: fs_context 2/7, parse "br" mount option
    a8488f603134 aufs: fs_context 1/7, skelton of the new shceme
    8e32e0015564 aufs: pre fs_context, convert a static flag to a macro
    f90cb4144aec aufs: pre fs_context, support the incomplete sb and sbinfo case
    948762ef859c aufs: pre fs_context, convert the type of alloc_sbinfo()
    77151a08776b aufs: 5.15.5-20211129 ---> 5.15.5-20220117
    2539adbbbe1e aufs: 5.14-20211018 ---> 5.15.5-20211129
    7d32b25193c4 aufs: for v5.15-rc1, sync_inode() is gone
    66ec0c509225 aufs: for v5.15-rc1, new param 'rcu' for ->get_acl()
    69709dc518cd aufs: for v5.15-rc1, no mand-lock anymore
    ada8fe9543e5 aufs: 5.14-20210906  ---> 5.14-20211018
    b77f7f3f394a Revert "aufs: adjust to v5.15 fs changes"
    81bdce5b5876 tick/nohz: WARN_ON --> WARN_ON_ONCE to prevent console saturation
    97c963889222 sched/isolation: really align nohz_full with rcu_nocbs
    871f23ad3627 Revert "ARM: defconfig: Enable ax88796c driver for Exynos boards"
    ffad0783dd5b ARM: config: multi v7: Regenerate defconifg
    5c1e1a1ff2d3 ARM: config: multi v7: Add renamed symbols
    badaf96564fe ARM: config: multi v7: Clean up enabled by default options
    34996040fc9b ARM: config: multi v7: Drop unavailable options
    7f685244afb3 powerpc/mm: Switch obsolete dssall to .long
    20301aeb1a64 riscv: fix build with binutils 2.38
    9df58d070506 powerpc/lib/sstep: fix 'ptesync' build error
    720b61fc400b x86_64_defconfig: Fix warnings
    02bf23d26bc4 arm64: defconfig: cleanup config options
    05914e2c87e5 arm: defconfig: drop unused POWER_AVS option
    ffb532fa19b9 aufs5: fix build against v5.15.3+
    a4b3abf4d96d qemux86: add configuration symbol to select values
    fee94ee09154 clear_warn_once: add a clear_warn_once= boot parameter
    3d8762d900d9 clear_warn_once: bind a timer to written reset value
    95faacac47e8 clear_warn_once: expand debugfs to include read support
    de20c4240018 perf: perf can not parser the backtrace of app in the 32bit system and 64bit kernel.
    0e4aacead9c1 perf: x86-32: explicitly include <errno.h>
    9ad92c11468e perf: mips64: Convert __u64 to unsigned long long
    09e7efe3e68a perf: fix bench numa compilation
    e79becc44fa6 perf: add SLANG_INC for slang.h
    b1033b588681 perf: add sgidefs.h to for mips builds
    cf9db484ac0b perf: change --root to --prefix for python install
    7fd052c2c562 perf: add 'libperl not found' warning
    27a437cdd469 perf: force include of <stdbool.h>
    3b99d21bec2f fat: don't use obsolete random32 call in namei_vfat
    a7e9293b506b FAT: Added FAT_NO_83NAME
    6fd0e71d9e5c FAT: Add CONFIG_VFAT_NO_CREATE_WITH_LONGNAMES option
    c379b0d324ae FAT: Add CONFIG_VFAT_FS_NO_DUALNAMES option
    538be0fdb124 aufs: adjust to v5.15 fs changes
    f45da75c8759 aufs5: core
    047f57e07e01 aufs5: standalone
    029fc15574c8 aufs5: mmap
    610d0192ee94 aufs5: base
    d4e428d0ec5f aufs5: kbuild
    eb067eca251a yaffs: replace IS_ERR with IS_ERR_OR_NULL to check both ERR and NULL
    286af18d0875 yaffs: fix -Wstringop-overread compile warning in yaffs_fix_null_name
    24d59a4e26a6 yaffs2: v5.12+ build fixups (not runtime tested)
    22c73536d5d7 yaffs: include blkdev.h
    506b7251bfb8 yaffs: fix misplaced variable declaration
    a0e26ff364dc yaffs2: v5.6 build fixups
    b10b1b2d169e yaffs2: fix memory leak when /proc/yaffs is read
    ad9adccbb214 yaffs: add strict check when call yaffs_internal_read_super
    2e3c3aec8279 yaffs: repair yaffs_get_mtd_device
    d662538516a7 yaffs: Fix build failure by handling inode i_version with proper atomic API
    70a6113ee2c7 yaffs2: fix memory leak in mount/umount
    3378e4a9e404 yaffs: Avoid setting any ACL releated xattr
    ec2284edddef Yaffs:check oob size before auto selecting Yaffs1
    c2a49874051c fs: yaffs2: replace CURRENT_TIME by other appropriate apis
    e9a5105a3e73 yaffs2: adjust to proper location of MS_RDONLY
    608807406f13 yaffs2: import git revision b4ce1bb (jan, 2020)
    89e660ece42c initramfs: allow an optional wrapper script around initramfs generation
    b179dbc9aa10 iwlwifi: select MAC80211_LEDS conditionally
    3fd5ca3673d0 net/dccp: make it depend on CONFIG_BROKEN (CVE-2020-16119)
    d1f6edbf0188 arm64/perf: Fix wrong cast that may cause wrong truncation
    d202fb2caf33 defconfigs: drop obselete options
    9a27e3b5f4e7 arm64/perf: fix backtrace for AAPCS with FP enabled
    e20d8cf019b4 linux-yocto: Handle /bin/awk issues
    b6d2a3dbbd3a uvesafb: provide option to specify timeout for task completion
    adb40f1e6a1a uvesafb: print error message when task timeout occurs
    f280a1ed0962 compiler.h: Undef before redefining __attribute_const__
    4352732f268c vmware: include jiffies.h
    7954a677968d Resolve jiffies wrapping about arp
    5f28a1035d95 nfs: Allow default io size to be configured.
    0d7260ad7106 check console device file on fs when booting
    900a12e37e0a mount_root: clarify error messages for when no rootfs found
    7b878cbea726 menuconfig,mconf-cfg: Allow specification of ncurses location
    6604fc1763b3 modpost: mask trivial warnings
    0d294adb09cb kbuild: exclude meta directory from distclean processing
    a097cdd95a9e powerpc: serialize image targets
    5db6ec39a0a3 arm: serialize build targets
    cbabca27905e crtsavres: fixups for 5.4+
    7fc7656ed403 powerpc/ptrace: Disable array-bounds warning with gcc8
    a5faac5a19a2 powerpc: Disable attribute-alias warnings from gcc8
    186c54665b67 powerpc: add crtsavres.o to archprepare for kbuild
    d1ea862964ca powerpc: kexec fix for powerpc64
    2ac35b89a0f9 powerpc: Add unwind information for SPE registers of E500 core
    2e1c348a28bb mips: vdso: fix 'jalr $t9' crash in vdso code
    ec57870b303a mips: Kconfig: add QEMUMIPS64 option
    6a81b3c08107 4kc cache tlb hazard: tlbp cache coherency
    74e3b2a21e54 malta uhci quirks: make allowance for slow 4k(e)c
    22e65b63d3b4 arm/Makefile: Fix systemtap
    b7f1ab59f19e vexpress: Pass LOADADDR to Makefile
    ce2800c73bf7 arm: ARM EABI socketcall
    019d142fd956 ARM: LPAE: Invalidate the TLB for module addresses during translation fault

(From OE-Core rev: e9d8b15dcc9cdbe33add676572c85d66f46b087c)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-08 09:03:46 -07:00
Bruce Ashfield
0dfb53c328 linux-yocto/5.15: update to v5.15.162
Updating linux-yocto/5.15 to the latest korg -stable release that comprises
the following commits:

    f45bea23c39c Linux 5.15.162
    69cdccf53725 tracing/net_sched: NULL pointer dereference in perf_trace_qdisc_reset()
    500bfbababce serial: 8250_omap: Fix Errata i2310 with RX FIFO level check
    c3507e8da743 arm64: dts: rockchip: Add sound-dai-cells for RK3368
    43d892943631 arm64: dts: rockchip: fix PMIC interrupt pin on ROCK Pi E
    f2474803e4fc ARM: dts: rockchip: rk3066a: add #sound-dai-cells to hdmi node
    468ef1530f0f KVM: arm64: vgic-v4: Make the doorbell request robust w.r.t preemption
    da38b55cd5c2 efi/x86: Free EFI memory map only when installing a new one.
    7e5a18bbe4d0 efi: xen: Set EFI_PARAVIRT for Xen dom0 boot on all architectures
    b898fae96331 efi: memmap: Move manipulation routines into x86 arch tree
    7670c5cbdf34 efi: Correct comment on efi_memmap_alloc
    78eed2c89c74 drivers: fix typo in firmware/efi/memmap.c
    fcd31dd8291b tcp: Fix data races around icsk->icsk_af_ops.
    5088b4d4f91f ipv6: Fix data races around sk->sk_prot.
    cb632144aed3 ipv6: annotate some data-races around sk->sk_prot
    e710727f4391 nfs: Leave pages in the pagecache if readpage failed
    a556ab1925ec pwm: stm32: Refuse too small period requests
    76da46c25dfc syscalls: fix sys_fanotify_mark prototype
    16c0403b7dec syscalls: fix compat_sys_io_pgetevents_time64 usage
    dbb226d81cd0 ftruncate: pass a signed offset
    5dde5f8b7902 ata: libata-core: Fix double free on error
    82f1a6910b3e ata: ahci: Clean up sysfs file on error
    a726d01d54c0 batman-adv: Don't accept TT entries for out-of-spec VIDs
    5eecb49a6c26 drm/nouveau/dispnv04: fix null pointer dereference in nv17_tv_get_hd_modes
    29c0fdf49078 drm/i915/gt: Fix potential UAF by revoke of fence registers
    7f35e01cb0ea drm/amdgpu: avoid using null object of framebuffer
    0d17604f2e44 drm/nouveau/dispnv04: fix null pointer dereference in nv17_tv_get_ld_modes
    c85d02f5bdb5 hexagon: fix fadvise64_64 calling conventions
    574afeec2f33 csky, hexagon: fix broken sys_sync_file_range
    79d2e629ecd8 sh: rework sync_file_range ABI
    32523b5717f0 kbuild: Install dtb files as 0644 in Makefile.dtbinst
    227dbe069a3c cpu/hotplug: Fix dynstate assignment in __cpuhp_setup_state_cpuslocked()
    1762ca80c2b7 net: can: j1939: enhanced error handling for tightly received RTS messages in xtp_rx_rts_session_new
    684f6709a17d net: can: j1939: recover socket queue on CAN bus error during BAM transmission
    4c5dc3927e17 net: can: j1939: Initialize unused data in j1939_send_one()
    4a4b2a33a357 tty: mcf: MCF54418 has 10 UARTS
    87257a28271c serial: 8250_omap: Implementation of Errata i2310
    7026576e8909 usb: dwc3: core: remove lock of otg mode during gadget suspend/resume to avoid deadlock
    1aac4be1aaa5 usb: atm: cxacru: fix endpoint checking in cxacru_bind()
    04ab997a63ba usb: musb: da8xx: fix a resource leak in probe()
    aa14dca6392a usb: gadget: printer: fix races against disable
    7abdf15c0c8e usb: gadget: printer: SS+ support
    7faf881854f7 net: usb: ax88179_178a: improve link status logs
    4c3bf788a45e iio: chemical: bme680: Fix sensor data read operation
    7a13d1357658 iio: chemical: bme680: Fix overflows in compensate() functions
    2edd0078e368 iio: chemical: bme680: Fix calibration data variable
    093d57259da8 iio: chemical: bme680: Fix pressure value output
    97cec39e61b7 iio: accel: fxls8962af: select IIO_BUFFER & IIO_KFIFO_BUF
    70908f430a2b iio: adc: ad7266: Fix variable checking bug
    9cab73566eb5 i2c: testunit: discard write requests while old command is running
    ae7871cc3ee8 i2c: testunit: don't erase registers after STOP
    7d8692671e5f mmc: sdhci: Do not lock spinlock around mmc_gpio_get_ro()
    9e77eb1a2a8c mmc: sdhci: Do not invert write-protect twice
    c389127e6947 mmc: sdhci-pci: Convert PCIBIOS_* return codes to errnos
    320273b5649b ocfs2: fix DIO failure due to insufficient transaction credits
    89c0dc93e564 parisc: use generic sys_fanotify_mark implementation
    2d07fea561d6 x86: stop playing stack games in profile_pc()
    064cfc7c2544 gpiolib: cdev: Disallow reconfiguration without direction (uAPI v1)
    70b48899f3f2 gpio: davinci: Validate the obtained number of IRQs
    287ea87ded8b drm/panel: simple: Add missing display timing flags for KOE TX26D202VM0BWA
    1c504edf1e48 nvme: fixup comment for nvme RDMA Provider Type
    ae4228a0a519 drm/radeon/radeon_display: Decrease the size of allocated memory
    70eb95e06427 soc: ti: wkup_m3_ipc: Send NULL dummy message instead of pointer message
    3d189e1a8152 media: dvbdev: Initialize sbuf
    7a18293fd8d8 ALSA: emux: improve patch ioctl data validation
    39173b04abda crypto: ecdh - explicitly zeroize private_key
    a55afc0f5f20 net/dpaa2: Avoid explicit cpumask var allocation on stack
    0af718a690ac net/iucv: Avoid explicit cpumask var allocation on stack
    8656ef8a9288 RDMA/restrack: Fix potential invalid address access
    43c39193d4f9 bpf: Add a check for struct bpf_fib_lookup size
    3f210d912874 mtd: partitions: redboot: Added conversion of operands to a larger type
    8607d7ccbf71 x86/fpu: Fix AMD X86_BUG_FXSAVE_LEAK fixup
    e1e4fb853aac vduse: Temporarily fail if control queue feature requested
    9649f8fdf83d vduse: validate block features only with block devices
    489f38de3375 drm/panel: ilitek-ili9881c: Fix warning with GPIO controllers that sleep
    a359696856ca bpf: Take return from set_memory_ro() into account with bpf_prog_lock_ro()
    461302e07f49 netfilter: nf_tables: fully validate NFT_DATA_VALUE on store to data registers
    3c5b9d05cec6 tcp: fix tcp_rcv_fastopen_synack() to enter TCP_CA_Loss for failed TFO
    950edaecc068 parisc: use correct compat recv/recvfrom syscalls
    9330cff1d4df sparc: fix compat recv/recvfrom syscalls
    acc3b8ee3828 sparc: fix old compat_sys_select()
    527bec1f56ac Fix race for duplicate reqsk on identical SYN
    57a1a06755e2 tcp: Use BPF timeout setting for SYN ACK RTO
    1d3e3b3aa2cb xdp: Remove WARN() from __xdp_reg_mem_model()
    9509b3269726 net: phy: micrel: add Microchip KSZ 9477 to the device table
    1d885efda88d ibmvnic: Free any outstanding tx skbs during scrq reset
    9eb0295f39dc net: dsa: microchip: fix initial port flush problem
    544ab46b7ece ASoC: fsl-asoc-card: set priv->pdev before using it
    e827e077a93d net: stmmac: Assign configured channel value to EXTTS event
    a03c3a34692f net: mdio: add helpers to extract clause 45 regad and devad fields
    4d020c1dbd2b drm/amdgpu: fix UBSAN warning in kv_dpm.c
    537bc27213ed cifs: fix typo in module parameter enable_gcm_256
    86ed0b350d44 pinctrl: rockchip: fix pinmux reset in rockchip_pmx_set
    a29846058819 pinctrl: rockchip: use dedicated pinctrl type for RK3328
    8f1b6cea9707 pinctrl: rockchip: fix pinmux bits for RK3328 GPIO3-B pins
    96903ed0e846 pinctrl: rockchip: fix pinmux bits for RK3328 GPIO2-B pins
    01fe2f885f78 pinctrl: fix deadlock in create_pinctrl() when handling -EPROBE_DEFER
    906faa4eee0a Input: ili210x - fix ili251x_read_touch_data() return value
    75afd8724739 gve: Clear napi->skb before dev_kfree_skb_any()
    b9b194dc3045 gve: Add RX context.
    4d59364add6a ACPI: x86: Force StorageD3Enable on more products
    029f2adf933a ACPI: x86: utils: Add Picasso to the list for forcing StorageD3Enable
    21f5dd36e655 smb: client: fix deadlock in smb2_find_smb_tcon()
    09783e2c024b x86/amd_nb: Check for invalid SMN reads
    34566c9c5ae3 PCI: Add PCI_ERROR_RESPONSE and related definitions
    f0f1bd244a85 perf/core: Fix missing wakeup when waiting for context reference
    ab4458bc32cb riscv: fix overlap of allocated page and PTR_ERR
    c1cb08c5a128 riscv: mm: init: try best to use IS_ENABLED(CONFIG_64BIT) instead of #ifdef
    3a20de3273d2 kheaders: explicitly define file modes for archived headers
    6aef00795f70 Revert "kheaders: substituting --sort in archive creation"
    4b9646f7fa02 drm/i915/gt: Disarm breadcrumbs if engines are already idle
    881ba5db3190 drm/i915/gt: Only kick the signal worker if there's been an update
    5e08b49ab291 ksmbd: ignore trailing slashes in share paths
    e492449549e9 x86/cpu: Fix x86_match_cpu() to match just X86_VENDOR_INTEL
    31446e391180 x86/cpu/vfm: Add new macros to work with (vendor/family/model) values
    96c75227ead5 tracing: Add MODULE_DESCRIPTION() to preemptirq_delay_test
    5a1922adc579 bcache: fix variable length array abuse in btree_iter
    d999d28e24d0 pmdomain: ti-sci: Fix duplicate PD referrals
    a5cca15b1a5c wifi: rtlwifi: rtl8192de: Fix 5 GHz TX power
    516aa9badb75 rtlwifi: rtl8192de: Style clean-ups
    751f50473977 ARM: dts: samsung: smdk4412: fix keypad no-autorepeat
    e5861d7faa93 ARM: dts: samsung: exynos4412-origen: fix keypad no-autorepeat
    f7fd57754c10 ARM: dts: samsung: smdkv310: fix keypad no-autorepeat
    e24d9a5c7375 perf script: Show also errors for --insn-trace option
    69c5f3ca1650 perf: script: add raw|disasm arguments to --insn-trace option
    b3f36a58e0cd drm/amd/display: revert Exit idle optimizations before HDCP execution
    716b29202db2 arm64: dts: imx8qm-mek: fix gpio number for reg_usdhc2_vmmc
    26c89fffcbf9 dt-bindings: i2c: google,cros-ec-i2c-tunnel: correct path to i2c-controller schema
    667b2471501b i2c: ocores: set IACK bit after core is enabled
    1ab1f442aab8 tcp: clear tp->retrans_stamp in tcp_rcv_fastopen_synack()
    b679b54b2cbc kcov: don't lose track of remote references during softirqs
    18647a78feb9 gcov: add support for GCC 14
    cf1cc8fcfe51 drm/radeon: fix UBSAN warning in kv_dpm.c
    e68266f2788a drm/i915/mso: using joiner is not possible with eDP MSO
    f553e58ddea5 ALSA: hda/realtek: Limit mic boost on N14AP7
    731df07602e5 KVM: x86: Always sync PIR to IRR prior to scanning I/O APIC routes
    2311fd03027d btrfs: retry block group reclaim without infinite loop
    78e4aa528a7b net: do not leave a dangling sk pointer, when socket creation fails
    8f64b185f53b serial: stm32: rework RX over DMA
    1e692244bf7d RDMA/mlx5: Add check for srq max_sge attribute
    dc5017c57f5e ACPICA: Revert "ACPICA: avoid Info: mapping multiple BARs. Your kernel is fine."
    fad7776dd9dd regulator: bd71815: fix ramp values
    b0f0bc72ec82 dmaengine: ioatdma: Fix missing kmem_cache_destroy()
    6666a3a137eb dmaengine: ioatdma: Fix kmemleak in ioat_pci_probe()
    e84cee6c468f dmaengine: ioatdma: Fix error path in ioat3_dma_probe()
    d83f755a6e3e dmaengine: ioat: use PCI core macros for PCIe Capability
    f063620856c6 dmaengine: ioatdma: Fix leaking on version mismatch
    7b1192a0842d dmaengine: ioat: Drop redundant pci_enable_pcie_error_reporting()
    a5dac50aee71 dmaengine: ioat: switch from 'pci_' to 'dma_' API
    1b08bf5a17c6 dmaengine: idxd: Fix possible Use-After-Free in irq_process_work_list
    1cfcb0cf2508 regulator: core: Fix modpost error "regulator_get_regmap" undefined
    9a314d3e5717 net: usb: rtl8150 fix unintiatilzed variables in rtl8150_get_link_ksettings
    bf9beea46130 bnxt_en: Restore PTP tx_avail count in case of skb_pad() error
    af90e3d73dc4 seg6: fix parameter passing when calling NF_HOOK() in End.DX4 and End.DX6 behaviors
    523bed6489e0 netfilter: ipset: Fix suspicious rcu_dereference_protected()
    7c9df04ea3a1 octeontx2-pf: Add error handling to VLAN unoffload handling
    0359fea1c117 virtio_net: checksum offloading handling fix
    2145583e5995 net: stmmac: No need to calculate speed divider when offload is disabled
    4b03da87d0b7 ptp: fix integer overflow in max_vclocks_store
    aa1f81fe3a05 sched: act_ct: add netns into the key of tcf_ct_flow_table
    4b361712667c net/sched: act_ct: set 'net' pointer when creating new nf_flow_table
    692803b39a36 tipc: force a dst refcount before doing decryption
    25987a97eec4 net/sched: act_api: fix possible infinite loop in tcf_idr_check_alloc()
    815bd4e2d152 net/sched: act_api: rely on rcu in tcf_idr_check_alloc
    e57495a0c388 qca_spi: Make interrupt remembering atomic
    cb7f811f638a netns: Make get_net_ns() handle zero refcount net
    9f30f1f1a51d xfrm6: check ip6_dst_idev() return value in xfrm6_get_saddr()
    569c9d9ea664 ipv6: prevent possible NULL dereference in rt6_probe()
    4cdfe813015d ipv6: prevent possible NULL deref in fib6_nh_init()
    280cf1173726 netrom: Fix a memory leak in nr_heartbeat_expiry()
    fbf722769712 cipso: fix total option length computation
    98a7bfc48fff tracing: Build event generation tests only as modules
    89167072fd24 mips: bmips: BCM6358: make sure CBR is correctly set
    9c82759c9c00 MIPS: Routerboard 532: Fix vendor retry check code
    5e93c2602710 serial: exar: adding missing CTI and Exar PCI ids
    7f2b9ab6d0b2 serial: imx: Introduce timeout when waiting on transmitter empty
    25998f561315 MIPS: Octeon: Add PCIe link status check
    3992ce79c919 PCI/PM: Avoid D3cold for HP Pavilion 17 PC/1972 PCIe Ports
    4f4ab8fb00a3 udf: udftime: prevent overflow in udf_disk_stamp_to_time()
    7c3bb96a20cd Avoid hw_desc array overrun in dw-axi-dmac
    4eaf2331a779 usb: misc: uss720: check for incompatible versions of the Belkin F5U002
    724429db09e2 f2fs: remove clear SB_INLINECRYPT flag in default_options
    34e0e05161cb iommu/arm-smmu-v3: Free MSIs in case of ENOMEM
    e63f071b916d power: supply: cros_usbpd: provide ID table for avoiding fallback match
    9ad656ec23a4 powerpc/io: Avoid clang null pointer arithmetic warnings
    262e942ff5a8 powerpc/pseries: Enforce hcall result buffer validity and size
    70aa1f2dec46 drm/lima: mask irqs in timeout path before hard reset
    2e0d73a2abb0 drm/lima: add mask irq callback to gp and pp
    ffabdc44b538 drm/amd/display: Exit idle optimizations before HDCP execution
    df8eaae03878 Bluetooth: ath3k: Fix multiple issues reported by checkpatch.pl
    8f917f517b24 ACPI: video: Add backlight=native quirk for Lenovo Slim 7 16ARH7
    f4223566f4d2 HID: Add quirk for Logitech Casa touchpad
    efd29cd9c7b8 netpoll: Fix race condition in netpoll_owner_active
    a5bd59e04819 kselftest: arm64: Add a null pointer check
    397a8990c377 scsi: qedi: Fix crash while reading debugfs attribute
    b3722fb69468 drop_monitor: replace spin_lock by raw_spin_lock
    03ea65b91f1f af_packet: avoid a false positive warning in packet_setsockopt()
    b37b1b660eae wifi: ath9k: work around memset overflow warning
    92176caf9896 batman-adv: bypass empty buckets in batadv_purge_orig_ref()
    ec874fb27fff selftests/bpf: Fix flaky test btf_map_in_map/lookup_update
    f4258833ffb3 selftests/bpf: Prevent client connect before server bind in test_tc_tunnel.sh
    3220c90f4dbd block/ioctl: prefer different overflow check
    103b56af907c rcutorture: Fix invalid context warning when enable srcu barrier testing
    b56e19015809 rcutorture: Make stall-tasks directly exit when rcutorture tests end
    48b0a8596f86 rcutorture: Fix rcu_torture_one_read() pipe_count overflow comment
    a886bcb0f67d crypto: hisilicon/sec - Fix memory leak for sec resource release
    ec7afa254367 padata: Disable BH when taking works lock on MT path
    a3dff121a7f5 Bluetooth: qca: fix info leak when fetching board id
    f257d5614941 Bluetooth: qca: Fix error code in qca_read_fw_build_info()
    8e69e589f233 zap_pid_ns_processes: clear TIF_NOTIFY_SIGNAL along with TIF_SIGPENDING
    8e9499ca912e i2c: designware: Fix the functionality flags of the slave-only interface
    42bb4ac55239 i2c: at91: Fix the functionality flags of the slave-only interface
    3eee13ab67f6 usb-storage: alauda: Check whether the media is initialized
    fb071f5c75d4 greybus: Fix use-after-free bug in gb_interface_release due to race condition.
    3f507f4a5bb0 kbuild: Remove support for Clang's ThinLTO caching
    b4697a762d8c mptcp: pm: update add_addr counters after connect
    9c2ed72112f3 mptcp: pm: inc RmAddr MIB counter once per RM_ADDR ID
    f571c8ab18a3 hugetlb_encode.h: fix undefined behaviour (34 << 26)
    3f92924d6f4b serial: 8250_pxa: Configure tx_loadsz to match FIFO IRQ level
    688bb46ad339 mm/huge_memory: don't unpoison huge_zero_folio
    3e5a49e3a2cc scsi: mpi3mr: Fix ATA NCQ priority support
    ecb7ab3a3288 tick/nohz_full: Don't abuse smp_call_function_single() in tick_setup_device()
    33900d7eae61 nilfs2: fix potential kernel bug due to lack of writeback flag waiting
    a942289800be intel_th: pci: Add Lunar Lake support
    90fa01534e14 intel_th: pci: Add Meteor Lake-S support
    4dbfc57316da intel_th: pci: Add Sapphire Rapids SOC support
    2b6e0d427bc3 intel_th: pci: Add Granite Rapids SOC support
    0bb4c9482bdf intel_th: pci: Add Granite Rapids support
    714950089aa7 dmaengine: axi-dmac: fix possible race in remove()
    85dac3dc9c81 PCI: rockchip-ep: Remove wrong mask on subsys_vendor_id
    38825ff9da91 ocfs2: fix races between hole punching and AIO+DIO
    fc1d429c857e ocfs2: use coarse time for new created files
    e1b160a50c75 fs/proc: fix softlockup in __read_vmcore
    4f2fd2a3789e knfsd: LOOKUP can return an illegal error value
    a4d9818ff52d spmi: hisi-spmi-controller: Do not override device identifier
    95ac3e773a1f vmci: prevent speculation leaks by sanitizing event in event_deliver()
    4959ffc65a0e sock_map: avoid race between sock_map_close and sk_psock_put
    efede53ad14b null_blk: Print correct max open zones limit in null_init_zoned_dev()
    367ef3c86557 tracing/selftests: Fix kprobe event name test for .isra. functions
    7b9c7fc8600b mptcp: ensure snd_una is properly initialized on connect
    6d6bb258d886 drm/exynos: hdmi: report safe 640x480 mode as a fallback when no EDID found
    777838c9b571 drm/exynos/vidi: fix memory leak in .get_modes()
    ec772ed7cb21 drivers: core: synchronize really_probe() and dev_uevent()
    085656620ba1 iio: imu: inv_icm42600: delete unneeded update watermark call
    d0f8616e11ab iio: dac: ad5592r: fix temperature channel scaling value
    e5134860a929 iio: adc: ad9467: fix scan type sign
    fa38ee41c952 af_unix: Read with MSG_PEEK loops if the first unread byte is OOB
    8edd18dab443 ionic: fix use after netif_napi_del()
    7aae016b231a net/ipv6: Fix the RT cache flush via sysctl using a previous delay
    76b34e5899ba net: stmmac: replace priv->speed with the portTransmitRate from the tc-cbs parameters
    0f1bb77c6d83 netfilter: ipset: Fix race between namespace cleanup and gc in the list:set type
    3c2a6dd63106 Bluetooth: L2CAP: Fix rejecting L2CAP_CONN_PARAM_UPDATE_REQ
    caf273553348 net/mlx5e: Fix features validation check for tunneled UDP (non-VXLAN) packets
    cba6c9058303 tcp: fix race in tcp_v6_syn_recv_sock()
    6e5164a5b757 drm/bridge/panel: Fix runtime warning on panel bridge release
    86042e3d16b7 drm/komeda: check for error-valued pointer
    a86490a3712c liquidio: Adjust a NULL pointer handling path in lio_vf_rep_copy_packet
    eeadf207a2c0 net: hns3: add cond_resched() to hns3 ring buffer init process
    62b5dfb67bfa net: hns3: fix kernel crash problem in concurrent scenario
    29c451129ebe net: sfp: Always call `sfp_sm_mod_remove()` on remove
    40e767bfc10d drm/vmwgfx: 3D disabled should not effect STDU memory limits
    a0503757947f HID: logitech-dj: Fix memory leak in logi_dj_recv_switch_to_dj_mode()
    2973b8e7d127 iommu: Return right value in iommu_sva_bind_device()
    05a61b03a81f iommu/amd: Fix sysfs leak in iommu init
    d37895aeacdd iommu/amd: Introduce pci segment structure
    8bac61934cd5 HID: core: remove unnecessary WARN_ON() in implement()
    bc0ab111f001 gpio: tqmx86: store IRQ trigger type and unmask status separately
    05f45f065821 gpio: tqmx86: fix typo in Kconfig label
    7625992f16c3 platform/x86: dell-smbios: Fix wrong token data in sysfs
    beec9b57e9f6 platform/x86: dell-smbios-base: Use sysfs_emit()
    9e6c4b1027b0 SUNRPC: return proper error from gss_wrap_req_priv
    6487966b4863 clk: sifive: Do not register clkdevs for PRCI clocks
    29d991419edd Input: try trimming too long modalias strings
    40c2bdef8104 powerpc/uaccess: Fix build errors seen with GCC 13/14
    521f333e644c scsi: mpt3sas: Avoid test/set_bit() operating in non-allocated memory
    42ce0d444be9 xhci: Apply broken streams quirk to Etron EJ188 xHCI host
    26460c1afa31 xhci: Handle TD clearing for multiple streams case
    8348dd97ab5c xhci: Apply reset resume quirk to Etron EJ188 xHCI host
    df2615cd7680 xhci: Set correct transferred length for cancelled bulk transfers
    480e5bc21f2c jfs: xattr: fix buffer overflow for invalid xattr
    3e89411cbb99 mei: me: release irq in mei_me_pci_resume error path
    62e939abae58 usb: typec: tcpm: Ignore received Hard Reset in TOGGLING state
    53250b54c92f USB: class: cdc-wdm: Fix CPU lockup caused by excessive log messages
    11a2edb70356 nilfs2: fix nilfs_empty_dir() misjudgment and long loop on I/O errors
    1db095222b58 nilfs2: return the mapped address from nilfs_get_page()
    95403e65525f nilfs2: Remove check for PageError
    f5d700d8bc31 btrfs: fix leak of qgroup extent records after transaction abort
    9c0914b8733d wifi: ath10k: fix QCOM_RPROC_COMMON dependency
    fdba4fbe5e54 selftests/mm: compaction_test: fix bogus test success on Aarch64
    9df7bb70906d selftests/mm: conform test to TAP format output
    68fdfb1dfe20 selftests/mm: compaction_test: fix incorrect write of zero to nr_hugepages
    70c8ec82f899 mm/cma: drop incorrect alignment check in cma_init_reserved_mem
    51163bfef6b7 cma: factor out minimum alignment requirement
    8dd8de424f30 i2c: acpi: Unbind mux adapters before delete
    fb6c53211fb7 i2c: add fwnode APIs
    aea35157bb9b mmc: davinci: Don't strip remove function when driver is builtin
    c4f8e95a2e03 mmc: davinci_mmc: Convert to platform remove callback returning void
    8ea8ef5e4217 ftrace: Fix possible use-after-free issue in ftrace_location()
    ce1b8b30d79a x86/ibt,ftrace: Search for __fentry__ location
    db11ccb43ae7 serial: sc16is7xx: fix bug in sc16is7xx_set_baud() when using prescaler
    f518bf02dd0e serial: sc16is7xx: replace hardcoded divisor value with BIT() macro
    62d5550ab620 Bluetooth: qca: fix info leak when fetching fw build id
    c3c1bd421db6 Bluetooth: qca: add support for QCA2066
    63053181b20e Bluetooth: qca: use switch case for soc type behavior
    60ff5e040527 Bluetooth: btqca: Add WCN3988 support
    76649dae9615 Bluetooth: btqca: use le32_to_cpu for ver.soc_id
    852a311d63fc Bluetooth: hci_qca: mark OF related data as maybe unused
    a9935c14a789 skbuff: introduce skb_pull_data
    28478f4ef9ec misc/pvpanic-pci: register attributes via pci_driver
    10921527ae88 misc/pvpanic: deduplicate common code
    7be0bdbcb977 pvpanic: Indentation fixes here and there
    52b5d3ca1364 pvpanic: Keep single style across modules
    2677eec526da drm/amd/display: Fix incorrect DSC instance for MST
    f055ddbc82fa drm/amd/display: drop unnecessary NULL checks in debugfs
    2d8139599ecf drm/amd/display: Clean up some inconsistent indenting
    8480f6083031 drm/amd/display: Handle Y carry-over in VCP X.Y calculation
    50b878ed127e iio: accel: mxc4005: Reset chip on probe() and resume()
    3613e5023f09 usb: gadget: f_fs: Fix race between aio_cancel() and AIO request complete
    3ec6464f050d usb: gadget: f_fs: use io_data->status consistently
    a0bc020592b5 ipv6: fix possible race in __fib6_drop_pcpu_from()
    d34d3b3f9224 af_unix: Annotate data-race of sk->sk_shutdown in sk_diag_fill().
    bdb5e4fbad58 af_unix: Use skb_queue_len_lockless() in sk_diag_show_rqlen().
    9402362b4c14 af_unix: Use skb_queue_empty_lockless() in unix_release_sock().
    0142dce07799 af_unix: annotate lockless accesses to sk->sk_err
    c633ff24d961 af_unix: Use unix_recvq_full_lockless() in unix_stream_connect().
    2c2e9cab9b2a af_unix: Annotate data-race of net->unx.sysctl_max_dgram_qlen.
    69e797f63468 af_unix: Annotate data-races around sk->sk_state in UNIX_DIAG.
    836a0b57633f af_unix: Annotate data-race of sk->sk_state in unix_stream_read_skb().
    cb1b9bee4b98 af_unix: Annotate data-races around sk->sk_state in sendmsg() and recvmsg().
    8807ca49c903 af_unix: Annotate data-race of sk->sk_state in unix_stream_connect().
    c8f2ebbb0e0c net: drop nopreempt requirement on sock_prot_inuse_add()
    aa4ed1e0f6cc net: inline sock_prot_inuse_add()
    d8653ec0e38d af_unix: Annotate data-races around sk->sk_state in unix_write_space() and poll().
    892cbc48c643 af_unix: Annotate data-race of sk->sk_state in unix_inq_len().
    5b9668fd8741 af_unix: Annodate data-races around sk->sk_state for writers.
    c8ffe6b44c3c af_unix: Set sk->sk_state under unix_state_lock() for truly disconencted peer.
    aed4a2b3eccc ptp: Fix error message on failed pin verification
    d3dde4c217f0 net/sched: taprio: always validate TCA_TAPRIO_ATTR_PRIOMAP
    582c32e6df40 tcp: count CLOSE-WAIT sockets for TCP_MIB_CURRESTAB
    d69cac92d1d9 vxlan: Fix regression when dropping packets due to invalid src addresses
    598572c64287 net: sched: sch_multiq: fix possible OOB write in multiq_tune()
    994c0f46668b octeontx2-af: Always allocate PF entries from low prioriy zone
    789bd77c9342 bpf: Set run context for rawtp test_run callback
    c30a334011f6 ipv6: sr: block BH in seg6_output_core() and seg6_input_core()
    50a5dd6de147 net/ncsi: Fix the multi thread manner of NCSI driver
    d5869d550ded net/ncsi: Simplify Kconfig/dts control flow
    7664a26be043 wifi: mac80211: correctly parse Spatial Reuse Parameter Set element
    65686118845d wifi: iwlwifi: mvm: don't read past the mfuart notifcation
    f777792952d0 wifi: iwlwifi: mvm: check n_ssids before accessing the ssids
    ab4cd503fd4e wifi: iwlwifi: dbg_ini: move iwl_dbg_tlv_free outside of debugfs ifdef
    3ce4c7e7fc0c wifi: iwlwifi: mvm: revert gen2 TX A-MPDU size to 64
    008ab7cc3292 wifi: cfg80211: pmsr: use correct nla_get_uX functions
    dfd84ce41663 wifi: cfg80211: Lock wiphy in cfg80211_get_station
    d90bdff79f8e wifi: mac80211: Fix deadlock in ieee80211_sta_ps_deliver_wakeup()
    c4c865f971fd wifi: mac80211: mesh: Fix leak of mesh_preq_queue objects
    b8086c3c1548 reiserfs: Avoid touching renamed directory if parent does not change
    ea091017ef62 ipv6: Fix data races around sk->sk_prot.
    ff8710da80ee ipv6: annotate some data-races around sk->sk_prot
    e8c2eafaaa6a tcp: Fix data races around icsk->icsk_af_ops.
    8d1bab770956 locking/rwsem: Disable preemption while trying for rwsem lock
    7c82dac02886 block, loop: support partitions without scanning
    45f504f301d4 bpftool: Fix pretty print dump for maps without BTF loaded
    1f24338cb789 jbd2: Drop the merge conflicted hunk
    e1d0e3c51bde tpm: tis_i2c: Limit write bursts to I2C_SMBUS_BLOCK_MAX (32) bytes
    1abe841fe331 tpm: tis_i2c: Limit read bursts to I2C_SMBUS_BLOCK_MAX (32) bytes
    6224acfc1d56 tpm: Add flag to use default cancellation policy
    1cd19d48fb90 tpm: tis_i2c: Fix sanity check interrupt enable mask
    a883da132fa8 tpm: Add tpm_tis_i2c backend for tpm_tis_core
    a742ac8a1c51 tpm: Add tpm_tis_verify_crc to the tpm_tis_phy_ops protocol layer
    ef495c5f45f2 tpm: Remove read16/read32/write32 calls from tpm_tis_phy_ops
    1f3be2e23aa6 gcc-plugins: Reorganize gimple includes for GCC 13
    24615a3b932a ata: ahci: fix enum constants for gcc-13
    5d6cb145541a net: stmmac: Enable mac_managed_pm phylink config
    fd93aabb4287 tools/resolve_btfids: Use pkg-config to locate libelf
    130f9da78406 tools/resolve_btfids: Build with host flags
    00f2f1a782f9 tools/resolve_btfids: Support cross-building the kernel with clang
    17776a4ba9c2 tools/resolve_btfids: Install libbpf headers when building
    7c9808380d70 libbpf: Make libbpf_version.h non-auto-generated
    37ae1ba791ac libbpf: Add LIBBPF_DEPRECATED_SINCE macro for scheduling API deprecations
    a2667e6d7314 drm/radeon: free iio for atombios when driver shutdown
    f100c753aa1f powerpc: Fix reschedule bug in KUAP-unlocked user copy
    da5513f30187 libbpf: Fix build warning on ref_ctr_off
    4c5a089621a8 perf python: Account for multiple words in CC
    1c5699ee85d4 fs: move S_ISGID stripping into the vfs_*() helpers
    838f5d0701d8 fs: add mode_strip_sgid() helper
    d97172683641 squashfs: provide backing_dev_info in order to disable read-ahead
    ed037d7be40c irq_work: use kasan_record_aux_stack_noalloc() record callstack
    1363bd7dbde3 ixgbevf: add disable link state
    e5601ae2bd24 ixgbe: add improvement for MDD response functionality
    caa57cd80575 ixgbe: add the ability for the PF to disable VF link state
    16a77bfcc7df Check /dev/console using init_stat()
    04574fd5579a tracing/arm: Have max stack tracer handle the case of return address after data
    0e51e5717018 gpiolib: cdev: Set lineevent_state::irq after IRQ register successfully
    1e6b7da6ddba drivers/base: Fix unsigned comparison to -1 in CPUMAP_FILE_MAX_BYTES
    493160901320 mtd_blkdevs: add mtd_table_mutex lock back to blktrans_{open, release} to avoid race condition
    04224f725aa3 irqchip/gic-v3-its: Skip HP notifier when no ITS is registered
    6f6c2996a81c irqchip/gic-v3-its: Postpone LPI pending table freeing and memreserve
    1fa94473423f irqchip/gic-v3-its: Give the percpu rdist struct its own flags field
    6013d1ae5feb cert host tools: Stop complaining about deprecated OpenSSL functions
    efe20512212b init/Kconfig: fix CC_HAS_ASM_GOTO_TIED_OUTPUT test with dash
    a40d2daf2795 pnmtologo: use relocatable file name
    3b40d5b41155 of: configfs: remove unused variable overlay_lock
    6c085baf1838 tools: use basename to identify file in gen-mach-types
    2fca0fd71981 lib/build_OID_registry: fix reproducibility issues
    0f586f4ee8ad vt/conmakehash: improve reproducibility
    a75774679f28 OF: DT-Overlay configfs interface (v8)
    d179c639b30b x86/boot: Wrap literal addresses in absolute_pointer()
    856ec356cf91 ACPI: thermal: drop an always true check
    7614af249993 xfs: Fix -Werror=dangling-pointer work-around for older GCC
    41470215f97e xfs: Work around GCC 12 -Werror=dangling-pointer for xfs_attr_remote.o
    44a445c1922d virtio-pci: Remove wrong address verification in vp_del_vqs()
    77aa9e489eaf bpf: Disallow unprivileged bpf by default
    ebfb1822e9f9 fs/aufs: fixup 5.15.36 fixups
    4eba9348d3e2 Revert "Revert "fbdev: Hot-unplug firmware fb devices on forced removal""
    5df6d1b00f95 jbd2: fix use-after-free of transaction_t race
    2d83e8196487 jbd2: refactor wait logic for transaction updates into a common function
    07a63f760793 netfilter: conntrack: avoid useless indirection during conntrack destruction
    4e7122625996 Revert "fbdev: Hot-unplug firmware fb devices on forced removal"
    7ba4cb36fd4f rcu: Avoid alloc_pages() when recording stack
    f78574dee71e kasan: test: silence intentional read overflow warnings
    d313cb89b6b1 kasan: arm64: fix pcpu_page_first_chunk crash with KASAN_VMALLOC
    5e279d5647cc arm64: support page mapping percpu first chunk allocator
    e5bf16752dca vmalloc: choose a better start address in vm_area_register_early()
    660b3d21b46f kasan: test: bypass __alloc_size checks
    00aa7573e53a kasan: test: add memcpy test that avoids out-of-bounds write
    67becf0b1bd4 kasan: fix tag for large allocations when using CONFIG_SLAB
    bedf1e033213 workqueue, kasan: avoid alloc_pages() when recording stack
    7195b67ce69b kasan: generic: introduce kasan_record_aux_stack_noalloc()
    bdff763f0e29 kasan: common: provide can_alloc in kasan_save_stack()
    51423ebb36ad lib/stackdepot: introduce __stack_depot_save()
    85373e66d847 lib/stackdepot: remove unused function argument
    5b6cc9b251f3 lib/stackdepot: include gfp.h
    c9f3902d8069 aufs: reduce overhead for "code present but disabled" use case.
    b98d189df02c aufs: bugfix, umount passes NULL to ->parse_monolithic()
    13b883cbbbd9 aufs standalone: cosmetic, missing copyright sentence
    21f8b0d81898 aufs: 5.15.5-20220117 ---> 5.15.5-20220221
    6199fd896645 aufs: tiny, headers after fs_context
    8ddb40e31c29 aufs: fs_context 7/7, finally remount
    69035f71c6fd aufs: fs_context 6/7, now mount
    bc841b970697 aufs: fs_context 5/7, parse all other mount options
    435188053da2 aufs: fs_context 4/7, parse xino options
    9af1f1825cbd aufs: fs_context 3/7, parse the branch-management options
    1c05eb767f8c aufs: fs_context 2/7, parse "br" mount option
    a8488f603134 aufs: fs_context 1/7, skelton of the new shceme
    8e32e0015564 aufs: pre fs_context, convert a static flag to a macro
    f90cb4144aec aufs: pre fs_context, support the incomplete sb and sbinfo case
    948762ef859c aufs: pre fs_context, convert the type of alloc_sbinfo()
    77151a08776b aufs: 5.15.5-20211129 ---> 5.15.5-20220117
    2539adbbbe1e aufs: 5.14-20211018 ---> 5.15.5-20211129
    7d32b25193c4 aufs: for v5.15-rc1, sync_inode() is gone
    66ec0c509225 aufs: for v5.15-rc1, new param 'rcu' for ->get_acl()
    69709dc518cd aufs: for v5.15-rc1, no mand-lock anymore
    ada8fe9543e5 aufs: 5.14-20210906  ---> 5.14-20211018
    b77f7f3f394a Revert "aufs: adjust to v5.15 fs changes"
    81bdce5b5876 tick/nohz: WARN_ON --> WARN_ON_ONCE to prevent console saturation
    97c963889222 sched/isolation: really align nohz_full with rcu_nocbs
    871f23ad3627 Revert "ARM: defconfig: Enable ax88796c driver for Exynos boards"
    ffad0783dd5b ARM: config: multi v7: Regenerate defconifg
    5c1e1a1ff2d3 ARM: config: multi v7: Add renamed symbols
    badaf96564fe ARM: config: multi v7: Clean up enabled by default options
    34996040fc9b ARM: config: multi v7: Drop unavailable options
    7f685244afb3 powerpc/mm: Switch obsolete dssall to .long
    20301aeb1a64 riscv: fix build with binutils 2.38
    9df58d070506 powerpc/lib/sstep: fix 'ptesync' build error
    720b61fc400b x86_64_defconfig: Fix warnings
    02bf23d26bc4 arm64: defconfig: cleanup config options
    05914e2c87e5 arm: defconfig: drop unused POWER_AVS option
    ffb532fa19b9 aufs5: fix build against v5.15.3+
    a4b3abf4d96d qemux86: add configuration symbol to select values
    fee94ee09154 clear_warn_once: add a clear_warn_once= boot parameter
    3d8762d900d9 clear_warn_once: bind a timer to written reset value
    95faacac47e8 clear_warn_once: expand debugfs to include read support
    de20c4240018 perf: perf can not parser the backtrace of app in the 32bit system and 64bit kernel.
    0e4aacead9c1 perf: x86-32: explicitly include <errno.h>
    9ad92c11468e perf: mips64: Convert __u64 to unsigned long long
    09e7efe3e68a perf: fix bench numa compilation
    e79becc44fa6 perf: add SLANG_INC for slang.h
    b1033b588681 perf: add sgidefs.h to for mips builds
    cf9db484ac0b perf: change --root to --prefix for python install
    7fd052c2c562 perf: add 'libperl not found' warning
    27a437cdd469 perf: force include of <stdbool.h>
    3b99d21bec2f fat: don't use obsolete random32 call in namei_vfat
    a7e9293b506b FAT: Added FAT_NO_83NAME
    6fd0e71d9e5c FAT: Add CONFIG_VFAT_NO_CREATE_WITH_LONGNAMES option
    c379b0d324ae FAT: Add CONFIG_VFAT_FS_NO_DUALNAMES option
    538be0fdb124 aufs: adjust to v5.15 fs changes
    f45da75c8759 aufs5: core
    047f57e07e01 aufs5: standalone
    029fc15574c8 aufs5: mmap
    610d0192ee94 aufs5: base
    d4e428d0ec5f aufs5: kbuild
    eb067eca251a yaffs: replace IS_ERR with IS_ERR_OR_NULL to check both ERR and NULL
    286af18d0875 yaffs: fix -Wstringop-overread compile warning in yaffs_fix_null_name
    24d59a4e26a6 yaffs2: v5.12+ build fixups (not runtime tested)
    22c73536d5d7 yaffs: include blkdev.h
    506b7251bfb8 yaffs: fix misplaced variable declaration
    a0e26ff364dc yaffs2: v5.6 build fixups
    b10b1b2d169e yaffs2: fix memory leak when /proc/yaffs is read
    ad9adccbb214 yaffs: add strict check when call yaffs_internal_read_super
    2e3c3aec8279 yaffs: repair yaffs_get_mtd_device
    d662538516a7 yaffs: Fix build failure by handling inode i_version with proper atomic API
    70a6113ee2c7 yaffs2: fix memory leak in mount/umount
    3378e4a9e404 yaffs: Avoid setting any ACL releated xattr
    ec2284edddef Yaffs:check oob size before auto selecting Yaffs1
    c2a49874051c fs: yaffs2: replace CURRENT_TIME by other appropriate apis
    e9a5105a3e73 yaffs2: adjust to proper location of MS_RDONLY
    608807406f13 yaffs2: import git revision b4ce1bb (jan, 2020)
    89e660ece42c initramfs: allow an optional wrapper script around initramfs generation
    b179dbc9aa10 iwlwifi: select MAC80211_LEDS conditionally
    3fd5ca3673d0 net/dccp: make it depend on CONFIG_BROKEN (CVE-2020-16119)
    d1f6edbf0188 arm64/perf: Fix wrong cast that may cause wrong truncation
    d202fb2caf33 defconfigs: drop obselete options
    9a27e3b5f4e7 arm64/perf: fix backtrace for AAPCS with FP enabled
    e20d8cf019b4 linux-yocto: Handle /bin/awk issues
    b6d2a3dbbd3a uvesafb: provide option to specify timeout for task completion
    adb40f1e6a1a uvesafb: print error message when task timeout occurs
    f280a1ed0962 compiler.h: Undef before redefining __attribute_const__
    4352732f268c vmware: include jiffies.h
    7954a677968d Resolve jiffies wrapping about arp
    5f28a1035d95 nfs: Allow default io size to be configured.
    0d7260ad7106 check console device file on fs when booting
    900a12e37e0a mount_root: clarify error messages for when no rootfs found
    7b878cbea726 menuconfig,mconf-cfg: Allow specification of ncurses location
    6604fc1763b3 modpost: mask trivial warnings
    0d294adb09cb kbuild: exclude meta directory from distclean processing
    a097cdd95a9e powerpc: serialize image targets
    5db6ec39a0a3 arm: serialize build targets
    cbabca27905e crtsavres: fixups for 5.4+
    7fc7656ed403 powerpc/ptrace: Disable array-bounds warning with gcc8
    a5faac5a19a2 powerpc: Disable attribute-alias warnings from gcc8
    186c54665b67 powerpc: add crtsavres.o to archprepare for kbuild
    d1ea862964ca powerpc: kexec fix for powerpc64
    2ac35b89a0f9 powerpc: Add unwind information for SPE registers of E500 core
    2e1c348a28bb mips: vdso: fix 'jalr $t9' crash in vdso code
    ec57870b303a mips: Kconfig: add QEMUMIPS64 option
    6a81b3c08107 4kc cache tlb hazard: tlbp cache coherency
    74e3b2a21e54 malta uhci quirks: make allowance for slow 4k(e)c
    22e65b63d3b4 arm/Makefile: Fix systemtap
    b7f1ab59f19e vexpress: Pass LOADADDR to Makefile
    ce2800c73bf7 arm: ARM EABI socketcall
    019d142fd956 ARM: LPAE: Invalidate the TLB for module addresses during translation fault

(From OE-Core rev: 4fa68c5a358f369d59c32f3c4c7bb33a2a051cb5)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-08 09:03:46 -07:00
Bruce Ashfield
dd6669d720 linux-yocto/5.15: update to v5.15.161
Updating linux-yocto/5.15 to the latest korg -stable release that comprises
the following commits:

    4878aadf2d15 Linux 5.15.161
    24665fc4bbef scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW major version > 5
    59b12bff04dd NFS: Fix READ_PLUS when server doesn't support OP_READ_PLUS
    f80c02175293 nfs: fix undefined behavior in nfs_block_bits()
    480aba20fa08 EDAC/igen6: Convert PCIBIOS_* return codes to errnos
    4ead622f74c9 i3c: master: svc: fix invalidate IBI type and miss call client IBI handler
    08de19f2b7a8 s390/cpacf: Make use of invalid opcode produce a link error
    edaaf1f94e24 s390/cpacf: Split and rework cpacf query functions
    67011123453b s390/ap: Fix crash in AP internal function modify_bitmap()
    681ff9a09acc ext4: fix mb_cache_entry's e_refcnt leak in ext4_xattr_block_cache_find()
    74f234f2b1d8 ext4: set type of ac_groups_linear_remaining to __u32 to avoid overflow
    0b787c79dab9 sparc: move struct termio to asm/termios.h
    eacb8b195579 net: fix __dst_negative_advice() race
    f76fd94ae697 kdb: Use format-specifiers rather than memset() for padding in kdb_read()
    98261a093571 kdb: Merge identical case statements in kdb_read()
    1c214d379191 kdb: Fix console handling when editing and tab-completing commands
    e350d3a6bfb8 kdb: Use format-strings rather than '\0' injection in kdb_read()
    f636a40834d2 kdb: Fix buffer overflow during tab-complete
    3f531c4cb789 watchdog: rti_wdt: Set min_hw_heartbeat_ms to accommodate a safety margin
    40f05fd442ba sparc64: Fix number of online CPUs
    532f40f279dc intel_th: pci: Add Meteor Lake-S CPU support
    89969ffbeb94 net/9p: fix uninit-value in p9_client_rpc()
    c84978d773f3 net/ipv6: Fix route deleting failure when metric equals 0
    3fb4601e0db1 crypto: qat - Fix ADF_DEV_RESET_SYNC memory leak
    8287a9d7d45e crypto: ecrdsa - Fix module auto-load on add_key
    b76d165bb4ad crypto: ecdsa - Fix module auto-load on add-key
    b7e69087b03f KVM: arm64: Allow AArch32 PSTATE.M to be restored as System mode
    511ff49371b9 KVM: arm64: Fix AArch32 register narrowing on userspace write
    421b55ea8497 drm/amdgpu/atomfirmware: add intergrated info v2.3 table
    4b2c67e30b4e fbdev: savage: Handle err return when savagefb_check_var failed
    ef34833373ed mmc: sdhci-acpi: Disable write protect detection on Toshiba WT10-A
    ffb56af9f293 mmc: sdhci-acpi: Fix Lenovo Yoga Tablet 2 Pro 1380 sdcard slot not working
    8280d35cb9ee mmc: sdhci-acpi: Sort DMI quirks alphabetically
    ee89a7d663da mmc: core: Add mmc_gpiod_set_cd_config() function
    4b2be0d3e3ad media: v4l2-core: hold videodev_lock until dev reg, finishes
    e8b445e1578b media: mxl5xx: Move xpt structures off stack
    8149eaddde86 media: mc: mark the media devnode as registered from the, start
    9c414fdb803a arm64: dts: hi3798cv200: fix the size of GICR
    e586ec1890cf wifi: rtlwifi: rtl8192de: Fix endianness issue in RX path
    4437888840d1 wifi: rtlwifi: rtl8192de: Fix low speed with WPA3-SAE
    70787344e5f4 wifi: rtl8xxxu: Fix the TX power of RTL8192CU, RTL8723AU
    098d54934814 md/raid5: fix deadlock that raid5d() wait for itself to clear MD_SB_CHANGE_PENDING
    f085591a871f arm64: dts: qcom: qcs404: fix bluetooth device address
    0778d97bcae6 arm64: tegra: Correct Tegra132 I2C alias
    dc15cd0a8964 ACPI: resource: Do IRQ override on TongFang GXxHRXx and GMxHGxx
    83c4aba920e3 soc: qcom: rpmh-rsc: Enhance check for VRM in-flight request
    2226b145afa5 thermal/drivers/qcom/lmh: Check for SCM availability at probe
    c422e1d407ae ata: pata_legacy: make legacy_exit() work again
    ea906e9ac61e drm/amdgpu: add error handle to avoid out-of-bounds
    526238d32c3a media: lgdt3306a: Add a check against null-pointer-def
    1640dcf383cd f2fs: fix to do sanity check on i_xattr_nid in sanity_check_inode()
    3feac2b55293 sunrpc: exclude from freezer when waiting for requests:
    a89f73ed5630 scripts/gdb: fix SB_* constants parsing
    e9ffc1951302 net: dsa: tag_sja1105: always prefer source port information from INCL_SRCPT
    c23b1a3bdbca net: dsa: sja1105: always enable the INCL_SRCPT option
    21c0fe2dfbbb vxlan: Fix regression when dropping packets due to invalid src addresses
    874aae15fbef mptcp: fix full TCP keep-alive support
    7f8c1cbb7819 Revert "drm/amdgpu: init iommu after amdkfd device init"
    e65ccf3a4de4 nilfs2: fix use-after-free of timer for log writer thread
    f2aca0a2d940 afs: Don't cross .backup mountpoint from backup volume
    88678723cb0b io_uring: fail NOP if non-zero op flags is passed in
    e345538cbc2f mmc: core: Do not force a retune before RPMB switch
    2ac168c67267 drm: Check polling initialized before enabling in drm_helper_probe_single_connector_modes
    786c27982a39 drm: Check output polling initialized before disabling
    b4878ea99f2b SUNRPC: Fix loop termination condition in gss_free_in_token_pages()
    a896c674d512 media: cec: core: add adap_nb_transmit_canceled() callback
    8d49ca19727b net: ena: Fix DMA syncing in XDP path when SWIOTLB is on
    9eeda3e0071a genirq/cpuhotplug, x86/vector: Prevent vector leak during CPU offline
    625872d22f53 KVM: x86: Don't advertise guest.MAXPHYADDR as host.MAXPHYADDR in CPUID
    83f0ba8592b9 ALSA: timer: Set lower bound of start tick time
    9b65598adffa hwmon: (shtc1) Fix property misspelling
    183c4b416454 ipvlan: Dont Use skb->sk in ipvlan_process_v{4,6}_outbound
    2292bfd243ae net: ena: Fix redundant device NUMA node override
    477c137131ec net: ena: Reduce lines with longer column width boundary
    a087d4b502ff net: ena: Add dynamic recycling mechanism for rx buffers
    600e8d0f47f6 net: ena: Do not waste napi skb cache
    cd549bd6cb1e net: ena: Extract recurring driver reset code into a function
    4ad48d7f26bb net: ena: Add capabilities field with support for ENI stats capability
    e5ed2cd0550f spi: stm32: Don't warn about spurious interrupts
    cbd383ebbabe kconfig: fix comparison to constant symbols, 'm', 'n'
    6fe5af4ff06d netfilter: tproxy: bail out if IP has been disabled on the device
    47ef50eb0443 netfilter: nft_payload: skbuff vlan metadata mangle support
    831292373921 netfilter: nft_payload: rebuild vlan header on h_proto access
    ae4053a6d4e3 netfilter: nft_payload: rebuild vlan header when needed
    bf83de0a51f2 netfilter: nft_payload: move struct nft_payload_set definition where it belongs
    b02c55e47e94 net:fec: Add fec_enet_deinit()
    11e8ecc5b860 bpf: Allow delete from sockmap/sockhash only if update is allowed
    a1f34dd7b8bb net: usb: smsc95xx: fix changing LED_SEL bit value updated from EEPROM
    25571a12fbc8 enic: Validate length of nl attributes in enic_set_vf_port
    e5138f43c97d bpf: Fix potential integer overflow in resolve_btfids
    9d75fab2c14a dma-buf/sw-sync: don't enable IRQ from sync_print_obj()
    d523719e7436 net/mlx5e: Use rx_missed_errors instead of rx_dropped for reporting buffer exhaustion
    98f1c6e5d73a net/mlx5e: Fix IPsec tunnel mode offload feature check
    16f0de919100 net: phy: micrel: set soft_reset callback to genphy_soft_reset for KSZ8061
    81f9b2a9a8c5 nvmet: fix ns enable/disable possible hang
    b41b0018e8ca dma-mapping: benchmark: handle NUMA_NO_NODE correctly
    35d31c8bd472 dma-mapping: benchmark: fix node id validation
    314607e65a67 spi: Don't mark message DMA mapped when no transfer in it is
    748cf3c26cfd netfilter: nft_payload: restore vlan q-in-q match support
    25ea5377e3d2 netfilter: nfnetlink_queue: acquire rcu_read_lock() in instance_destroy_rcu()
    5935b9ff690d ice: Interpret .set_channels() input differently
    0f3ced8b4d33 nfc: nci: Fix handling of zero-length payload packets in nci_rx_work()
    6e48baec2e15 nfc: nci: Fix kcov check in nci_rx_work()
    2c260a24cf1c tls: fix missing memory barrier in tls_init
    2cc3da9ae0f4 net: fec: avoid lock evasion when reading pps_enable
    b8d78a7573ff riscv: stacktrace: fixed walk_stackframe()
    aae5f57c43a9 riscv: stacktrace: Make walk_stackframe cross pt_regs frame
    42d30da50d5c virtio: delete vq in vp_find_vqs_msix() when request_irq() fails
    c1929c041a26 arm64: asm-bug: Add .align 2 to the end of __BUG_ENTRY
    6eec23fa6e90 openvswitch: Set the skbuff pkt_type for proper pmtud support.
    8602150286a2 tcp: Fix shift-out-of-bounds in dctcp_update_alpha().
    61d31ac85b45 ipv6: sr: fix memleak in seg6_hmac_init_algo
    518a994aa0b8 af_unix: Update unix_sk(sk)->oob_skb under sk_receive_queue lock.
    39818fbd3e3a rpcrdma: fix handling for RDMA_CM_EVENT_DEVICE_REMOVAL
    e5c34f10534d sunrpc: fix NFSACL RPC retry on soft mount
    61ceeebbd2a0 NFSv4: Fixup smatch warning for ambiguous return
    1c03ea9acb14 ASoC: tas2552: Add TX path for capturing AUDIO-OUT data
    ad4d196d2008 nfc: nci: Fix uninit-value in nci_rx_work
    e8688218e381 ipv6: sr: fix missing sk_buff release in seg6_input_core
    c707bf57a8db net: Always descend into dsa/ folder with CONFIG_NET_DSA enabled
    42952002ec9f x86/kconfig: Select ARCH_WANT_FRAME_POINTERS again when UNWINDER_FRAME_POINTER=y
    dab0d7e67d33 regulator: bd71828: Don't overwrite runtime voltages
    fde10aab8264 ASoC: mediatek: mt8192: fix register configuration for tdm
    4bb60a0ecee3 null_blk: Fix the WARNING: modpost: missing MODULE_DESCRIPTION()
    f86a3b7ce88b media: cec: core: avoid confusing "transmit timed out" message
    b5da8217c000 media: cec: core: avoid recursive cec_claim_log_addrs
    1e2dbdf6ec88 media: cec-adap.c: drop activate_cnt, use state info instead
    1d1d76a69961 media: cec: use call_op and check for !unregistered
    54e5e151eb4f media: cec: correctly pass on reply results
    b945810fe2cb media: cec: abort if the current transmit was canceled
    6f6340dbe60b media: cec: call enable_adap on s_log_addrs
    f0266ee4cd03 media: cec: cec-api: add locking in cec_release()
    2698f28b1d1e media: cec: cec-adap: always cancel work in cec_transmit_msg_fh
    026ea9532a9b um: Fix the -Wmissing-prototypes warning for __switch_mm
    97e1f40f9f51 powerpc/pseries: Add failure related checks for h_get_mpp and h_get_ppp
    c94e77516fc3 media: flexcop-usb: fix sanity check of bNumEndpoints
    061057a94997 media: flexcop-usb: clean up endpoint sanity checks
    f99809fdeb50 Input: cyapa - add missing input core locking to suspend/resume functions
    124b0afdd17c scsi: qla2xxx: Replace all non-returning strlcpy() with strscpy()
    7532bcec0797 media: stk1160: fix bounds checking in stk1160_copy_video()
    6721557404cf drm/bridge: tc358775: fix support for jeida-18 and jeida-24
    a2de301d90b7 fs/ntfs3: Use variable length array instead of fixed size
    2d1ad595d15f fs/ntfs3: Use 64 bit variable to avoid 32 bit overflow
    90bfce05a370 um: vector: fix bpfflash parameter evaluation
    31960d991e43 um: Add winch to winch_handlers before registering winch IRQ
    78863940745f um: Fix return value in ubd_init()
    0854c0efd383 drm/msm/dpu: Always flush the slave INTF on the CTL
    912f8385ebfc drm/msm/dsi: Print dual-DSI-adjusted pclk instead of original mode pclk
    a992b28aa265 Input: pm8xxx-vibrator - correct VIB_MAX_LEVELS calculation
    ccdc1b2baa36 mmc: sdhci_am654: Fix ITAPDLY for HS400 timing
    a2ffc95f2c9e mmc: sdhci_am654: Add ITAPDLYSEL in sdhci_j721e_4bit_set_clock
    81360e7fdc3c mmc: sdhci_am654: Add OTAP/ITAP delay enable
    21deb1a72279 mmc: sdhci_am654: Drop lookup for deprecated ti,otap-del-sel
    e5eefc47c934 mmc: sdhci_am654: Write ITAPDLY for DDR52 timing
    b2d13473d091 mmc: sdhci_am654: Add tuning algorithm for delay chain
    f23f82b42556 Input: ioc3kbd - add device table
    369d8da0185b Input: ioc3kbd - convert to platform remove callback returning void
    13e975b09b1e Input: ims-pcu - fix printf string overflow
    e1e40928b78b s390/boot: Remove alt_stfle_fac_list from decompressor
    3a091c2010aa s390/ipl: Fix incorrect initialization of nvme dump block
    79e71379f3a2 s390/ipl: Fix incorrect initialization of len fields in nvme reipl block
    cede8ab8528f s390/vdso: Use standard stack frame layout
    24d50b7148b2 s390/vdso: Generate unwind information for C modules
    ddfd7ca99e7c s390/vdso64: filter out munaligned-symbols flag for vdso
    1bc9dd3aea45 s390/vdso: filter out mno-pic-data-is-text-relative cflag
    6dbeee1608ea libsubcmd: Fix parse-options memory leak
    b28bdc96074b serial: sh-sci: protect invalidating RXDMA on shutdown
    8acae0472150 f2fs: compress: don't allow unaligned truncation on released compress inode
    3109022d9fb4 f2fs: fix to release node block count in error path of f2fs_new_node_page()
    b5bac43875aa f2fs: compress: fix to cover {reserve,release}_compress_blocks() w/ cp_rwsem lock
    8a8b95be1649 PCI/EDR: Align EDR_PORT_LOCATE_DSM with PCI Firmware r3.3
    44568a390006 PCI/EDR: Align EDR_PORT_DPC_ENABLE_DSM with PCI Firmware r3.3
    d3c257aa1bc0 extcon: max8997: select IRQ_DOMAIN instead of depending on it
    b65d0410b879 ppdev: Add an error check in register_device
    5276c9d90df7 ppdev: Remove usage of the deprecated ida_simple_xx() API
    7419df1acffb stm class: Fix a double free in stm_register_device()
    170b600e5cc3 usb: gadget: u_audio: Clear uac pointer when freed.
    b17f6f448b13 watchdog: bd9576: Drop "always-running" property
    a87a838c6835 watchdog: bd9576_wdt: switch to using devm_fwnode_gpiod_get()
    0a1c804cf250 dt-bindings: pinctrl: mediatek: mt7622: fix array properties
    e1768962f1ac microblaze: Remove early printk call from cpuinfo-static.c
    ee0cb15a1405 microblaze: Remove gcc flag for non existing early_printk.c file
    9b4eee8572dc fpga: region: add owner module and take its refcount
    33c213cdfc62 fpga: region: Use standard dev_release for class driver
    194e0455273c coresight: etm4x: Fix access to resource selector registers
    4bc3921911e3 coresight: etm4x: Safe access for TRCQCLTR
    e1eb887d81b7 coresight: etm4x: Cleanup TRCIDR0 register accesses
    4d166858650d coresight: no-op refactor to make INSTP0 check more idiomatic
    355144530b74 coresight: etm4x: Do not save/restore Data trace control registers
    ee5f0eca94b8 coresight: etm4x: Do not hardcode IOMEM access for register restore
    f437c761fc8a iio: pressure: dps310: support negative temperature values
    39c2c97507c8 coresight: etm4x: Fix unbalanced pm_runtime_enable()
    919f899a2207 f2fs: fix to check pinfile flag in f2fs_move_file_range()
    2623fae7e769 f2fs: fix to relocate check condition in f2fs_fallocate()
    71486c10c550 f2fs: fix typos in comments
    603c0c3a83fc f2fs: do not allow partial truncation on pinned file
    4f0750bf8a33 f2fs: compress: fix to relocate check condition in f2fs_ioc_{,de}compress_file()
    4eb2124f453a f2fs: convert to use sbi directly
    84908c23a90e f2fs: compress: fix to relocate check condition in f2fs_{release,reserve}_compress_blocks()
    eeabb84d796e dt-bindings: PCI: rcar-pci-host: Add missing IOMMU properties
    b8e68dbc490a dt-bindings: PCI: rcar-pci-host: Add optional regulators
    703fd706fc14 serial: sc16is7xx: add proper sched.h include for sched_set_fifo()
    dcf811e15ae2 PCI: tegra194: Fix probe path for Endpoint mode
    088139c9d36d greybus: arche-ctrl: move device table to its right location
    b0008a4c83a6 serial: max3100: Fix bitwise types
    361a92c9038e serial: max3100: Update uart_driver_registered on driver removal
    78dbda51bb42 serial: max3100: Lock port->lock when calling uart_handle_cts_change()
    5786b3696110 firmware: dmi-id: add a release callback function
    6bc7423ffdab dmaengine: idma64: Add check for dma_set_max_seg_size
    902f6d656441 soundwire: cadence: fix invalid PDI offset
    a762959a6f43 f2fs: fix to wait on page writeback in __clone_blkaddrs()
    aaac91468f5b f2fs: Delete f2fs_copy_page() and replace with memcpy_page()
    330f6bcdcef0 greybus: lights: check return of get_channel_from_mode
    c002914c0ac9 sched/core: Fix incorrect initialization of the 'burst' parameter in cpu_max_write()
    cc1e9513c180 sched/fair: Allow disabling sched_balance_newidle with sched_relax_domain_level
    c335ad738f52 af_packet: do not call packet_read_pending() from tpacket_destruct_skb()
    421c50fa8183 netrom: fix possible dead-lock in nr_rt_ioctl()
    eaa53a28b74b net: qrtr: ns: Fix module refcnt
    d449edd8063e selftests: net: bridge: increase IGMP/MLD exclude timeout membership interval
    ca759d47ec49 RDMA/IPoIB: Fix format truncation compilation errors
    099750e9d950 selftests/kcmp: remove unused open mode
    e26259f7e754 selftests/kcmp: Make the test output consistent and clear
    fe0b474974fe SUNRPC: Fix gss_free_in_token_pages()
    3ae762f26b67 ext4: fix potential unnitialized variable
    5267b649a956 ext4: remove unused parameter from ext4_mb_new_blocks_simple()
    778b1ac4d672 ext4: try all groups in ext4_mb_new_blocks_simple
    2b9310a99d5b ext4: fix unit mismatch in ext4_mb_new_blocks_simple
    db26ff923faa ext4: simplify calculation of blkoff in ext4_mb_new_blocks_simple
    33feac2e8df3 sunrpc: removed redundant procp check
    5c6705aa47b5 drivers/virt/acrn: fix PFNMAP PTE checks in acrn_vm_ram_map()
    5283ac5e0788 virt: acrn: stop using follow_pfn
    af453dfb4516 virt: acrn: Prefer array_size and struct_size over open coded arithmetic
    239a1dfaaf9b ext4: avoid excessive credit estimate in ext4_tmpfile()
    69db696bdb74 x86/insn: Fix PUSH instruction in x86 instruction decoder opcode map
    08d1c49bfa58 clk: qcom: mmcc-msm8998: fix venus clock issue
    cc699b7eb2bc RDMA/hns: Modify the print level of CQE error
    4d5b155cd495 RDMA/hns: Use complete parentheses in macros
    fc6342d4f082 RDMA/hns: Fix GMV table pagesize
    4a3be1a0ffe0 RDMA/hns: Fix deadlock on SRQ async events.
    ed159691a29c RDMA/hns: Fix return value in hns_roce_map_mr_sg
    f0b2483d45be RDMA/mlx5: Adding remote atomic access flag to updatable flags
    74a9b48bc53c drm/mipi-dsi: use correct return type for the DSC functions
    910594fe9208 drm/panel: simple: Add missing Innolux G121X1-L03 format, flags, connector
    6b887596b6d9 drm/bridge: tc358775: Don't log an error when DSI host can't be found
    078192c48473 drm/bridge: lt9611: Don't log an error when DSI host can't be found
    fb444706ff8c drm/bridge: lt8912b: Don't log an error when DSI host can't be found
    7b94000a8cd1 ASoC: tracing: Export SND_SOC_DAPM_DIR_OUT to its value
    6cf1874aec42 drm: vc4: Fix possible null pointer dereference
    3e54d4e95120 drm/arm/malidp: fix a possible null pointer dereference
    82c2c85aead3 media: atomisp: ssh_css: Fix a null-pointer dereference in load_video_binaries
    f709129f82c2 fbdev: sh7760fb: allow modular build
    5f61df672368 media: dt-bindings: ovti,ov2680: Fix the power supply names
    da8608cf2e5b media: ipu3-cio2: Request IRQ earlier
    04e8b87339d0 media: ipu3-cio2: Use temporary storage for struct device pointer
    89788cd9824c drm: bridge: cdns-mhdp8546: Fix possible null pointer dereference
    3770a54a0867 media: radio-shark2: Avoid led_names truncations
    5a0736545151 media: ngene: Add dvb_ca_en50221_init return value check
    916143cff84f fbdev: sisfb: hide unused variables
    1db23928d6ef powerpc/fsl-soc: hide unused const variable
    0e3b6f912372 drm/mediatek: Add 0 size check to mtk_drm_gem_obj
    eb1caaa00e75 drm/meson: vclk: fix calculation of 59.94 fractional rates
    d48d0c5fd733 ASoC: kirkwood: Fix potential NULL dereference
    22509899d56d fbdev: shmobile: fix snprintf truncation
    99bc9199de86 mtd: rawnand: hynix: fixed typo
    96725324ef44 mtd: core: Report error if first mtd_otp_size() call fails in mtd_otp_nvmem_add()
    58374345112a ASoC: Intel: Disable route checks for Skylake boards
    ced9c4e2289a drm/amd/display: Fix potential index out of bounds in color transformation function
    5391368a87bd dev_printk: Add and use dev_no_printk()
    6558872aa04a printk: Let no_printk() use _printk()
    21ca029e23ea mptcp: SO_KEEPALIVE: fix getsockopt support
    16da7f772837 s390/bpf: Emit a barrier for BPF_FETCH instructions
    3cb92b0ad73d net/mlx5: Discard command completions in internal error
    1a63730fb315 ipv6: sr: fix invalid unregister error path
    17e99ea1313b ipv6: sr: fix incorrect unregister order
    bc1b9c255bf2 ipv6: sr: add missing seg6_local_exit
    483eb70f441e net: openvswitch: fix overwriting ct original tuple for ICMPv6
    14f28fd93245 net: usb: smsc95xx: stop lying about skb->truesize
    9aa8773abfa0 af_unix: Fix data races in unix_release_sock/unix_stream_sendmsg
    4cca12e15a22 net: ethernet: cortina: Locking fixes
    fbeeb55dbb33 eth: sungem: remove .ndo_poll_controller to avoid deadlocks
    fb724a948d23 net: ipv6: fix wrong start position when receive hop-by-hop fragment
    48629bdb39e2 m68k: mac: Fix reboot hang on Mac IIci
    77b2b67a0f8b m68k: Fix spinlock race in kernel thread creation
    1119da6a72b7 net: usb: sr9700: stop lying about skb->truesize
    097a9a015b4f usb: aqc111: stop lying about skb->truesize
    0488f7bcac2c wifi: mwl8k: initialize cmd->addr[] properly
    37c82d000270 scsi: qla2xxx: Fix debugfs output for fw_resource_count
    dccd97b39ab2 scsi: qedf: Ensure the copied buf is NUL terminated
    1708e3cf2488 scsi: bfa: Ensure the copied buf is NUL terminated
    3dfc214de694 HID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectors
    44d7f481da7e selftests/resctrl: fix clang build failure: use LOCAL_HDRS
    0af9e305f1c2 selftests/binderfs: use the Makefile's rules, not Make's implicit rules
    1e6a56726699 Revert "sh: Handle calling csum_partial with misaligned data"
    50e409546001 sh: kprobes: Merge arch_copy_kprobe() into arch_prepare_kprobe()
    b4c24de37a6b wifi: ar5523: enable proper endpoint verification
    6a9892bf24c9 wifi: carl9170: add a proper sanity check for endpoints
    010d4cb19bb1 macintosh/via-macii: Fix "BUG: sleeping function called from invalid context"
    7075faa7544f net: give more chances to rcu in netdev_wait_allrefs_any()
    822c8bb7b9b0 pwm: sti: Simplify probe function using devm functions
    1370b265cdb2 pwm: sti: Prepare removing pwm_chip from driver data
    2da4e80a6791 pwm: sti: Convert to platform remove callback returning void
    05c6b7473427 tcp: avoid premature drops in tcp_add_backlog()
    e040b08648d5 net: dsa: mv88e6xxx: Avoid EEPROM timeout without EEPROM on 88E6250-family switches
    25479712dab1 net: dsa: mv88e6xxx: Add support for model-specific pre- and post-reset handlers
    719dac9679fa wifi: ath10k: populate board data for WCN3990
    2142fc035872 wifi: ath10k: Fix an error code problem in ath10k_dbg_sta_write_peer_debug_trigger()
    27600e0c5272 thermal/drivers/tsens: Fix null pointer dereference
    89e2d5f29a36 x86/purgatory: Switch to the position-independent small code model
    83d460c9f4e4 scsi: hpsa: Fix allocation size for Scsi_Host private data
    a3f5c4404a46 scsi: libsas: Fix the failure of adding phy with zero-address to port
    9a185cc5a79b cppc_cpufreq: Fix possible null pointer dereference
    65cbcec7db54 udp: Avoid call to compute_score on multiple sites
    547c22f28cd7 net: remove duplicate reuseport_lookup functions
    284f738be643 net: export inet_lookup_reuseport and inet6_lookup_reuseport
    35db5e76d5e9 cpufreq: exit() callback is optional
    43b27f9714bd cpufreq: Rearrange locking in cpufreq_remove_dev()
    f0773bd7cab4 cpufreq: Split cpufreq_offline()
    4b29dd145a06 cpufreq: Reorganize checks in cpufreq_offline()
    83ca1efe5044 selftests/bpf: Fix umount cgroup2 error in test_sockmap
    d09a8f2d3004 gfs2: Fix "ignore unlock failures after withdraw"
    1fa360d7441b gfs2: Don't forget to complete delayed withdraw
    d582bb39e0e3 ACPI: disable -Wstringop-truncation
    96c44901df31 irqchip/loongson-pch-msi: Fix off-by-one on allocation error path
    e434ddd1da70 irqchip/alpine-msi: Fix off-by-one in allocation error path
    f98c6fd4ec2b scsi: ufs: core: Perform read back after disabling UIC_COMMAND_COMPL
    64875204247f scsi: ufs: core: Perform read back after disabling interrupts
    dd33e64e50de scsi: ufs: cdns-pltfrm: Perform read back after writing HCLKDIV
    dca83b9fd190 scsi: ufs: qcom: Perform read back after writing CGC enable
    8a4a516a7fdd scsi: ufs: qcom: Perform read back after writing unipro mode
    49edc54dd9b3 scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW version major 5
    f1f8d2978805 scsi: ufs: ufs-qcom: Fix the Qcom register name for offset 0xD0
    52ac441ca7c9 scsi: ufs: qcom: Perform read back after writing REG_UFS_SYS1CLK_1US
    a765a56392af scsi: ufs: qcom: Perform read back after writing reset bit
    f654b258e9fa bpf: Pack struct bpf_fib_lookup
    1a82569ea51a qed: avoid truncating work queue length
    97f0f81eca30 sched/fair: Add EAS checks before updating root_domain::overutilized
    8a1f57539db4 x86/boot: Ignore relocations in .notes sections in walk_relocs() too
    b47b7640ea4c wifi: ath10k: poll service ready message before failing
    69296914bfd5 md: fix resync softlockup when bitmap size is less than array size
    54f39d56d6bf null_blk: Fix missing mutex_destroy() at module removal
    3355628ed097 soc: mediatek: cmdq: Fix typo of CMDQ_JUMP_RELATIVE
    a1d21bcd78cf jffs2: prevent xattr node from overflowing the eraseblock
    ff5dbd6a74ff s390/cio: fix tracepoint subchannel type field
    cc1e53c7f77d crypto: x86/sha512-avx2 - add missing vzeroupper
    7bce9cd3da5a crypto: x86/sha256-avx2 - add missing vzeroupper
    d15b50f2ef6b crypto: x86/nh-avx2 - add missing vzeroupper
    b975277e6d7b crypto: ccp - drop platform ifdef checks
    4e56db565120 parisc: add missing export of __cmpxchg_u8()
    669ed3c1ea2d nilfs2: fix out-of-range warning
    12db25a54ce6 ecryptfs: Fix buffer size for tag 66 packet
    eb6d925fe70c firmware: raspberrypi: Use correct device for DMA mappings
    d19ba2e3f5e7 mm/slub, kunit: Use inverted data to corrupt kmem cache
    c69a1e4b419c crypto: bcm - Fix pointer arithmetic
    2be75d2a8d26 openpromfs: finish conversion to the new mount API
    cbfd1088e24e epoll: be better about file lifetimes
    92de16aeca0e nvme: find numa distance only if controller has valid numa id
    e1e4e33df597 x86/mm: Remove broken vsyscall emulation code from the page fault code
    8f11f991f221 drm/amdkfd: Flush the process wq before creating a kfd_process
    77fb5cbe0228 ASoC: da7219-aad: fix usage of device_get_named_child_node()
    19ef439df2a6 softirq: Fix suspicious RCU usage in __do_softirq()
    1d3ff18aeee5 ASoC: rt715-sdca: volume step modification
    5b49e8195f9a ASoC: rt715: add vendor clear control register
    5b4d0d839995 regulator: vqmmc-ipq4019: fix module autoloading
    a06efd8ab975 ASoC: dt-bindings: rt5645: add cbj sleeve gpio property
    f8324c4c3555 ASoC: rt5645: Fix the electric noise due to the CBJ contacts floating
    ab859797e4b8 regulator: irq_helpers: duplicate IRQ name
    621cf1de2d23 selftests: sud_test: return correct emulated syscall value on RISC-V
    3218fd551406 drm/amd/display: Set color_mgmt_changed to true on unsuspend
    c26b6683703b net: usb: qmi_wwan: add Telit FN920C04 compositions
    551b1c385009 dt-bindings: rockchip: grf: Add missing type to 'pcie-phy' node
    a88b42393ab8 wifi: cfg80211: fix the order of arguments for trace events of the tx_rx_evt class
    ff80185e7b7b ALSA: Fix deadlocks with kctl removals at disconnection
    e7e0ca200772 ALSA: core: Fix NULL module pointer assignment at card init
    98740ae2b361 fs/ntfs3: Break dir enumeration if directory contents error
    562c86caed68 fs/ntfs3: Fix case when index is reused during tree transformation
    7ab0c256964e fs/ntfs3: Taking DOS names into account during link counting
    4a8cd11d8538 fs/ntfs3: Remove max link count info display during driver init
    06afce714d87 nilfs2: fix potential hang in nilfs_detach_log_writer()
    257d6c90dc38 nilfs2: fix unexpected freezing of nilfs_segctor_sync()
    e6062c494b93 net: smc91x: Fix m68k kernel compilation for ColdFire CPU
    f3a1efd98ba2 tools/latency-collector: Fix -Wformat-security compile warns
    595363182f28 ring-buffer: Fix a race between readers and resize checks
    b6d21cf40de1 r8169: Fix possible ring buffer corruption on fragmented Tx packets.
    528a620c1397 Revert "r8169: don't try to disable interrupts if NAPI is, scheduled already"
    3adc11febf5a serial: 8250_bcm7271: use default_mux_rate if possible
    504178fb7d9f speakup: Fix sizeof() vs ARRAY_SIZE() bug
    ab1e76993c2a tty: n_gsm: fix missing receive state reset after mode switch
    4c267110fc11 tty: n_gsm: fix possible out-of-bounds in gsm0_receive()
    bdd621ccc993 x86/tsc: Trust initial offset in architectural TSC-adjust MSRs
    b8086c3c1548 reiserfs: Avoid touching renamed directory if parent does not change
    ea091017ef62 ipv6: Fix data races around sk->sk_prot.
    ff8710da80ee ipv6: annotate some data-races around sk->sk_prot
    e8c2eafaaa6a tcp: Fix data races around icsk->icsk_af_ops.
    8d1bab770956 locking/rwsem: Disable preemption while trying for rwsem lock
    7c82dac02886 block, loop: support partitions without scanning
    45f504f301d4 bpftool: Fix pretty print dump for maps without BTF loaded
    1f24338cb789 jbd2: Drop the merge conflicted hunk
    e1d0e3c51bde tpm: tis_i2c: Limit write bursts to I2C_SMBUS_BLOCK_MAX (32) bytes
    1abe841fe331 tpm: tis_i2c: Limit read bursts to I2C_SMBUS_BLOCK_MAX (32) bytes
    6224acfc1d56 tpm: Add flag to use default cancellation policy
    1cd19d48fb90 tpm: tis_i2c: Fix sanity check interrupt enable mask
    a883da132fa8 tpm: Add tpm_tis_i2c backend for tpm_tis_core
    a742ac8a1c51 tpm: Add tpm_tis_verify_crc to the tpm_tis_phy_ops protocol layer
    ef495c5f45f2 tpm: Remove read16/read32/write32 calls from tpm_tis_phy_ops
    1f3be2e23aa6 gcc-plugins: Reorganize gimple includes for GCC 13
    24615a3b932a ata: ahci: fix enum constants for gcc-13
    5d6cb145541a net: stmmac: Enable mac_managed_pm phylink config
    fd93aabb4287 tools/resolve_btfids: Use pkg-config to locate libelf
    130f9da78406 tools/resolve_btfids: Build with host flags
    00f2f1a782f9 tools/resolve_btfids: Support cross-building the kernel with clang
    17776a4ba9c2 tools/resolve_btfids: Install libbpf headers when building
    7c9808380d70 libbpf: Make libbpf_version.h non-auto-generated
    37ae1ba791ac libbpf: Add LIBBPF_DEPRECATED_SINCE macro for scheduling API deprecations
    a2667e6d7314 drm/radeon: free iio for atombios when driver shutdown
    f100c753aa1f powerpc: Fix reschedule bug in KUAP-unlocked user copy
    da5513f30187 libbpf: Fix build warning on ref_ctr_off
    4c5a089621a8 perf python: Account for multiple words in CC
    1c5699ee85d4 fs: move S_ISGID stripping into the vfs_*() helpers
    838f5d0701d8 fs: add mode_strip_sgid() helper
    d97172683641 squashfs: provide backing_dev_info in order to disable read-ahead
    ed037d7be40c irq_work: use kasan_record_aux_stack_noalloc() record callstack
    1363bd7dbde3 ixgbevf: add disable link state
    e5601ae2bd24 ixgbe: add improvement for MDD response functionality
    caa57cd80575 ixgbe: add the ability for the PF to disable VF link state
    16a77bfcc7df Check /dev/console using init_stat()
    04574fd5579a tracing/arm: Have max stack tracer handle the case of return address after data
    0e51e5717018 gpiolib: cdev: Set lineevent_state::irq after IRQ register successfully
    1e6b7da6ddba drivers/base: Fix unsigned comparison to -1 in CPUMAP_FILE_MAX_BYTES
    493160901320 mtd_blkdevs: add mtd_table_mutex lock back to blktrans_{open, release} to avoid race condition
    04224f725aa3 irqchip/gic-v3-its: Skip HP notifier when no ITS is registered
    6f6c2996a81c irqchip/gic-v3-its: Postpone LPI pending table freeing and memreserve
    1fa94473423f irqchip/gic-v3-its: Give the percpu rdist struct its own flags field
    6013d1ae5feb cert host tools: Stop complaining about deprecated OpenSSL functions
    efe20512212b init/Kconfig: fix CC_HAS_ASM_GOTO_TIED_OUTPUT test with dash
    a40d2daf2795 pnmtologo: use relocatable file name
    3b40d5b41155 of: configfs: remove unused variable overlay_lock
    6c085baf1838 tools: use basename to identify file in gen-mach-types
    2fca0fd71981 lib/build_OID_registry: fix reproducibility issues
    0f586f4ee8ad vt/conmakehash: improve reproducibility
    a75774679f28 OF: DT-Overlay configfs interface (v8)
    d179c639b30b x86/boot: Wrap literal addresses in absolute_pointer()
    856ec356cf91 ACPI: thermal: drop an always true check
    7614af249993 xfs: Fix -Werror=dangling-pointer work-around for older GCC
    41470215f97e xfs: Work around GCC 12 -Werror=dangling-pointer for xfs_attr_remote.o
    44a445c1922d virtio-pci: Remove wrong address verification in vp_del_vqs()
    77aa9e489eaf bpf: Disallow unprivileged bpf by default
    ebfb1822e9f9 fs/aufs: fixup 5.15.36 fixups
    4eba9348d3e2 Revert "Revert "fbdev: Hot-unplug firmware fb devices on forced removal""
    5df6d1b00f95 jbd2: fix use-after-free of transaction_t race
    2d83e8196487 jbd2: refactor wait logic for transaction updates into a common function
    07a63f760793 netfilter: conntrack: avoid useless indirection during conntrack destruction
    4e7122625996 Revert "fbdev: Hot-unplug firmware fb devices on forced removal"
    7ba4cb36fd4f rcu: Avoid alloc_pages() when recording stack
    f78574dee71e kasan: test: silence intentional read overflow warnings
    d313cb89b6b1 kasan: arm64: fix pcpu_page_first_chunk crash with KASAN_VMALLOC
    5e279d5647cc arm64: support page mapping percpu first chunk allocator
    e5bf16752dca vmalloc: choose a better start address in vm_area_register_early()
    660b3d21b46f kasan: test: bypass __alloc_size checks
    00aa7573e53a kasan: test: add memcpy test that avoids out-of-bounds write
    67becf0b1bd4 kasan: fix tag for large allocations when using CONFIG_SLAB
    bedf1e033213 workqueue, kasan: avoid alloc_pages() when recording stack
    7195b67ce69b kasan: generic: introduce kasan_record_aux_stack_noalloc()
    bdff763f0e29 kasan: common: provide can_alloc in kasan_save_stack()
    51423ebb36ad lib/stackdepot: introduce __stack_depot_save()
    85373e66d847 lib/stackdepot: remove unused function argument
    5b6cc9b251f3 lib/stackdepot: include gfp.h
    c9f3902d8069 aufs: reduce overhead for "code present but disabled" use case.
    b98d189df02c aufs: bugfix, umount passes NULL to ->parse_monolithic()
    13b883cbbbd9 aufs standalone: cosmetic, missing copyright sentence
    21f8b0d81898 aufs: 5.15.5-20220117 ---> 5.15.5-20220221
    6199fd896645 aufs: tiny, headers after fs_context
    8ddb40e31c29 aufs: fs_context 7/7, finally remount
    69035f71c6fd aufs: fs_context 6/7, now mount
    bc841b970697 aufs: fs_context 5/7, parse all other mount options
    435188053da2 aufs: fs_context 4/7, parse xino options
    9af1f1825cbd aufs: fs_context 3/7, parse the branch-management options
    1c05eb767f8c aufs: fs_context 2/7, parse "br" mount option
    a8488f603134 aufs: fs_context 1/7, skelton of the new shceme
    8e32e0015564 aufs: pre fs_context, convert a static flag to a macro
    f90cb4144aec aufs: pre fs_context, support the incomplete sb and sbinfo case
    948762ef859c aufs: pre fs_context, convert the type of alloc_sbinfo()
    77151a08776b aufs: 5.15.5-20211129 ---> 5.15.5-20220117
    2539adbbbe1e aufs: 5.14-20211018 ---> 5.15.5-20211129
    7d32b25193c4 aufs: for v5.15-rc1, sync_inode() is gone
    66ec0c509225 aufs: for v5.15-rc1, new param 'rcu' for ->get_acl()
    69709dc518cd aufs: for v5.15-rc1, no mand-lock anymore
    ada8fe9543e5 aufs: 5.14-20210906  ---> 5.14-20211018
    b77f7f3f394a Revert "aufs: adjust to v5.15 fs changes"
    81bdce5b5876 tick/nohz: WARN_ON --> WARN_ON_ONCE to prevent console saturation
    97c963889222 sched/isolation: really align nohz_full with rcu_nocbs
    871f23ad3627 Revert "ARM: defconfig: Enable ax88796c driver for Exynos boards"
    ffad0783dd5b ARM: config: multi v7: Regenerate defconifg
    5c1e1a1ff2d3 ARM: config: multi v7: Add renamed symbols
    badaf96564fe ARM: config: multi v7: Clean up enabled by default options
    34996040fc9b ARM: config: multi v7: Drop unavailable options
    7f685244afb3 powerpc/mm: Switch obsolete dssall to .long
    20301aeb1a64 riscv: fix build with binutils 2.38
    9df58d070506 powerpc/lib/sstep: fix 'ptesync' build error
    720b61fc400b x86_64_defconfig: Fix warnings
    02bf23d26bc4 arm64: defconfig: cleanup config options
    05914e2c87e5 arm: defconfig: drop unused POWER_AVS option
    ffb532fa19b9 aufs5: fix build against v5.15.3+
    a4b3abf4d96d qemux86: add configuration symbol to select values
    fee94ee09154 clear_warn_once: add a clear_warn_once= boot parameter
    3d8762d900d9 clear_warn_once: bind a timer to written reset value
    95faacac47e8 clear_warn_once: expand debugfs to include read support
    de20c4240018 perf: perf can not parser the backtrace of app in the 32bit system and 64bit kernel.
    0e4aacead9c1 perf: x86-32: explicitly include <errno.h>
    9ad92c11468e perf: mips64: Convert __u64 to unsigned long long
    09e7efe3e68a perf: fix bench numa compilation
    e79becc44fa6 perf: add SLANG_INC for slang.h
    b1033b588681 perf: add sgidefs.h to for mips builds
    cf9db484ac0b perf: change --root to --prefix for python install
    7fd052c2c562 perf: add 'libperl not found' warning
    27a437cdd469 perf: force include of <stdbool.h>
    3b99d21bec2f fat: don't use obsolete random32 call in namei_vfat
    a7e9293b506b FAT: Added FAT_NO_83NAME
    6fd0e71d9e5c FAT: Add CONFIG_VFAT_NO_CREATE_WITH_LONGNAMES option
    c379b0d324ae FAT: Add CONFIG_VFAT_FS_NO_DUALNAMES option
    538be0fdb124 aufs: adjust to v5.15 fs changes
    f45da75c8759 aufs5: core
    047f57e07e01 aufs5: standalone
    029fc15574c8 aufs5: mmap
    610d0192ee94 aufs5: base
    d4e428d0ec5f aufs5: kbuild
    eb067eca251a yaffs: replace IS_ERR with IS_ERR_OR_NULL to check both ERR and NULL
    286af18d0875 yaffs: fix -Wstringop-overread compile warning in yaffs_fix_null_name
    24d59a4e26a6 yaffs2: v5.12+ build fixups (not runtime tested)
    22c73536d5d7 yaffs: include blkdev.h
    506b7251bfb8 yaffs: fix misplaced variable declaration
    a0e26ff364dc yaffs2: v5.6 build fixups
    b10b1b2d169e yaffs2: fix memory leak when /proc/yaffs is read
    ad9adccbb214 yaffs: add strict check when call yaffs_internal_read_super
    2e3c3aec8279 yaffs: repair yaffs_get_mtd_device
    d662538516a7 yaffs: Fix build failure by handling inode i_version with proper atomic API
    70a6113ee2c7 yaffs2: fix memory leak in mount/umount
    3378e4a9e404 yaffs: Avoid setting any ACL releated xattr
    ec2284edddef Yaffs:check oob size before auto selecting Yaffs1
    c2a49874051c fs: yaffs2: replace CURRENT_TIME by other appropriate apis
    e9a5105a3e73 yaffs2: adjust to proper location of MS_RDONLY
    608807406f13 yaffs2: import git revision b4ce1bb (jan, 2020)
    89e660ece42c initramfs: allow an optional wrapper script around initramfs generation
    b179dbc9aa10 iwlwifi: select MAC80211_LEDS conditionally
    3fd5ca3673d0 net/dccp: make it depend on CONFIG_BROKEN (CVE-2020-16119)
    d1f6edbf0188 arm64/perf: Fix wrong cast that may cause wrong truncation
    d202fb2caf33 defconfigs: drop obselete options
    9a27e3b5f4e7 arm64/perf: fix backtrace for AAPCS with FP enabled
    e20d8cf019b4 linux-yocto: Handle /bin/awk issues
    b6d2a3dbbd3a uvesafb: provide option to specify timeout for task completion
    adb40f1e6a1a uvesafb: print error message when task timeout occurs
    f280a1ed0962 compiler.h: Undef before redefining __attribute_const__
    4352732f268c vmware: include jiffies.h
    7954a677968d Resolve jiffies wrapping about arp
    5f28a1035d95 nfs: Allow default io size to be configured.
    0d7260ad7106 check console device file on fs when booting
    900a12e37e0a mount_root: clarify error messages for when no rootfs found
    7b878cbea726 menuconfig,mconf-cfg: Allow specification of ncurses location
    6604fc1763b3 modpost: mask trivial warnings
    0d294adb09cb kbuild: exclude meta directory from distclean processing
    a097cdd95a9e powerpc: serialize image targets
    5db6ec39a0a3 arm: serialize build targets
    cbabca27905e crtsavres: fixups for 5.4+
    7fc7656ed403 powerpc/ptrace: Disable array-bounds warning with gcc8
    a5faac5a19a2 powerpc: Disable attribute-alias warnings from gcc8
    186c54665b67 powerpc: add crtsavres.o to archprepare for kbuild
    d1ea862964ca powerpc: kexec fix for powerpc64
    2ac35b89a0f9 powerpc: Add unwind information for SPE registers of E500 core
    2e1c348a28bb mips: vdso: fix 'jalr $t9' crash in vdso code
    ec57870b303a mips: Kconfig: add QEMUMIPS64 option
    6a81b3c08107 4kc cache tlb hazard: tlbp cache coherency
    74e3b2a21e54 malta uhci quirks: make allowance for slow 4k(e)c
    22e65b63d3b4 arm/Makefile: Fix systemtap
    b7f1ab59f19e vexpress: Pass LOADADDR to Makefile
    ce2800c73bf7 arm: ARM EABI socketcall
    019d142fd956 ARM: LPAE: Invalidate the TLB for module addresses during translation fault

(From OE-Core rev: 9b280f895ebd395c3dcfb403efae06674394eaa7)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-08 09:03:46 -07:00
Bruce Ashfield
7397fefc2f linux-yocto/5.15: update to v5.15.160
Updating linux-yocto/5.15 to the latest korg -stable release that comprises
the following commits:

    c61bd26ae81a Linux 5.15.160
    0df819cac13e docs: kernel_include.py: Cope with docutils 0.21
    1786e0c96af1 admin-guide/hw-vuln/core-scheduling: fix return type of PR_SCHED_CORE_GET
    96f650995c70 KEYS: trusted: Do not use WARN when encode fails
    00548ac6b144 remoteproc: mediatek: Make sure IPI buffer fits in L2TCM
    da6504c63f78 serial: kgdboc: Fix NMI-safety problems from keyboard reset code
    1768f29972cd usb: typec: ucsi: displayport: Fix potential deadlock
    ddbcd7d36e38 binder: fix max_thread type inconsistency
    7e6d6f27522b drm/amdgpu: Fix possible NULL dereference in amdgpu_ras_query_error_status_helper()
    c9f2b6d88e65 KVM: x86: Clear "has_error_code", not "error_code", for RM exception injection
    2750d7641d08 netlink: annotate data-races around sk->sk_err
    7cff4103be7c netlink: annotate lockless accesses to nlk->max_recvmsg_len
    3ade391adc58 net: tls: handle backlogging of crypto requests
    f17d21ea7391 tls: fix race between async notify and socket close
    94afddde1e92 net: tls: factor out tls_*crypt_async_wait()
    fb782814bf09 tls: extract context alloc/initialization out of tls_set_sw_offload
    704402f913b8 tls: rx: simplify async wait
    cc4fac519d28 net: bcmgenet: synchronize UMAC_CMD access
    1d5d18efc181 net: bcmgenet: synchronize EXT_RGMII_OOB_CTRL access
    52c4287f23c8 Revert "selftests: mm: fix map_hugetlb failure on 64K page size systems"
    1e6914fa8e77 KEYS: trusted: Fix memory leak in tpm2_key_encode()
    9b8a8e5e8129 nfsd: don't allow nfsd threads to be signalled.
    44889eacfe1f pinctrl: core: handle radix_tree_insert() errors in pinctrl_register_one_pin()
    a32c8f951c8a drm/amd/display: Fix division by zero in setup_dsc_config
    83655231580b Linux 5.15.159
    f3a1787dc482 md: fix kmemleak of rdev->serial
    ed79b93f725c keys: Fix overwrite of key expiration on instantiation
    580bcd6bf24f Bluetooth: qca: fix firmware check error path
    b91390f4e828 Bluetooth: qca: fix NVM configuration parsing
    ed53949cc92e Bluetooth: qca: add missing firmware sanity checks
    d68dbfb837c0 regulator: core: fix debugfs creation regression
    1a6be4e70790 hwmon: (pmbus/ucd9000) Increase delay from 250 to 500us
    9518b79bfd2f net: fix out-of-bounds access in ops_init
    b7bab33c4623 drm/vmwgfx: Fix invalid reads in fence signaled events
    c3d84a764ed1 mei: me: add lunar lake point M DID
    2a47da1cd81f slimbus: qcom-ngd-ctrl: Add timeout for wait operation
    ba3c118cff7b dyndbg: fix old BUG_ON in >control parser
    866d84456494 ASoC: ti: davinci-mcasp: Fix race condition during probe
    40098e3fd40d ASoC: tegra: Fix DSPK 16-bit playback
    1cbe6d8999db net: bcmgenet: synchronize use of bcmgenet_set_rx_mode()
    66116556076f tipc: fix UAF in error path
    2a512ca151da iio: accel: mxc4005: Interrupt handling fixes
    93cfed3aea7c iio:imu: adis16475: Fix sync mode setting
    eeee7fc41562 dt-bindings: iio: health: maxim,max30102: fix compatible check
    dc941fec0719 mptcp: ensure snd_nxt is properly initialized on connect
    c5ee5f184da9 btrfs: add missing mutex_unlock in btrfs_relocate_sys_chunks()
    f1f364ffe274 ALSA: hda/realtek: Fix mute led of HP Laptop 15-da3001TU
    2ddbb35a01e7 usb: dwc3: core: Prevent phy suspend during init
    f78ff8825eb8 usb: xhci-plat: Don't include xhci.h
    bad094bd0827 usb: gadget: f_fs: Fix a race condition when processing setup packets.
    0bbb498b8e3e usb: gadget: composite: fix OS descriptors w_value logic
    855717130362 usb: ohci: Prevent missed ohci interrupts
    f157133326cc usb: Fix regression caused by invalid ep0 maxpacket in virtual SuperSpeed device
    a6b9bffbcbb8 usb: typec: ucsi: Fix connector check on init
    5f499d7421ac usb: typec: ucsi: Check for notifications after init
    9f112211cc54 arm64: dts: qcom: Fix 'interrupt-map' parent address cells
    4a89ac4b0921 Reapply "drm/qxl: simplify qxl_fence_wait"
    79f988d3ffc1 firewire: nosy: ensure user_length is taken into account when fetching packet contents
    5ef9681f73b8 btrfs: fix kvcalloc() arguments order in btrfs_ioctl_send()
    890d39f6d974 ACPI: CPPC: Fix access width used for PCC registers
    7fcaa31c0047 ACPI: CPPC: Fix bit_offset shift in MASK_VAL() macro
    6dfd79ed04c5 Revert "Revert "ACPI: CPPC: Use access_width over bit_width for system memory accesses""
    3c7013a87124 drm/amd/display: Atom Integrated System Info v2_2 for DCN35
    edf5238df340 drm/connector: Add \n to message about demoting connector force-probes
    5a5cc5ca725c drm/meson: dw-hdmi: add bandgap setting for g12
    f8229be8d627 drm/meson: dw-hdmi: power up phy on device init
    c5c8616b3534 net: hns3: fix port vlan filter not disabled issue
    2720b9792a52 net: hns3: split function hclge_init_vlan_config()
    45b6316f2373 net: hns3: use appropriate barrier function after setting a bit value
    f37df6f9b5f6 net: hns3: change type of numa_node_mask as nodemask_t
    1e91931e316d net: hns3: refactor hclge_cmd_send with new hclge_comm_cmd_send API
    f9315f3ad186 net: hns3: create new set of unified hclge_comm_cmd_send APIs
    dd69c1c99a54 net: hns3: create new cmdq hardware description structure hclge_comm_hw
    ed3c393fb24f net: hns3: refactor hns3 makefile to support hns3_common module
    50964654df19 net: hns3: direct return when receive a unknown mailbox message
    5789bfcb9ff9 net: hns3: refactor function hclge_mbx_handler()
    52acec0106be net: hns3: add query vf ring and vector map relation
    bc8fb44566ff net: hns3: add log for workqueue scheduled late
    fee4a1e6564c net: hns3: using user configure after hardware reset
    35f8ee4d43ee net: hns3: PF support get unicast MAC address space assigned by firmware
    35297fc68de3 ipv6: fib6_rules: avoid possible NULL dereference in fib6_rule_action()
    21d85ee2d388 net: bridge: fix corrupted ethernet header on multicast-to-unicast
    4ff334cade9d phonet: fix rtm_phonet_notify() skb allocation
    bb739796564a hwmon: (corsair-cpro) Protect ccp->wait_input_report with a spinlock
    073ca0c27b36 hwmon: (corsair-cpro) Use complete_all() instead of complete() in ccp_raw_event()
    6e6644c0a4f8 hwmon: (corsair-cpro) Use a separate buffer for sending commands
    f3c1bf3054f9 rtnetlink: Correct nested IFLA_VF_VLAN_LIST attribute validation
    e97e16433eb4 Bluetooth: l2cap: fix null-ptr-deref in l2cap_chan_timeout
    6a18eeb1b3bb Bluetooth: Fix use-after-free bugs caused by sco_sock_timeout
    27b0284d8be1 tcp: Use refcount_inc_not_zero() in tcp_twsk_unique().
    2552c9d9440f tcp: defer shutdown(SEND_SHUTDOWN) for TCP_SYN_RECV sockets
    20ac71bee028 ARM: 9381/1: kasan: clear stale stack poison
    624cd60d6413 xfrm: Preserve vlan tags for transport mode software GRO
    24dd9b08df71 qibfs: fix dentry leak
    ab5b5e322d12 bpf, sockmap: Improved check for empty queue
    d908a8a3de94 bpf, sockmap: Reschedule is now done through backlog
    657cfb194cdb bpf, sockmap: Convert schedule_work into delayed_work
    bbf2ed06757f bpf, sockmap: Handle fin correctly
    ab3128de6edb bpf, sockmap: TCP data stall on recv before accept
    4105f0c9af39 net:usb:qmi_wwan: support Rolling modules
    90850083ceec drm/nouveau/dp: Don't probe eDP ports twice harder
    859e2448be41 fs/9p: drop inodes immediately on non-.L too
    4d36b9b7ec4f clk: Don't hold prepare_lock when calling kref_put()
    7ca04b83c109 gpio: crystalcove: Use -ENOTSUPP consistently
    c5ad5c7a1eed gpio: wcove: Use -ENOTSUPP consistently
    d6a15d3bb81c 9p: explicitly deny setlease attempts
    2b493bd0da9b fs/9p: translate O_TRUNC into OTRUNC
    ad4f65328661 fs/9p: only translate RWX permissions for plain 9P2000
    3931e927d551 iommu: mtk: fix module autoloading
    12a2ca67f946 selftests: timers: Fix valid-adjtimex signed left-shift undefined behavior
    78f459dce4e3 MIPS: scall: Save thread_info.syscall unconditionally on entry
    5d3392552087 gpu: host1x: Do not setup DMA for virtual devices
    844fc023e9f1 blk-iocost: avoid out of bounds shift
    a95798aa08ac scsi: target: Fix SELinux error when systemd-modules loads the target module
    546e3bc295ce btrfs: always clear PERTRANS metadata during commit
    8b40803c9615 btrfs: make btrfs_clear_delalloc_extent() free delalloc reserve
    a362afd5f2a5 tools/power turbostat: Fix Bzy_MHz documentation typo
    b582c9ffcb69 tools/power turbostat: Fix added raw MSR output
    4f9cc355c328 firewire: ohci: mask bus reset interrupts between ISR and bottom half
    6f6aa8c58de4 ata: sata_gemini: Check clk_enable() result
    c4fa8b793ddb net: bcmgenet: Reset RBUF on first open
    9a41f5e19f27 ALSA: line6: Zero-initialize message buffers
    d1b93d4017c4 kbuild: Disable KCSAN for autogenerated *.mod.c intermediaries
    8943a256b06e btrfs: return accurate error code on open failure in open_fs_devices()
    93aa5ccc4478 scsi: bnx2fc: Remove spin_lock_bh while releasing resources after upload
    c259a4102c84 net: mark racy access on sk->sk_rcvbuf
    5490a385b48d wifi: cfg80211: fix rdev_dump_mpp() arguments order
    5396e63b73e3 wifi: mac80211: fix ieee80211_bss_*_flags kernel-doc
    f5d95eead358 gfs2: Fix invalid metadata access in punch_hole
    4cab23bbcb98 scsi: lpfc: Replace hbalock with ndlp lock in lpfc_nvme_unregister_port()
    e5dcdf60c9a8 scsi: lpfc: Update lpfc_ramp_down_queue_handler() logic
    f2c7f029051e scsi: lpfc: Move NPIV's transport unregistration to after resource clean up
    17db92da8be5 KVM: arm64: vgic-v2: Check for non-NULL vCPU in vgic_v2_parse_attr()
    5ee5997a085e KVM: arm64: vgic-v2: Use cpuid from userspace as vcpu_id
    f1fa9a981620 clk: sunxi-ng: h6: Reparent CPUX during PLL CPUX rate change
    83ac89e3797d net: gro: add flush check in udp_gro_receive_segment
    1b127feac247 drm/panel: ili9341: Use predefined error codes
    9de7f6864aa8 drm/panel: ili9341: Respect deferred probe
    8792b557eb50 s390/qeth: Fix kernel panic after setting hsuid
    b2973b79d5d0 s390/qeth: don't keep track of Input Queue count
    42c8471b0566 tipc: fix a possible memleak in tipc_buf_append
    c7af99cc2192 net: core: reject skb_copy(_expand) for fraglist GSO skbs
    bfd62ca7c87b net: bridge: fix multicast-to-unicast with fraglist GSO
    9672bf3eac4f net: dsa: mv88e6xxx: Fix number of databases for 88E6141 / 88E6341
    19275de18b2f cxgb4: Properly lock TX queue for the selftest.
    c9d48ce16330 s390/cio: Ensure the copied buf is NUL terminated
    bd2d9641a39e ALSA: hda: intel-sdw-acpi: fix usage of device_get_named_child_node()
    fd7dcd658154 ASoC: meson: cards: select SND_DYNAMIC_MINORS
    a4ae1c3692ac ASoC: meson: axg-tdm-interface: manage formatters in trigger
    fd824a1721eb ASoC: meson: axg-card: make links nonatomic
    9719b354f7d4 ASoC: meson: axg-fifo: use threaded irq to check periods
    c3b36cd49217 ASoC: meson: axg-fifo: use FIELD helpers
    56c44b7f7201 net: qede: use return from qede_parse_actions()
    62ad7f87e40b net: qede: use return from qede_parse_flow_attr() for flow_spec
    ccf2317b1565 net: qede: use return from qede_parse_flow_attr() for flower
    3a6929a6f00c net: qede: sanitize 'rc' in qede_add_tc_flower_fltr()
    97005a10bf39 s390/vdso: Add CFI for RA register to asm macro vdso_func
    e97e0051056b net l2tp: drop flow hash on forward
    5a4603fbc285 nsh: Restore skb->{protocol,data,mac_header} for outer header in nsh_gso_segment().
    ec697fbd38cb octeontx2-af: avoid off-by-one read from userspace
    0f560240b4cc bna: ensure the copied buf is NUL terminated
    12481f30128f xdp: use flags field to disambiguate broadcast redirect
    b6a7077c0ffe xdp: Add xdp_do_redirect_frame() for pre-computed xdp_frames
    a174aa99bae8 xdp: Move conversion to xdp_frame out of map functions
    7038794bbfe1 s390/mm: Fix clearing storage keys for huge pages
    e27a0db41537 s390/mm: Fix storage key clearing for guest huge pages
    fef735072de8 spi: hisi-kunpeng: Delete the dump interface of data registers in debugfs
    396df2b93943 bpf: Fix a verifier verbose message
    5965bc7535fb bpf, skmsg: Fix NULL pointer dereference in sk_psock_skb_ingress_enqueue
    16c6e4179041 bpf, kconfig: Fix DEBUG_INFO_BTF_MODULES Kconfig definition
    64ea2f585e3c regulator: mt6360: De-capitalize devicetree regulator subnodes
    76aa2440deb9 pinctrl: devicetree: fix refcount leak in pinctrl_dt_to_map()
    fe881e793fbd power: supply: mt6360_charger: Fix of_match for usb-otg-vbus regulator
    e2ebfee0833d power: rt9455: hide unused rt9455_boost_voltage_values
    ea6ce93327bd nfs: Handle error of rpc_proc_register() in nfs_net_init().
    7ceb89f4016e nfs: make the rpc_stat per net namespace
    0bbd42926082 nfs: expose /proc/net/sunrpc/nfs in net namespaces
    9e644ff63b2d sunrpc: add a struct rpc_stats arg to rpc_create_args
    764e752bf321 pinctrl: mediatek: paris: Rework support for PIN_CONFIG_{INPUT,OUTPUT}_ENABLE
    35d704f2b9b9 pinctrl: mediatek: paris: Fix PIN_CONFIG_INPUT_SCHMITT_ENABLE readback
    5505e5578621 pinctrl: mediatek: paris: Rework mtk_pinconf_{get,set} switch/case logic
    41f88ef8ba38 pinctrl: core: delete incorrect free in pinctrl_enable()
    34674f754960 pinctrl/meson: fix typo in PDM's pin name
    ffa6e4d2d5ba pinctrl: pinctrl-aspeed-g6: Fix register offset for pinconf of GPIOR-T
    26d32bec4c6d eeprom: at24: fix memory corruption race condition
    c4137dee8e81 eeprom: at24: Probe for DDR3 thermal sensor in the SPD case
    6f35227dcd22 eeprom: at24: Use dev_err_probe for nvmem register failure
    91c6dcbc2bab ksmbd: clear RENAME_NOREPLACE before calling vfs_rename
    8f3d0bf1d0c6 ksmbd: validate request buffer size in smb2_allocate_rsp_buf()
    da2140137260 ksmbd: fix slab-out-of-bounds in smb2_allocate_rsp_buf
    ad12c74e953b wifi: nl80211: don't free NULL coalescing rule
    714794ed7a8b dmaengine: Revert "dmaengine: pl330: issue_pending waits until WFP state"
    79a61bfe2ff3 dmaengine: pl330: issue_pending waits until WFP state
    b8086c3c1548 reiserfs: Avoid touching renamed directory if parent does not change
    ea091017ef62 ipv6: Fix data races around sk->sk_prot.
    ff8710da80ee ipv6: annotate some data-races around sk->sk_prot
    e8c2eafaaa6a tcp: Fix data races around icsk->icsk_af_ops.
    8d1bab770956 locking/rwsem: Disable preemption while trying for rwsem lock
    7c82dac02886 block, loop: support partitions without scanning
    45f504f301d4 bpftool: Fix pretty print dump for maps without BTF loaded
    1f24338cb789 jbd2: Drop the merge conflicted hunk
    e1d0e3c51bde tpm: tis_i2c: Limit write bursts to I2C_SMBUS_BLOCK_MAX (32) bytes
    1abe841fe331 tpm: tis_i2c: Limit read bursts to I2C_SMBUS_BLOCK_MAX (32) bytes
    6224acfc1d56 tpm: Add flag to use default cancellation policy
    1cd19d48fb90 tpm: tis_i2c: Fix sanity check interrupt enable mask
    a883da132fa8 tpm: Add tpm_tis_i2c backend for tpm_tis_core
    a742ac8a1c51 tpm: Add tpm_tis_verify_crc to the tpm_tis_phy_ops protocol layer
    ef495c5f45f2 tpm: Remove read16/read32/write32 calls from tpm_tis_phy_ops
    1f3be2e23aa6 gcc-plugins: Reorganize gimple includes for GCC 13
    24615a3b932a ata: ahci: fix enum constants for gcc-13
    5d6cb145541a net: stmmac: Enable mac_managed_pm phylink config
    fd93aabb4287 tools/resolve_btfids: Use pkg-config to locate libelf
    130f9da78406 tools/resolve_btfids: Build with host flags
    00f2f1a782f9 tools/resolve_btfids: Support cross-building the kernel with clang
    17776a4ba9c2 tools/resolve_btfids: Install libbpf headers when building
    7c9808380d70 libbpf: Make libbpf_version.h non-auto-generated
    37ae1ba791ac libbpf: Add LIBBPF_DEPRECATED_SINCE macro for scheduling API deprecations
    a2667e6d7314 drm/radeon: free iio for atombios when driver shutdown
    f100c753aa1f powerpc: Fix reschedule bug in KUAP-unlocked user copy
    da5513f30187 libbpf: Fix build warning on ref_ctr_off
    4c5a089621a8 perf python: Account for multiple words in CC
    1c5699ee85d4 fs: move S_ISGID stripping into the vfs_*() helpers
    838f5d0701d8 fs: add mode_strip_sgid() helper
    d97172683641 squashfs: provide backing_dev_info in order to disable read-ahead
    ed037d7be40c irq_work: use kasan_record_aux_stack_noalloc() record callstack
    1363bd7dbde3 ixgbevf: add disable link state
    e5601ae2bd24 ixgbe: add improvement for MDD response functionality
    caa57cd80575 ixgbe: add the ability for the PF to disable VF link state
    16a77bfcc7df Check /dev/console using init_stat()
    04574fd5579a tracing/arm: Have max stack tracer handle the case of return address after data
    0e51e5717018 gpiolib: cdev: Set lineevent_state::irq after IRQ register successfully
    1e6b7da6ddba drivers/base: Fix unsigned comparison to -1 in CPUMAP_FILE_MAX_BYTES
    493160901320 mtd_blkdevs: add mtd_table_mutex lock back to blktrans_{open, release} to avoid race condition
    04224f725aa3 irqchip/gic-v3-its: Skip HP notifier when no ITS is registered
    6f6c2996a81c irqchip/gic-v3-its: Postpone LPI pending table freeing and memreserve
    1fa94473423f irqchip/gic-v3-its: Give the percpu rdist struct its own flags field
    6013d1ae5feb cert host tools: Stop complaining about deprecated OpenSSL functions
    efe20512212b init/Kconfig: fix CC_HAS_ASM_GOTO_TIED_OUTPUT test with dash
    a40d2daf2795 pnmtologo: use relocatable file name
    3b40d5b41155 of: configfs: remove unused variable overlay_lock
    6c085baf1838 tools: use basename to identify file in gen-mach-types
    2fca0fd71981 lib/build_OID_registry: fix reproducibility issues
    0f586f4ee8ad vt/conmakehash: improve reproducibility
    a75774679f28 OF: DT-Overlay configfs interface (v8)
    d179c639b30b x86/boot: Wrap literal addresses in absolute_pointer()
    856ec356cf91 ACPI: thermal: drop an always true check
    7614af249993 xfs: Fix -Werror=dangling-pointer work-around for older GCC
    41470215f97e xfs: Work around GCC 12 -Werror=dangling-pointer for xfs_attr_remote.o
    44a445c1922d virtio-pci: Remove wrong address verification in vp_del_vqs()
    77aa9e489eaf bpf: Disallow unprivileged bpf by default
    ebfb1822e9f9 fs/aufs: fixup 5.15.36 fixups
    4eba9348d3e2 Revert "Revert "fbdev: Hot-unplug firmware fb devices on forced removal""
    5df6d1b00f95 jbd2: fix use-after-free of transaction_t race
    2d83e8196487 jbd2: refactor wait logic for transaction updates into a common function
    07a63f760793 netfilter: conntrack: avoid useless indirection during conntrack destruction
    4e7122625996 Revert "fbdev: Hot-unplug firmware fb devices on forced removal"
    7ba4cb36fd4f rcu: Avoid alloc_pages() when recording stack
    f78574dee71e kasan: test: silence intentional read overflow warnings
    d313cb89b6b1 kasan: arm64: fix pcpu_page_first_chunk crash with KASAN_VMALLOC
    5e279d5647cc arm64: support page mapping percpu first chunk allocator
    e5bf16752dca vmalloc: choose a better start address in vm_area_register_early()
    660b3d21b46f kasan: test: bypass __alloc_size checks
    00aa7573e53a kasan: test: add memcpy test that avoids out-of-bounds write
    67becf0b1bd4 kasan: fix tag for large allocations when using CONFIG_SLAB
    bedf1e033213 workqueue, kasan: avoid alloc_pages() when recording stack
    7195b67ce69b kasan: generic: introduce kasan_record_aux_stack_noalloc()
    bdff763f0e29 kasan: common: provide can_alloc in kasan_save_stack()
    51423ebb36ad lib/stackdepot: introduce __stack_depot_save()
    85373e66d847 lib/stackdepot: remove unused function argument
    5b6cc9b251f3 lib/stackdepot: include gfp.h
    c9f3902d8069 aufs: reduce overhead for "code present but disabled" use case.
    b98d189df02c aufs: bugfix, umount passes NULL to ->parse_monolithic()
    13b883cbbbd9 aufs standalone: cosmetic, missing copyright sentence
    21f8b0d81898 aufs: 5.15.5-20220117 ---> 5.15.5-20220221
    6199fd896645 aufs: tiny, headers after fs_context
    8ddb40e31c29 aufs: fs_context 7/7, finally remount
    69035f71c6fd aufs: fs_context 6/7, now mount
    bc841b970697 aufs: fs_context 5/7, parse all other mount options
    435188053da2 aufs: fs_context 4/7, parse xino options
    9af1f1825cbd aufs: fs_context 3/7, parse the branch-management options
    1c05eb767f8c aufs: fs_context 2/7, parse "br" mount option
    a8488f603134 aufs: fs_context 1/7, skelton of the new shceme
    8e32e0015564 aufs: pre fs_context, convert a static flag to a macro
    f90cb4144aec aufs: pre fs_context, support the incomplete sb and sbinfo case
    948762ef859c aufs: pre fs_context, convert the type of alloc_sbinfo()
    77151a08776b aufs: 5.15.5-20211129 ---> 5.15.5-20220117
    2539adbbbe1e aufs: 5.14-20211018 ---> 5.15.5-20211129
    7d32b25193c4 aufs: for v5.15-rc1, sync_inode() is gone
    66ec0c509225 aufs: for v5.15-rc1, new param 'rcu' for ->get_acl()
    69709dc518cd aufs: for v5.15-rc1, no mand-lock anymore
    ada8fe9543e5 aufs: 5.14-20210906  ---> 5.14-20211018
    b77f7f3f394a Revert "aufs: adjust to v5.15 fs changes"
    81bdce5b5876 tick/nohz: WARN_ON --> WARN_ON_ONCE to prevent console saturation
    97c963889222 sched/isolation: really align nohz_full with rcu_nocbs
    871f23ad3627 Revert "ARM: defconfig: Enable ax88796c driver for Exynos boards"
    ffad0783dd5b ARM: config: multi v7: Regenerate defconifg
    5c1e1a1ff2d3 ARM: config: multi v7: Add renamed symbols
    badaf96564fe ARM: config: multi v7: Clean up enabled by default options
    34996040fc9b ARM: config: multi v7: Drop unavailable options
    7f685244afb3 powerpc/mm: Switch obsolete dssall to .long
    20301aeb1a64 riscv: fix build with binutils 2.38
    9df58d070506 powerpc/lib/sstep: fix 'ptesync' build error
    720b61fc400b x86_64_defconfig: Fix warnings
    02bf23d26bc4 arm64: defconfig: cleanup config options
    05914e2c87e5 arm: defconfig: drop unused POWER_AVS option
    ffb532fa19b9 aufs5: fix build against v5.15.3+
    a4b3abf4d96d qemux86: add configuration symbol to select values
    fee94ee09154 clear_warn_once: add a clear_warn_once= boot parameter
    3d8762d900d9 clear_warn_once: bind a timer to written reset value
    95faacac47e8 clear_warn_once: expand debugfs to include read support
    de20c4240018 perf: perf can not parser the backtrace of app in the 32bit system and 64bit kernel.
    0e4aacead9c1 perf: x86-32: explicitly include <errno.h>
    9ad92c11468e perf: mips64: Convert __u64 to unsigned long long
    09e7efe3e68a perf: fix bench numa compilation
    e79becc44fa6 perf: add SLANG_INC for slang.h
    b1033b588681 perf: add sgidefs.h to for mips builds
    cf9db484ac0b perf: change --root to --prefix for python install
    7fd052c2c562 perf: add 'libperl not found' warning
    27a437cdd469 perf: force include of <stdbool.h>
    3b99d21bec2f fat: don't use obsolete random32 call in namei_vfat
    a7e9293b506b FAT: Added FAT_NO_83NAME
    6fd0e71d9e5c FAT: Add CONFIG_VFAT_NO_CREATE_WITH_LONGNAMES option
    c379b0d324ae FAT: Add CONFIG_VFAT_FS_NO_DUALNAMES option
    538be0fdb124 aufs: adjust to v5.15 fs changes
    f45da75c8759 aufs5: core
    047f57e07e01 aufs5: standalone
    029fc15574c8 aufs5: mmap
    610d0192ee94 aufs5: base
    d4e428d0ec5f aufs5: kbuild
    eb067eca251a yaffs: replace IS_ERR with IS_ERR_OR_NULL to check both ERR and NULL
    286af18d0875 yaffs: fix -Wstringop-overread compile warning in yaffs_fix_null_name
    24d59a4e26a6 yaffs2: v5.12+ build fixups (not runtime tested)
    22c73536d5d7 yaffs: include blkdev.h
    506b7251bfb8 yaffs: fix misplaced variable declaration
    a0e26ff364dc yaffs2: v5.6 build fixups
    b10b1b2d169e yaffs2: fix memory leak when /proc/yaffs is read
    ad9adccbb214 yaffs: add strict check when call yaffs_internal_read_super
    2e3c3aec8279 yaffs: repair yaffs_get_mtd_device
    d662538516a7 yaffs: Fix build failure by handling inode i_version with proper atomic API
    70a6113ee2c7 yaffs2: fix memory leak in mount/umount
    3378e4a9e404 yaffs: Avoid setting any ACL releated xattr
    ec2284edddef Yaffs:check oob size before auto selecting Yaffs1
    c2a49874051c fs: yaffs2: replace CURRENT_TIME by other appropriate apis
    e9a5105a3e73 yaffs2: adjust to proper location of MS_RDONLY
    608807406f13 yaffs2: import git revision b4ce1bb (jan, 2020)
    89e660ece42c initramfs: allow an optional wrapper script around initramfs generation
    b179dbc9aa10 iwlwifi: select MAC80211_LEDS conditionally
    3fd5ca3673d0 net/dccp: make it depend on CONFIG_BROKEN (CVE-2020-16119)
    d1f6edbf0188 arm64/perf: Fix wrong cast that may cause wrong truncation
    d202fb2caf33 defconfigs: drop obselete options
    9a27e3b5f4e7 arm64/perf: fix backtrace for AAPCS with FP enabled
    e20d8cf019b4 linux-yocto: Handle /bin/awk issues
    b6d2a3dbbd3a uvesafb: provide option to specify timeout for task completion
    adb40f1e6a1a uvesafb: print error message when task timeout occurs
    f280a1ed0962 compiler.h: Undef before redefining __attribute_const__
    4352732f268c vmware: include jiffies.h
    7954a677968d Resolve jiffies wrapping about arp
    5f28a1035d95 nfs: Allow default io size to be configured.
    0d7260ad7106 check console device file on fs when booting
    900a12e37e0a mount_root: clarify error messages for when no rootfs found
    7b878cbea726 menuconfig,mconf-cfg: Allow specification of ncurses location
    6604fc1763b3 modpost: mask trivial warnings
    0d294adb09cb kbuild: exclude meta directory from distclean processing
    a097cdd95a9e powerpc: serialize image targets
    5db6ec39a0a3 arm: serialize build targets
    cbabca27905e crtsavres: fixups for 5.4+
    7fc7656ed403 powerpc/ptrace: Disable array-bounds warning with gcc8
    a5faac5a19a2 powerpc: Disable attribute-alias warnings from gcc8
    186c54665b67 powerpc: add crtsavres.o to archprepare for kbuild
    d1ea862964ca powerpc: kexec fix for powerpc64
    2ac35b89a0f9 powerpc: Add unwind information for SPE registers of E500 core
    2e1c348a28bb mips: vdso: fix 'jalr $t9' crash in vdso code
    ec57870b303a mips: Kconfig: add QEMUMIPS64 option
    6a81b3c08107 4kc cache tlb hazard: tlbp cache coherency
    74e3b2a21e54 malta uhci quirks: make allowance for slow 4k(e)c
    22e65b63d3b4 arm/Makefile: Fix systemtap
    b7f1ab59f19e vexpress: Pass LOADADDR to Makefile
    ce2800c73bf7 arm: ARM EABI socketcall
    019d142fd956 ARM: LPAE: Invalidate the TLB for module addresses during translation fault

(From OE-Core rev: 973963d56804139193e40fb960aae0b76ed0de46)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-08 09:03:46 -07:00
Bruce Ashfield
2ccf694440 linux-yocto/5.15: update to v5.15.158
Updating linux-yocto/5.15 to the latest korg -stable release that comprises
the following commits:

    284087d4f7d5 Linux 5.15.158
    802cab68a6d5 serial: core: fix kernel-doc for uart_port_unlock_irqrestore()
    e6a488ae31ce udp: preserve the connected status if only UDP cmsg
    93ba36238db6 bounds: Use the right number of bits for power-of-two CONFIG_NR_CPUS
    b65fb50e04a9 HID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up
    b93bdfcf41f2 fbdev: fix incorrect address computation in deferred IO
    5a09eae9a7db i2c: smbus: fix NULL function pointer dereference
    52e8a42b1107 riscv: Fix TASK_SIZE on 64-bit NOMMU
    83c5c0e3cd08 riscv: fix VMALLOC_START definition
    9edd3aa34d50 dmaengine: idxd: Fix oops during rmmod on single-CPU platforms
    0ccac964520a dma: xilinx_dpdma: Fix locking
    dd946e8e57c0 idma64: Don't try to serve interrupts when device is powered off
    f5db31e59fd8 dmaengine: owl: fix register access functions
    4fa0befa92f2 tcp: Fix NEW_SYN_RECV handling in inet_twsk_purge()
    214a2dfbb84f tcp: Clean up kernel listener's reqsk in inet_twsk_purge()
    5be39f901169 mtd: diskonchip: work around ubsan link failure
    ec8d0ee88079 stackdepot: respect __GFP_NOLOCKDEP allocation flag
    018c4ea7002f net: b44: set pause params only when interface is up
    d35fb1664eb2 ethernet: Add helper for assigning packet type when dest address does not match device address
    5dbdbe113391 irqchip/gic-v3-its: Prevent double free on error
    9d0580ded513 drm/amdgpu: Fix leak when GPU memory allocation fails
    7e350ee649e0 drm/amdgpu/sdma5.2: use legacy HDP flush for SDMA2/3
    1a1dc37c23aa arm64: dts: rockchip: enable internal pull-up for Q7_THRM# on RK3399 Puma
    36b32816fbab cpu: Re-enable CPU mitigations by default for !X86 architectures
    e58047553a4e btrfs: fix information leak in btrfs_ioctl_logical_to_ino()
    1200481cd606 mmc: sdhci-msm: pervent access to suspended controller
    52f9041deaca Bluetooth: qca: fix NULL-deref on non-serdev suspend
    b3b2f2ed7d56 Bluetooth: btusb: Add Realtek RTL8852BE support ID 0x0bda:0x4853
    46c105b178b9 Bluetooth: Fix type of len in {l2cap,sco}_sock_getsockopt_old()
    2cb0b9aaa0fe x86/cpu: Fix check for RDPKRU in __show_regs()
    b8511fbf03fb tracing: Increase PERF_MAX_TRACE_SIZE to handle Sentinel1 and docker together
    1ea85ae08e39 tracing: Show size of requested perf buffer
    605a9eb70e92 net/mlx5e: Fix a race in command alloc flow
    7e44291e9615 Revert "crypto: api - Disallow identical driver names"
    51256394970e drm/vmwgfx: Fix crtc's atomic check conditional
    7c3461b6b1dc drm-print: add drm_dbg_driver to improve namespace symmetry
    479244d68f5d serial: mxs-auart: add spinlock around changing cts state
    5c92a4517cc9 serial: core: Provide port lock wrappers
    2e29ff824b47 af_unix: Suppress false-positive lockdep splat for spin_lock() in __unix_gc().
    0b289962c482 net: ethernet: ti: am65-cpts: Fix PTPv1 message type on TX packets
    2418d3f348d5 iavf: Fix TC config comparison with existing adapter TC config
    69ae07c7ad82 i40e: Report MFS in decimal base instead of hex
    ff7431f898dd i40e: Do not use WQ_MEM_RECLAIM flag for workqueue
    5c45feb3c288 netfilter: nf_tables: honor table dormant flag from netdev release event path
    63d814d93c5c mlxsw: spectrum_acl_tcam: Fix memory leak when canceling rehash work
    64435b64e43d mlxsw: spectrum_acl_tcam: Fix incorrect list API usage
    039992b6d2df mlxsw: spectrum_acl_tcam: Fix warning during rehash
    413a01886c39 mlxsw: spectrum_acl_tcam: Fix memory leak during rehash
    7adc29af50f7 mlxsw: spectrum_acl_tcam: Rate limit error message
    4c89642ca47f mlxsw: spectrum_acl_tcam: Fix possible use-after-free during rehash
    c17976b42d54 mlxsw: spectrum_acl_tcam: Fix possible use-after-free during activity update
    2943fb714d83 mlxsw: spectrum_acl_tcam: Fix race during rehash delayed work
    9048616553c6 net: openvswitch: Fix Use-After-Free in ovs_ct_exit
    8ece90ac97eb ipvs: Fix checksumming on GSO of SCTP packets
    2e74b3fd6bf5 net: gtp: Fix Use-After-Free in gtp_dellink
    dd602fb3526d net: usb: ax88179_178a: stop lying about skb->truesize
    03b5a9b2b526 ipv4: check for NULL idev in ip_route_use_hint()
    55da4788ceed NFC: trf7970a: disable all regulators on removal
    f41fbb4ff219 bridge/br_netlink.c: no need to return void function
    23b7ee4a8d55 icmp: prevent possible NULL dereferences from icmp_build_probe()
    8bdd3cf01490 mlxsw: core: Unregister EMAD trap using FORWARD action
    7336b6aa825f vxlan: drop packets from invalid src-address
    66384a7399f9 wifi: iwlwifi: mvm: return uid from iwl_mvm_build_scan_cmd
    f5aa109c94ec wifi: iwlwifi: mvm: remove old PASN station when adding a new one
    0f530ed87266 ARC: [plat-hsdk]: Remove misplaced interrupt-cells property
    7acd2d7b7603 arm64: dts: mediatek: mt2712: fix validation errors
    203e81849bd9 arm64: dts: mediatek: mt7622: drop "reset-names" from thermal block
    7b0a487bce51 arm64: dts: mediatek: mt7622: fix ethernet controller "compatible"
    d856ae10cdcf arm64: dts: mediatek: mt7622: fix IR nodename
    0434c99bf3f1 arm64: dts: mediatek: mt7622: fix clock controllers
    2f83d3d2cc3c arm64: dts: mediatek: mt7622: introduce nodes for Wireless Ethernet Dispatch
    506ac5538498 arm64: dts: mediatek: mt7622: add support for coherent DMA
    a897ecbb5779 arm64: dts: mediatek: mt8183: Add power-domains properity to mfgcfg
    daf284595e6f arm64: dts: rockchip: Remove unsupported node from the Pinebook Pro dts
    91eb350da992 arm64: dts: rockchip: enable internal pull-up on PCIE_WAKE# for RK3399 Puma
    c5ff64a50037 arm64: dts: rockchip: fix alphabetical ordering RK3399 puma
    938cf022b72c arm64: dts: rockchip: enable internal pull-up on Q7_USB_ID for RK3399 Puma
    d69ccea6041e HID: logitech-dj: allow mice to use all types of reports
    9fd9468d1c5e HID: intel-ish-hid: ipc: Fix dev_err usage with uninitialized dev->devc
    e054770d566b cifs: reinstate original behavior again for forceuid/forcegid
    929ba00702cf smb: client: fix rename(2) regression against samba
    b8086c3c1548 reiserfs: Avoid touching renamed directory if parent does not change
    ea091017ef62 ipv6: Fix data races around sk->sk_prot.
    ff8710da80ee ipv6: annotate some data-races around sk->sk_prot
    e8c2eafaaa6a tcp: Fix data races around icsk->icsk_af_ops.
    8d1bab770956 locking/rwsem: Disable preemption while trying for rwsem lock
    7c82dac02886 block, loop: support partitions without scanning
    45f504f301d4 bpftool: Fix pretty print dump for maps without BTF loaded
    1f24338cb789 jbd2: Drop the merge conflicted hunk
    e1d0e3c51bde tpm: tis_i2c: Limit write bursts to I2C_SMBUS_BLOCK_MAX (32) bytes
    1abe841fe331 tpm: tis_i2c: Limit read bursts to I2C_SMBUS_BLOCK_MAX (32) bytes
    6224acfc1d56 tpm: Add flag to use default cancellation policy
    1cd19d48fb90 tpm: tis_i2c: Fix sanity check interrupt enable mask
    a883da132fa8 tpm: Add tpm_tis_i2c backend for tpm_tis_core
    a742ac8a1c51 tpm: Add tpm_tis_verify_crc to the tpm_tis_phy_ops protocol layer
    ef495c5f45f2 tpm: Remove read16/read32/write32 calls from tpm_tis_phy_ops
    1f3be2e23aa6 gcc-plugins: Reorganize gimple includes for GCC 13
    24615a3b932a ata: ahci: fix enum constants for gcc-13
    5d6cb145541a net: stmmac: Enable mac_managed_pm phylink config
    fd93aabb4287 tools/resolve_btfids: Use pkg-config to locate libelf
    130f9da78406 tools/resolve_btfids: Build with host flags
    00f2f1a782f9 tools/resolve_btfids: Support cross-building the kernel with clang
    17776a4ba9c2 tools/resolve_btfids: Install libbpf headers when building
    7c9808380d70 libbpf: Make libbpf_version.h non-auto-generated
    37ae1ba791ac libbpf: Add LIBBPF_DEPRECATED_SINCE macro for scheduling API deprecations
    a2667e6d7314 drm/radeon: free iio for atombios when driver shutdown
    f100c753aa1f powerpc: Fix reschedule bug in KUAP-unlocked user copy
    da5513f30187 libbpf: Fix build warning on ref_ctr_off
    4c5a089621a8 perf python: Account for multiple words in CC
    1c5699ee85d4 fs: move S_ISGID stripping into the vfs_*() helpers
    838f5d0701d8 fs: add mode_strip_sgid() helper
    d97172683641 squashfs: provide backing_dev_info in order to disable read-ahead
    ed037d7be40c irq_work: use kasan_record_aux_stack_noalloc() record callstack
    1363bd7dbde3 ixgbevf: add disable link state
    e5601ae2bd24 ixgbe: add improvement for MDD response functionality
    caa57cd80575 ixgbe: add the ability for the PF to disable VF link state
    16a77bfcc7df Check /dev/console using init_stat()
    04574fd5579a tracing/arm: Have max stack tracer handle the case of return address after data
    0e51e5717018 gpiolib: cdev: Set lineevent_state::irq after IRQ register successfully
    1e6b7da6ddba drivers/base: Fix unsigned comparison to -1 in CPUMAP_FILE_MAX_BYTES
    493160901320 mtd_blkdevs: add mtd_table_mutex lock back to blktrans_{open, release} to avoid race condition
    04224f725aa3 irqchip/gic-v3-its: Skip HP notifier when no ITS is registered
    6f6c2996a81c irqchip/gic-v3-its: Postpone LPI pending table freeing and memreserve
    1fa94473423f irqchip/gic-v3-its: Give the percpu rdist struct its own flags field
    6013d1ae5feb cert host tools: Stop complaining about deprecated OpenSSL functions
    efe20512212b init/Kconfig: fix CC_HAS_ASM_GOTO_TIED_OUTPUT test with dash
    a40d2daf2795 pnmtologo: use relocatable file name
    3b40d5b41155 of: configfs: remove unused variable overlay_lock
    6c085baf1838 tools: use basename to identify file in gen-mach-types
    2fca0fd71981 lib/build_OID_registry: fix reproducibility issues
    0f586f4ee8ad vt/conmakehash: improve reproducibility
    a75774679f28 OF: DT-Overlay configfs interface (v8)
    d179c639b30b x86/boot: Wrap literal addresses in absolute_pointer()
    856ec356cf91 ACPI: thermal: drop an always true check
    7614af249993 xfs: Fix -Werror=dangling-pointer work-around for older GCC
    41470215f97e xfs: Work around GCC 12 -Werror=dangling-pointer for xfs_attr_remote.o
    44a445c1922d virtio-pci: Remove wrong address verification in vp_del_vqs()
    77aa9e489eaf bpf: Disallow unprivileged bpf by default
    ebfb1822e9f9 fs/aufs: fixup 5.15.36 fixups
    4eba9348d3e2 Revert "Revert "fbdev: Hot-unplug firmware fb devices on forced removal""
    5df6d1b00f95 jbd2: fix use-after-free of transaction_t race
    2d83e8196487 jbd2: refactor wait logic for transaction updates into a common function
    07a63f760793 netfilter: conntrack: avoid useless indirection during conntrack destruction
    4e7122625996 Revert "fbdev: Hot-unplug firmware fb devices on forced removal"
    7ba4cb36fd4f rcu: Avoid alloc_pages() when recording stack
    f78574dee71e kasan: test: silence intentional read overflow warnings
    d313cb89b6b1 kasan: arm64: fix pcpu_page_first_chunk crash with KASAN_VMALLOC
    5e279d5647cc arm64: support page mapping percpu first chunk allocator
    e5bf16752dca vmalloc: choose a better start address in vm_area_register_early()
    660b3d21b46f kasan: test: bypass __alloc_size checks
    00aa7573e53a kasan: test: add memcpy test that avoids out-of-bounds write
    67becf0b1bd4 kasan: fix tag for large allocations when using CONFIG_SLAB
    bedf1e033213 workqueue, kasan: avoid alloc_pages() when recording stack
    7195b67ce69b kasan: generic: introduce kasan_record_aux_stack_noalloc()
    bdff763f0e29 kasan: common: provide can_alloc in kasan_save_stack()
    51423ebb36ad lib/stackdepot: introduce __stack_depot_save()
    85373e66d847 lib/stackdepot: remove unused function argument
    5b6cc9b251f3 lib/stackdepot: include gfp.h
    c9f3902d8069 aufs: reduce overhead for "code present but disabled" use case.
    b98d189df02c aufs: bugfix, umount passes NULL to ->parse_monolithic()
    13b883cbbbd9 aufs standalone: cosmetic, missing copyright sentence
    21f8b0d81898 aufs: 5.15.5-20220117 ---> 5.15.5-20220221
    6199fd896645 aufs: tiny, headers after fs_context
    8ddb40e31c29 aufs: fs_context 7/7, finally remount
    69035f71c6fd aufs: fs_context 6/7, now mount
    bc841b970697 aufs: fs_context 5/7, parse all other mount options
    435188053da2 aufs: fs_context 4/7, parse xino options
    9af1f1825cbd aufs: fs_context 3/7, parse the branch-management options
    1c05eb767f8c aufs: fs_context 2/7, parse "br" mount option
    a8488f603134 aufs: fs_context 1/7, skelton of the new shceme
    8e32e0015564 aufs: pre fs_context, convert a static flag to a macro
    f90cb4144aec aufs: pre fs_context, support the incomplete sb and sbinfo case
    948762ef859c aufs: pre fs_context, convert the type of alloc_sbinfo()
    77151a08776b aufs: 5.15.5-20211129 ---> 5.15.5-20220117
    2539adbbbe1e aufs: 5.14-20211018 ---> 5.15.5-20211129
    7d32b25193c4 aufs: for v5.15-rc1, sync_inode() is gone
    66ec0c509225 aufs: for v5.15-rc1, new param 'rcu' for ->get_acl()
    69709dc518cd aufs: for v5.15-rc1, no mand-lock anymore
    ada8fe9543e5 aufs: 5.14-20210906  ---> 5.14-20211018
    b77f7f3f394a Revert "aufs: adjust to v5.15 fs changes"
    81bdce5b5876 tick/nohz: WARN_ON --> WARN_ON_ONCE to prevent console saturation
    97c963889222 sched/isolation: really align nohz_full with rcu_nocbs
    871f23ad3627 Revert "ARM: defconfig: Enable ax88796c driver for Exynos boards"
    ffad0783dd5b ARM: config: multi v7: Regenerate defconifg
    5c1e1a1ff2d3 ARM: config: multi v7: Add renamed symbols
    badaf96564fe ARM: config: multi v7: Clean up enabled by default options
    34996040fc9b ARM: config: multi v7: Drop unavailable options
    7f685244afb3 powerpc/mm: Switch obsolete dssall to .long
    20301aeb1a64 riscv: fix build with binutils 2.38
    9df58d070506 powerpc/lib/sstep: fix 'ptesync' build error
    720b61fc400b x86_64_defconfig: Fix warnings
    02bf23d26bc4 arm64: defconfig: cleanup config options
    05914e2c87e5 arm: defconfig: drop unused POWER_AVS option
    ffb532fa19b9 aufs5: fix build against v5.15.3+
    a4b3abf4d96d qemux86: add configuration symbol to select values
    fee94ee09154 clear_warn_once: add a clear_warn_once= boot parameter
    3d8762d900d9 clear_warn_once: bind a timer to written reset value
    95faacac47e8 clear_warn_once: expand debugfs to include read support
    de20c4240018 perf: perf can not parser the backtrace of app in the 32bit system and 64bit kernel.
    0e4aacead9c1 perf: x86-32: explicitly include <errno.h>
    9ad92c11468e perf: mips64: Convert __u64 to unsigned long long
    09e7efe3e68a perf: fix bench numa compilation
    e79becc44fa6 perf: add SLANG_INC for slang.h
    b1033b588681 perf: add sgidefs.h to for mips builds
    cf9db484ac0b perf: change --root to --prefix for python install
    7fd052c2c562 perf: add 'libperl not found' warning
    27a437cdd469 perf: force include of <stdbool.h>
    3b99d21bec2f fat: don't use obsolete random32 call in namei_vfat
    a7e9293b506b FAT: Added FAT_NO_83NAME
    6fd0e71d9e5c FAT: Add CONFIG_VFAT_NO_CREATE_WITH_LONGNAMES option
    c379b0d324ae FAT: Add CONFIG_VFAT_FS_NO_DUALNAMES option
    538be0fdb124 aufs: adjust to v5.15 fs changes
    f45da75c8759 aufs5: core
    047f57e07e01 aufs5: standalone
    029fc15574c8 aufs5: mmap
    610d0192ee94 aufs5: base
    d4e428d0ec5f aufs5: kbuild
    eb067eca251a yaffs: replace IS_ERR with IS_ERR_OR_NULL to check both ERR and NULL
    286af18d0875 yaffs: fix -Wstringop-overread compile warning in yaffs_fix_null_name
    24d59a4e26a6 yaffs2: v5.12+ build fixups (not runtime tested)
    22c73536d5d7 yaffs: include blkdev.h
    506b7251bfb8 yaffs: fix misplaced variable declaration
    a0e26ff364dc yaffs2: v5.6 build fixups
    b10b1b2d169e yaffs2: fix memory leak when /proc/yaffs is read
    ad9adccbb214 yaffs: add strict check when call yaffs_internal_read_super
    2e3c3aec8279 yaffs: repair yaffs_get_mtd_device
    d662538516a7 yaffs: Fix build failure by handling inode i_version with proper atomic API
    70a6113ee2c7 yaffs2: fix memory leak in mount/umount
    3378e4a9e404 yaffs: Avoid setting any ACL releated xattr
    ec2284edddef Yaffs:check oob size before auto selecting Yaffs1
    c2a49874051c fs: yaffs2: replace CURRENT_TIME by other appropriate apis
    e9a5105a3e73 yaffs2: adjust to proper location of MS_RDONLY
    608807406f13 yaffs2: import git revision b4ce1bb (jan, 2020)
    89e660ece42c initramfs: allow an optional wrapper script around initramfs generation
    b179dbc9aa10 iwlwifi: select MAC80211_LEDS conditionally
    3fd5ca3673d0 net/dccp: make it depend on CONFIG_BROKEN (CVE-2020-16119)
    d1f6edbf0188 arm64/perf: Fix wrong cast that may cause wrong truncation
    d202fb2caf33 defconfigs: drop obselete options
    9a27e3b5f4e7 arm64/perf: fix backtrace for AAPCS with FP enabled
    e20d8cf019b4 linux-yocto: Handle /bin/awk issues
    b6d2a3dbbd3a uvesafb: provide option to specify timeout for task completion
    adb40f1e6a1a uvesafb: print error message when task timeout occurs
    f280a1ed0962 compiler.h: Undef before redefining __attribute_const__
    4352732f268c vmware: include jiffies.h
    7954a677968d Resolve jiffies wrapping about arp
    5f28a1035d95 nfs: Allow default io size to be configured.
    0d7260ad7106 check console device file on fs when booting
    900a12e37e0a mount_root: clarify error messages for when no rootfs found
    7b878cbea726 menuconfig,mconf-cfg: Allow specification of ncurses location
    6604fc1763b3 modpost: mask trivial warnings
    0d294adb09cb kbuild: exclude meta directory from distclean processing
    a097cdd95a9e powerpc: serialize image targets
    5db6ec39a0a3 arm: serialize build targets
    cbabca27905e crtsavres: fixups for 5.4+
    7fc7656ed403 powerpc/ptrace: Disable array-bounds warning with gcc8
    a5faac5a19a2 powerpc: Disable attribute-alias warnings from gcc8
    186c54665b67 powerpc: add crtsavres.o to archprepare for kbuild
    d1ea862964ca powerpc: kexec fix for powerpc64
    2ac35b89a0f9 powerpc: Add unwind information for SPE registers of E500 core
    2e1c348a28bb mips: vdso: fix 'jalr $t9' crash in vdso code
    ec57870b303a mips: Kconfig: add QEMUMIPS64 option
    6a81b3c08107 4kc cache tlb hazard: tlbp cache coherency
    74e3b2a21e54 malta uhci quirks: make allowance for slow 4k(e)c
    22e65b63d3b4 arm/Makefile: Fix systemtap
    b7f1ab59f19e vexpress: Pass LOADADDR to Makefile
    ce2800c73bf7 arm: ARM EABI socketcall
    019d142fd956 ARM: LPAE: Invalidate the TLB for module addresses during translation fault

(From OE-Core rev: 88ec14db188d701168a6d6978475bd9fd61cb20b)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-08 09:03:46 -07:00
Soumya Sambu
7506cbff40 go: Fix CVE-2024-24789
The archive/zip package's handling of certain types of invalid zip files
differs from the behavior of most zip implementations. This misalignment
could be exploited to create an zip file with contents that vary depending
on the implementation reading the file. The archive/zip package now rejects
files containing these errors.

References:
https://nvd.nist.gov/vuln/detail/CVE-2024-24789

Upstream-patch:
c8e40338cf

(From OE-Core rev: f198fdc392c6e3b99431383ab6577749e83f1cb3)

Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-08 09:03:45 -07:00
Ashish Sharma
ae4a66db4b gtk+3 : backport fix for CVE-2024-6655
stop looking for modules in cwd in gtk/gtkmodules.c.

Upstream-Status: Backport [https://launchpad.net/ubuntu/+source/gtk+3.0/3.24.33-1ubuntu2.2]

(From OE-Core rev: 37b9eb01dc6342bc0308c9c970e3c379c83b706f)

Signed-off-by: Ashish Sharma <asharma@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-08 09:03:45 -07:00
Peter Marko
93ef091fb2 gcc-runtime: remove bashism
Debian 12 no longer supports replacing dash with bash as default shell.
Therefore to achieve compatibility with Debian 12, all bashisms need
to be removed.

Shell comparison via == gives an error with dash and thus the condition
is always false.

(From OE-Core rev: 3723b26f82219ff71823335d550dbf29086d63d4)

(From OE-Core rev: c6cafd2aa50357c80fbab79741d575ff567c5766)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-05 06:02:01 -07:00
Wang Mingyu
0405a3b4f3 wireless-regdb: upgrade 2024.01.23 -> 2024.05.08
(From OE-Core rev: 0f9dae1adabb4fc22e8c4849eb2d52aecf21c19f)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 0823e8ea83ac907b37bc9eb0ec7dc32862997eff)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-05 06:02:01 -07:00
Deepthi Hemraj
2a6c675b9a llvm: Fix CVE-2024-31852
(From OE-Core rev: c001e2af10d8afa13c8f50632a074c5a9a00d7bb)

Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-05 06:02:01 -07:00
Deepthi Hemraj
e135227779 llvm: Fix CVE-2023-46049
[Bitcode] Add some missing GetTypeByID failure checks

Print an error instead of crashing.

(From OE-Core rev: 9cc4518226488693942ad325d6264e52006bd061)

Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-05 06:02:01 -07:00
Peter Marko
e781bf1095 wpa-supplicant: Patch CVE-2023-52160
PEAP client: Update Phase 2 authentication requirements. Also see
https://www.top10vpn.com/research/wifi-vulnerabilities/

Patch is copied from scarthgap, the recipes differ too much for
cherry-pick even if they have the same version.

(From OE-Core rev: 5e1283f0afeaf0d0aa5e1c96fc571f69897e1ca8)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-08-05 06:02:01 -07:00
Florian Amstutz
322d4df8cb uboot-sign: Fix index error in concat_dtb_helper() with multiple configs
Commit 60774248a5 solves issues when i or j
have been set in other shell functions.

Since j is not unset after the inner loop, the image will only be copied
for the first configuration.

Unsetting i and j after the loops also prevents index issues in other functions.

(From OE-Core rev: f6de96c9fa8d0b6c81c32016f342ad93c8940d9e)

Signed-off-by: Florian Amstutz <florian.amstutz@scs.ch>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-24 07:51:58 -07:00
Vijay Anusuri
b1b94b434d python3-jinja2: Upgrade 3.1.3 -> 3.1.4
Switch to use flit core since upstream changed.

They also changed the capitalisation under pypi.

The license didn't change but the file was renamed, probably as it wasn't
rst.

(From OE-Core rev: 58ee84c274b0c93902aad5d4f434daec5da55134)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e352680528b18c3cdae26233bef7cddc2771d42d)

Upgrade fixes CVE-2024-34064

Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-24 07:51:58 -07:00
Peter Marko
67e1f5404c libarchive: ignore CVE-2024-37407
History of code changes:
* introduced: 390d83012f (v3.7.2-52-g390d8301)
* reverted: 6https://github.com/libarchive/libarchive/commit/2c8caf6611a7d0662d80176c4fdb40f85794699 (v3.7.2-53-g62c8caf6)
* re-introduced: 9https://github.com/libarchive/libarchive/commit/1f27004a5c88589658e38d68e46d223da6b75ca (v3.7.3-14-g91f27004)
* fixed: bhttps://github.com/libarchive/libarchive/commit/6a979481b7d77c12fa17bbed94576b63bbcb0c0 (v3.7.3-24-gb6a97948)

Since there is no release where this CVE was present, we can safely
ignore it.

(From OE-Core rev: 2b407f34df5a768c271fc7049e7272d1a79c04a0)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-24 07:51:58 -07:00
Peter Marko
3242d8234d busybox: Patch CVE-2021-42380
Backport patch for CVE-2021-42380.

Move if before patch for CVE-2023-42363 because they touch the same code
and they are in this order in git history so we avoid fuzz modifications.
This will remove fuzz modifications from CVE-2023-42363 and both will
apply cleanly without modifications (except line number changes and the
first one also has little fuzz fix in tests).
This will also make it equal to master/scarthgap patch order/content.

(From OE-Core rev: af3c8ff64054e131b009545883cb87454ce04b64)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-24 07:51:58 -07:00
Ashish Sharma
6d58d0c4a2 ruby: backport fix for CVE-2024-27282
Upstream-Status: Backport [989a235580]
(From OE-Core rev: 94a0350058e51c4b05bf5d4e02d048c2e6256725)

Signed-off-by: Ashish Sharma <asharma@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-24 07:51:58 -07:00
Hitendra Prajapati
4bad38de6e busybox: Fix CVE-2023-42363
Upstream-Status: Backport from https://git.busybox.net/busybox/commit/?id=fb08d43d44d1fea1f741fafb9aa7e1958a5f69aa

(From OE-Core rev: 929deb4a80d65dc3a6e9a523f1aed12635ed7d53)

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-24 07:51:58 -07:00
Steve Sakoman
6bd3969d32 build-appliance-image: Update to kirkstone head revision
(From OE-Core rev: 5d97b0576e98a2cf402abab1a1edcab223545d87)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-15 10:35:04 -07:00
Steve Sakoman
75ff26ce99 poky.conf: bump version for 4.0.20
(From meta-yocto rev: c4c74d1e575217ddc4b74759cd83186a70940ef9)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-15 10:30:10 -07:00
Poonam Jadhav
be9285cbd9 glibc-tests: Add missing bash ptest dependency
The script has a bashism and needs bash to execute correctly. Mark it
as such and add the missing bash dependency so it executes in minimal
images.

(From OE-Core rev: a1b5afac108d9c94e8fc2ad8cfebfee16f6f243b)

(From OE-Core rev: 8e650506885bc4465f9569b3ccdc327eb83d90db)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 28b8d57a88)
Signed-off-by: Poonam Jadhav <poonam.jadhav@kpit.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-09 06:06:09 -07:00
Poonam Jadhav
945b58b5ba glibc-tests: correctly pull in the actual tests when installing -ptest package
The tests are packaged into the main glibc-tests package which is fine,
but then glibc-tests-ptest package needs to depend on that.
Which is what this commit addresses.

(From OE-Core rev: d37c2d428b09b9d0cbb875f083c6a1e9883a7fed)

(From OE-Core rev: c09335a23025ff78a6d3eb41c483b5a479b1c3be)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 644914efa8)
Signed-off-by: Poonam Jadhav <poonam.jadhav@kpit.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-09 06:06:09 -07:00
Jonas Gorski
b5381de5ba linuxloader: add -armhf on arm only for TARGET_FPU 'hard'
There are two types of soft FPU options for arm, soft and softfp, and if
using the latter the wrong dynamic loader will be used.

E.g. go will link against ld-linux-armhf.so.3, but libc6 will only ship
a ld-linux.so.3, so go programs will fail to start.

Fix this by instead checking for TARGET_FPU being 'hard' and then
applying the suffix.

(From OE-Core rev: c7426629245db2ea8d9f3cf25b575ac31b5a83b0)

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 07b4c7a2bd23f8645810e13439e814caaaf9cd94)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-09 06:06:09 -07:00
Jose Quaresma
979f68bad0 openssh: fix CVE-2024-6387
sshd(8) in Portable OpenSSH versions 8.5p1 to 9.7p1 (inclusive).
Race condition resulting in potential remote code execution.
A race condition in sshd(8) could allow remote code execution as root on non-OpenBSD systems.
This attack could be prevented by disabling the login grace timeout (LoginGraceTime=0 in sshd_config)
though this makes denial-of service against sshd(8) considerably easier.
For more information, please refer to the release notes [1] and the
report from the Qualys Security Advisory Team [2] who discovered the bug.

[1] https://www.openssh.com/txt/release-9.8
[2] https://www.qualys.com/2024/07/01/cve-2024-6387/regresshion.txt

References:
https://www.openssh.com/security.html

(From OE-Core rev: ddb998d16fd869acb00a1cd8038ada20fd32aa8b)

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>

v2: include the missing cve tag: CVE: CVE-2024-6387
v3: add the Signed-off-by on the CVE-2024-6387.patch
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-09 06:06:09 -07:00
Siddharth Doshi
9170d3f0f3 OpenSSL: Security fix for CVE-2024-5535
Upstream-Status: Backport from [cf6f91f612]

CVE's Fixed:
CVE-2024-5535 openssl: SSL_select_next_proto buffer overread

(From OE-Core rev: 2f4ac382a76e093a3eac6e74fbe2d136094cedf1)

Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-09 06:06:09 -07:00
Archana Polampalli
14065a801b gstreamer1.0-plugins-base: fix CVE-2024-4453
GStreamer EXIF Metadata Parsing Integer Overflow Remote Code Execution Vulnerability.
This vulnerability allows remote attackers to execute arbitrary code on affected
installations of GStreamer. Interaction with this library is required to exploit this
vulnerability but attack vectors may vary depending on the implementation. The specific
flaw exists within the parsing of EXIF metadata. The issue results from the lack of
proper validation of user-supplied data, which can result in an integer overflow before
allocating a buffer. An attacker can leverage this vulnerability to execute code in the
context of the current process. . Was ZDI-CAN-23896.

(From OE-Core rev: 6708631c89d1cb0d7e0e1b888c51826b3939f8af)

Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-09 06:06:09 -07:00
Vijay Anusuri
6635675a68 wget: Fix for CVE-2024-38428
Upstream-Status: Backport
[https://git.savannah.gnu.org/cgit/wget.git/commit/?id=ed0c7c7e0e8f7298352646b2fd6e06a11e242ace]

(From OE-Core rev: 4f7fb1cf937b0cefa5b0079417859b56c3171c0a)

Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-09 06:06:09 -07:00
Changqing Li
cbac0f1bfc man-pages: remove conflict pages
Remove the pages which libxcrypt and shadow already have to avoid
following conflicts during install man-pages and libxcrypt/shadow at the
same time.

Error: Transaction test error:
  file /usr/share/man/man3/crypt.3 from install of
  libcrypt-doc-4.4.33-r0.x86_64 conflicts with file from package
  man-pages-6.04-r0.x86_64

(From OE-Core rev: fbc8f5381e8e1da0d06f7f8e5b8c63a49b1858c2)

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 605b4a91dc44d33bd4742841e71645275bc039e8)
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-26 05:04:39 -07:00
Thomas Perrot
7c5fc9fedc man-pages: add an alternative link name for crypt_r.3
Because crypt_r.3 is also provided by libxcrypt-doc.

(From OE-Core rev: 5160fb6bf6ef49c0c33b000f377a56effd398fd0)

Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit ae5a8629ea72d6b3567047c7b858deae28623aba)
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-26 05:04:39 -07:00
Khem Raj
af50c9154c gobject-introspection: Do not hardcode objdump name
Use OBJDUMP variable in the script, this helps in using the lddwrapper
with recipes which maybe using different objdump tools e.g.l
llvm-objdump or vice-versa

(From OE-Core rev: bbbb515f7df240b8679567cd3e04d6b4ccc65f6d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit c04b3e0e371859c159b76bff87a5b1299b51d0c8)
Signed-off-by: Daiane Angolini <daiane.angolini@foundries.io>
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-26 05:04:39 -07:00
Siddharth
940a24ab8b openssl: Upgrade 3.0.13 -> 3.0.14
CVE's Fixed by upgrade:
CVE-2024-4741: Fixed potential use after free after SSL_free_buffers() is called
CVE-2024-4603: Fixed an issue where checking excessively long DSA keys or parameters may be very slow
CVE-2024-2511: Fixed unbounded memory growth with session handling in TLSv1.3

Removed backports of CVE-2024-2511 and CVE-2024-4603 as they are already
fixed.

Detailed Information:
https://github.com/openssl/openssl/blob/openssl-3.0/CHANGES.md#changes-between-3013-and-3014-4-jun-2024

(From OE-Core rev: 8f51bac2a05747ea186e928eda2358f2e6295883)

Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-26 05:04:39 -07:00
Deepthi Hemraj
14fe1f1319 glibc: stable 2.35 branch updates
Below commit on glibc-2.35 stable branch is updated.
72abffe225 Force DT_RPATH for --enable-hardcoded-path-in-tests

(From OE-Core rev: 8accff90a850265ecc8570cfa15e8e5963d2a5d7)

Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-26 05:04:39 -07:00
Yogita Urade
52f1435174 ruby: fix CVE-2024-27280
A buffer-overread issue was discovered in StringIO 3.0.1, as
distributed in Ruby 3.0.x through 3.0.6 and 3.1.x through
3.1.4. The ungetbyte and ungetc methods on a StringIO can
read past the end of a string, and a subsequent call to
StringIO.gets may return the memory value. 3.0.3 is the main
fixed version; however, for Ruby 3.0 users, a fixed version
is stringio 3.0.1.1, and for Ruby 3.1 users, a fixed version
is stringio 3.0.1.2.

Reference:
https://nvd.nist.gov/vuln/detail/CVE-2024-27280

(From OE-Core rev: 729310d17310dff955c51811ff3339fdbc017b95)

Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-26 05:04:39 -07:00
Yogita Urade
064e000b18 acpica: fix CVE-2024-24856
The memory allocation function ACPI_ALLOCATE_ZEROED does not
guarantee a successful allocation, but the subsequent code
directly dereferences the pointer that receives it, which may
lead to null pointer dereference. To fix this issue, a null
pointer check should be added. If it is null, return exception
code AE_NO_MEMORY.

Reference:
https://nvd.nist.gov/vuln/detail/CVE-2024-24856

(From OE-Core rev: 0920aacb2a042e10e54db949428471ef9b20c96d)

Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-26 05:04:39 -07:00
Siddharth Doshi
e2366b9d09 libxml2: Security fix for CVE-2024-34459
Upstream-Status: Backport from [2876ac5392]

CVE's Fixed:
CVE-2024-34459 libxml2: buffer over-read in xmlHTMLPrintFileContext in xmllint.c

(From OE-Core rev: b9f46d058854c0a6104a928b7b0b30d65fb87c2e)

Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-26 05:04:39 -07:00
Peter Marko
f27a1997b6 glib-2.0: patch CVE-2024-34397
This is taken from https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4047
That MR was not merged as 2.72 is inactive branch now.
But it can be used by distributions, like Ubuntu did under
https://git.launchpad.net/ubuntu/+source/glib2.0/commit/?h=applied/ubuntu/jammy-security&id=94425c909b037c63c9dbbf72015f628ed4ad4aea

(From OE-Core rev: 95e8507848e3143eca83621f6572439e22f60bd4)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-26 05:04:39 -07:00
Lee Chee Yang
35a517b7bd migration-guides: add release notes for 4.0.19
add release notes for 4.0.19.

(From yocto-docs rev: b15b1d369edf33cd91232fefa0278e7e89653a01)

Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Reviewed-by: Michael Opdenacker <michael@opdenacker.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-24 06:53:46 -07:00
Steve Sakoman
4374c6dfab bitbake: tests/fetch: Tweak test to match upstream repo url change Upstream changed their urls, update our test to match.
(Bitbake rev: 734b0ea3dfe45eb16ee60f0c2c388e22af4040e0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-24 06:53:45 -07:00
130 changed files with 9905 additions and 453 deletions

View File

@@ -261,12 +261,9 @@ class VariableHistory(object):
return
if 'op' not in loginfo or not loginfo['op']:
loginfo['op'] = 'set'
if 'detail' in loginfo:
loginfo['detail'] = str(loginfo['detail'])
if 'variable' not in loginfo or 'file' not in loginfo:
raise ValueError("record() missing variable or file.")
var = loginfo['variable']
if var not in self.variables:
self.variables[var] = []
if not isinstance(self.variables[var], list):
@@ -325,7 +322,8 @@ class VariableHistory(object):
flag = '[%s] ' % (event['flag'])
else:
flag = ''
o.write("# %s %s:%s%s\n# %s\"%s\"\n" % (event['op'], event['file'], event['line'], display_func, flag, re.sub('\n', '\n# ', event['detail'])))
o.write("# %s %s:%s%s\n# %s\"%s\"\n" % \
(event['op'], event['file'], event['line'], display_func, flag, re.sub('\n', '\n# ', str(event['detail']))))
if len(history) > 1:
o.write("# pre-expansion value:\n")
o.write('# "%s"\n' % (commentVal))
@@ -379,7 +377,7 @@ class VariableHistory(object):
if isset and event['op'] == 'set?':
continue
isset = True
items = d.expand(event['detail']).split()
items = d.expand(str(event['detail'])).split()
for item in items:
# This is a little crude but is belt-and-braces to avoid us
# having to handle every possible operation type specifically

View File

@@ -1335,7 +1335,7 @@ class FetchLatestVersionTest(FetcherTest):
# combination version pattern
("sysprof", "git://gitlab.gnome.org/GNOME/sysprof.git;protocol=https;branch=master", "cd44ee6644c3641507fb53b8a2a69137f2971219", "")
: "1.2.0",
("u-boot-mkimage", "git://git.denx.de/u-boot.git;branch=master;protocol=git", "62c175fbb8a0f9a926c88294ea9f7e88eb898f6c", "")
("u-boot-mkimage", "git://source.denx.de/u-boot/u-boot.git;branch=master;protocol=https", "62c175fbb8a0f9a926c88294ea9f7e88eb898f6c", "")
: "2014.01",
# version pattern "yyyymmdd"
("mobile-broadband-provider-info", "git://gitlab.gnome.org/GNOME/mobile-broadband-provider-info.git;protocol=https;branch=master", "4ed19e11c2975105b71b956440acdb25d46a347d", "")

View File

@@ -25,3 +25,6 @@ Release 4.0 (kirkstone)
release-notes-4.0.16
release-notes-4.0.17
release-notes-4.0.18
release-notes-4.0.19
release-notes-4.0.20

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,130 @@
.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
Release notes for Yocto-4.0.20 (Kirkstone)
------------------------------------------
Security Fixes in Yocto-4.0.20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- acpica: Fix :cve:`2024-24856`
- glib-2.0: Fix :cve:`2024-34397`
- gstreamer1.0-plugins-base: Fix :cve:`2024-4453`
- libxml2: Fix :cve:`2024-34459`
- openssh: fix :cve:`2024-6387`
- openssl: Fix :cve_mitre:`2024-4741` and :cve:`2024-5535`
- ruby: fix :cve:`2024-27280`
- wget: Fix for :cve:`2024-38428`
Fixes in Yocto-4.0.20
~~~~~~~~~~~~~~~~~~~~~
- bitbake: tests/fetch: Tweak test to match upstream repo url change Upstream changed their urls, update our test to match.
- build-appliance-image: Update to kirkstone head revision
- glibc-tests: Add missing bash ptest dependency
- glibc-tests: correctly pull in the actual tests when installing -ptest package
- glibc: stable 2.35 branch updates
- gobject-introspection: Do not hardcode objdump name
- linuxloader: add -armhf on arm only for :term:`TARGET_FPU` 'hard'
- man-pages: add an alternative link name for crypt_r.3
- man-pages: remove conflict pages
- migration-guides: add release notes for 4.0.19
- openssl: Upgrade 3.0.13 -> 3.0.14
- poky.conf: bump version for 4.0.20
Known Issues in Yocto-4.0.20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- N/A
Contributors to Yocto-4.0.20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Archana Polampalli
- Changqing Li
- Deepthi Hemraj
- Jonas Gorski
- Jose Quaresma
- Khem Raj
- Lee Chee Yang
- Peter Marko
- Poonam Jadhav
- Siddharth Doshi
- Steve Sakoman
- Thomas Perrot
- Vijay Anusuri
- Yogita Urade
Repositories / Downloads for Yocto-4.0.20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
poky
- Repository Location: :yocto_git:`/poky`
- Branch: :yocto_git:`kirkstone </poky/log/?h=kirkstone>`
- Tag: :yocto_git:`yocto-4.0.20 </poky/log/?h=yocto-4.0.20>`
- Git Revision: :yocto_git:`6bd3969d32730538608e680653e032e66958fe84 </poky/commit/?id=6bd3969d32730538608e680653e032e66958fe84>`
- Release Artefact: poky-6bd3969d32730538608e680653e032e66958fe84
- sha: b7ef1bd5ba1af257c4eb07a59b51d69e147723aea010eb2da99ea30dcbbbe2d9
- Download Locations:
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.20/poky-6bd3969d32730538608e680653e032e66958fe84.tar.bz2
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.20/poky-6bd3969d32730538608e680653e032e66958fe84.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.20 </openembedded-core/log/?h=yocto-4.0.20>`
- Git Revision: :oe_git:`5d97b0576e98a2cf402abab1a1edcab223545d87 </openembedded-core/commit/?id=5d97b0576e98a2cf402abab1a1edcab223545d87>`
- Release Artefact: oecore-5d97b0576e98a2cf402abab1a1edcab223545d87
- sha: 4064a32b8ff1ad8a98aa15e75b27585d2b27236c8cdfa4a28af6d6fef99b93c0
- Download Locations:
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.20/oecore-5d97b0576e98a2cf402abab1a1edcab223545d87.tar.bz2
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.20/oecore-5d97b0576e98a2cf402abab1a1edcab223545d87.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.20 </meta-mingw/log/?h=yocto-4.0.20>`
- Git Revision: :yocto_git:`f6b38ce3c90e1600d41c2ebb41e152936a0357d7 </meta-mingw/commit/?id=f6b38ce3c90e1600d41c2ebb41e152936a0357d7>`
- Release Artefact: meta-mingw-f6b38ce3c90e1600d41c2ebb41e152936a0357d7
- sha: 7d57167c19077f4ab95623d55a24c2267a3a3fb5ed83688659b4c03586373b25
- Download Locations:
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.20/meta-mingw-f6b38ce3c90e1600d41c2ebb41e152936a0357d7.tar.bz2
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.20/meta-mingw-f6b38ce3c90e1600d41c2ebb41e152936a0357d7.tar.bz2
meta-gplv2
- Repository Location: :yocto_git:`/meta-gplv2`
- Branch: :yocto_git:`kirkstone </meta-gplv2/log/?h=kirkstone>`
- Tag: :yocto_git:`yocto-4.0.20 </meta-gplv2/log/?h=yocto-4.0.20>`
- Git Revision: :yocto_git:`d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a </meta-gplv2/commit/?id=d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a>`
- Release Artefact: meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a
- sha: c386f59f8a672747dc3d0be1d4234b6039273d0e57933eb87caa20f56b9cca6d
- Download Locations:
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.20/meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a.tar.bz2
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.20/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.20 </bitbake/log/?h=yocto-4.0.20>`
- Git Revision: :oe_git:`734b0ea3dfe45eb16ee60f0c2c388e22af4040e0 </bitbake/commit/?id=734b0ea3dfe45eb16ee60f0c2c388e22af4040e0>`
- Release Artefact: bitbake-734b0ea3dfe45eb16ee60f0c2c388e22af4040e0
- sha: 99f4c6786fec790fd6c4577b5dea3c97c580cc4815bd409ce554a68ee99b0180
- Download Locations:
http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.20/bitbake-734b0ea3dfe45eb16ee60f0c2c388e22af4040e0.tar.bz2
http://mirrors.kernel.org/yocto/yocto/yocto-4.0.20/bitbake-734b0ea3dfe45eb16ee60f0c2c388e22af4040e0.tar.bz2
yocto-docs
- Repository Location: :yocto_git:`/yocto-docs`
- Branch: :yocto_git:`kirkstone </yocto-docs/log/?h=kirkstone>`
- Tag: :yocto_git:`yocto-4.0.20 </yocto-docs/log/?h=yocto-4.0.20>`
- Git Revision: :yocto_git:`b15b1d369edf33cd91232fefa0278e7e89653a01 </yocto-docs/commit/?id=b15b1d369edf33cd91232fefa0278e7e89653a01>`

View File

@@ -8123,6 +8123,35 @@ system and gives an overview of their function and contents.
/sysroot-only \
"
Consider the following example in which you need to manipulate this variable.
Assume you have a recipe ``A`` that provides a shared library ``.so.*`` that is
installed into a custom folder other than "``${libdir}``"
or "``${base_libdir}``", let's say "``/opt/lib``".
.. note::
This is not a recommended way to deal with shared libraries, but this
is just to show the usefulness of setting :term:`SYSROOT_DIRS`.
When a recipe ``B`` :term:`DEPENDS` on ``A``, it means what is in
:term:`SYSROOT_DIRS` will be copied from :term:`D` of the recipe ``A``
into ``B``'s :term:`SYSROOT_DESTDIR` that is "``${WORKDIR}/sysroot-destdir``".
Now, since ``/opt/lib`` is not in :term:`SYSROOT_DIRS`, it will never be copied to
``A``'s :term:`RECIPE_SYSROOT`, which is "``${WORKDIR}/recipe-sysroot``". So,
the linking process will fail.
To fix this, you need to add ``/opt/lib`` to :term:`SYSROOT_DIRS`::
SYSROOT_DIRS:append = " /opt/lib"
.. note::
Even after setting ``/opt/lib`` to :term:`SYSROOT_DIRS`, the linking process will still fail
because the linker does not know that location, since :term:`TARGET_LDFLAGS`
doesn't contain it (if your recipe is for the target). Therefore, so you should add::
TARGET_LDFLAGS:append = " -L${RECIPE_SYSROOT}/opt/lib"
:term:`SYSROOT_DIRS_IGNORE`
Directories that are not staged into the sysroot by the
:ref:`ref-tasks-populate_sysroot` task. You
@@ -8146,35 +8175,6 @@ system and gives an overview of their function and contents.
${libdir}/${BPN}/ptest \
"
Consider the following example in which you need to manipulate this variable.
Assume you have a recipe ``A`` that provides a shared library ``.so.*`` that is
installed into a custom folder other than "``${libdir}``"
or "``${base_libdir}``", let's say "``/opt/lib``".
.. note::
This is not a recommended way to deal with shared libraries, but this
is just to show the usefulness of setting :term:`SYSROOT_DIRS`.
When a recipe ``B`` :term:`DEPENDS` on ``A``, it means what is in
:term:`SYSROOT_DIRS` will be copied from :term:`D` of the recipe ``B``
into ``B``'s :term:`SYSROOT_DESTDIR` that is "``${WORKDIR}/sysroot-destdir``".
Now, since ``/opt/lib`` is not in :term:`SYSROOT_DIRS`, it will never be copied to
``A``'s :term:`RECIPE_SYSROOT`, which is "``${WORKDIR}/recipe-sysroot``". So,
the linking process will fail.
To fix this, you need to add ``/opt/lib`` to :term:`SYSROOT_DIRS`::
SYSROOT_DIRS:append = " /opt/lib"
.. note::
Even after setting ``/opt/lib`` to :term:`SYSROOT_DIRS`, the linking process will still fail
because the linker does not know that location, since :term:`TARGET_LDFLAGS`
doesn't contain it (if your recipe is for the target). Therefore, so you should add::
TARGET_LDFLAGS:append = " -L${RECIPE_SYSROOT}/opt/lib"
:term:`SYSROOT_DIRS_NATIVE`
Extra directories staged into the sysroot by the
:ref:`ref-tasks-populate_sysroot` task for

View File

@@ -1,7 +1,7 @@
DISTRO = "poky"
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
#DISTRO_VERSION = "3.4+snapshot-${METADATA_REVISION}"
DISTRO_VERSION = "4.0.19"
DISTRO_VERSION = "4.0.21"
DISTRO_CODENAME = "kirkstone"
SDK_VENDOR = "-pokysdk"
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${METADATA_REVISION}', 'snapshot')}"

View File

@@ -292,8 +292,8 @@ CONVERSION_CMD:lzma = "lzma -k -f -7 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
CONVERSION_CMD:gz = "gzip -f -9 -n -c --rsyncable ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.gz"
CONVERSION_CMD:bz2 = "pbzip2 -f -k ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
CONVERSION_CMD:xz = "xz -f -k -c ${XZ_COMPRESSION_LEVEL} ${XZ_DEFAULTS} --check=${XZ_INTEGRITY_CHECK} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.xz"
CONVERSION_CMD:lz4 = "lz4 -9 -z -l ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.lz4"
CONVERSION_CMD:lzo = "lzop -9 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
CONVERSION_CMD:lz4 = "lz4 -f -9 -z -l ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.lz4"
CONVERSION_CMD:lzo = "lzop -f -9 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
CONVERSION_CMD:zip = "zip ${ZIP_COMPRESSION_LEVEL} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.zip ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
CONVERSION_CMD:zst = "zstd -f -k -T0 -c ${ZSTD_COMPRESSION_LEVEL} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.zst"
CONVERSION_CMD:sum = "sumtool -i ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} -o ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sum ${JFFS2_SUM_EXTRA_ARGS}"

View File

@@ -49,7 +49,7 @@ def get_glibc_loader(d):
elif re.search("i.86", targetarch):
dynamic_loader = "${base_libdir}/ld-linux.so.2"
elif targetarch == "arm":
dynamic_loader = "${base_libdir}/ld-linux${@['-armhf', ''][d.getVar('TARGET_FPU') == 'soft']}.so.3"
dynamic_loader = "${base_libdir}/ld-linux${@['', '-armhf'][d.getVar('TARGET_FPU') == 'hard']}.so.3"
elif targetarch.startswith("aarch64"):
dynamic_loader = "${base_libdir}/ld-linux-aarch64${ARMPKGSFX_ENDIAN_64}.so.1"
elif targetarch.startswith("riscv64"):

View File

@@ -137,8 +137,7 @@ concat_dtb_helper() {
if [ -n "${UBOOT_CONFIG}" ]
then
i=0
j=0
unset i j
for config in ${UBOOT_MACHINE}; do
i=$(expr $i + 1);
for type in ${UBOOT_CONFIG}; do
@@ -146,9 +145,12 @@ concat_dtb_helper() {
if [ $j -eq $i ]
then
cp ${UBOOT_IMAGE} ${B}/${CONFIG_B_PATH}/u-boot-$type.${UBOOT_SUFFIX}
break
fi
done
unset j
done
unset i
fi
else
bbwarn "Failure while adding public key to u-boot binary. Verified boot won't be available."

View File

@@ -0,0 +1,70 @@
From e43f3d93b28cce852c110c7a8e40d8311bcd8bb1 Mon Sep 17 00:00:00 2001
From: Robbie Harwood <rharwood@redhat.com>
Date: Fri, 15 Jul 2022 16:13:02 -0400
Subject: [PATCH] fs/fat: Don't error when mtime is 0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In the wild, we occasionally see valid ESPs where some file modification
times are 0. For instance:
├── [Dec 31 1979] EFI
│ ├── [Dec 31 1979] BOOT
│ │ ├── [Dec 31 1979] BOOTX64.EFI
│ │ └── [Dec 31 1979] fbx64.efi
│ └── [Jun 27 02:41] fedora
│ ├── [Dec 31 1979] BOOTX64.CSV
│ ├── [Dec 31 1979] fonts
│ ├── [Mar 14 03:35] fw
│ │ ├── [Mar 14 03:35] fwupd-359c1169-abd6-4a0d-8bce-e4d4713335c1.cap
│ │ ├── [Mar 14 03:34] fwupd-9d255c4b-2d88-4861-860d-7ee52ade9463.cap
│ │ └── [Mar 14 03:34] fwupd-b36438d8-9128-49d2-b280-487be02d948b.cap
│ ├── [Dec 31 1979] fwupdx64.efi
│ ├── [May 10 10:47] grub.cfg
│ ├── [Jun 3 12:38] grub.cfg.new.new
│ ├── [May 10 10:41] grub.cfg.old
│ ├── [Jun 27 02:41] grubenv
│ ├── [Dec 31 1979] grubx64.efi
│ ├── [Dec 31 1979] mmx64.efi
│ ├── [Dec 31 1979] shim.efi
│ ├── [Dec 31 1979] shimx64.efi
│ └── [Dec 31 1979] shimx64-fedora.efi
└── [Dec 31 1979] FSCK0000.REC
5 directories, 17 files
This causes grub-probe failure, which in turn causes grub-mkconfig
failure. They are valid filesystems that appear intact, and the Linux
FAT stack is able to mount and manipulate them without complaint.
The check for mtime of 0 has been present since
20def1a3c3952982395cd7c3ea7e78638527962b (fat: support file
modification times).
Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=e43f3d93b28cce852c110c7a8e40d8311bcd8bb1]
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
---
grub-core/fs/fat.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/grub-core/fs/fat.c b/grub-core/fs/fat.c
index 0951b2e63..c5efed724 100644
--- a/grub-core/fs/fat.c
+++ b/grub-core/fs/fat.c
@@ -1027,9 +1027,6 @@ grub_fat_dir (grub_device_t device, const char *path, grub_fs_dir_hook_t hook,
grub_le_to_cpu16 (ctxt.dir.w_date),
&info.mtime);
#endif
- if (info.mtimeset == 0)
- grub_error (GRUB_ERR_OUT_OF_RANGE,
- "invalid modification timestamp for %s", path);
if (hook (ctxt.filename, &info, hook_data))
break;
--
2.34.1

View File

@@ -40,6 +40,7 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
file://CVE-2022-28736-loader-efi-chainloader-Use-grub_loader_set_ex.patch \
file://CVE-2023-4692.patch \
file://CVE-2023-4693.patch \
file://0001-fs-fat-Don-t-error-when-mtime-is-0.patch \
"
SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f"

View File

@@ -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] = "709d73023c9115ddad3bab65b6c8c79a590196d0d114f5d0ca2533dbd52ddf66"
SRC_URI[sha256sum] = "e7cce9a165f7b619eefc4832f0a8dc16b005d29e3890aed6008c506ea286a5e7"
UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
# follow the ESV versions divisible by 2

View File

@@ -0,0 +1,37 @@
From a90421d8e45d63b304dc010baba24633e7869682 Mon Sep 17 00:00:00 2001
From: Denis Kenzior <denkenz@gmail.com>
Date: Mon, 5 Aug 2024 19:50:04 +0800
Subject: [PATCH] smsutil: ensure the address length in bytes <= 10
If a specially formatted SMS is received, it is conceivable that the
address length might overflow the structure it is being parsed into.
Ensure that the length in bytes of the address never exceeds 10.
CVE: CVE-2023-2794
Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=a90421d8e45d63b304dc010baba24633e7869682]
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
---
src/smsutil.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/smsutil.c b/src/smsutil.c
index 8dd2126..d8170d1 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -643,7 +643,12 @@ gboolean sms_decode_address_field(const unsigned char *pdu, int len,
else
byte_len = (addr_len + 1) / 2;
- if ((len - *offset) < byte_len)
+ /*
+ * 23.040:
+ * The maximum length of the full address field
+ * (AddressLength, TypeofAddress and AddressValue) is 12 octets.
+ */
+ if ((len - *offset) < byte_len || byte_len > 10)
return FALSE;
out->number_type = bit_field(addr_type, 4, 3);
--
2.25.1

View File

@@ -0,0 +1,32 @@
From 7f2adfa22fbae824f8e2c3ae86a3f51da31ee400 Mon Sep 17 00:00:00 2001
From: Denis Kenzior <denkenz@gmail.com>
Date: Mon, 5 Aug 2024 20:06:09 +0800
Subject: [PATCH] smsutil: Check cbs_dcs_decode return value
It is better to explicitly check the return value of cbs_dcs_decode
instead of relying on udhi not being changed due to side-effects.
CVE: CVE-2023-2794
Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=7f2adfa22fbae824f8e2c3ae86a3f51da31ee400]
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
---
src/smsutil.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/smsutil.c b/src/smsutil.c
index d8170d1..7746a71 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -1765,7 +1765,8 @@ gboolean sms_udh_iter_init_from_cbs(const struct cbs *cbs,
const guint8 *hdr;
guint8 max_ud_len;
- cbs_dcs_decode(cbs->dcs, &udhi, NULL, NULL, NULL, NULL, NULL);
+ if (!cbs_dcs_decode(cbs->dcs, &udhi, NULL, NULL, NULL, NULL, NULL))
+ return FALSE;
if (!udhi)
return FALSE;
--
2.25.1

View File

@@ -0,0 +1,44 @@
From 07f48b23e3877ef7d15a7b0b8b79d32ad0a3607e Mon Sep 17 00:00:00 2001
From: Denis Kenzior <denkenz@gmail.com>
Date: Mon, 5 Aug 2024 20:23:38 +0800
Subject: [PATCH] simutil: Make sure set_length on the parent succeeds
CVE: CVE-2023-2794
Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=07f48b23e3877ef7d15a7b0b8b79d32ad0a3607e]
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
---
src/simutil.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/simutil.c b/src/simutil.c
index 59d8d5d..0e131e8 100644
--- a/src/simutil.c
+++ b/src/simutil.c
@@ -588,8 +588,9 @@ gboolean ber_tlv_builder_set_length(struct ber_tlv_builder *builder,
if (new_pos > builder->max)
return FALSE;
- if (builder->parent)
- ber_tlv_builder_set_length(builder->parent, new_pos);
+ if (builder->parent &&
+ !ber_tlv_builder_set_length(builder->parent, new_pos))
+ return FALSE;
builder->len = new_len;
@@ -730,9 +731,9 @@ gboolean comprehension_tlv_builder_set_length(
if (builder->pos + new_ctlv_len > builder->max)
return FALSE;
- if (builder->parent)
- ber_tlv_builder_set_length(builder->parent,
- builder->pos + new_ctlv_len);
+ if (builder->parent && !ber_tlv_builder_set_length(builder->parent,
+ builder->pos + new_ctlv_len))
+ return FALSE;
len = MIN(builder->len, new_len);
if (len > 0 && new_len_size != len_size)
--
2.25.1

View File

@@ -0,0 +1,127 @@
From 8fa1fdfcb54e1edb588c6a5e2688880b065a39c9 Mon Sep 17 00:00:00 2001
From: Denis Kenzior <denkenz@gmail.com>
Date: Mon, 5 Aug 2024 20:38:20 +0800
Subject: [PATCH] smsutil: Use a safer strlcpy
sms_address_from_string is meant as private API, to be used with string
form addresses that have already been sanitized. However, to be safe,
use a safe version of strcpy to avoid overflowing the buffer in case the
input was not sanitized properly. While here, add a '__' prefix to the
function name to help make it clearer that this API is private and
should be used with more care.
CVE: CVE-2023-2794
Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=8fa1fdfcb54e1edb588c6a5e2688880b065a39c9]
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
---
src/smsutil.c | 14 +++++++-------
src/smsutil.h | 2 +-
unit/test-sms.c | 6 +++---
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/smsutil.c b/src/smsutil.c
index 7746a71..e073a06 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -1887,15 +1887,15 @@ time_t sms_scts_to_time(const struct sms_scts *scts, struct tm *remote)
return ret;
}
-void sms_address_from_string(struct sms_address *addr, const char *str)
+void __sms_address_from_string(struct sms_address *addr, const char *str)
{
addr->numbering_plan = SMS_NUMBERING_PLAN_ISDN;
if (str[0] == '+') {
addr->number_type = SMS_NUMBER_TYPE_INTERNATIONAL;
- strcpy(addr->address, str + 1);
+ l_strlcpy(addr->address, str + 1, sizeof(addr->address));
} else {
addr->number_type = SMS_NUMBER_TYPE_UNKNOWN;
- strcpy(addr->address, str);
+ l_strlcpy(addr->address, str, sizeof(addr->address));
}
}
@@ -3087,7 +3087,7 @@ gboolean status_report_assembly_report(struct status_report_assembly *assembly,
}
}
- sms_address_from_string(&addr, straddr);
+ __sms_address_from_string(&addr, straddr);
if (pending == TRUE && node->deliverable == TRUE) {
/*
@@ -3180,7 +3180,7 @@ void status_report_assembly_expire(struct status_report_assembly *assembly,
while (g_hash_table_iter_next(&iter_addr, (gpointer) &straddr,
(gpointer) &id_table)) {
- sms_address_from_string(&addr, straddr);
+ __sms_address_from_string(&addr, straddr);
g_hash_table_iter_init(&iter_node, id_table);
/* Go through different messages. */
@@ -3474,7 +3474,7 @@ GSList *sms_datagram_prepare(const char *to,
template.submit.vp.relative = 0xA7; /* 24 Hours */
template.submit.dcs = 0x04; /* Class Unspecified, 8 Bit */
template.submit.udhi = TRUE;
- sms_address_from_string(&template.submit.daddr, to);
+ __sms_address_from_string(&template.submit.daddr, to);
offset = 1;
@@ -3601,7 +3601,7 @@ GSList *sms_text_prepare_with_alphabet(const char *to, const char *utf8,
template.submit.srr = use_delivery_reports;
template.submit.mr = 0;
template.submit.vp.relative = 0xA7; /* 24 Hours */
- sms_address_from_string(&template.submit.daddr, to);
+ __sms_address_from_string(&template.submit.daddr, to);
/* There are two enums for the same thing */
dialect = (enum gsm_dialect)alphabet;
diff --git a/src/smsutil.h b/src/smsutil.h
index 01487de..bc21504 100644
--- a/src/smsutil.h
+++ b/src/smsutil.h
@@ -487,7 +487,7 @@ int sms_udl_in_bytes(guint8 ud_len, guint8 dcs);
time_t sms_scts_to_time(const struct sms_scts *scts, struct tm *remote);
const char *sms_address_to_string(const struct sms_address *addr);
-void sms_address_from_string(struct sms_address *addr, const char *str);
+void __sms_address_from_string(struct sms_address *addr, const char *str);
const guint8 *sms_extract_common(const struct sms *sms, gboolean *out_udhi,
guint8 *out_dcs, guint8 *out_udl,
diff --git a/unit/test-sms.c b/unit/test-sms.c
index 3bc099b..88293d5 100644
--- a/unit/test-sms.c
+++ b/unit/test-sms.c
@@ -1603,7 +1603,7 @@ static void test_sr_assembly(void)
sr3.status_report.mr);
}
- sms_address_from_string(&addr, "+4915259911630");
+ __sms_address_from_string(&addr, "+4915259911630");
sra = status_report_assembly_new(NULL);
@@ -1626,7 +1626,7 @@ static void test_sr_assembly(void)
* Send sms-message in the national address-format,
* but receive in the international address-format.
*/
- sms_address_from_string(&addr, "9911630");
+ __sms_address_from_string(&addr, "9911630");
status_report_assembly_add_fragment(sra, sha1, &addr, 4, time(NULL), 2);
status_report_assembly_add_fragment(sra, sha1, &addr, 5, time(NULL), 2);
@@ -1641,7 +1641,7 @@ static void test_sr_assembly(void)
* Send sms-message in the international address-format,
* but receive in the national address-format.
*/
- sms_address_from_string(&addr, "+358123456789");
+ __sms_address_from_string(&addr, "+358123456789");
status_report_assembly_add_fragment(sra, sha1, &addr, 6, time(NULL), 1);
g_assert(status_report_assembly_report(sra, &sr3, id, &delivered));
--
2.25.1

View File

@@ -14,6 +14,10 @@ SRC_URI = "\
file://0002-mbim-Fix-build-with-ell-0.39-by-restoring-unlikely-m.patch \
file://CVE-2023-4234.patch \
file://CVE-2023-4233.patch \
file://CVE-2023-2794-0001.patch \
file://CVE-2023-2794-0002.patch \
file://CVE-2023-2794-0003.patch \
file://CVE-2023-2794-0004.patch \
"
SRC_URI[sha256sum] = "c0b96d3013447ec2bcb74579bef90e4e59c68dbfa4b9c6fbce5d12401a43aac7"

View File

@@ -0,0 +1,27 @@
Description: fix signal handler race condition
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/2070497
CVE: CVE-2024-6387
Upstream-Status: Backport
https://git.launchpad.net/ubuntu/+source/openssh/commit/?h=applied/ubuntu/jammy-devel&id=b059bcfa928df4ff2d103ae2e8f4e3136ee03efc
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
--- a/log.c
+++ b/log.c
@@ -452,12 +452,14 @@ void
sshsigdie(const char *file, const char *func, int line, int showfunc,
LogLevel level, const char *suffix, const char *fmt, ...)
{
+#if 0
va_list args;
va_start(args, fmt);
sshlogv(file, func, line, showfunc, SYSLOG_LEVEL_FATAL,
suffix, fmt, args);
va_end(args);
+#endif
_exit(1);
}

View File

@@ -36,6 +36,7 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
file://CVE-2023-48795.patch \
file://CVE-2023-51384.patch \
file://CVE-2023-51385.patch \
file://CVE-2024-6387.patch \
"
SRC_URI[sha256sum] = "fd497654b7ab1686dac672fb83dfb4ba4096e8b5ffcdaccd262380ae58bec5e7"

View File

@@ -1,122 +0,0 @@
From b52867a9f618bb955bed2a3ce3db4d4f97ed8e5d Mon Sep 17 00:00:00 2001
From: Matt Caswell <matt@openssl.org>
Date: Tue, 5 Mar 2024 15:43:53 +0000
Subject: [PATCH] Fix unconstrained session cache growth in TLSv1.3
In TLSv1.3 we create a new session object for each ticket that we send.
We do this by duplicating the original session. If SSL_OP_NO_TICKET is in
use then the new session will be added to the session cache. However, if
early data is not in use (and therefore anti-replay protection is being
used), then multiple threads could be resuming from the same session
simultaneously. If this happens and a problem occurs on one of the threads,
then the original session object could be marked as not_resumable. When we
duplicate the session object this not_resumable status gets copied into the
new session object. The new session object is then added to the session
cache even though it is not_resumable.
Subsequently, another bug means that the session_id_length is set to 0 for
sessions that are marked as not_resumable - even though that session is
still in the cache. Once this happens the session can never be removed from
the cache. When that object gets to be the session cache tail object the
cache never shrinks again and grows indefinitely.
CVE-2024-2511
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24044)
(cherry picked from commit 7e4d731b1c07201ad9374c1cd9ac5263bdf35bce)
CVE: CVE-2024-2511
Upstream-Status: Backport [https://github.com/openssl/openssl/commit/b52867a9f618bb955bed2a3ce3db4d4f97ed8e5d]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
ssl/ssl_lib.c | 5 +++--
ssl/ssl_sess.c | 28 ++++++++++++++++++++++------
ssl/statem/statem_srvr.c | 5 ++---
3 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 2c8479eb5fc69..eed649c6fdee9 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -3736,9 +3736,10 @@ void ssl_update_cache(SSL *s, int mode)
/*
* If the session_id_length is 0, we are not supposed to cache it, and it
- * would be rather hard to do anyway :-)
+ * would be rather hard to do anyway :-). Also if the session has already
+ * been marked as not_resumable we should not cache it for later reuse.
*/
- if (s->session->session_id_length == 0)
+ if (s->session->session_id_length == 0 || s->session->not_resumable)
return;
/*
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index d836b33ed0e81..75adbd9e52b40 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -152,16 +152,11 @@ SSL_SESSION *SSL_SESSION_new(void)
return ss;
}
-SSL_SESSION *SSL_SESSION_dup(const SSL_SESSION *src)
-{
- return ssl_session_dup(src, 1);
-}
-
/*
* Create a new SSL_SESSION and duplicate the contents of |src| into it. If
* ticket == 0 then no ticket information is duplicated, otherwise it is.
*/
-SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket)
+static SSL_SESSION *ssl_session_dup_intern(const SSL_SESSION *src, int ticket)
{
SSL_SESSION *dest;
@@ -285,6 +280,27 @@ SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket)
return NULL;
}
+SSL_SESSION *SSL_SESSION_dup(const SSL_SESSION *src)
+{
+ return ssl_session_dup_intern(src, 1);
+}
+
+/*
+ * Used internally when duplicating a session which might be already shared.
+ * We will have resumed the original session. Subsequently we might have marked
+ * it as non-resumable (e.g. in another thread) - but this copy should be ok to
+ * resume from.
+ */
+SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket)
+{
+ SSL_SESSION *sess = ssl_session_dup_intern(src, ticket);
+
+ if (sess != NULL)
+ sess->not_resumable = 0;
+
+ return sess;
+}
+
const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len)
{
if (len)
diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c
index a9e67f9d32a77..6c942e6bcec29 100644
--- a/ssl/statem/statem_srvr.c
+++ b/ssl/statem/statem_srvr.c
@@ -2338,9 +2338,8 @@ int tls_construct_server_hello(SSL *s, WPACKET *pkt)
* so the following won't overwrite an ID that we're supposed
* to send back.
*/
- if (s->session->not_resumable ||
- (!(s->ctx->session_cache_mode & SSL_SESS_CACHE_SERVER)
- && !s->hit))
+ if (!(s->ctx->session_cache_mode & SSL_SESS_CACHE_SERVER)
+ && !s->hit)
s->session->session_id_length = 0;
if (usetls13) {

View File

@@ -1,180 +0,0 @@
From 3559e868e58005d15c6013a0c1fd832e51c73397 Mon Sep 17 00:00:00 2001
From: Tomas Mraz <tomas@openssl.org>
Date: Wed, 8 May 2024 15:23:45 +0200
Subject: [PATCH] Check DSA parameters for excessive sizes before validating
This avoids overly long computation of various validation
checks.
Fixes CVE-2024-4603
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/24346)
(cherry picked from commit 85ccbab216da245cf9a6503dd327072f21950d9b)
<dropped CHANGES.md modifications as it would need backport of all previous changes>
CVE: CVE-2024-4603
Upstream-Status: Backport [https://github.com/openssl/openssl/commit/3559e868e58005d15c6013a0c1fd832e51c73397]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
crypto/dsa/dsa_check.c | 44 ++++++++++++--
.../invalid/p10240_q256_too_big.pem | 57 +++++++++++++++++++
2 files changed, 97 insertions(+), 4 deletions(-)
create mode 100644 test/recipes/15-test_dsaparam_data/invalid/p10240_q256_too_big.pem
diff --git a/crypto/dsa/dsa_check.c b/crypto/dsa/dsa_check.c
index fb0e9129a2..122449a7bf 100644
--- a/crypto/dsa/dsa_check.c
+++ b/crypto/dsa/dsa_check.c
@@ -19,8 +19,34 @@
#include "dsa_local.h"
#include "crypto/dsa.h"
+static int dsa_precheck_params(const DSA *dsa, int *ret)
+{
+ if (dsa->params.p == NULL || dsa->params.q == NULL) {
+ ERR_raise(ERR_LIB_DSA, DSA_R_BAD_FFC_PARAMETERS);
+ *ret = FFC_CHECK_INVALID_PQ;
+ return 0;
+ }
+
+ if (BN_num_bits(dsa->params.p) > OPENSSL_DSA_MAX_MODULUS_BITS) {
+ ERR_raise(ERR_LIB_DSA, DSA_R_MODULUS_TOO_LARGE);
+ *ret = FFC_CHECK_INVALID_PQ;
+ return 0;
+ }
+
+ if (BN_num_bits(dsa->params.q) >= BN_num_bits(dsa->params.p)) {
+ ERR_raise(ERR_LIB_DSA, DSA_R_BAD_Q_VALUE);
+ *ret = FFC_CHECK_INVALID_PQ;
+ return 0;
+ }
+
+ return 1;
+}
+
int ossl_dsa_check_params(const DSA *dsa, int checktype, int *ret)
{
+ if (!dsa_precheck_params(dsa, ret))
+ return 0;
+
if (checktype == OSSL_KEYMGMT_VALIDATE_QUICK_CHECK)
return ossl_ffc_params_simple_validate(dsa->libctx, &dsa->params,
FFC_PARAM_TYPE_DSA, ret);
@@ -39,6 +65,9 @@ int ossl_dsa_check_params(const DSA *dsa, int checktype, int *ret)
*/
int ossl_dsa_check_pub_key(const DSA *dsa, const BIGNUM *pub_key, int *ret)
{
+ if (!dsa_precheck_params(dsa, ret))
+ return 0;
+
return ossl_ffc_validate_public_key(&dsa->params, pub_key, ret)
&& *ret == 0;
}
@@ -50,6 +79,9 @@ int ossl_dsa_check_pub_key(const DSA *dsa, const BIGNUM *pub_key, int *ret)
*/
int ossl_dsa_check_pub_key_partial(const DSA *dsa, const BIGNUM *pub_key, int *ret)
{
+ if (!dsa_precheck_params(dsa, ret))
+ return 0;
+
return ossl_ffc_validate_public_key_partial(&dsa->params, pub_key, ret)
&& *ret == 0;
}
@@ -58,8 +90,10 @@ int ossl_dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret)
{
*ret = 0;
- return (dsa->params.q != NULL
- && ossl_ffc_validate_private_key(dsa->params.q, priv_key, ret));
+ if (!dsa_precheck_params(dsa, ret))
+ return 0;
+
+ return ossl_ffc_validate_private_key(dsa->params.q, priv_key, ret);
}
/*
@@ -72,8 +106,10 @@ int ossl_dsa_check_pairwise(const DSA *dsa)
BN_CTX *ctx = NULL;
BIGNUM *pub_key = NULL;
- if (dsa->params.p == NULL
- || dsa->params.g == NULL
+ if (!dsa_precheck_params(dsa, &ret))
+ return 0;
+
+ if (dsa->params.g == NULL
|| dsa->priv_key == NULL
|| dsa->pub_key == NULL)
return 0;
diff --git a/test/recipes/15-test_dsaparam_data/invalid/p10240_q256_too_big.pem b/test/recipes/15-test_dsaparam_data/invalid/p10240_q256_too_big.pem
new file mode 100644
index 0000000000..e85e2953b7
--- /dev/null
+++ b/test/recipes/15-test_dsaparam_data/invalid/p10240_q256_too_big.pem
@@ -0,0 +1,57 @@
+-----BEGIN DSA PARAMETERS-----
+MIIKLAKCBQEAym47LzPFZdbz16WvjczLKuzLtsP8yRk/exxL4bBthJhP1qOwctja
+p1586SF7gDxCMn7yWVEYdfRbFefGoq0gj1XOE917XqlbnkmZhMgxut2KbNJo/xil
+XNFUjGvKs3F413U9rAodC8f07cWHP1iTcWL+vPe6u2yilKWYYfnLWHQH+Z6aPrrF
+x/R08LI6DZ6nEsIo+hxaQnEtx+iqNTJC6Q1RIjWDqxQkFVTkJ0Y7miRDXmRdneWk
+oLrMZRpaXr5l5tSjEghh1pBgJcdyOv0lh4dlDy/alAiqE2Qlb667yHl6A9dDPlpW
+dAntpffy4LwOxfbuEhISvKjjQoBwIvYE4TBPqL0Q6bC6HgQ4+tqd9b44pQjdIQjb
+Xcjc6azheITSnPEex3OdKtKoQeRq01qCeLBpMXu1c+CTf4ApKArZvT3vZSg0hM1O
+pR71bRZrEEegDj0LH2HCgI5W6H3blOS9A0kUTddCoQXr2lsVdiPtRbPKH1gcd9FQ
+P8cGrvbakpTiC0dCczOMDaCteM1QNILlkM7ZoV6VghsKvDnFPxFsiIr5GgjasXP5
+hhbn3g7sDoq1LiTEo+IKQY28pBWx7etSOSRuXW/spnvCkivZla7lSEGljoy9QlQ2
+UZmsEQI9G3YyzgpxHvKZBK1CiZVTywdYKTZ4TYCxvqzhYhjv2bqbpjI12HRFLojB
+koyEmMSp53lldCzp158PrIanqSp2rksMR8SmmCL3FwfAp2OjqFMEglG9DT8x0WaN
+TLSkjGC6t2csMte7WyU1ekNoFDKfMjDSAz0+xIx21DEmZtYqFOg1DNPK1xYLS0pl
+RSMRRkJVN2mk/G7/1oxlB8Wb9wgi3GKUqqCYT11SnBjzq0NdoJ3E4GMedp5Lx3AZ
+4mFuRPUd4iV86tE0XDSHSFE7Y3ZkrOjD7Q/26/L53L/UH5z4HW6CHP5os7QERJjg
+c1S3x87wXWo9QXbB9b2xmf+c+aWwAAr1cviw38tru58jF3/IGyduj9H8claKQqBG
+cIOUF4aNe1hK2K3ArAOApUxr4KE+tCvrltRfiTmVFip0g9Jt1CPY3Zu7Bd4Z2ZkE
+DtSztpwa49HrWF5E9xpquvBL2U8jQ68E7Xd8Wp4orI/TIChriamBmdkgRz3H2LvN
+Ozb6+hsnEGrz3sp2RVAToSqA9ysa6nHZdfufPNtMEbQdO/k1ehmGRb0ljBRsO6b2
+rsG2eYuC8tg8eCrIkua0TGRI7g6a4K32AJdzaX6NsISaaIW+OYJuoDSscvD3oOg8
+PPEhU+zM7xJskTA+jxvPlikKx8V7MNHOCQECldJlUBwzJvqp40JvwfnDsF+8VYwd
+UaiieR3pzMzyTjpReXRmZbnRPusRcsVzxb2OhB79wmuy4UPjjQBX+7eD0rs8xxvW
+5a5q1Cjq4AvbwmmcA/wDrHDOjcbD/zodad2O1QtBWa/R4xyWea4zKsflgACE1zY9
+wW2br7+YQFekcrXkkkEzgxd6zxv8KVEDpXRZjmAM1cI5LvkoN64To4GedN8Qe/G7
+R9SZh9gnS17PTP64hK+aYqhFafMdu87q/+qLfxaSux727qE5hiW01u4nnWhACf9s
+xuOozowKqxZxkolMIyZv6Lddwy1Zv5qjCyd0DvM/1skpXWkb9kfabYC+OhjsjVhs
+0Ktfs6a5B3eixiw5x94hhIcTEcS4hmvhGUL72FiTca6ZeSERTKmNBy8CIQC9/ZUN
+uU/V5JTcnYyUGHzm7+XcZBjyGBagBj9rCmW3SQKCBQAJ/k9rb39f1cO+/3XDEMjy
+9bIEXSuS48g5RAc1UGd5nrrBQwuDxGWFyz0yvAY7LgyidZuJS21+MAp9EY7AOMmx
+TDttifNaBJYt4GZ8of166PcqTKkHQwq5uBpxeSDv/ZE8YbYfaCtLTcUC8KlO+l36
+gjJHSkdkflSsGy1yObSNDQDfVAAwQs//TjDMnuEtvlNXZllsTvFFBceXVETn10K2
+ZMmdSIJNfLnjReUKEN6PfeGqv7F4xoyGwUybEfRE4u5RmXrqCODaIjY3SNMrOq8B
+R3Ata/cCozsM1jIdIW2z+OybDJH+BYsYm2nkSZQjZS6javTYClLrntEKG/hAQwL8
+F16YLOQXpHhgiAaWnTZzANtLppB2+5qCVy5ElzKongOwT8JTjTFXOaRnqe/ngm9W
+SSbrxfDaoWUOyK9XD8Cydzpv3n4Y8nWNGayi7/yAFCU36Ri040ufgv/TZLuKacnl
++3ga3ZUpRlSigzx0kb1+KjTSWeQ8vE/psdWjvBukVEbzdUauMLyRLo/6znSVvvPX
+UGhviThE5uhrsUg+wEPFINriSHfF7JDKVhDcJnLBdaXvfN52pkF/naLBF5Rt3Gvq
+fjCxjx0Sy9Lag1hDN4dor7dzuO7wmwOS01DJW1PtNLuuH0Bbqh1kYSaQkmyXBZWX
+qo8K3nkoDM0niOtJJubOhTNrGmSaZpNXkK3Mcy9rBbdvEs5O0Jmqaax/eOdU0Yot
+B3lX+3ddOseT2ZEFjzObqTtkWuFBeBxuYNcRTsu3qMdIBsEb8URQdsTtjoIja2fK
+hreVgjK36GW70KXEl8V/vq5qjQulmqkBEjmilcDuiREKqQuyeagUOnhQaBplqVco
+4xznh5DMBMRbpGb5lHxKv4cPNi+uNAJ5i98zWUM1JRt6aXnRCuWcll1z8fRZ+5kD
+vK9FaZU3VRMK/eknEG49cGr8OuJ6ZRSaC+tKwV1y+amkSZpKPWnk2bUnQI3ApJv3
+k1e1EToeECpMUkLMDgNbpKBoz4nqMEvAAlYgw9xKNbLlQlahqTVEAmaJHh4yDMDy
+i7IZ9Wrn47IGoR7s3cvhDHUpRPeW4nsmgzj+tf5EAxemI61STZJTTWo0iaPGJxct
+9nhOOhw1I38Mvm4vkAbFH7YJ0B6QrjjYL2MbOTp5JiIh4vdOeWwNo9/y4ffyaN5+
+ADpxuuIAmcbdr6GPOhkOFFixRJa0B2eP1i032HESlLs8RB9oYtdTXdXQotnIgJGd
+Y8tSKOa1zjzeLHn3AVpRZTUW++/BxmApV3GKIeG8fsUjg/df0QRrBcdC/1uccdaG
+KKlAOwlywVn5jUlwHkTmDiTM9w5AqVVGHZ2b+4ZgQW8jnPKN0SrKf6U555D+zp7E
+x4uXoE8ojN9y8m8UKf0cTLnujH2XgZorjPfuMOt5VZEhQFMS2QaljSeni5CJJ8gk
+XtztNqfBlAtWR4V5iAHeQOfIB2YaOy8GESda89tyKraKeaez41VblpTVHTeq9IIF
+YB4cQA2PfuNaGVRGLMAgT3Dvl+mxxxeJyxnGAiUcETU/jJJt9QombiuszBlYGQ5d
+ELOSm/eQSRARV9zNSt5jaQlMSjMBqenIEM09BzYqa7jDwqoztFxNdO8bcuQPuKwa
+4z3bBZ1yYm63WFdNbQqqGEwc0OYmqg1raJ0zltgHyjFyw8IGu4g/wETs+nVQcH7D
+vKuje86bePD6kD/LH3wmkA==
+-----END DSA PARAMETERS-----
--
2.30.2

View File

@@ -0,0 +1,115 @@
From e6190fc977f086428cc7880f95e8bcd5a11ac193 Mon Sep 17 00:00:00 2001
From: Matt Caswell <matt@openssl.org>
Date: Fri, 31 May 2024 11:14:33 +0100
Subject: [PATCH 1/9] Fix SSL_select_next_proto
Ensure that the provided client list is non-NULL and starts with a valid
entry. When called from the ALPN callback the client list should already
have been validated by OpenSSL so this should not cause a problem. When
called from the NPN callback the client list is locally configured and
will not have already been validated. Therefore SSL_select_next_proto
should not assume that it is correctly formatted.
We implement stricter checking of the client protocol list. We also do the
same for the server list while we are about it.
CVE-2024-5535
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24718)
(cherry picked from commit 4ada436a1946cbb24db5ab4ca082b69c1bc10f37)
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/cf6f91f6121f4db167405db2f0de410a456f260c]
CVE: CVE-2024-5535
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
---
ssl/ssl_lib.c | 63 ++++++++++++++++++++++++++++++++-------------------
1 file changed, 40 insertions(+), 23 deletions(-)
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index cb4e006..e628140 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -2952,37 +2952,54 @@ int SSL_select_next_proto(unsigned char **out, unsigned char *outlen,
unsigned int server_len,
const unsigned char *client, unsigned int client_len)
{
- unsigned int i, j;
- const unsigned char *result;
- int status = OPENSSL_NPN_UNSUPPORTED;
+ PACKET cpkt, csubpkt, spkt, ssubpkt;
+
+ if (!PACKET_buf_init(&cpkt, client, client_len)
+ || !PACKET_get_length_prefixed_1(&cpkt, &csubpkt)
+ || PACKET_remaining(&csubpkt) == 0) {
+ *out = NULL;
+ *outlen = 0;
+ return OPENSSL_NPN_NO_OVERLAP;
+ }
+
+ /*
+ * Set the default opportunistic protocol. Will be overwritten if we find
+ * a match.
+ */
+ *out = (unsigned char *)PACKET_data(&csubpkt);
+ *outlen = (unsigned char)PACKET_remaining(&csubpkt);
/*
* For each protocol in server preference order, see if we support it.
*/
- for (i = 0; i < server_len;) {
- for (j = 0; j < client_len;) {
- if (server[i] == client[j] &&
- memcmp(&server[i + 1], &client[j + 1], server[i]) == 0) {
- /* We found a match */
- result = &server[i];
- status = OPENSSL_NPN_NEGOTIATED;
- goto found;
+ if (PACKET_buf_init(&spkt, server, server_len)) {
+ while (PACKET_get_length_prefixed_1(&spkt, &ssubpkt)) {
+ if (PACKET_remaining(&ssubpkt) == 0)
+ continue; /* Invalid - ignore it */
+ if (PACKET_buf_init(&cpkt, client, client_len)) {
+ while (PACKET_get_length_prefixed_1(&cpkt, &csubpkt)) {
+ if (PACKET_equal(&csubpkt, PACKET_data(&ssubpkt),
+ PACKET_remaining(&ssubpkt))) {
+ /* We found a match */
+ *out = (unsigned char *)PACKET_data(&ssubpkt);
+ *outlen = (unsigned char)PACKET_remaining(&ssubpkt);
+ return OPENSSL_NPN_NEGOTIATED;
+ }
+ }
+ /* Ignore spurious trailing bytes in the client list */
+ } else {
+ /* This should never happen */
+ return OPENSSL_NPN_NO_OVERLAP;
}
- j += client[j];
- j++;
}
- i += server[i];
- i++;
+ /* Ignore spurious trailing bytes in the server list */
}
- /* There's no overlap between our protocols and the server's list. */
- result = client;
- status = OPENSSL_NPN_NO_OVERLAP;
-
- found:
- *out = (unsigned char *)result + 1;
- *outlen = result[0];
- return status;
+ /*
+ * There's no overlap between our protocols and the server's list. We use
+ * the default opportunistic protocol selected earlier
+ */
+ return OPENSSL_NPN_NO_OVERLAP;
}
#ifndef OPENSSL_NO_NEXTPROTONEG
--
2.25.1

View File

@@ -0,0 +1,44 @@
From 4a96c6b7265838b044dab4a2a6150c246297bc89 Mon Sep 17 00:00:00 2001
From: Matt Caswell <matt@openssl.org>
Date: Fri, 31 May 2024 11:18:27 +0100
Subject: [PATCH 2/9] More correctly handle a selected_len of 0 when processing
NPN
In the case where the NPN callback returns with SSL_TLEXT_ERR_OK, but
the selected_len is 0 we should fail. Previously this would fail with an
internal_error alert because calling OPENSSL_malloc(selected_len) will
return NULL when selected_len is 0. We make this error detection more
explicit and return a handshake failure alert.
Follow on from CVE-2024-5535
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24718)
(cherry picked from commit 4279c89a726025c758db3dafb263b17e52211304)
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/159921152fd4aa91e4c849fd281ad93ac0d0d0ba]
CVE: CVE-2024-5535
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
---
ssl/statem/extensions_clnt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ssl/statem/extensions_clnt.c b/ssl/statem/extensions_clnt.c
index 842be07..a07dc62 100644
--- a/ssl/statem/extensions_clnt.c
+++ b/ssl/statem/extensions_clnt.c
@@ -1536,7 +1536,8 @@ int tls_parse_stoc_npn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
PACKET_data(pkt),
PACKET_remaining(pkt),
s->ctx->ext.npn_select_cb_arg) !=
- SSL_TLSEXT_ERR_OK) {
+ SSL_TLSEXT_ERR_OK
+ || selected_len == 0) {
SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, SSL_R_BAD_EXTENSION);
return 0;
}
--
2.25.1

View File

@@ -0,0 +1,84 @@
From 6887608f77236d14b0789f4b1c14df53dfe2d618 Mon Sep 17 00:00:00 2001
From: Matt Caswell <matt@openssl.org>
Date: Fri, 31 May 2024 11:46:38 +0100
Subject: [PATCH 3/9] Clarify the SSL_select_next_proto() documentation
We clarify the input preconditions and the expected behaviour in the event
of no overlap.
Follow on from CVE-2024-5535
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24718)
(cherry picked from commit 889ed19ba25abebd2690997acd6d4791cbe5c493)
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/7a9f521b1de96e79184948e5813e791e608cc94b]
CVE: CVE-2024-5535
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
---
doc/man3/SSL_CTX_set_alpn_select_cb.pod | 26 +++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/doc/man3/SSL_CTX_set_alpn_select_cb.pod b/doc/man3/SSL_CTX_set_alpn_select_cb.pod
index 102e657..a29557d 100644
--- a/doc/man3/SSL_CTX_set_alpn_select_cb.pod
+++ b/doc/man3/SSL_CTX_set_alpn_select_cb.pod
@@ -52,7 +52,8 @@ SSL_select_next_proto, SSL_get0_alpn_selected, SSL_get0_next_proto_negotiated
SSL_CTX_set_alpn_protos() and SSL_set_alpn_protos() are used by the client to
set the list of protocols available to be negotiated. The B<protos> must be in
protocol-list format, described below. The length of B<protos> is specified in
-B<protos_len>.
+B<protos_len>. Setting B<protos_len> to 0 clears any existing list of ALPN
+protocols and no ALPN extension will be sent to the server.
SSL_CTX_set_alpn_select_cb() sets the application callback B<cb> used by a
server to select which protocol to use for the incoming connection. When B<cb>
@@ -73,9 +74,16 @@ B<server_len> and B<client>, B<client_len> must be in the protocol-list format
described below. The first item in the B<server>, B<server_len> list that
matches an item in the B<client>, B<client_len> list is selected, and returned
in B<out>, B<outlen>. The B<out> value will point into either B<server> or
-B<client>, so it should be copied immediately. If no match is found, the first
-item in B<client>, B<client_len> is returned in B<out>, B<outlen>. This
-function can also be used in the NPN callback.
+B<client>, so it should be copied immediately. The client list must include at
+least one valid (nonempty) protocol entry in the list.
+
+The SSL_select_next_proto() helper function can be useful from either the ALPN
+callback or the NPN callback (described below). If no match is found, the first
+item in B<client>, B<client_len> is returned in B<out>, B<outlen> and
+B<OPENSSL_NPN_NO_OVERLAP> is returned. This can be useful when implementating
+the NPN callback. In the ALPN case, the value returned in B<out> and B<outlen>
+must be ignored if B<OPENSSL_NPN_NO_OVERLAP> has been returned from
+SSL_select_next_proto().
SSL_CTX_set_next_proto_select_cb() sets a callback B<cb> that is called when a
client needs to select a protocol from the server's provided list, and a
@@ -85,9 +93,10 @@ must be set to point to the selected protocol (which may be within B<in>).
The length of the protocol name must be written into B<outlen>. The
server's advertised protocols are provided in B<in> and B<inlen>. The
callback can assume that B<in> is syntactically valid. The client must
-select a protocol. It is fatal to the connection if this callback returns
-a value other than B<SSL_TLSEXT_ERR_OK>. The B<arg> parameter is the pointer
-set via SSL_CTX_set_next_proto_select_cb().
+select a protocol (although it may be an empty, zero length protocol). It is
+fatal to the connection if this callback returns a value other than
+B<SSL_TLSEXT_ERR_OK> or if the zero length protocol is selected. The B<arg>
+parameter is the pointer set via SSL_CTX_set_next_proto_select_cb().
SSL_CTX_set_next_protos_advertised_cb() sets a callback B<cb> that is called
when a TLS server needs a list of supported protocols for Next Protocol
@@ -149,7 +158,8 @@ A match was found and is returned in B<out>, B<outlen>.
=item OPENSSL_NPN_NO_OVERLAP
No match was found. The first item in B<client>, B<client_len> is returned in
-B<out>, B<outlen>.
+B<out>, B<outlen> (or B<NULL> and 0 in the case where the first entry in
+B<client> is invalid).
=back
--
2.25.1

View File

@@ -0,0 +1,178 @@
From 6f9e71968f1f5e089bf79b0925e703a16f7bfa19 Mon Sep 17 00:00:00 2001
From: Matt Caswell <matt@openssl.org>
Date: Fri, 31 May 2024 16:35:16 +0100
Subject: [PATCH 4/9] Add a test for SSL_select_next_proto
Follow on from CVE-2024-5535
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24718)
(cherry picked from commit ad1318efa2cfdf43ed49d23c4a815f4754604b97)
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/707c71aa03ba968e09325d72cf1e8dcac70df2df]
CVE: CVE-2024-5535
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
---
test/sslapitest.c | 137 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 137 insertions(+)
diff --git a/test/sslapitest.c b/test/sslapitest.c
index 2b1c2fd..3922262 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -10765,6 +10765,142 @@ static int test_multi_resume(int idx)
return testresult;
}
+static struct next_proto_st {
+ int serverlen;
+ unsigned char server[40];
+ int clientlen;
+ unsigned char client[40];
+ int expected_ret;
+ size_t selectedlen;
+ unsigned char selected[40];
+} next_proto_tests[] = {
+ {
+ 4, { 3, 'a', 'b', 'c' },
+ 4, { 3, 'a', 'b', 'c' },
+ OPENSSL_NPN_NEGOTIATED,
+ 3, { 'a', 'b', 'c' }
+ },
+ {
+ 7, { 3, 'a', 'b', 'c', 2, 'a', 'b' },
+ 4, { 3, 'a', 'b', 'c' },
+ OPENSSL_NPN_NEGOTIATED,
+ 3, { 'a', 'b', 'c' }
+ },
+ {
+ 7, { 2, 'a', 'b', 3, 'a', 'b', 'c', },
+ 4, { 3, 'a', 'b', 'c' },
+ OPENSSL_NPN_NEGOTIATED,
+ 3, { 'a', 'b', 'c' }
+ },
+ {
+ 4, { 3, 'a', 'b', 'c' },
+ 7, { 3, 'a', 'b', 'c', 2, 'a', 'b', },
+ OPENSSL_NPN_NEGOTIATED,
+ 3, { 'a', 'b', 'c' }
+ },
+ {
+ 4, { 3, 'a', 'b', 'c' },
+ 7, { 2, 'a', 'b', 3, 'a', 'b', 'c'},
+ OPENSSL_NPN_NEGOTIATED,
+ 3, { 'a', 'b', 'c' }
+ },
+ {
+ 7, { 2, 'b', 'c', 3, 'a', 'b', 'c' },
+ 7, { 2, 'a', 'b', 3, 'a', 'b', 'c'},
+ OPENSSL_NPN_NEGOTIATED,
+ 3, { 'a', 'b', 'c' }
+ },
+ {
+ 10, { 2, 'b', 'c', 3, 'a', 'b', 'c', 2, 'a', 'b' },
+ 7, { 2, 'a', 'b', 3, 'a', 'b', 'c'},
+ OPENSSL_NPN_NEGOTIATED,
+ 3, { 'a', 'b', 'c' }
+ },
+ {
+ 4, { 3, 'b', 'c', 'd' },
+ 4, { 3, 'a', 'b', 'c' },
+ OPENSSL_NPN_NO_OVERLAP,
+ 3, { 'a', 'b', 'c' }
+ },
+ {
+ 0, { 0 },
+ 4, { 3, 'a', 'b', 'c' },
+ OPENSSL_NPN_NO_OVERLAP,
+ 3, { 'a', 'b', 'c' }
+ },
+ {
+ -1, { 0 },
+ 4, { 3, 'a', 'b', 'c' },
+ OPENSSL_NPN_NO_OVERLAP,
+ 3, { 'a', 'b', 'c' }
+ },
+ {
+ 4, { 3, 'a', 'b', 'c' },
+ 0, { 0 },
+ OPENSSL_NPN_NO_OVERLAP,
+ 0, { 0 }
+ },
+ {
+ 4, { 3, 'a', 'b', 'c' },
+ -1, { 0 },
+ OPENSSL_NPN_NO_OVERLAP,
+ 0, { 0 }
+ },
+ {
+ 3, { 3, 'a', 'b', 'c' },
+ 4, { 3, 'a', 'b', 'c' },
+ OPENSSL_NPN_NO_OVERLAP,
+ 3, { 'a', 'b', 'c' }
+ },
+ {
+ 4, { 3, 'a', 'b', 'c' },
+ 3, { 3, 'a', 'b', 'c' },
+ OPENSSL_NPN_NO_OVERLAP,
+ 0, { 0 }
+ }
+};
+
+static int test_select_next_proto(int idx)
+{
+ struct next_proto_st *np = &next_proto_tests[idx];
+ int ret = 0;
+ unsigned char *out, *client, *server;
+ unsigned char outlen;
+ unsigned int clientlen, serverlen;
+
+ if (np->clientlen == -1) {
+ client = NULL;
+ clientlen = 0;
+ } else {
+ client = np->client;
+ clientlen = (unsigned int)np->clientlen;
+ }
+ if (np->serverlen == -1) {
+ server = NULL;
+ serverlen = 0;
+ } else {
+ server = np->server;
+ serverlen = (unsigned int)np->serverlen;
+ }
+
+ if (!TEST_int_eq(SSL_select_next_proto(&out, &outlen, server, serverlen,
+ client, clientlen),
+ np->expected_ret))
+ goto err;
+
+ if (np->selectedlen == 0) {
+ if (!TEST_ptr_null(out) || !TEST_uchar_eq(outlen, 0))
+ goto err;
+ } else {
+ if (!TEST_mem_eq(out, outlen, np->selected, np->selectedlen))
+ goto err;
+ }
+
+ ret = 1;
+ err:
+ return ret;
+}
+
OPT_TEST_DECLARE_USAGE("certfile privkeyfile srpvfile tmpfile provider config dhfile\n")
int setup_tests(void)
@@ -11041,6 +11177,7 @@ int setup_tests(void)
#endif
ADD_ALL_TESTS(test_handshake_retry, 16);
ADD_ALL_TESTS(test_multi_resume, 5);
+ ADD_ALL_TESTS(test_select_next_proto, OSSL_NELEM(next_proto_tests));
return 1;
err:
--
2.25.1

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,45 @@
From a8c0ee154d212284f82680275de63642d914365e Mon Sep 17 00:00:00 2001
From: Matt Caswell <matt@openssl.org>
Date: Fri, 21 Jun 2024 10:41:55 +0100
Subject: [PATCH 6/9] Correct return values for
tls_construct_stoc_next_proto_neg
Return EXT_RETURN_NOT_SENT in the event that we don't send the extension,
rather than EXT_RETURN_SENT. This actually makes no difference at all to
the current control flow since this return value is ignored in this case
anyway. But lets make it correct anyway.
Follow on from CVE-2024-5535
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24718)
(cherry picked from commit 087501b4f572825e27ca8cc2c5874fcf6fd47cf7)
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/189a7ed3e380e34ea38fe4190a7c9396bace0fb7]
CVE: CVE-2024-5535
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
---
ssl/statem/extensions_srvr.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ssl/statem/extensions_srvr.c b/ssl/statem/extensions_srvr.c
index 1fab5a3..51ea74b 100644
--- a/ssl/statem/extensions_srvr.c
+++ b/ssl/statem/extensions_srvr.c
@@ -1471,9 +1471,10 @@ EXT_RETURN tls_construct_stoc_next_proto_neg(SSL *s, WPACKET *pkt,
return EXT_RETURN_FAIL;
}
s->s3.npn_seen = 1;
+ return EXT_RETURN_SENT;
}
- return EXT_RETURN_SENT;
+ return EXT_RETURN_NOT_SENT;
}
#endif
--
2.25.1

View File

@@ -0,0 +1,68 @@
From fa5cc5eb58a4c9632929397fc9a6c291fff1b99d Mon Sep 17 00:00:00 2001
From: Matt Caswell <matt@openssl.org>
Date: Fri, 21 Jun 2024 11:51:54 +0100
Subject: [PATCH 7/9] Add ALPN validation in the client
The ALPN protocol selected by the server must be one that we originally
advertised. We should verify that it is.
Follow on from CVE-2024-5535
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24718)
(cherry picked from commit 017e54183b95617825fb9316d618c154a34c634e)
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/4b375b998798dd516d367036773073e1b88e6433]
CVE: CVE-2024-5535
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
---
ssl/statem/extensions_clnt.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/ssl/statem/extensions_clnt.c b/ssl/statem/extensions_clnt.c
index a07dc62..b21ccf9 100644
--- a/ssl/statem/extensions_clnt.c
+++ b/ssl/statem/extensions_clnt.c
@@ -1566,6 +1566,8 @@ int tls_parse_stoc_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
size_t chainidx)
{
size_t len;
+ PACKET confpkt, protpkt;
+ int valid = 0;
/* We must have requested it. */
if (!s->s3.alpn_sent) {
@@ -1584,6 +1586,28 @@ int tls_parse_stoc_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
return 0;
}
+
+ /* It must be a protocol that we sent */
+ if (!PACKET_buf_init(&confpkt, s->ext.alpn, s->ext.alpn_len)) {
+ SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+ return 0;
+ }
+ while (PACKET_get_length_prefixed_1(&confpkt, &protpkt)) {
+ if (PACKET_remaining(&protpkt) != len)
+ continue;
+ if (memcmp(PACKET_data(pkt), PACKET_data(&protpkt), len) == 0) {
+ /* Valid protocol found */
+ valid = 1;
+ break;
+ }
+ }
+
+ if (!valid) {
+ /* The protocol sent from the server does not match one we advertised */
+ SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+ return 0;
+ }
+
OPENSSL_free(s->s3.alpn_selected);
s->s3.alpn_selected = OPENSSL_malloc(len);
if (s->s3.alpn_selected == NULL) {
--
2.25.1

View File

@@ -0,0 +1,273 @@
From b898db2b91751a52d2af699e674a80a6b218084d Mon Sep 17 00:00:00 2001
From: Matt Caswell <matt@openssl.org>
Date: Fri, 21 Jun 2024 10:09:41 +0100
Subject: [PATCH 8/9] Add explicit testing of ALN and NPN in sslapitest
We already had some tests elsewhere - but this extends that testing with
additional tests.
Follow on from CVE-2024-5535
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24718)
(cherry picked from commit 0453bf5a7ac60ab01c8bb713d8cc2a94324aa88c)
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/ca176d7291eb780e4ed2781342f5be5a32210a68]
CVE: CVE-2024-5535
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
---
test/sslapitest.c | 229 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 229 insertions(+)
diff --git a/test/sslapitest.c b/test/sslapitest.c
index 3922262..171298b 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -10901,6 +10901,231 @@ static int test_select_next_proto(int idx)
return ret;
}
+static const unsigned char fooprot[] = {3, 'f', 'o', 'o' };
+static const unsigned char barprot[] = {3, 'b', 'a', 'r' };
+
+#if !defined(OPENSSL_NO_TLS1_2) && !defined(OPENSSL_NO_NEXTPROTONEG)
+static int npn_advert_cb(SSL *ssl, const unsigned char **out,
+ unsigned int *outlen, void *arg)
+{
+ int *idx = (int *)arg;
+
+ switch (*idx) {
+ default:
+ case 0:
+ *out = fooprot;
+ *outlen = sizeof(fooprot);
+ return SSL_TLSEXT_ERR_OK;
+
+ case 1:
+ *outlen = 0;
+ return SSL_TLSEXT_ERR_OK;
+
+ case 2:
+ return SSL_TLSEXT_ERR_NOACK;
+ }
+}
+
+static int npn_select_cb(SSL *s, unsigned char **out, unsigned char *outlen,
+ const unsigned char *in, unsigned int inlen, void *arg)
+{
+ int *idx = (int *)arg;
+
+ switch (*idx) {
+ case 0:
+ case 1:
+ *out = (unsigned char *)(fooprot + 1);
+ *outlen = *fooprot;
+ return SSL_TLSEXT_ERR_OK;
+
+ case 3:
+ *out = (unsigned char *)(barprot + 1);
+ *outlen = *barprot;
+ return SSL_TLSEXT_ERR_OK;
+
+ case 4:
+ *outlen = 0;
+ return SSL_TLSEXT_ERR_OK;
+
+ default:
+ case 2:
+ return SSL_TLSEXT_ERR_ALERT_FATAL;
+ }
+}
+
+/*
+ * Test the NPN callbacks
+ * Test 0: advert = foo, select = foo
+ * Test 1: advert = <empty>, select = foo
+ * Test 2: no advert
+ * Test 3: advert = foo, select = bar
+ * Test 4: advert = foo, select = <empty> (should fail)
+ */
+static int test_npn(int idx)
+{
+ SSL_CTX *sctx = NULL, *cctx = NULL;
+ SSL *serverssl = NULL, *clientssl = NULL;
+ int testresult = 0;
+
+ if (!TEST_true(create_ssl_ctx_pair(libctx, TLS_server_method(),
+ TLS_client_method(), 0, TLS1_2_VERSION,
+ &sctx, &cctx, cert, privkey)))
+ goto end;
+
+ SSL_CTX_set_next_protos_advertised_cb(sctx, npn_advert_cb, &idx);
+ SSL_CTX_set_next_proto_select_cb(cctx, npn_select_cb, &idx);
+
+ if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL,
+ NULL)))
+ goto end;
+
+ if (idx == 4) {
+ /* We don't allow empty selection of NPN, so this should fail */
+ if (!TEST_false(create_ssl_connection(serverssl, clientssl,
+ SSL_ERROR_NONE)))
+ goto end;
+ } else {
+ const unsigned char *prot;
+ unsigned int protlen;
+
+ if (!TEST_true(create_ssl_connection(serverssl, clientssl,
+ SSL_ERROR_NONE)))
+ goto end;
+
+ SSL_get0_next_proto_negotiated(serverssl, &prot, &protlen);
+ switch (idx) {
+ case 0:
+ case 1:
+ if (!TEST_mem_eq(prot, protlen, fooprot + 1, *fooprot))
+ goto end;
+ break;
+ case 2:
+ if (!TEST_uint_eq(protlen, 0))
+ goto end;
+ break;
+ case 3:
+ if (!TEST_mem_eq(prot, protlen, barprot + 1, *barprot))
+ goto end;
+ break;
+ default:
+ TEST_error("Should not get here");
+ goto end;
+ }
+ }
+
+ testresult = 1;
+ end:
+ SSL_free(serverssl);
+ SSL_free(clientssl);
+ SSL_CTX_free(sctx);
+ SSL_CTX_free(cctx);
+
+ return testresult;
+}
+#endif /* !defined(OPENSSL_NO_TLS1_2) && !defined(OPENSSL_NO_NEXTPROTONEG) */
+
+static int alpn_select_cb2(SSL *ssl, const unsigned char **out,
+ unsigned char *outlen, const unsigned char *in,
+ unsigned int inlen, void *arg)
+{
+ int *idx = (int *)arg;
+
+ switch (*idx) {
+ case 0:
+ *out = (unsigned char *)(fooprot + 1);
+ *outlen = *fooprot;
+ return SSL_TLSEXT_ERR_OK;
+
+ case 2:
+ *out = (unsigned char *)(barprot + 1);
+ *outlen = *barprot;
+ return SSL_TLSEXT_ERR_OK;
+
+ case 3:
+ *outlen = 0;
+ return SSL_TLSEXT_ERR_OK;
+
+ default:
+ case 1:
+ return SSL_TLSEXT_ERR_ALERT_FATAL;
+ }
+ return 0;
+}
+
+/*
+ * Test the ALPN callbacks
+ * Test 0: client = foo, select = foo
+ * Test 1: client = <empty>, select = none
+ * Test 2: client = foo, select = bar (should fail)
+ * Test 3: client = foo, select = <empty> (should fail)
+ */
+static int test_alpn(int idx)
+{
+ SSL_CTX *sctx = NULL, *cctx = NULL;
+ SSL *serverssl = NULL, *clientssl = NULL;
+ int testresult = 0;
+ const unsigned char *prots = fooprot;
+ unsigned int protslen = sizeof(fooprot);
+
+ if (!TEST_true(create_ssl_ctx_pair(libctx, TLS_server_method(),
+ TLS_client_method(), 0, 0,
+ &sctx, &cctx, cert, privkey)))
+ goto end;
+
+ SSL_CTX_set_alpn_select_cb(sctx, alpn_select_cb2, &idx);
+
+ if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL,
+ NULL)))
+ goto end;
+
+ if (idx == 1) {
+ prots = NULL;
+ protslen = 0;
+ }
+
+ /* SSL_set_alpn_protos returns 0 for success! */
+ if (!TEST_false(SSL_set_alpn_protos(clientssl, prots, protslen)))
+ goto end;
+
+ if (idx == 2 || idx == 3) {
+ /* We don't allow empty selection of NPN, so this should fail */
+ if (!TEST_false(create_ssl_connection(serverssl, clientssl,
+ SSL_ERROR_NONE)))
+ goto end;
+ } else {
+ const unsigned char *prot;
+ unsigned int protlen;
+
+ if (!TEST_true(create_ssl_connection(serverssl, clientssl,
+ SSL_ERROR_NONE)))
+ goto end;
+
+ SSL_get0_alpn_selected(clientssl, &prot, &protlen);
+ switch (idx) {
+ case 0:
+ if (!TEST_mem_eq(prot, protlen, fooprot + 1, *fooprot))
+ goto end;
+ break;
+ case 1:
+ if (!TEST_uint_eq(protlen, 0))
+ goto end;
+ break;
+ default:
+ TEST_error("Should not get here");
+ goto end;
+ }
+ }
+
+ testresult = 1;
+ end:
+ SSL_free(serverssl);
+ SSL_free(clientssl);
+ SSL_CTX_free(sctx);
+ SSL_CTX_free(cctx);
+
+ return testresult;
+}
+
OPT_TEST_DECLARE_USAGE("certfile privkeyfile srpvfile tmpfile provider config dhfile\n")
int setup_tests(void)
@@ -11178,6 +11403,10 @@ int setup_tests(void)
ADD_ALL_TESTS(test_handshake_retry, 16);
ADD_ALL_TESTS(test_multi_resume, 5);
ADD_ALL_TESTS(test_select_next_proto, OSSL_NELEM(next_proto_tests));
+#if !defined(OPENSSL_NO_TLS1_2) && !defined(OPENSSL_NO_NEXTPROTONEG)
+ ADD_ALL_TESTS(test_npn, 5);
+#endif
+ ADD_ALL_TESTS(test_alpn, 4);
return 1;
err:
--
2.25.1

View File

@@ -0,0 +1,205 @@
From 475480db0f9592f15f00a7cf692d3e04ad8e742f Mon Sep 17 00:00:00 2001
From: Matt Caswell <matt@openssl.org>
Date: Fri, 21 Jun 2024 14:29:26 +0100
Subject: [PATCH 9/9] Add a test for an empty NextProto message
It is valid according to the spec for a NextProto message to have no
protocols listed in it. The OpenSSL implementation however does not allow
us to create such a message. In order to check that we work as expected
when communicating with a client that does generate such messages we have
to use a TLSProxy test.
Follow on from CVE-2024-5535
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24718)
(cherry picked from commit a201030901de9f9a48b34c38f6922fb0b272f26f)
Upstream-Status: Backport from [https://github.com/openssl/openssl/commit/99c2b6b971c302595db1801e26a202247238659d]
CVE: CVE-2024-5535
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
---
test/recipes/70-test_npn.t | 73 +++++++++++++++++++++++++++++++++
util/perl/TLSProxy/Message.pm | 9 ++++
util/perl/TLSProxy/NextProto.pm | 54 ++++++++++++++++++++++++
util/perl/TLSProxy/Proxy.pm | 1 +
4 files changed, 137 insertions(+)
create mode 100644 test/recipes/70-test_npn.t
create mode 100644 util/perl/TLSProxy/NextProto.pm
diff --git a/test/recipes/70-test_npn.t b/test/recipes/70-test_npn.t
new file mode 100644
index 0000000..f82e71a
--- /dev/null
+++ b/test/recipes/70-test_npn.t
@@ -0,0 +1,73 @@
+#! /usr/bin/env perl
+# Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License"). You may not use
+# this file except in compliance with the License. You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+use strict;
+use OpenSSL::Test qw/:DEFAULT cmdstr srctop_file/;
+use OpenSSL::Test::Utils;
+
+use TLSProxy::Proxy;
+
+my $test_name = "test_npn";
+setup($test_name);
+
+plan skip_all => "TLSProxy isn't usable on $^O"
+ if $^O =~ /^(VMS)$/;
+
+plan skip_all => "$test_name needs the dynamic engine feature enabled"
+ if disabled("engine") || disabled("dynamic-engine");
+
+plan skip_all => "$test_name needs the sock feature enabled"
+ if disabled("sock");
+
+plan skip_all => "$test_name needs NPN enabled"
+ if disabled("nextprotoneg");
+
+plan skip_all => "$test_name needs TLSv1.2 enabled"
+ if disabled("tls1_2");
+
+my $proxy = TLSProxy::Proxy->new(
+ undef,
+ cmdstr(app(["openssl"]), display => 1),
+ srctop_file("apps", "server.pem"),
+ (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
+);
+
+$proxy->start() or plan skip_all => "Unable to start up Proxy for tests";
+plan tests => 1;
+
+my $npnseen = 0;
+
+# Test 1: Check sending an empty NextProto message from the client works. This is
+# valid as per the spec, but OpenSSL does not allow you to send it.
+# Therefore we must be prepared to receive such a message but we cannot
+# generate it except via TLSProxy
+$proxy->clear();
+$proxy->filter(\&npn_filter);
+$proxy->clientflags("-nextprotoneg foo -no_tls1_3");
+$proxy->serverflags("-nextprotoneg foo");
+$proxy->start();
+ok($npnseen && TLSProxy::Message->success(), "Empty NPN message");
+
+sub npn_filter
+{
+ my $proxy = shift;
+ my $message;
+
+ # The NextProto message always appears in flight 2
+ return if $proxy->flight != 2;
+
+ foreach my $message (@{$proxy->message_list}) {
+ if ($message->mt == TLSProxy::Message::MT_NEXT_PROTO) {
+ # Our TLSproxy NextProto message support doesn't support parsing of
+ # the message. If we repack it just creates an empty NextProto
+ # message - which is exactly the scenario we want to test here.
+ $message->repack();
+ $npnseen = 1;
+ }
+ }
+}
diff --git a/util/perl/TLSProxy/Message.pm b/util/perl/TLSProxy/Message.pm
index 2c1bdb3..eb350de 100644
--- a/util/perl/TLSProxy/Message.pm
+++ b/util/perl/TLSProxy/Message.pm
@@ -379,6 +379,15 @@ sub create_message
[@message_frag_lens]
);
$message->parse();
+ } elsif ($mt == MT_NEXT_PROTO) {
+ $message = TLSProxy::NextProto->new(
+ $server,
+ $data,
+ [@message_rec_list],
+ $startoffset,
+ [@message_frag_lens]
+ );
+ $message->parse();
} else {
#Unknown message type
$message = TLSProxy::Message->new(
diff --git a/util/perl/TLSProxy/NextProto.pm b/util/perl/TLSProxy/NextProto.pm
new file mode 100644
index 0000000..0e18347
--- /dev/null
+++ b/util/perl/TLSProxy/NextProto.pm
@@ -0,0 +1,54 @@
+# Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License"). You may not use
+# this file except in compliance with the License. You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+use strict;
+
+package TLSProxy::NextProto;
+
+use vars '@ISA';
+push @ISA, 'TLSProxy::Message';
+
+sub new
+{
+ my $class = shift;
+ my ($server,
+ $data,
+ $records,
+ $startoffset,
+ $message_frag_lens) = @_;
+
+ my $self = $class->SUPER::new(
+ $server,
+ TLSProxy::Message::MT_NEXT_PROTO,
+ $data,
+ $records,
+ $startoffset,
+ $message_frag_lens);
+
+ return $self;
+}
+
+sub parse
+{
+ # We don't support parsing at the moment
+}
+
+# This is supposed to reconstruct the on-the-wire message data following changes.
+# For now though since we don't support parsing we just create an empty NextProto
+# message - this capability is used in test_npn
+sub set_message_contents
+{
+ my $self = shift;
+ my $data;
+
+ $data = pack("C32", 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00);
+ $self->data($data);
+}
+1;
diff --git a/util/perl/TLSProxy/Proxy.pm b/util/perl/TLSProxy/Proxy.pm
index 3de10ec..b707722 100644
--- a/util/perl/TLSProxy/Proxy.pm
+++ b/util/perl/TLSProxy/Proxy.pm
@@ -23,6 +23,7 @@ use TLSProxy::CertificateRequest;
use TLSProxy::CertificateVerify;
use TLSProxy::ServerKeyExchange;
use TLSProxy::NewSessionTicket;
+use TLSProxy::NextProto;
my $have_IPv6;
my $IP_factory;
--
2.25.1

View File

@@ -12,15 +12,22 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \
file://afalg.patch \
file://0001-Configure-do-not-tweak-mips-cflags.patch \
file://CVE-2024-2511.patch \
file://CVE-2024-4603.patch \
file://CVE-2024-5535_1.patch \
file://CVE-2024-5535_2.patch \
file://CVE-2024-5535_3.patch \
file://CVE-2024-5535_4.patch \
file://CVE-2024-5535_5.patch \
file://CVE-2024-5535_6.patch \
file://CVE-2024-5535_7.patch \
file://CVE-2024-5535_8.patch \
file://CVE-2024-5535_9.patch \
"
SRC_URI:append:class-nativesdk = " \
file://environment.d-openssl.sh \
"
SRC_URI[sha256sum] = "88525753f79d3bec27d2fa7c66aa0b92b3aa9498dafd93d7cfa4b3780cdae313"
SRC_URI[sha256sum] = "eeca035d4dd4e84fc25846d952da6297484afa0650a6f84c682e39df3a4123ca"
inherit lib_package multilib_header multilib_script ptest perlnative
MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"

View File

@@ -0,0 +1,213 @@
From f6f7cead3661ceeef54b21f7e799c0afc98537ec Mon Sep 17 00:00:00 2001
From: Jouni Malinen <j@w1.fi>
Date: Sat, 8 Jul 2023 19:55:32 +0300
Subject: [PATCH] PEAP client: Update Phase 2 authentication requirements
The previous PEAP client behavior allowed the server to skip Phase 2
authentication with the expectation that the server was authenticated
during Phase 1 through TLS server certificate validation. Various PEAP
specifications are not exactly clear on what the behavior on this front
is supposed to be and as such, this ended up being more flexible than
the TTLS/FAST/TEAP cases. However, this is not really ideal when
unfortunately common misconfiguration of PEAP is used in deployed
devices where the server trust root (ca_cert) is not configured or the
user has an easy option for allowing this validation step to be skipped.
Change the default PEAP client behavior to be to require Phase 2
authentication to be successfully completed for cases where TLS session
resumption is not used and the client certificate has not been
configured. Those two exceptions are the main cases where a deployed
authentication server might skip Phase 2 and as such, where a more
strict default behavior could result in undesired interoperability
issues. Requiring Phase 2 authentication will end up disabling TLS
session resumption automatically to avoid interoperability issues.
Allow Phase 2 authentication behavior to be configured with a new phase1
configuration parameter option:
'phase2_auth' option can be used to control Phase 2 (i.e., within TLS
tunnel) behavior for PEAP:
* 0 = do not require Phase 2 authentication
* 1 = require Phase 2 authentication when client certificate
(private_key/client_cert) is no used and TLS session resumption was
not used (default)
* 2 = require Phase 2 authentication in all cases
Signed-off-by: Jouni Malinen <j@w1.fi>
CVE: CVE-2023-52160
Upstream-Status: Backport [https://w1.fi/cgit/hostap/commit/?id=8e6485a1bcb0baffdea9e55255a81270b768439c]
Signed-off-by: Claus Stovgaard <claus.stovgaard@gmail.com>
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
src/eap_peer/eap_config.h | 8 ++++++
src/eap_peer/eap_peap.c | 40 +++++++++++++++++++++++++++---
src/eap_peer/eap_tls_common.c | 6 +++++
src/eap_peer/eap_tls_common.h | 5 ++++
wpa_supplicant/wpa_supplicant.conf | 7 ++++++
5 files changed, 63 insertions(+), 3 deletions(-)
diff --git a/src/eap_peer/eap_config.h b/src/eap_peer/eap_config.h
index 3238f74..047eec2 100644
--- a/src/eap_peer/eap_config.h
+++ b/src/eap_peer/eap_config.h
@@ -469,6 +469,14 @@ struct eap_peer_config {
* 1 = use cryptobinding if server supports it
* 2 = require cryptobinding
*
+ * phase2_auth option can be used to control Phase 2 (i.e., within TLS
+ * tunnel) behavior for PEAP:
+ * 0 = do not require Phase 2 authentication
+ * 1 = require Phase 2 authentication when client certificate
+ * (private_key/client_cert) is no used and TLS session resumption was
+ * not used (default)
+ * 2 = require Phase 2 authentication in all cases
+ *
* EAP-WSC (WPS) uses following options: pin=Device_Password and
* uuid=Device_UUID
*
diff --git a/src/eap_peer/eap_peap.c b/src/eap_peer/eap_peap.c
index 12e30df..6080697 100644
--- a/src/eap_peer/eap_peap.c
+++ b/src/eap_peer/eap_peap.c
@@ -67,6 +67,7 @@ struct eap_peap_data {
u8 cmk[20];
int soh; /* Whether IF-TNCCS-SOH (Statement of Health; Microsoft NAP)
* is enabled. */
+ enum { NO_AUTH, FOR_INITIAL, ALWAYS } phase2_auth;
};
@@ -114,6 +115,19 @@ static void eap_peap_parse_phase1(struct eap_peap_data *data,
wpa_printf(MSG_DEBUG, "EAP-PEAP: Require cryptobinding");
}
+ if (os_strstr(phase1, "phase2_auth=0")) {
+ data->phase2_auth = NO_AUTH;
+ wpa_printf(MSG_DEBUG,
+ "EAP-PEAP: Do not require Phase 2 authentication");
+ } else if (os_strstr(phase1, "phase2_auth=1")) {
+ data->phase2_auth = FOR_INITIAL;
+ wpa_printf(MSG_DEBUG,
+ "EAP-PEAP: Require Phase 2 authentication for initial connection");
+ } else if (os_strstr(phase1, "phase2_auth=2")) {
+ data->phase2_auth = ALWAYS;
+ wpa_printf(MSG_DEBUG,
+ "EAP-PEAP: Require Phase 2 authentication for all cases");
+ }
#ifdef EAP_TNC
if (os_strstr(phase1, "tnc=soh2")) {
data->soh = 2;
@@ -142,6 +156,7 @@ static void * eap_peap_init(struct eap_sm *sm)
data->force_peap_version = -1;
data->peap_outer_success = 2;
data->crypto_binding = OPTIONAL_BINDING;
+ data->phase2_auth = FOR_INITIAL;
if (config && config->phase1)
eap_peap_parse_phase1(data, config->phase1);
@@ -454,6 +469,20 @@ static int eap_tlv_validate_cryptobinding(struct eap_sm *sm,
}
+static bool peap_phase2_sufficient(struct eap_sm *sm,
+ struct eap_peap_data *data)
+{
+ if ((data->phase2_auth == ALWAYS ||
+ (data->phase2_auth == FOR_INITIAL &&
+ !tls_connection_resumed(sm->ssl_ctx, data->ssl.conn) &&
+ !data->ssl.client_cert_conf) ||
+ data->phase2_eap_started) &&
+ !data->phase2_eap_success)
+ return false;
+ return true;
+}
+
+
/**
* eap_tlv_process - Process a received EAP-TLV message and generate a response
* @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
@@ -568,6 +597,11 @@ static int eap_tlv_process(struct eap_sm *sm, struct eap_peap_data *data,
" - force failed Phase 2");
resp_status = EAP_TLV_RESULT_FAILURE;
ret->decision = DECISION_FAIL;
+ } else if (!peap_phase2_sufficient(sm, data)) {
+ wpa_printf(MSG_INFO,
+ "EAP-PEAP: Server indicated Phase 2 success, but sufficient Phase 2 authentication has not been completed");
+ resp_status = EAP_TLV_RESULT_FAILURE;
+ ret->decision = DECISION_FAIL;
} else {
resp_status = EAP_TLV_RESULT_SUCCESS;
ret->decision = DECISION_UNCOND_SUCC;
@@ -887,8 +921,7 @@ continue_req:
/* EAP-Success within TLS tunnel is used to indicate
* shutdown of the TLS channel. The authentication has
* been completed. */
- if (data->phase2_eap_started &&
- !data->phase2_eap_success) {
+ if (!peap_phase2_sufficient(sm, data)) {
wpa_printf(MSG_DEBUG, "EAP-PEAP: Phase 2 "
"Success used to indicate success, "
"but Phase 2 EAP was not yet "
@@ -1199,8 +1232,9 @@ static struct wpabuf * eap_peap_process(struct eap_sm *sm, void *priv,
static bool eap_peap_has_reauth_data(struct eap_sm *sm, void *priv)
{
struct eap_peap_data *data = priv;
+
return tls_connection_established(sm->ssl_ctx, data->ssl.conn) &&
- data->phase2_success;
+ data->phase2_success && data->phase2_auth != ALWAYS;
}
diff --git a/src/eap_peer/eap_tls_common.c b/src/eap_peer/eap_tls_common.c
index c1837db..a53eeb1 100644
--- a/src/eap_peer/eap_tls_common.c
+++ b/src/eap_peer/eap_tls_common.c
@@ -239,6 +239,12 @@ static int eap_tls_params_from_conf(struct eap_sm *sm,
sm->ext_cert_check = !!(params->flags & TLS_CONN_EXT_CERT_CHECK);
+ if (!phase2)
+ data->client_cert_conf = params->client_cert ||
+ params->client_cert_blob ||
+ params->private_key ||
+ params->private_key_blob;
+
return 0;
}
diff --git a/src/eap_peer/eap_tls_common.h b/src/eap_peer/eap_tls_common.h
index 9ac0012..3348634 100644
--- a/src/eap_peer/eap_tls_common.h
+++ b/src/eap_peer/eap_tls_common.h
@@ -79,6 +79,11 @@ struct eap_ssl_data {
* tls_v13 - Whether TLS v1.3 or newer is used
*/
int tls_v13;
+
+ /**
+ * client_cert_conf: Whether client certificate has been configured
+ */
+ bool client_cert_conf;
};
diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf
index 6619d6b..d63f73c 100644
--- a/wpa_supplicant/wpa_supplicant.conf
+++ b/wpa_supplicant/wpa_supplicant.conf
@@ -1321,6 +1321,13 @@ fast_reauth=1
# * 0 = do not use cryptobinding (default)
# * 1 = use cryptobinding if server supports it
# * 2 = require cryptobinding
+# 'phase2_auth' option can be used to control Phase 2 (i.e., within TLS
+# tunnel) behavior for PEAP:
+# * 0 = do not require Phase 2 authentication
+# * 1 = require Phase 2 authentication when client certificate
+# (private_key/client_cert) is no used and TLS session resumption was
+# not used (default)
+# * 2 = require Phase 2 authentication in all cases
# EAP-WSC (WPS) uses following options: pin=<Device Password> or
# pbc=1.
#

View File

@@ -25,6 +25,7 @@ SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \
file://wpa_supplicant.conf \
file://wpa_supplicant.conf-sane \
file://99_wpa_supplicant \
file://0001-PEAP-client-Update-Phase-2-authentication-requiremen.patch \
"
SRC_URI[sha256sum] = "20df7ae5154b3830355f8ab4269123a87affdea59fe74fe9292a91d0d7e17b2f"

View File

@@ -0,0 +1,151 @@
From 5dcc443dba039b305a510c01883e9f34e42656ae Mon Sep 17 00:00:00 2001
From: Denys Vlasenko <vda.linux@googlemail.com>
Date: Fri, 26 May 2023 19:36:58 +0200
Subject: [PATCH] awk: fix use-after-realloc (CVE-2021-42380), closes 15601
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
CVE: CVE-2021-42380
Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=5dcc443dba039b305a510c01883e9f34e42656ae]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
editors/awk.c | 26 ++++++++++++++++-----
testsuite/awk.tests | 55 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 75 insertions(+), 6 deletions(-)
diff --git a/editors/awk.c b/editors/awk.c
index 728ee8685..2af823808 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -555,7 +555,7 @@ struct globals {
const char *g_progname;
int g_lineno;
int nfields;
- int maxfields; /* used in fsrealloc() only */
+ unsigned maxfields;
var *Fields;
char *g_pos;
char g_saved_ch;
@@ -1917,9 +1917,9 @@ static void fsrealloc(int size)
{
int i, newsize;
- if (size >= maxfields) {
- /* Sanity cap, easier than catering for overflows */
- if (size > 0xffffff)
+ if ((unsigned)size >= maxfields) {
+ /* Sanity cap, easier than catering for over/underflows */
+ if ((unsigned)size > 0xffffff)
bb_die_memory_exhausted();
i = maxfields;
@@ -2877,6 +2877,7 @@ static var *evaluate(node *op, var *res)
uint32_t opinfo;
int opn;
node *op1;
+ var *old_Fields_ptr;
opinfo = op->info;
opn = (opinfo & OPNMASK);
@@ -2885,10 +2886,16 @@ static var *evaluate(node *op, var *res)
debug_printf_eval("opinfo:%08x opn:%08x\n", opinfo, opn);
/* execute inevitable things */
+ old_Fields_ptr = NULL;
if (opinfo & OF_RES1) {
if ((opinfo & OF_REQUIRED) && !op1)
syntax_error(EMSG_TOO_FEW_ARGS);
L.v = evaluate(op1, TMPVAR0);
+ /* Does L.v point to $n variable? */
+ if ((size_t)(L.v - Fields) < maxfields) {
+ /* yes, remember where Fields[] is */
+ old_Fields_ptr = Fields;
+ }
if (opinfo & OF_STR1) {
L.s = getvar_s(L.v);
debug_printf_eval("L.s:'%s'\n", L.s);
@@ -2907,8 +2914,15 @@ static var *evaluate(node *op, var *res)
*/
if (opinfo & OF_RES2) {
R.v = evaluate(op->r.n, TMPVAR1);
- //TODO: L.v may be invalid now, set L.v to NULL to catch bugs?
- //L.v = NULL;
+ /* Seen in $5=$$5=$0:
+ * Evaluation of R.v ($$5=$0 expression)
+ * made L.v ($5) invalid. It's detected here.
+ */
+ if (old_Fields_ptr) {
+ //if (old_Fields_ptr != Fields)
+ // debug_printf_eval("L.v moved\n");
+ L.v += Fields - old_Fields_ptr;
+ }
if (opinfo & OF_STR2) {
R.s = getvar_s(R.v);
debug_printf_eval("R.s:'%s'\n", R.s);
diff --git a/testsuite/awk.tests b/testsuite/awk.tests
index bcaafe8..08afdb2 100755
--- a/testsuite/awk.tests
+++ b/testsuite/awk.tests
@@ -469,4 +469,59 @@ testing 'awk printf %% prints one %' \
"%\n" \
'' ''
+# User-supplied bug (SEGV) example, was causing use-after-realloc
+testing 'awk assign while assign' \
+ "awk '\$5=\$\$5=\$0'; echo \$?" \
+ "\
+─ process timing ────────────────────────────────────┬─ ─ process timing ────────────────────────────────────┬─ overall results ────┐ results ────┐
+│ run time : │ run time : 0 days, 0 hrs, 0 min, 56 sec │ cycles done : 0 │ days, 0 hrs, 0 min, 56 sec │ cycles done : 0 │
+│ last new find │ last new find : 0 days, 0 hrs, 0 min, 1 sec │ corpus count : 208 │ 0 days, 0 hrs, 0 min, 1 sec │ corpus count : 208 │
+│last saved crash : │last saved crash : none seen yet │saved crashes : 0 │ seen yet │saved crashes : 0 │
+│ last saved hang │ last saved hang : none seen yet │ saved hangs : 0 │ none seen yet │ saved hangs : 0 │
+├─ cycle progress ─────────────────────┬─ ├─ cycle progress ─────────────────────┬─ map coverage┴──────────────────────┤ coverage┴──────────────────────┤
+│ now processing : │ now processing : 184.1 (88.5%) │ map density : 0.30% / 0.52% │ (88.5%) │ map density : 0.30% / 0.52% │ │ now processing : 184.1 (88.5%) │ map density : 0.30% / 0.52% │
+│ runs timed out │ runs timed out : 0 (0.00%) │ count coverage : 2.18 bits/tuple │ 0 (0.00%) │ count coverage : 2.18 bits/tuple │
+├─ stage progress ─────────────────────┼─ ├─ stage progress ─────────────────────┼─ findings in depth ─────────────────┤ in depth ─────────────────┤
+│ now trying : │ now trying : havoc │ favored items : 43 (20.67%) │ │ favored items : 43 (20.67%) │
+│ stage execs : │ stage execs : 11.2k/131k (8.51%) │ new edges on : 52 (25.00%) │ (8.51%) │ new edges on │ stage execs : 11.2k/131k (8.51%) │ new edges on : 52 (25.00%) │ 52 (25.00%) │
+│ total execs : │ total execs : 179k │ total crashes : 0 (0 saved) │ │ total crashes : 0 (0 saved) │ │ total execs : 179k │ total crashes : 0 (0 saved) │
+│ exec speed : │ exec speed : 3143/sec │ total tmouts : 0 (0 saved) │ │ total tmouts : 0 (0 saved) │ │ exec speed : 3143/sec │ total tmouts : 0 (0 saved) │
+├─ fuzzing strategy yields ├─ fuzzing strategy yields ────────────┴─────────────┬─ item geometry ───────┤ item geometry ───────┤
+│ bit flips : │ bit flips : 11/648, 4/638, 5/618 │ levels : 4 │ 4/638, 5/618 │ levels : │ bit flips : 11/648, 4/638, 5/618 │ levels : 4 │ │
+│ byte flips : │ byte flips : 0/81, 0/71, 0/52 │ pending : 199 │ 0/71, 0/52 │ pending : 199 │
+│ arithmetics : 11/4494, │ arithmetics : 11/4494, 0/1153, 0/0 │ pend fav : 35 │ 0/0 │ pend fav : 35 │
+│ known ints : 1/448, 0/1986, 0/2288 │ own finds : 207 │ known ints : │ known ints : 1/448, 0/1986, 0/2288 │ own finds : 207 │ 0/1986, 0/2288 │ own finds : 207 │
+│ dictionary : 0/0, │ dictionary : 0/0, 0/0, 0/0, 0/0 │ imported : 0 │ 0/0, 0/0 │ imported : 0 │
+│havoc/splice : 142/146k, 23/7616 │havoc/splice : 142/146k, 23/7616 │ stability : 100.00% │ stability : 100.00% │
+│py/custom/rq : unused, unused, │py/custom/rq : unused, unused, unused, unused ├───────────────────────┘ unused ├───────────────────────┘
+│ trim/eff : 57.02%/26, │ trim/eff : 57.02%/26, 0.00% │ [cpu000:100%] │ [cpu000:100%]
+└────────────────────────────────────────────────────┘^C └────────────────────────────────────────────────────┘^C
+0
+" \
+ "" \
+ "\
+─ process timing ────────────────────────────────────┬─ overall results ────┐
+│ run time : 0 days, 0 hrs, 0 min, 56 sec │ cycles done : 0 │
+│ last new find : 0 days, 0 hrs, 0 min, 1 sec │ corpus count : 208 │
+│last saved crash : none seen yet │saved crashes : 0 │
+│ last saved hang : none seen yet │ saved hangs : 0 │
+├─ cycle progress ─────────────────────┬─ map coverage┴──────────────────────┤
+│ now processing : 184.1 (88.5%) │ map density : 0.30% / 0.52% │
+│ runs timed out : 0 (0.00%) │ count coverage : 2.18 bits/tuple │
+├─ stage progress ─────────────────────┼─ findings in depth ─────────────────┤
+│ now trying : havoc │ favored items : 43 (20.67%) │
+│ stage execs : 11.2k/131k (8.51%) │ new edges on : 52 (25.00%) │
+│ total execs : 179k │ total crashes : 0 (0 saved) │
+│ exec speed : 3143/sec │ total tmouts : 0 (0 saved) │
+├─ fuzzing strategy yields ────────────┴─────────────┬─ item geometry ───────┤
+│ bit flips : 11/648, 4/638, 5/618 │ levels : 4 │
+│ byte flips : 0/81, 0/71, 0/52 │ pending : 199 │
+│ arithmetics : 11/4494, 0/1153, 0/0 │ pend fav : 35 │
+│ known ints : 1/448, 0/1986, 0/2288 │ own finds : 207 │
+│ dictionary : 0/0, 0/0, 0/0, 0/0 │ imported : 0 │
+│havoc/splice : 142/146k, 23/7616 │ stability : 100.00% │
+│py/custom/rq : unused, unused, unused, unused ├───────────────────────┘
+│ trim/eff : 57.02%/26, 0.00% │ [cpu000:100%]
+└────────────────────────────────────────────────────┘^C"
+
exit $FAILCOUNT
--
2.30.2

View File

@@ -0,0 +1,68 @@
From fb08d43d44d1fea1f741fafb9aa7e1958a5f69aa Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Mon, 20 May 2024 17:55:28 +0200
Subject: awk: fix use after free (CVE-2023-42363)
function old new delta
evaluate 3377 3385 +8
Fixes https://bugs.busybox.net/show_bug.cgi?id=15865
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=fb08d43d44d1fea1f741fafb9aa7e1958a5f69aa]
CVE: CVE-2023-42363
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
editors/awk.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/editors/awk.c b/editors/awk.c
index 654cbac..4fbc11d 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -2896,19 +2896,14 @@ static var *evaluate(node *op, var *res)
/* yes, remember where Fields[] is */
old_Fields_ptr = Fields;
}
- if (opinfo & OF_STR1) {
- L.s = getvar_s(L.v);
- debug_printf_eval("L.s:'%s'\n", L.s);
- }
if (opinfo & OF_NUM1) {
L_d = getvar_i(L.v);
debug_printf_eval("L_d:%f\n", L_d);
}
}
- /* NB: Must get string/numeric values of L (done above)
- * _before_ evaluate()'ing R.v: if both L and R are $NNNs,
- * and right one is large, then L.v points to Fields[NNN1],
- * second evaluate() reallocates and moves (!) Fields[],
+ /* NB: if both L and R are $NNNs, and right one is large,
+ * then at this pint L.v points to Fields[NNN1], second
+ * evaluate() below reallocates and moves (!) Fields[],
* R.v points to Fields[NNN2] but L.v now points to freed mem!
* (Seen trying to evaluate "$444 $44444")
*/
@@ -2928,6 +2923,16 @@ static var *evaluate(node *op, var *res)
debug_printf_eval("R.s:'%s'\n", R.s);
}
}
+ /* Get L.s _after_ R.v is evaluated: it may have realloc'd L.v
+ * so we must get the string after "old_Fields_ptr" correction
+ * above. Testcase: x = (v = "abc", gsub("b", "X", v));
+ */
+ if (opinfo & OF_RES1) {
+ if (opinfo & OF_STR1) {
+ L.s = getvar_s(L.v);
+ debug_printf_eval("L.s:'%s'\n", L.s);
+ }
+ }
debug_printf_eval("switch(0x%x)\n", XC(opinfo & OPCLSMASK));
switch (XC(opinfo & OPCLSMASK)) {
--
2.25.1

View File

@@ -0,0 +1,197 @@
From dedc9380c76834ba64c8b526aef6f461ea4e7f2e Mon Sep 17 00:00:00 2001
From: Denys Vlasenko <vda.linux@googlemail.com>
Date: Tue, 30 May 2023 16:42:18 +0200
Subject: [PATCH 1/2] awk: fix precedence of = relative to ==
Discovered while adding code to disallow assignments to non-lvalues
function old new delta
parse_expr 936 991 +55
.rodata 105243 105247 +4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 59/0) Total: 59 bytes
Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4]
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
(cherry picked from commit 0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4)
CVE: CVE-2023-42364 CVE-2023-42365
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
editors/awk.c | 66 ++++++++++++++++++++++++++++++---------------
testsuite/awk.tests | 5 ++++
2 files changed, 50 insertions(+), 21 deletions(-)
diff --git a/editors/awk.c b/editors/awk.c
index ec9301e..aff86fe 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -337,7 +337,9 @@ static void debug_parse_print_tc(uint32_t n)
#undef P
#undef PRIMASK
#undef PRIMASK2
-#define P(x) (x << 24)
+/* Smaller 'x' means _higher_ operator precedence */
+#define PRECEDENCE(x) (x << 24)
+#define P(x) PRECEDENCE(x)
#define PRIMASK 0x7F000000
#define PRIMASK2 0x7E000000
@@ -360,7 +362,7 @@ enum {
OC_MOVE = 0x1f00, OC_PGETLINE = 0x2000, OC_REGEXP = 0x2100,
OC_REPLACE = 0x2200, OC_RETURN = 0x2300, OC_SPRINTF = 0x2400,
OC_TERNARY = 0x2500, OC_UNARY = 0x2600, OC_VAR = 0x2700,
- OC_DONE = 0x2800,
+ OC_CONST = 0x2800, OC_DONE = 0x2900,
ST_IF = 0x3000, ST_DO = 0x3100, ST_FOR = 0x3200,
ST_WHILE = 0x3300
@@ -440,9 +442,9 @@ static const uint32_t tokeninfo[] ALIGN4 = {
#define TI_PREINC (OC_UNARY|xV|P(9)|'P')
#define TI_PREDEC (OC_UNARY|xV|P(9)|'M')
TI_PREINC, TI_PREDEC, OC_FIELD|xV|P(5),
- OC_COMPARE|VV|P(39)|5, OC_MOVE|VV|P(74), OC_REPLACE|NV|P(74)|'+', OC_REPLACE|NV|P(74)|'-',
- OC_REPLACE|NV|P(74)|'*', OC_REPLACE|NV|P(74)|'/', OC_REPLACE|NV|P(74)|'%', OC_REPLACE|NV|P(74)|'&',
- OC_BINARY|NV|P(29)|'+', OC_BINARY|NV|P(29)|'-', OC_REPLACE|NV|P(74)|'&', OC_BINARY|NV|P(15)|'&',
+ OC_COMPARE|VV|P(39)|5, OC_MOVE|VV|P(38), OC_REPLACE|NV|P(38)|'+', OC_REPLACE|NV|P(38)|'-',
+ OC_REPLACE|NV|P(38)|'*', OC_REPLACE|NV|P(38)|'/', OC_REPLACE|NV|P(38)|'%', OC_REPLACE|NV|P(38)|'&',
+ OC_BINARY|NV|P(29)|'+', OC_BINARY|NV|P(29)|'-', OC_REPLACE|NV|P(38)|'&', OC_BINARY|NV|P(15)|'&',
OC_BINARY|NV|P(25)|'/', OC_BINARY|NV|P(25)|'%', OC_BINARY|NV|P(15)|'&', OC_BINARY|NV|P(25)|'*',
OC_COMPARE|VV|P(39)|4, OC_COMPARE|VV|P(39)|3, OC_COMPARE|VV|P(39)|0, OC_COMPARE|VV|P(39)|1,
#define TI_LESS (OC_COMPARE|VV|P(39)|2)
@@ -1290,7 +1292,7 @@ static uint32_t next_token(uint32_t expected)
save_tclass = tc;
save_info = t_info;
tc = TC_BINOPX;
- t_info = OC_CONCAT | SS | P(35);
+ t_info = OC_CONCAT | SS | PRECEDENCE(35);
}
t_tclass = tc;
@@ -1350,9 +1352,8 @@ static node *parse_expr(uint32_t term_tc)
{
node sn;
node *cn = &sn;
- node *vn, *glptr;
+ node *glptr;
uint32_t tc, expected_tc;
- var *v;
debug_printf_parse("%s() term_tc(%x):", __func__, term_tc);
debug_parse_print_tc(term_tc);
@@ -1363,11 +1364,12 @@ static node *parse_expr(uint32_t term_tc)
expected_tc = TS_OPERAND | TS_UOPPRE | TC_REGEXP | term_tc;
while (!((tc = next_token(expected_tc)) & term_tc)) {
+ node *vn;
if (glptr && (t_info == TI_LESS)) {
/* input redirection (<) attached to glptr node */
debug_printf_parse("%s: input redir\n", __func__);
- cn = glptr->l.n = new_node(OC_CONCAT | SS | P(37));
+ cn = glptr->l.n = new_node(OC_CONCAT | SS | PRECEDENCE(37));
cn->a.n = glptr;
expected_tc = TS_OPERAND | TS_UOPPRE;
glptr = NULL;
@@ -1379,24 +1381,42 @@ static node *parse_expr(uint32_t term_tc)
* previous operators with higher priority */
vn = cn;
while (((t_info & PRIMASK) > (vn->a.n->info & PRIMASK2))
- || ((t_info == vn->info) && t_info == TI_COLON)
+ || (t_info == vn->info && t_info == TI_COLON)
) {
vn = vn->a.n;
if (!vn->a.n) syntax_error(EMSG_UNEXP_TOKEN);
}
if (t_info == TI_TERNARY)
//TODO: why?
- t_info += P(6);
+ t_info += PRECEDENCE(6);
cn = vn->a.n->r.n = new_node(t_info);
cn->a.n = vn->a.n;
if (tc & TS_BINOP) {
cn->l.n = vn;
-//FIXME: this is the place to detect and reject assignments to non-lvalues.
-//Currently we allow "assignments" to consts and temporaries, nonsense like this:
-// awk 'BEGIN { "qwe" = 1 }'
-// awk 'BEGIN { 7 *= 7 }'
-// awk 'BEGIN { length("qwe") = 1 }'
-// awk 'BEGIN { (1+1) += 3 }'
+
+ /* Prevent:
+ * awk 'BEGIN { "qwe" = 1 }'
+ * awk 'BEGIN { 7 *= 7 }'
+ * awk 'BEGIN { length("qwe") = 1 }'
+ * awk 'BEGIN { (1+1) += 3 }'
+ */
+ /* Assignment? (including *= and friends) */
+ if (((t_info & OPCLSMASK) == OC_MOVE)
+ || ((t_info & OPCLSMASK) == OC_REPLACE)
+ ) {
+ debug_printf_parse("%s: MOVE/REPLACE vn->info:%08x\n", __func__, vn->info);
+ /* Left side is a (variable or array element)
+ * or function argument
+ * or $FIELD ?
+ */
+ if ((vn->info & OPCLSMASK) != OC_VAR
+ && (vn->info & OPCLSMASK) != OC_FNARG
+ && (vn->info & OPCLSMASK) != OC_FIELD
+ ) {
+ syntax_error(EMSG_UNEXP_TOKEN); /* no. bad */
+ }
+ }
+
expected_tc = TS_OPERAND | TS_UOPPRE | TC_REGEXP;
if (t_info == TI_PGETLINE) {
/* it's a pipe */
@@ -1432,6 +1452,8 @@ static node *parse_expr(uint32_t term_tc)
/* one should be very careful with switch on tclass -
* only simple tclasses should be used (TC_xyz, not TS_xyz) */
switch (tc) {
+ var *v;
+
case TC_VARIABLE:
case TC_ARRAY:
debug_printf_parse("%s: TC_VARIABLE | TC_ARRAY\n", __func__);
@@ -1452,14 +1474,14 @@ static node *parse_expr(uint32_t term_tc)
case TC_NUMBER:
case TC_STRING:
debug_printf_parse("%s: TC_NUMBER | TC_STRING\n", __func__);
- cn->info = OC_VAR;
+ cn->info = OC_CONST;
v = cn->l.v = xzalloc(sizeof(var));
- if (tc & TC_NUMBER)
+ if (tc & TC_NUMBER) {
setvar_i(v, t_double);
- else {
+ } else {
setvar_s(v, t_string);
- expected_tc &= ~TC_UOPPOST; /* "str"++ is not allowed */
}
+ expected_tc &= ~TC_UOPPOST; /* NUM++, "str"++ not allowed */
break;
case TC_REGEXP:
@@ -3107,6 +3129,8 @@ static var *evaluate(node *op, var *res)
/* -- recursive node type -- */
+ case XC( OC_CONST ):
+ debug_printf_eval("CONST ");
case XC( OC_VAR ):
debug_printf_eval("VAR\n");
L.v = op->l.v;
diff --git a/testsuite/awk.tests b/testsuite/awk.tests
index ddc5104..a78fdcd 100755
--- a/testsuite/awk.tests
+++ b/testsuite/awk.tests
@@ -540,4 +540,9 @@ testing 'awk assign while assign' \
│ trim/eff : 57.02%/26, 0.00% │ [cpu000:100%]
└────────────────────────────────────────────────────┘^C"
+testing "awk = has higher precedence than == (despite what gawk manpage claims)" \
+ "awk 'BEGIN { v=1; print 2==v; print 2==v=2; print v; print v=3==3; print v}'" \
+ '0\n1\n2\n1\n3\n' \
+ '' ''
+
exit $FAILCOUNT

View File

@@ -0,0 +1,96 @@
From c3bfdac8e0e9a21d524ad72036953f68d2193e52 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 21 May 2024 14:46:08 +0200
Subject: [PATCH 2/2] awk: fix ternary operator and precedence of =
Adjust the = precedence test to match behavior of gawk, mawk and
FreeBSD. awk 'BEGIN {print v=3==3; print v}' should print two '1'.
To fix this, and to unbreak the ternary conditional operator, we restore
the precedence of = in the token list, but override this with a lower
priority when the assignment is on the right side of a compare.
This fixes commit 0256e00a9d07 (awk: fix precedence of = relative to ==) [1]
Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2024-May/090766.html]
[1] https://bugs.busybox.net/show_bug.cgi?id=15871#c6
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
(cherry picked from commit 1714301c405ef03b39605c85c23f22a190cddd95)
CVE: CVE-2023-42364 CVE-2023-42365
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
editors/awk.c | 18 ++++++++++++++----
testsuite/awk.tests | 9 +++++++--
2 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/editors/awk.c b/editors/awk.c
index aff86fe..f320d8c 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -442,9 +442,10 @@ static const uint32_t tokeninfo[] ALIGN4 = {
#define TI_PREINC (OC_UNARY|xV|P(9)|'P')
#define TI_PREDEC (OC_UNARY|xV|P(9)|'M')
TI_PREINC, TI_PREDEC, OC_FIELD|xV|P(5),
- OC_COMPARE|VV|P(39)|5, OC_MOVE|VV|P(38), OC_REPLACE|NV|P(38)|'+', OC_REPLACE|NV|P(38)|'-',
- OC_REPLACE|NV|P(38)|'*', OC_REPLACE|NV|P(38)|'/', OC_REPLACE|NV|P(38)|'%', OC_REPLACE|NV|P(38)|'&',
- OC_BINARY|NV|P(29)|'+', OC_BINARY|NV|P(29)|'-', OC_REPLACE|NV|P(38)|'&', OC_BINARY|NV|P(15)|'&',
+#define TI_ASSIGN (OC_MOVE|VV|P(74))
+ OC_COMPARE|VV|P(39)|5, TI_ASSIGN, OC_REPLACE|NV|P(74)|'+', OC_REPLACE|NV|P(74)|'-',
+ OC_REPLACE|NV|P(74)|'*', OC_REPLACE|NV|P(74)|'/', OC_REPLACE|NV|P(74)|'%', OC_REPLACE|NV|P(74)|'&',
+ OC_BINARY|NV|P(29)|'+', OC_BINARY|NV|P(29)|'-', OC_REPLACE|NV|P(74)|'&', OC_BINARY|NV|P(15)|'&',
OC_BINARY|NV|P(25)|'/', OC_BINARY|NV|P(25)|'%', OC_BINARY|NV|P(15)|'&', OC_BINARY|NV|P(25)|'*',
OC_COMPARE|VV|P(39)|4, OC_COMPARE|VV|P(39)|3, OC_COMPARE|VV|P(39)|0, OC_COMPARE|VV|P(39)|1,
#define TI_LESS (OC_COMPARE|VV|P(39)|2)
@@ -1376,11 +1377,19 @@ static node *parse_expr(uint32_t term_tc)
continue;
}
if (tc & (TS_BINOP | TC_UOPPOST)) {
+ int prio;
debug_printf_parse("%s: TS_BINOP | TC_UOPPOST tc:%x\n", __func__, tc);
/* for binary and postfix-unary operators, jump back over
* previous operators with higher priority */
vn = cn;
- while (((t_info & PRIMASK) > (vn->a.n->info & PRIMASK2))
+ /* Let assignment get higher priority when used on right
+ * side in compare. i.e: 2==v=3 */
+ if (t_info == TI_ASSIGN && (vn->a.n->info & OPCLSMASK) == OC_COMPARE) {
+ prio = PRECEDENCE(38);
+ } else {
+ prio = (t_info & PRIMASK);
+ }
+ while ((prio > (vn->a.n->info & PRIMASK2))
|| (t_info == vn->info && t_info == TI_COLON)
) {
vn = vn->a.n;
@@ -1412,6 +1421,7 @@ static node *parse_expr(uint32_t term_tc)
if ((vn->info & OPCLSMASK) != OC_VAR
&& (vn->info & OPCLSMASK) != OC_FNARG
&& (vn->info & OPCLSMASK) != OC_FIELD
+ && (vn->info & OPCLSMASK) != OC_COMPARE
) {
syntax_error(EMSG_UNEXP_TOKEN); /* no. bad */
}
diff --git a/testsuite/awk.tests b/testsuite/awk.tests
index a78fdcd..d2706de 100755
--- a/testsuite/awk.tests
+++ b/testsuite/awk.tests
@@ -540,9 +540,14 @@ testing 'awk assign while assign' \
│ trim/eff : 57.02%/26, 0.00% │ [cpu000:100%]
└────────────────────────────────────────────────────┘^C"
-testing "awk = has higher precedence than == (despite what gawk manpage claims)" \
+testing "awk = has higher precedence than == on right side" \
"awk 'BEGIN { v=1; print 2==v; print 2==v=2; print v; print v=3==3; print v}'" \
- '0\n1\n2\n1\n3\n' \
+ '0\n1\n2\n1\n1\n' \
+ '' ''
+
+testing 'awk ternary precedence' \
+ "awk 'BEGIN { a = 0 ? \"yes\": \"no\"; print a }'" \
+ 'no\n' \
'' ''
exit $FAILCOUNT

View File

@@ -0,0 +1,36 @@
From 8542236894a8d5f7393327117bc7f64787444efc Mon Sep 17 00:00:00 2001
From: Valery Ushakov <uwe@stderr.spb.ru>
Date: Wed, 24 Jan 2024 22:24:41 +0300
Subject: [PATCH] awk.c: fix CVE-2023-42366 (bug #15874)
Make sure we don't read past the end of the string in next_token()
when backslash is the last character in an (invalid) regexp.
a fix and issue reported in bugzilla
https://bugs.busybox.net/show_bug.cgi?id=15874
Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2024-May/090766.html]
CVE: CVE-2023-42366
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
editors/awk.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/editors/awk.c b/editors/awk.c
index f320d8c..a53b193 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -1168,9 +1168,11 @@ static uint32_t next_token(uint32_t expected)
s[-1] = bb_process_escape_sequence((const char **)&pp);
if (*p == '\\')
*s++ = '\\';
- if (pp == p)
+ if (pp == p) {
+ if (*p == '\0')
+ syntax_error(EMSG_UNEXP_EOS);
*s++ = *p++;
- else
+ } else
p = pp;
}
}

View File

@@ -52,6 +52,11 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
file://CVE-2022-30065.patch \
file://0001-devmem-add-128-bit-width.patch \
file://CVE-2022-48174.patch \
file://CVE-2021-42380.patch \
file://CVE-2023-42363.patch \
file://CVE-2023-42364_42365-1.patch \
file://CVE-2023-42364_42365-2.patch \
file://CVE-2023-42366.patch \
"
SRC_URI:append:libc-musl = " file://musl.cfg "

View File

@@ -0,0 +1,129 @@
From c4e3022918565253ffad52449dd0e648b6d772c7 Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@gnome.org>
Date: Tue, 28 Nov 2023 12:58:20 +0000
Subject: [PATCH 01/18] gdbusmessage: Cache the arg0 value
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Technically we cant rely on it being kept alive by the `message->body`
pointer, unless we can guarantee that the `GVariant` is always
serialised. Thats not necessarily the case, so keep a separate ref on
the arg0 value at all times.
This avoids a potential use-after-free.
Spotted by Thomas Haller in
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3720#note_1924707.
[This is a prerequisite for having tests pass after fixing the
vulnerability described in glib#3268, because after fixing that
vulnerability, the use-after-free genuinely does happen during
regression testing. -smcv]
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3183, #3268
(cherry picked from commit 10e9a917be7fb92b6b27837ef7a7f1d0be6095d5)
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/c4e3022918565253ffad52449dd0e648b6d772c7]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/gdbusmessage.c | 35 ++++++++++++++++++++++-------------
1 file changed, 22 insertions(+), 13 deletions(-)
diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
index ecef6cd3c..3fd1151ca 100644
--- a/gio/gdbusmessage.c
+++ b/gio/gdbusmessage.c
@@ -506,6 +506,7 @@ struct _GDBusMessage
guint32 serial;
GHashTable *headers;
GVariant *body;
+ GVariant *arg0_cache; /* (nullable) (owned) */
#ifdef G_OS_UNIX
GUnixFDList *fd_list;
#endif
@@ -528,6 +529,7 @@ g_dbus_message_finalize (GObject *object)
g_hash_table_unref (message->headers);
if (message->body != NULL)
g_variant_unref (message->body);
+ g_clear_pointer (&message->arg0_cache, g_variant_unref);
#ifdef G_OS_UNIX
if (message->fd_list != NULL)
g_object_unref (message->fd_list);
@@ -1163,6 +1165,7 @@ g_dbus_message_set_body (GDBusMessage *message,
if (body == NULL)
{
message->body = NULL;
+ message->arg0_cache = NULL;
g_dbus_message_set_signature (message, NULL);
}
else
@@ -1173,6 +1176,12 @@ g_dbus_message_set_body (GDBusMessage *message,
message->body = g_variant_ref_sink (body);
+ if (g_variant_is_of_type (message->body, G_VARIANT_TYPE_TUPLE) &&
+ g_variant_n_children (message->body) > 0)
+ message->arg0_cache = g_variant_get_child_value (message->body, 0);
+ else
+ message->arg0_cache = NULL;
+
type_string = g_variant_get_type_string (body);
type_string_len = strlen (type_string);
g_assert (type_string_len >= 2);
@@ -2325,6 +2334,14 @@ g_dbus_message_new_from_blob (guchar *blob,
2,
&local_error);
g_variant_type_free (variant_type);
+
+ if (message->body != NULL &&
+ g_variant_is_of_type (message->body, G_VARIANT_TYPE_TUPLE) &&
+ g_variant_n_children (message->body) > 0)
+ message->arg0_cache = g_variant_get_child_value (message->body, 0);
+ else
+ message->arg0_cache = NULL;
+
if (message->body == NULL)
goto fail;
}
@@ -3364,22 +3381,13 @@ g_dbus_message_set_signature (GDBusMessage *message,
const gchar *
g_dbus_message_get_arg0 (GDBusMessage *message)
{
- const gchar *ret;
-
g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL);
- ret = NULL;
+ if (message->arg0_cache != NULL &&
+ g_variant_is_of_type (message->arg0_cache, G_VARIANT_TYPE_STRING))
+ return g_variant_get_string (message->arg0_cache, NULL);
- if (message->body != NULL && g_variant_is_of_type (message->body, G_VARIANT_TYPE_TUPLE))
- {
- GVariant *item;
- item = g_variant_get_child_value (message->body, 0);
- if (g_variant_is_of_type (item, G_VARIANT_TYPE_STRING))
- ret = g_variant_get_string (item, NULL);
- g_variant_unref (item);
- }
-
- return ret;
+ return NULL;
}
/* ---------------------------------------------------------------------------------------------------- */
@@ -3822,6 +3830,7 @@ g_dbus_message_copy (GDBusMessage *message,
* to just ref (as opposed to deep-copying) the GVariant instances
*/
ret->body = message->body != NULL ? g_variant_ref (message->body) : NULL;
+ ret->arg0_cache = message->arg0_cache != NULL ? g_variant_ref (message->arg0_cache) : NULL;
g_hash_table_iter_init (&iter, message->headers);
while (g_hash_table_iter_next (&iter, &header_key, (gpointer) &header_value))
g_hash_table_insert (ret->headers, header_key, g_variant_ref (header_value));
--
2.30.2

View File

@@ -0,0 +1,62 @@
From c805fd3862baaa114d1cceee27cc931264894c98 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Wed, 1 May 2024 15:51:42 +0100
Subject: [PATCH 02/18] gdbusconnection: Make a backport of g_set_str()
available
A subsequent commit will need this. Copying all of g_set_str() into a
private header seems cleaner than replacing the call to it.
Helps: GNOME/glib#3268
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/c805fd3862baaa114d1cceee27cc931264894c98]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/gdbusconnection.c | 1 +
glib/glib-private.h | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 1159c2db4..82a68437b 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -95,6 +95,7 @@
#include <stdlib.h>
#include <string.h>
+#include "glib-private.h"
#include "gdbusauth.h"
#include "gdbusutils.h"
#include "gdbusaddress.h"
diff --git a/glib/glib-private.h b/glib/glib-private.h
index 943252f1b..f02828ff5 100644
--- a/glib/glib-private.h
+++ b/glib/glib-private.h
@@ -201,4 +201,22 @@ GLibPrivateVTable *glib__private__ (void);
# define GLIB_DEFAULT_LOCALE ""
#endif
+/* Backported from GLib 2.78.x, where it is public API in gstrfuncs.h */
+static inline gboolean
+g_set_str (char **str_pointer,
+ const char *new_str)
+{
+ char *copy;
+
+ if (*str_pointer == new_str ||
+ (*str_pointer && new_str && strcmp (*str_pointer, new_str) == 0))
+ return FALSE;
+
+ copy = g_strdup (new_str);
+ g_free (*str_pointer);
+ *str_pointer = copy;
+
+ return TRUE;
+}
+
#endif /* __GLIB_PRIVATE_H__ */
--
2.30.2

View File

@@ -0,0 +1,985 @@
From 8b1d90457e2e72f1d7db7cb77b74754af3a5c4ef Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Fri, 8 Mar 2024 14:19:46 +0000
Subject: [PATCH 03/18] tests: Add a data-driven test for signal subscriptions
This somewhat duplicates test_connection_signals(), but is easier to
extend to cover different scenarios.
Each scenario is tested three times: once with lower-level
GDBusConnection APIs, once with the higher-level GDBusProxy (which
cannot implement all of the subscription scenarios, so some message
counts are lower), and once with both (to check that delivery of the
same message to multiple destinations is handled appropriately).
[Backported to glib-2-74, resolving conflicts in gio/tests/meson.build]
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/8b1d90457e2e72f1d7db7cb77b74754af3a5c4ef]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/tests/gdbus-subscribe.c | 938 ++++++++++++++++++++++++++++++++++++
gio/tests/meson.build | 1 +
2 files changed, 939 insertions(+)
create mode 100644 gio/tests/gdbus-subscribe.c
diff --git a/gio/tests/gdbus-subscribe.c b/gio/tests/gdbus-subscribe.c
new file mode 100644
index 000000000..3f53e1d7f
--- /dev/null
+++ b/gio/tests/gdbus-subscribe.c
@@ -0,0 +1,938 @@
+/*
+ * Copyright 2024 Collabora Ltd.
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include <gio/gio.h>
+
+#include "gdbus-tests.h"
+
+#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
+#define DBUS_PATH_DBUS "/org/freedesktop/DBus"
+#define DBUS_INTERFACE_DBUS DBUS_SERVICE_DBUS
+
+/* A signal that each connection emits to indicate that it has finished
+ * emitting other signals */
+#define FINISHED_PATH "/org/gtk/Test/Finished"
+#define FINISHED_INTERFACE "org.gtk.Test.Finished"
+#define FINISHED_SIGNAL "Finished"
+
+/* A signal emitted during testing */
+#define EXAMPLE_PATH "/org/gtk/GDBus/ExampleInterface"
+#define EXAMPLE_INTERFACE "org.gtk.GDBus.ExampleInterface"
+#define FOO_SIGNAL "Foo"
+
+/* Log @s in a debug message. */
+static inline const char *
+nonnull (const char *s,
+ const char *if_null)
+{
+ return (s == NULL) ? if_null : s;
+}
+
+typedef enum
+{
+ TEST_CONN_NONE,
+ TEST_CONN_FIRST,
+ /* A connection that subscribes to signals */
+ TEST_CONN_SUBSCRIBER = TEST_CONN_FIRST,
+ /* A mockup of a legitimate service */
+ TEST_CONN_SERVICE,
+ /* A mockup of a second legitimate service */
+ TEST_CONN_SERVICE2,
+ /* A connection that tries to trick @subscriber into processing its signals
+ * as if they came from @service */
+ TEST_CONN_ATTACKER,
+ NUM_TEST_CONNS
+} TestConn;
+
+static const char * const test_conn_descriptions[NUM_TEST_CONNS] =
+{
+ "(unused)",
+ "subscriber",
+ "service",
+ "service 2",
+ "attacker"
+};
+
+typedef enum
+{
+ SUBSCRIPTION_MODE_CONN,
+ SUBSCRIPTION_MODE_PROXY,
+ SUBSCRIPTION_MODE_PARALLEL
+} SubscriptionMode;
+
+typedef struct
+{
+ GDBusProxy *received_by_proxy;
+ TestConn sender;
+ char *path;
+ char *iface;
+ char *member;
+ GVariant *parameters;
+ char *arg0;
+ guint32 step;
+} ReceivedMessage;
+
+static void
+received_message_free (ReceivedMessage *self)
+{
+
+ g_clear_object (&self->received_by_proxy);
+ g_free (self->path);
+ g_free (self->iface);
+ g_free (self->member);
+ g_clear_pointer (&self->parameters, g_variant_unref);
+ g_free (self->arg0);
+ g_free (self);
+}
+
+typedef struct
+{
+ TestConn sender;
+ TestConn unicast_to;
+ const char *path;
+ const char *iface;
+ const char *member;
+ const char *arg0;
+ guint received_by_conn;
+ guint received_by_proxy;
+} TestEmitSignal;
+
+typedef struct
+{
+ TestConn sender;
+ const char *path;
+ const char *iface;
+ const char *member;
+ const char *arg0;
+ GDBusSignalFlags flags;
+} TestSubscribe;
+
+typedef enum
+{
+ TEST_ACTION_NONE = 0,
+ TEST_ACTION_SUBSCRIBE,
+ TEST_ACTION_EMIT_SIGNAL,
+} TestAction;
+
+typedef struct
+{
+ TestAction action;
+ union {
+ TestEmitSignal signal;
+ TestSubscribe subscribe;
+ } u;
+} TestStep;
+
+/* Arbitrary, extend as necessary to accommodate the longest test */
+#define MAX_TEST_STEPS 10
+
+typedef struct
+{
+ const char *description;
+ TestStep steps[MAX_TEST_STEPS];
+} TestPlan;
+
+static const TestPlan plan_simple =
+{
+ .description = "A broadcast is only received after subscribing to it",
+ .steps = {
+ {
+ /* We don't receive a signal if we haven't subscribed yet */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_SERVICE,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 0,
+ .received_by_proxy = 0
+ },
+ },
+ {
+ .action = TEST_ACTION_SUBSCRIBE,
+ .u.subscribe = {
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ },
+ },
+ {
+ /* Now it works */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_SERVICE,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 1,
+ /* The proxy can't be used in this case, because it needs
+ * a bus name to subscribe to */
+ .received_by_proxy = 0
+ },
+ },
+ },
+};
+
+static const TestPlan plan_broadcast_from_anyone =
+{
+ .description = "A subscription with NULL sender accepts broadcast and unicast",
+ .steps = {
+ {
+ /* Subscriber wants to receive signals from anyone */
+ .action = TEST_ACTION_SUBSCRIBE,
+ .u.subscribe = {
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ },
+ },
+ {
+ /* First service sends a broadcast */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_SERVICE,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 1,
+ .received_by_proxy = 0
+ },
+ },
+ {
+ /* Second service also sends a broadcast */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_SERVICE2,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 1,
+ .received_by_proxy = 0
+ },
+ },
+ {
+ /* First service sends a unicast signal */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_SERVICE,
+ .unicast_to = TEST_CONN_SUBSCRIBER,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 1,
+ .received_by_proxy = 0
+ },
+ },
+ {
+ /* Second service also sends a unicast signal */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_SERVICE2,
+ .unicast_to = TEST_CONN_SUBSCRIBER,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 1,
+ .received_by_proxy = 0
+ },
+ },
+ },
+};
+
+static const TestPlan plan_match_twice =
+{
+ .description = "A message matching more than one subscription is received "
+ "once per subscription",
+ .steps = {
+ {
+ .action = TEST_ACTION_SUBSCRIBE,
+ .u.subscribe = {
+ .sender = TEST_CONN_SERVICE,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ },
+ },
+ {
+ .action = TEST_ACTION_SUBSCRIBE,
+ .u.subscribe = {
+ .path = EXAMPLE_PATH,
+ },
+ },
+ {
+ .action = TEST_ACTION_SUBSCRIBE,
+ .u.subscribe = {
+ .iface = EXAMPLE_INTERFACE,
+ },
+ },
+ {
+ .action = TEST_ACTION_SUBSCRIBE,
+ .u.subscribe = {
+ .sender = TEST_CONN_SERVICE,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ },
+ },
+ {
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_SERVICE,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 4,
+ /* Only the first and last work with GDBusProxy */
+ .received_by_proxy = 2
+ },
+ },
+ },
+};
+
+static const TestPlan plan_limit_by_unique_name =
+{
+ .description = "A subscription via a unique name only accepts messages "
+ "sent by that same unique name",
+ .steps = {
+ {
+ /* Subscriber wants to receive signals from service */
+ .action = TEST_ACTION_SUBSCRIBE,
+ .u.subscribe = {
+ .sender = TEST_CONN_SERVICE,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ },
+ },
+ {
+ /* Attacker wants to trick subscriber into thinking that service
+ * sent a signal */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_ATTACKER,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 0,
+ .received_by_proxy = 0
+ },
+ },
+ {
+ /* Attacker tries harder, by sending a signal unicast directly to
+ * the subscriber */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_ATTACKER,
+ .unicast_to = TEST_CONN_SUBSCRIBER,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 0,
+ .received_by_proxy = 0
+ },
+ },
+ {
+ /* When the real service sends a signal, it should still get through */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_SERVICE,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 1,
+ .received_by_proxy = 1
+ },
+ },
+ },
+};
+
+typedef struct
+{
+ const TestPlan *plan;
+ SubscriptionMode mode;
+ GError *error;
+ /* (element-type ReceivedMessage) */
+ GPtrArray *received;
+ /* conns[TEST_CONN_NONE] is unused and remains NULL */
+ GDBusConnection *conns[NUM_TEST_CONNS];
+ /* Proxies on conns[TEST_CONN_SUBSCRIBER] */
+ GPtrArray *proxies;
+ /* unique_names[TEST_CONN_NONE] is unused and remains NULL */
+ const char *unique_names[NUM_TEST_CONNS];
+ /* finished[TEST_CONN_NONE] is unused and remains FALSE */
+ gboolean finished[NUM_TEST_CONNS];
+ /* Remains 0 for any step that is not a subscription */
+ guint subscriptions[MAX_TEST_STEPS];
+ /* Number of times the signal from step n was received */
+ guint received_by_conn[MAX_TEST_STEPS];
+ /* Number of times the signal from step n was received */
+ guint received_by_proxy[MAX_TEST_STEPS];
+ guint finished_subscription;
+} Fixture;
+
+/* Wait for asynchronous messages from @conn to have been processed
+ * by the message bus, as a sequence point so that we can make
+ * "happens before" and "happens after" assertions relative to this.
+ * The easiest way to achieve this is to call a message bus method that has
+ * no arguments and wait for it to return: because the message bus processes
+ * messages in-order, anything we sent before this must have been processed
+ * by the time this call arrives. */
+static void
+connection_wait_for_bus (GDBusConnection *conn)
+{
+ GError *error = NULL;
+ GVariant *call_result;
+
+ call_result = g_dbus_connection_call_sync (conn,
+ DBUS_SERVICE_DBUS,
+ DBUS_PATH_DBUS,
+ DBUS_INTERFACE_DBUS,
+ "GetId",
+ NULL, /* arguments */
+ NULL, /* result type */
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ &error);
+ g_assert_no_error (error);
+ g_assert_nonnull (call_result);
+ g_variant_unref (call_result);
+}
+
+/*
+ * Called when the subscriber receives a message from any connection
+ * announcing that it has emitted all the signals that it plans to emit.
+ */
+static void
+subscriber_finished_cb (GDBusConnection *conn,
+ const char *sender_name,
+ const char *path,
+ const char *iface,
+ const char *member,
+ GVariant *parameters,
+ void *user_data)
+{
+ Fixture *f = user_data;
+ GDBusConnection *subscriber = f->conns[TEST_CONN_SUBSCRIBER];
+ guint i;
+
+ g_assert_true (conn == subscriber);
+
+ for (i = TEST_CONN_FIRST; i < G_N_ELEMENTS (f->conns); i++)
+ {
+ if (g_str_equal (sender_name, f->unique_names[i]))
+ {
+ g_assert_false (f->finished[i]);
+ f->finished[i] = TRUE;
+
+ g_test_message ("Received Finished signal from %s %s",
+ test_conn_descriptions[i], sender_name);
+ return;
+ }
+ }
+
+ g_error ("Received Finished signal from unknown sender %s", sender_name);
+}
+
+/*
+ * Called when we receive a signal, either via the GDBusProxy (proxy != NULL)
+ * or via the GDBusConnection (proxy == NULL).
+ */
+static void
+fixture_received_signal (Fixture *f,
+ GDBusProxy *proxy,
+ const char *sender_name,
+ const char *path,
+ const char *iface,
+ const char *member,
+ GVariant *parameters)
+{
+ guint i;
+ ReceivedMessage *received;
+
+ /* Ignore the Finished signal if it matches a wildcard subscription */
+ if (g_str_equal (member, FINISHED_SIGNAL))
+ return;
+
+ received = g_new0 (ReceivedMessage, 1);
+
+ if (proxy != NULL)
+ received->received_by_proxy = g_object_ref (proxy);
+ else
+ received->received_by_proxy = NULL;
+
+ received->path = g_strdup (path);
+ received->iface = g_strdup (iface);
+ received->member = g_strdup (member);
+ received->parameters = g_variant_ref (parameters);
+
+ for (i = TEST_CONN_FIRST; i < G_N_ELEMENTS (f->conns); i++)
+ {
+ if (g_str_equal (sender_name, f->unique_names[i]))
+ {
+ received->sender = i;
+ g_assert_false (f->finished[i]);
+ break;
+ }
+ }
+
+ g_assert_cmpint (received->sender, !=, TEST_CONN_NONE);
+
+ g_test_message ("Signal received from %s %s via %s",
+ test_conn_descriptions[received->sender],
+ sender_name,
+ proxy != NULL ? "proxy" : "connection");
+ g_test_message ("\tPath: %s", path);
+ g_test_message ("\tInterface: %s", iface);
+ g_test_message ("\tMember: %s", member);
+
+ if (g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(su)")))
+ {
+ g_variant_get (parameters, "(su)", &received->arg0, &received->step);
+ g_test_message ("\tString argument 0: %s", received->arg0);
+ g_test_message ("\tSent in step: %u", received->step);
+ }
+ else
+ {
+ g_assert_cmpstr (g_variant_get_type_string (parameters), ==, "(uu)");
+ g_variant_get (parameters, "(uu)", NULL, &received->step);
+ g_test_message ("\tArgument 0: (not a string)");
+ g_test_message ("\tSent in step: %u", received->step);
+ }
+
+ g_ptr_array_add (f->received, g_steal_pointer (&received));
+}
+
+static void
+proxy_signal_cb (GDBusProxy *proxy,
+ const char *sender_name,
+ const char *member,
+ GVariant *parameters,
+ void *user_data)
+{
+ Fixture *f = user_data;
+
+ fixture_received_signal (f, proxy, sender_name,
+ g_dbus_proxy_get_object_path (proxy),
+ g_dbus_proxy_get_interface_name (proxy),
+ member, parameters);
+}
+
+static void
+subscribed_signal_cb (GDBusConnection *conn,
+ const char *sender_name,
+ const char *path,
+ const char *iface,
+ const char *member,
+ GVariant *parameters,
+ void *user_data)
+{
+ Fixture *f = user_data;
+ GDBusConnection *subscriber = f->conns[TEST_CONN_SUBSCRIBER];
+
+ g_assert_true (conn == subscriber);
+
+ fixture_received_signal (f, NULL, sender_name, path, iface, member, parameters);
+}
+
+static void
+fixture_subscribe (Fixture *f,
+ const TestSubscribe *subscribe,
+ guint step_number)
+{
+ GDBusConnection *subscriber = f->conns[TEST_CONN_SUBSCRIBER];
+ const char *sender;
+
+ if (subscribe->sender != TEST_CONN_NONE)
+ {
+ sender = f->unique_names[subscribe->sender];
+ g_test_message ("\tSender: %s %s",
+ test_conn_descriptions[subscribe->sender],
+ sender);
+ }
+ else
+ {
+ sender = NULL;
+ g_test_message ("\tSender: (any)");
+ }
+
+ g_test_message ("\tPath: %s", nonnull (subscribe->path, "(any)"));
+ g_test_message ("\tInterface: %s",
+ nonnull (subscribe->iface, "(any)"));
+ g_test_message ("\tMember: %s",
+ nonnull (subscribe->member, "(any)"));
+ g_test_message ("\tString argument 0: %s",
+ nonnull (subscribe->arg0, "(any)"));
+ g_test_message ("\tFlags: %x", subscribe->flags);
+
+ if (f->mode != SUBSCRIPTION_MODE_PROXY)
+ {
+ /* CONN or PARALLEL */
+ guint id;
+
+ g_test_message ("\tSubscribing via connection");
+ id = g_dbus_connection_signal_subscribe (subscriber,
+ sender,
+ subscribe->iface,
+ subscribe->member,
+ subscribe->path,
+ subscribe->arg0,
+ subscribe->flags,
+ subscribed_signal_cb,
+ f, NULL);
+ g_assert_cmpuint (id, !=, 0);
+ f->subscriptions[step_number] = id;
+ }
+
+ if (f->mode != SUBSCRIPTION_MODE_CONN)
+ {
+ /* PROXY or PARALLEL */
+
+ if (sender == NULL)
+ {
+ g_test_message ("\tCannot subscribe via proxy: no bus name");
+ }
+ else if (subscribe->path == NULL)
+ {
+ g_test_message ("\tCannot subscribe via proxy: no path");
+ }
+ else if (subscribe->iface == NULL)
+ {
+ g_test_message ("\tCannot subscribe via proxy: no interface");
+ }
+ else
+ {
+ GDBusProxy *proxy;
+
+ g_test_message ("\tSubscribing via proxy");
+ proxy = g_dbus_proxy_new_sync (subscriber,
+ (G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES
+ | G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START),
+ NULL, /* GDBusInterfaceInfo */
+ sender,
+ subscribe->path,
+ subscribe->iface,
+ NULL, /* GCancellable */
+ &f->error);
+ g_assert_no_error (f->error);
+ g_assert_nonnull (proxy);
+ g_signal_connect (proxy, "g-signal", G_CALLBACK (proxy_signal_cb), f);
+ g_ptr_array_add (f->proxies, g_steal_pointer (&proxy));
+ }
+ }
+
+ /* As in setup(), we need to wait for AddMatch to happen. */
+ g_test_message ("Waiting for AddMatch to be processed");
+ connection_wait_for_bus (subscriber);
+}
+
+static void
+fixture_emit_signal (Fixture *f,
+ const TestEmitSignal *signal,
+ guint step_number)
+{
+ GVariant *body;
+ const char *destination;
+ gboolean ok;
+
+ g_test_message ("\tSender: %s",
+ test_conn_descriptions[signal->sender]);
+
+ if (signal->unicast_to != TEST_CONN_NONE)
+ {
+ destination = f->unique_names[signal->unicast_to];
+ g_test_message ("\tDestination: %s %s",
+ test_conn_descriptions[signal->unicast_to],
+ destination);
+ }
+ else
+ {
+ destination = NULL;
+ g_test_message ("\tDestination: (broadcast)");
+ }
+
+ g_assert_nonnull (signal->path);
+ g_test_message ("\tPath: %s", signal->path);
+ g_assert_nonnull (signal->iface);
+ g_test_message ("\tInterface: %s", signal->iface);
+ g_assert_nonnull (signal->member);
+ g_test_message ("\tMember: %s", signal->member);
+
+ /* If arg0 is non-NULL, put it in the message's argument 0.
+ * Otherwise put something that will not match any arg0.
+ * Either way, put the sequence number in argument 1 so we can
+ * correlate sent messages with received messages later. */
+ if (signal->arg0 != NULL)
+ {
+ g_test_message ("\tString argument 0: %s", signal->arg0);
+ /* floating */
+ body = g_variant_new ("(su)", signal->arg0, (guint32) step_number);
+ }
+ else
+ {
+ g_test_message ("\tArgument 0: (not a string)");
+ body = g_variant_new ("(uu)", (guint32) 0, (guint32) step_number);
+ }
+
+ ok = g_dbus_connection_emit_signal (f->conns[signal->sender],
+ destination,
+ signal->path,
+ signal->iface,
+ signal->member,
+ /* steals floating reference */
+ g_steal_pointer (&body),
+ &f->error);
+ g_assert_no_error (f->error);
+ g_assert_true (ok);
+
+ /* Emitting the signal is asynchronous, so if we want subsequent steps
+ * to be guaranteed to happen after the signal from the message bus's
+ * perspective, we have to do a round-trip to the message bus to sync up. */
+ g_test_message ("Waiting for signal to reach message bus");
+ connection_wait_for_bus (f->conns[signal->sender]);
+}
+
+static void
+fixture_run_plan (Fixture *f,
+ const TestPlan *plan,
+ SubscriptionMode mode)
+{
+ guint i;
+
+ G_STATIC_ASSERT (G_N_ELEMENTS (plan->steps) == G_N_ELEMENTS (f->subscriptions));
+ G_STATIC_ASSERT (G_N_ELEMENTS (plan->steps) == G_N_ELEMENTS (f->received_by_conn));
+ G_STATIC_ASSERT (G_N_ELEMENTS (plan->steps) == G_N_ELEMENTS (f->received_by_proxy));
+
+ f->mode = mode;
+ f->plan = plan;
+
+ g_test_summary (plan->description);
+
+ for (i = 0; i < G_N_ELEMENTS (plan->steps); i++)
+ {
+ const TestStep *step = &plan->steps[i];
+
+ switch (step->action)
+ {
+ case TEST_ACTION_SUBSCRIBE:
+ g_test_message ("Step %u: adding subscription", i);
+ fixture_subscribe (f, &step->u.subscribe, i);
+ break;
+
+ case TEST_ACTION_EMIT_SIGNAL:
+ g_test_message ("Step %u: emitting signal", i);
+ fixture_emit_signal (f, &step->u.signal, i);
+ break;
+
+ case TEST_ACTION_NONE:
+ /* Padding to fill the rest of the array, do nothing */
+ break;
+
+ default:
+ g_return_if_reached ();
+ }
+ }
+
+ /* Now that we have done everything we wanted to do, emit Finished
+ * from each connection. */
+ for (i = TEST_CONN_FIRST; i < G_N_ELEMENTS (f->conns); i++)
+ {
+ gboolean ok;
+
+ ok = g_dbus_connection_emit_signal (f->conns[i],
+ NULL,
+ FINISHED_PATH,
+ FINISHED_INTERFACE,
+ FINISHED_SIGNAL,
+ NULL,
+ &f->error);
+ g_assert_no_error (f->error);
+ g_assert_true (ok);
+ }
+
+ /* Wait until we have seen the Finished signal from each sender */
+ while (TRUE)
+ {
+ gboolean all_finished = TRUE;
+
+ for (i = TEST_CONN_FIRST; i < G_N_ELEMENTS (f->conns); i++)
+ all_finished = all_finished && f->finished[i];
+
+ if (all_finished)
+ break;
+
+ g_main_context_iteration (NULL, TRUE);
+ }
+
+ /* Assert that the correct things happened before each Finished signal */
+ for (i = 0; i < f->received->len; i++)
+ {
+ const ReceivedMessage *received = g_ptr_array_index (f->received, i);
+
+ g_assert_cmpuint (received->step, <, G_N_ELEMENTS (f->received_by_conn));
+ g_assert_cmpuint (received->step, <, G_N_ELEMENTS (f->received_by_proxy));
+ g_assert_cmpint (plan->steps[received->step].action,
+ ==, TEST_ACTION_EMIT_SIGNAL);
+
+ if (received->received_by_proxy != NULL)
+ f->received_by_proxy[received->step] += 1;
+ else
+ f->received_by_conn[received->step] += 1;
+ }
+
+ for (i = 0; i < G_N_ELEMENTS (plan->steps); i++)
+ {
+ const TestStep *step = &plan->steps[i];
+
+ if (step->action == TEST_ACTION_EMIT_SIGNAL)
+ {
+ const TestEmitSignal *signal = &plan->steps[i].u.signal;
+
+ if (mode != SUBSCRIPTION_MODE_PROXY)
+ {
+ g_test_message ("Signal from step %u was received %u times by "
+ "GDBusConnection, expected %u",
+ i, f->received_by_conn[i], signal->received_by_conn);
+ g_assert_cmpuint (f->received_by_conn[i], ==, signal->received_by_conn);
+ }
+ else
+ {
+ g_assert_cmpuint (f->received_by_conn[i], ==, 0);
+ }
+
+ if (mode != SUBSCRIPTION_MODE_CONN)
+ {
+ g_test_message ("Signal from step %u was received %u times by "
+ "GDBusProxy, expected %u",
+ i, f->received_by_proxy[i], signal->received_by_proxy);
+ g_assert_cmpuint (f->received_by_proxy[i], ==, signal->received_by_proxy);
+ }
+ else
+ {
+ g_assert_cmpuint (f->received_by_proxy[i], ==, 0);
+ }
+ }
+ }
+}
+
+static void
+setup (Fixture *f,
+ G_GNUC_UNUSED const void *context)
+{
+ GDBusConnection *subscriber;
+ guint i;
+
+ session_bus_up ();
+
+ f->proxies = g_ptr_array_new_full (MAX_TEST_STEPS, g_object_unref);
+ f->received = g_ptr_array_new_full (MAX_TEST_STEPS,
+ (GDestroyNotify) received_message_free);
+
+ for (i = TEST_CONN_FIRST; i < G_N_ELEMENTS (f->conns); i++)
+ {
+ f->conns[i] = _g_bus_get_priv (G_BUS_TYPE_SESSION, NULL, &f->error);
+ g_assert_no_error (f->error);
+ g_assert_nonnull (f->conns[i]);
+
+ f->unique_names[i] = g_dbus_connection_get_unique_name (f->conns[i]);
+ g_assert_nonnull (f->unique_names[i]);
+ g_test_message ("%s is %s",
+ test_conn_descriptions[i],
+ f->unique_names[i]);
+ }
+
+ subscriber = f->conns[TEST_CONN_SUBSCRIBER];
+
+ /* Used to wait for all connections to finish sending whatever they
+ * wanted to send */
+ f->finished_subscription = g_dbus_connection_signal_subscribe (subscriber,
+ NULL,
+ FINISHED_INTERFACE,
+ FINISHED_SIGNAL,
+ FINISHED_PATH,
+ NULL,
+ G_DBUS_SIGNAL_FLAGS_NONE,
+ subscriber_finished_cb,
+ f, NULL);
+ /* AddMatch is sent asynchronously, so we don't know how
+ * soon it will be processed. Before emitting signals, we
+ * need to wait for the message bus to get as far as processing
+ * AddMatch. */
+ g_test_message ("Waiting for AddMatch to be processed");
+ connection_wait_for_bus (subscriber);
+}
+
+static void
+test_conn_subscribe (Fixture *f,
+ const void *context)
+{
+ fixture_run_plan (f, context, SUBSCRIPTION_MODE_CONN);
+}
+
+static void
+test_proxy_subscribe (Fixture *f,
+ const void *context)
+{
+ fixture_run_plan (f, context, SUBSCRIPTION_MODE_PROXY);
+}
+
+static void
+test_parallel_subscribe (Fixture *f,
+ const void *context)
+{
+ fixture_run_plan (f, context, SUBSCRIPTION_MODE_PARALLEL);
+}
+
+static void
+teardown (Fixture *f,
+ G_GNUC_UNUSED const void *context)
+{
+ GDBusConnection *subscriber = f->conns[TEST_CONN_SUBSCRIBER];
+ guint i;
+
+ g_ptr_array_unref (f->proxies);
+
+ if (f->finished_subscription != 0)
+ g_dbus_connection_signal_unsubscribe (subscriber, f->finished_subscription);
+
+ for (i = 0; i < G_N_ELEMENTS (f->subscriptions); i++)
+ {
+ if (f->subscriptions[i] != 0)
+ g_dbus_connection_signal_unsubscribe (subscriber, f->subscriptions[i]);
+ }
+
+ g_ptr_array_unref (f->received);
+
+ for (i = TEST_CONN_FIRST; i < G_N_ELEMENTS (f->conns); i++)
+ g_clear_object (&f->conns[i]);
+
+ g_clear_error (&f->error);
+
+ session_bus_down ();
+}
+
+int
+main (int argc,
+ char *argv[])
+{
+ g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
+
+ g_test_dbus_unset ();
+
+#define ADD_SUBSCRIBE_TEST(name) \
+ do { \
+ g_test_add ("/gdbus/subscribe/conn/" #name, \
+ Fixture, &plan_ ## name, \
+ setup, test_conn_subscribe, teardown); \
+ g_test_add ("/gdbus/subscribe/proxy/" #name, \
+ Fixture, &plan_ ## name, \
+ setup, test_proxy_subscribe, teardown); \
+ g_test_add ("/gdbus/subscribe/parallel/" #name, \
+ Fixture, &plan_ ## name, \
+ setup, test_parallel_subscribe, teardown); \
+ } while (0)
+
+ ADD_SUBSCRIBE_TEST (simple);
+ ADD_SUBSCRIBE_TEST (broadcast_from_anyone);
+ ADD_SUBSCRIBE_TEST (match_twice);
+ ADD_SUBSCRIBE_TEST (limit_by_unique_name);
+
+ return g_test_run();
+}
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index 383d84319..a1551aa53 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -354,6 +354,7 @@ if host_machine.system() != 'windows'
},
'gdbus-proxy-unique-name' : {'extra_sources' : extra_sources},
'gdbus-proxy-well-known-name' : {'extra_sources' : extra_sources},
+ 'gdbus-subscribe' : {'extra_sources' : extra_sources},
'gdbus-test-codegen' : {
'extra_sources' : [extra_sources, gdbus_test_codegen_generated, gdbus_test_codegen_generated_interface_info],
'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32'],
--
2.30.2

View File

@@ -0,0 +1,253 @@
From a87931c257a6bb1b7c104623beadd9b14d766ca6 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Fri, 8 Mar 2024 19:28:15 +0000
Subject: [PATCH 04/18] tests: Add support for subscribing to signals from a
well-known name
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/a87931c257a6bb1b7c104623beadd9b14d766ca6]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/tests/gdbus-subscribe.c | 133 ++++++++++++++++++++++++++++++++++--
1 file changed, 126 insertions(+), 7 deletions(-)
diff --git a/gio/tests/gdbus-subscribe.c b/gio/tests/gdbus-subscribe.c
index 3f53e1d7f..3d2a14e03 100644
--- a/gio/tests/gdbus-subscribe.c
+++ b/gio/tests/gdbus-subscribe.c
@@ -7,6 +7,9 @@
#include "gdbus-tests.h"
+/* From the D-Bus Specification */
+#define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1
+
#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
#define DBUS_PATH_DBUS "/org/freedesktop/DBus"
#define DBUS_INTERFACE_DBUS DBUS_SERVICE_DBUS
@@ -22,6 +25,9 @@
#define EXAMPLE_INTERFACE "org.gtk.GDBus.ExampleInterface"
#define FOO_SIGNAL "Foo"
+#define ALREADY_OWNED_NAME "org.gtk.Test.AlreadyOwned"
+#define OWNED_LATER_NAME "org.gtk.Test.OwnedLater"
+
/* Log @s in a debug message. */
static inline const char *
nonnull (const char *s,
@@ -101,7 +107,8 @@ typedef struct
typedef struct
{
- TestConn sender;
+ const char *string_sender;
+ TestConn unique_sender;
const char *path;
const char *iface;
const char *member;
@@ -109,11 +116,18 @@ typedef struct
GDBusSignalFlags flags;
} TestSubscribe;
+typedef struct
+{
+ const char *name;
+ TestConn owner;
+} TestOwnName;
+
typedef enum
{
TEST_ACTION_NONE = 0,
TEST_ACTION_SUBSCRIBE,
TEST_ACTION_EMIT_SIGNAL,
+ TEST_ACTION_OWN_NAME,
} TestAction;
typedef struct
@@ -122,6 +136,7 @@ typedef struct
union {
TestEmitSignal signal;
TestSubscribe subscribe;
+ TestOwnName own_name;
} u;
} TestStep;
@@ -247,7 +262,7 @@ static const TestPlan plan_match_twice =
{
.action = TEST_ACTION_SUBSCRIBE,
.u.subscribe = {
- .sender = TEST_CONN_SERVICE,
+ .unique_sender = TEST_CONN_SERVICE,
.path = EXAMPLE_PATH,
.iface = EXAMPLE_INTERFACE,
},
@@ -267,7 +282,7 @@ static const TestPlan plan_match_twice =
{
.action = TEST_ACTION_SUBSCRIBE,
.u.subscribe = {
- .sender = TEST_CONN_SERVICE,
+ .unique_sender = TEST_CONN_SERVICE,
.path = EXAMPLE_PATH,
.iface = EXAMPLE_INTERFACE,
},
@@ -296,7 +311,7 @@ static const TestPlan plan_limit_by_unique_name =
/* Subscriber wants to receive signals from service */
.action = TEST_ACTION_SUBSCRIBE,
.u.subscribe = {
- .sender = TEST_CONN_SERVICE,
+ .unique_sender = TEST_CONN_SERVICE,
.path = EXAMPLE_PATH,
.iface = EXAMPLE_INTERFACE,
},
@@ -343,6 +358,62 @@ static const TestPlan plan_limit_by_unique_name =
},
};
+static const TestPlan plan_limit_by_well_known_name =
+{
+ .description = "A subscription via a well-known name only accepts messages "
+ "sent by the owner of that well-known name",
+ .steps = {
+ {
+ /* Service already owns one name */
+ .action = TEST_ACTION_OWN_NAME,
+ .u.own_name = {
+ .name = ALREADY_OWNED_NAME,
+ .owner = TEST_CONN_SERVICE
+ },
+ },
+ {
+ /* Subscriber wants to receive signals from service */
+ .action = TEST_ACTION_SUBSCRIBE,
+ .u.subscribe = {
+ .string_sender = ALREADY_OWNED_NAME,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ },
+ },
+ {
+ /* Subscriber wants to receive signals from service by another name */
+ .action = TEST_ACTION_SUBSCRIBE,
+ .u.subscribe = {
+ .string_sender = OWNED_LATER_NAME,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ },
+ },
+ {
+ /* Service claims another name */
+ .action = TEST_ACTION_OWN_NAME,
+ .u.own_name = {
+ .name = OWNED_LATER_NAME,
+ .owner = TEST_CONN_SERVICE
+ },
+ },
+ {
+ /* Now the subscriber gets this signal twice, once for each
+ * subscription; and similarly each of the two proxies gets this
+ * signal twice */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_SERVICE,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 2,
+ .received_by_proxy = 2
+ },
+ },
+ },
+};
+
typedef struct
{
const TestPlan *plan;
@@ -540,11 +611,16 @@ fixture_subscribe (Fixture *f,
GDBusConnection *subscriber = f->conns[TEST_CONN_SUBSCRIBER];
const char *sender;
- if (subscribe->sender != TEST_CONN_NONE)
+ if (subscribe->string_sender != NULL)
{
- sender = f->unique_names[subscribe->sender];
+ sender = subscribe->string_sender;
+ g_test_message ("\tSender: %s", sender);
+ }
+ else if (subscribe->unique_sender != TEST_CONN_NONE)
+ {
+ sender = f->unique_names[subscribe->unique_sender];
g_test_message ("\tSender: %s %s",
- test_conn_descriptions[subscribe->sender],
+ test_conn_descriptions[subscribe->unique_sender],
sender);
}
else
@@ -689,6 +765,43 @@ fixture_emit_signal (Fixture *f,
connection_wait_for_bus (f->conns[signal->sender]);
}
+static void
+fixture_own_name (Fixture *f,
+ const TestOwnName *own_name)
+{
+ GVariant *call_result;
+ guint32 flags;
+ guint32 result_code;
+
+ g_test_message ("\tName: %s", own_name->name);
+ g_test_message ("\tOwner: %s",
+ test_conn_descriptions[own_name->owner]);
+
+ /* For simplicity, we do this via a direct bus call rather than
+ * using g_bus_own_name_on_connection(). The flags in
+ * GBusNameOwnerFlags are numerically equal to those in the
+ * D-Bus wire protocol. */
+ flags = G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE;
+ call_result = g_dbus_connection_call_sync (f->conns[own_name->owner],
+ DBUS_SERVICE_DBUS,
+ DBUS_PATH_DBUS,
+ DBUS_INTERFACE_DBUS,
+ "RequestName",
+ g_variant_new ("(su)",
+ own_name->name,
+ flags),
+ G_VARIANT_TYPE ("(u)"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ &f->error);
+ g_assert_no_error (f->error);
+ g_assert_nonnull (call_result);
+ g_variant_get (call_result, "(u)", &result_code);
+ g_assert_cmpuint (result_code, ==, DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER);
+ g_variant_unref (call_result);
+}
+
static void
fixture_run_plan (Fixture *f,
const TestPlan *plan,
@@ -721,6 +834,11 @@ fixture_run_plan (Fixture *f,
fixture_emit_signal (f, &step->u.signal, i);
break;
+ case TEST_ACTION_OWN_NAME:
+ g_test_message ("Step %u: claiming bus name", i);
+ fixture_own_name (f, &step->u.own_name);
+ break;
+
case TEST_ACTION_NONE:
/* Padding to fill the rest of the array, do nothing */
break;
@@ -933,6 +1051,7 @@ main (int argc,
ADD_SUBSCRIBE_TEST (broadcast_from_anyone);
ADD_SUBSCRIBE_TEST (match_twice);
ADD_SUBSCRIBE_TEST (limit_by_unique_name);
+ ADD_SUBSCRIBE_TEST (limit_by_well_known_name);
return g_test_run();
}
--
2.30.2

View File

@@ -0,0 +1,88 @@
From 4d4c40e858cb71a229b19f89196e6e02e235eb5b Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Fri, 8 Mar 2024 19:44:03 +0000
Subject: [PATCH 05/18] tests: Add a test-case for what happens if a unique
name doesn't exist
On GNOME/glib#3268 there was some concern about whether this would
allow an attacker to send signals and have them be matched to a
GDBusProxy in this situation, but it seems that was a false alarm.
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/4d4c40e858cb71a229b19f89196e6e02e235eb5b]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/tests/gdbus-subscribe.c | 48 +++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/gio/tests/gdbus-subscribe.c b/gio/tests/gdbus-subscribe.c
index 3d2a14e03..350ec9f52 100644
--- a/gio/tests/gdbus-subscribe.c
+++ b/gio/tests/gdbus-subscribe.c
@@ -358,6 +358,53 @@ static const TestPlan plan_limit_by_unique_name =
},
};
+static const TestPlan plan_nonexistent_unique_name =
+{
+ .description = "A subscription via a unique name that doesn't exist "
+ "accepts no messages",
+ .steps = {
+ {
+ /* Subscriber wants to receive signals from service */
+ .action = TEST_ACTION_SUBSCRIBE,
+ .u.subscribe = {
+ /* This relies on the implementation detail that the dbus-daemon
+ * (and presumably other bus implementations) never actually generates
+ * a unique name in this format */
+ .string_sender = ":0.this.had.better.not.exist",
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ },
+ },
+ {
+ /* Attacker wants to trick subscriber into thinking that service
+ * sent a signal */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_ATTACKER,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 0,
+ .received_by_proxy = 0
+ },
+ },
+ {
+ /* Attacker tries harder, by sending a signal unicast directly to
+ * the subscriber */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_ATTACKER,
+ .unicast_to = TEST_CONN_SUBSCRIBER,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 0,
+ .received_by_proxy = 0
+ },
+ },
+ },
+};
+
static const TestPlan plan_limit_by_well_known_name =
{
.description = "A subscription via a well-known name only accepts messages "
@@ -1051,6 +1098,7 @@ main (int argc,
ADD_SUBSCRIBE_TEST (broadcast_from_anyone);
ADD_SUBSCRIBE_TEST (match_twice);
ADD_SUBSCRIBE_TEST (limit_by_unique_name);
+ ADD_SUBSCRIBE_TEST (nonexistent_unique_name);
ADD_SUBSCRIBE_TEST (limit_by_well_known_name);
return g_test_run();
--
2.30.2

View File

@@ -0,0 +1,263 @@
From 4d8106ba534c7f3c2037cca4c654fd13ce0b93d9 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Fri, 8 Mar 2024 20:10:29 +0000
Subject: [PATCH 06/18] tests: Add test coverage for signals that match the
message bus's name
This is a special case of unique names, even though it's syntactically
a well-known name.
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/4d8106ba534c7f3c2037cca4c654fd13ce0b93d9]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/tests/gdbus-subscribe.c | 161 ++++++++++++++++++++++++++++++++++--
1 file changed, 154 insertions(+), 7 deletions(-)
diff --git a/gio/tests/gdbus-subscribe.c b/gio/tests/gdbus-subscribe.c
index 350ec9f52..af100de7d 100644
--- a/gio/tests/gdbus-subscribe.c
+++ b/gio/tests/gdbus-subscribe.c
@@ -13,6 +13,7 @@
#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
#define DBUS_PATH_DBUS "/org/freedesktop/DBus"
#define DBUS_INTERFACE_DBUS DBUS_SERVICE_DBUS
+#define NAME_OWNER_CHANGED "NameOwnerChanged"
/* A signal that each connection emits to indicate that it has finished
* emitting other signals */
@@ -101,6 +102,7 @@ typedef struct
const char *iface;
const char *member;
const char *arg0;
+ const char *args;
guint received_by_conn;
guint received_by_proxy;
} TestEmitSignal;
@@ -120,6 +122,8 @@ typedef struct
{
const char *name;
TestConn owner;
+ guint received_by_conn;
+ guint received_by_proxy;
} TestOwnName;
typedef enum
@@ -461,6 +465,63 @@ static const TestPlan plan_limit_by_well_known_name =
},
};
+static const TestPlan plan_limit_to_message_bus =
+{
+ .description = "A subscription to the message bus only accepts messages "
+ "from the message bus",
+ .steps = {
+ {
+ /* Subscriber wants to receive signals from the message bus itself */
+ .action = TEST_ACTION_SUBSCRIBE,
+ .u.subscribe = {
+ .string_sender = DBUS_SERVICE_DBUS,
+ .path = DBUS_PATH_DBUS,
+ .iface = DBUS_INTERFACE_DBUS,
+ },
+ },
+ {
+ /* Attacker wants to trick subscriber into thinking that the message
+ * bus sent a signal */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_ATTACKER,
+ .path = DBUS_PATH_DBUS,
+ .iface = DBUS_INTERFACE_DBUS,
+ .member = NAME_OWNER_CHANGED,
+ .arg0 = "would I lie to you?",
+ .received_by_conn = 0,
+ .received_by_proxy = 0
+ },
+ },
+ {
+ /* Attacker tries harder, by sending a signal unicast directly to
+ * the subscriber, and using more realistic arguments */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .unicast_to = TEST_CONN_SUBSCRIBER,
+ .sender = TEST_CONN_ATTACKER,
+ .path = DBUS_PATH_DBUS,
+ .iface = DBUS_INTERFACE_DBUS,
+ .member = NAME_OWNER_CHANGED,
+ .args = "('com.example.Name', '', ':1.12')",
+ .received_by_conn = 0,
+ .received_by_proxy = 0
+ },
+ },
+ {
+ /* When the message bus sends a signal (in this case triggered by
+ * owning a name), it should still get through */
+ .action = TEST_ACTION_OWN_NAME,
+ .u.own_name = {
+ .name = OWNED_LATER_NAME,
+ .owner = TEST_CONN_SERVICE,
+ .received_by_conn = 1,
+ .received_by_proxy = 1
+ },
+ },
+ },
+};
+
typedef struct
{
const TestPlan *plan;
@@ -591,7 +652,18 @@ fixture_received_signal (Fixture *f,
}
}
- g_assert_cmpint (received->sender, !=, TEST_CONN_NONE);
+ if (g_str_equal (sender_name, DBUS_SERVICE_DBUS))
+ {
+ g_test_message ("Signal received from message bus %s",
+ sender_name);
+ }
+ else
+ {
+ g_test_message ("Signal received from %s %s",
+ test_conn_descriptions[received->sender],
+ sender_name);
+ g_assert_cmpint (received->sender, !=, TEST_CONN_NONE);
+ }
g_test_message ("Signal received from %s %s via %s",
test_conn_descriptions[received->sender],
@@ -607,13 +679,56 @@ fixture_received_signal (Fixture *f,
g_test_message ("\tString argument 0: %s", received->arg0);
g_test_message ("\tSent in step: %u", received->step);
}
- else
+ else if (g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(uu)")))
{
- g_assert_cmpstr (g_variant_get_type_string (parameters), ==, "(uu)");
g_variant_get (parameters, "(uu)", NULL, &received->step);
g_test_message ("\tArgument 0: (not a string)");
g_test_message ("\tSent in step: %u", received->step);
}
+ else if (g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(sss)")))
+ {
+ const char *name;
+ const char *old_owner;
+ const char *new_owner;
+
+ /* The only signal of this signature that we legitimately receive
+ * during this test is NameOwnerChanged, so just assert that it
+ * is from the message bus and can be matched to a plausible step.
+ * (This is less thorough than the above, and will not work if we
+ * add a test scenario where a name's ownership is repeatedly
+ * changed while watching NameOwnerChanged - so don't do that.) */
+ g_assert_cmpstr (sender_name, ==, DBUS_SERVICE_DBUS);
+ g_assert_cmpstr (path, ==, DBUS_PATH_DBUS);
+ g_assert_cmpstr (iface, ==, DBUS_INTERFACE_DBUS);
+ g_assert_cmpstr (member, ==, NAME_OWNER_CHANGED);
+
+ g_variant_get (parameters, "(&s&s&s)", &name, &old_owner, &new_owner);
+
+ for (i = 0; i < G_N_ELEMENTS (f->plan->steps); i++)
+ {
+ const TestStep *step = &f->plan->steps[i];
+
+ if (step->action == TEST_ACTION_OWN_NAME)
+ {
+ const TestOwnName *own_name = &step->u.own_name;
+
+ if (g_str_equal (name, own_name->name)
+ && g_str_equal (new_owner, f->unique_names[own_name->owner])
+ && own_name->received_by_conn > 0)
+ {
+ received->step = i;
+ break;
+ }
+ }
+
+ if (i >= G_N_ELEMENTS (f->plan->steps))
+ g_error ("Could not match message to a test step");
+ }
+ }
+ else
+ {
+ g_error ("Unexpected message received");
+ }
g_ptr_array_add (f->received, g_steal_pointer (&received));
}
@@ -782,10 +897,15 @@ fixture_emit_signal (Fixture *f,
* Otherwise put something that will not match any arg0.
* Either way, put the sequence number in argument 1 so we can
* correlate sent messages with received messages later. */
- if (signal->arg0 != NULL)
+ if (signal->args != NULL)
{
- g_test_message ("\tString argument 0: %s", signal->arg0);
/* floating */
+ body = g_variant_new_parsed (signal->args);
+ g_assert_nonnull (body);
+ }
+ else if (signal->arg0 != NULL)
+ {
+ g_test_message ("\tString argument 0: %s", signal->arg0);
body = g_variant_new ("(su)", signal->arg0, (guint32) step_number);
}
else
@@ -933,8 +1053,6 @@ fixture_run_plan (Fixture *f,
g_assert_cmpuint (received->step, <, G_N_ELEMENTS (f->received_by_conn));
g_assert_cmpuint (received->step, <, G_N_ELEMENTS (f->received_by_proxy));
- g_assert_cmpint (plan->steps[received->step].action,
- ==, TEST_ACTION_EMIT_SIGNAL);
if (received->received_by_proxy != NULL)
f->received_by_proxy[received->step] += 1;
@@ -974,6 +1092,34 @@ fixture_run_plan (Fixture *f,
g_assert_cmpuint (f->received_by_proxy[i], ==, 0);
}
}
+ else if (step->action == TEST_ACTION_OWN_NAME)
+ {
+ const TestOwnName *own_name = &plan->steps[i].u.own_name;
+
+ if (mode != SUBSCRIPTION_MODE_PROXY)
+ {
+ g_test_message ("NameOwnerChanged from step %u was received %u "
+ "times by GDBusConnection, expected %u",
+ i, f->received_by_conn[i], own_name->received_by_conn);
+ g_assert_cmpuint (f->received_by_conn[i], ==, own_name->received_by_conn);
+ }
+ else
+ {
+ g_assert_cmpuint (f->received_by_conn[i], ==, 0);
+ }
+
+ if (mode != SUBSCRIPTION_MODE_CONN)
+ {
+ g_test_message ("NameOwnerChanged from step %u was received %u "
+ "times by GDBusProxy, expected %u",
+ i, f->received_by_proxy[i], own_name->received_by_proxy);
+ g_assert_cmpuint (f->received_by_proxy[i], ==, own_name->received_by_proxy);
+ }
+ else
+ {
+ g_assert_cmpuint (f->received_by_proxy[i], ==, 0);
+ }
+ }
}
}
@@ -1100,6 +1246,7 @@ main (int argc,
ADD_SUBSCRIBE_TEST (limit_by_unique_name);
ADD_SUBSCRIBE_TEST (nonexistent_unique_name);
ADD_SUBSCRIBE_TEST (limit_by_well_known_name);
+ ADD_SUBSCRIBE_TEST (limit_to_message_bus);
return g_test_run();
}
--
2.30.2

View File

@@ -0,0 +1,45 @@
From 5057b6a0e488af6495146cfe96e93eb5e7beb66b Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Thu, 14 Mar 2024 19:18:15 +0000
Subject: [PATCH 07/18] gdbusprivate: Add symbolic constants for the message
bus itself
Using these is a bit more clearly correct than repeating them everywhere.
To avoid excessive diffstat in a branch for a bug fix, I'm not
immediately replacing all existing occurrences of the same literals with
these names.
The names of these constants are chosen to be consistent with libdbus,
despite using somewhat outdated terminology (D-Bus now uses the term
"well-known bus name" for what used to be called a service name,
reserving the word "service" to mean specifically the programs that
have .service files and participate in service activation).
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/5057b6a0e488af6495146cfe96e93eb5e7beb66b]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/gdbusprivate.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/gio/gdbusprivate.h b/gio/gdbusprivate.h
index 72d2c32a9..ac737bd7a 100644
--- a/gio/gdbusprivate.h
+++ b/gio/gdbusprivate.h
@@ -29,6 +29,11 @@
G_BEGIN_DECLS
+/* Bus name, interface and object path of the message bus itself */
+#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
+#define DBUS_INTERFACE_DBUS DBUS_SERVICE_DBUS
+#define DBUS_PATH_DBUS "/org/freedesktop/DBus"
+
/* ---------------------------------------------------------------------------------------------------- */
typedef struct GDBusWorker GDBusWorker;
--
2.30.2

View File

@@ -0,0 +1,168 @@
From 467ff27a5a08c21705e20da70a988a55b9f15513 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Thu, 14 Mar 2024 19:24:24 +0000
Subject: [PATCH 08/18] gdbusconnection: Move SignalData, SignalSubscriber
higher up
Subsequent changes will need to access these data structures from
on_worker_message_received(). No functional change here, only moving
code around.
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/467ff27a5a08c21705e20da70a988a55b9f15513]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/gdbusconnection.c | 128 +++++++++++++++++++++---------------------
1 file changed, 65 insertions(+), 63 deletions(-)
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 82a68437b..4f31e8502 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -283,6 +283,71 @@ call_destroy_notify (GMainContext *context,
/* ---------------------------------------------------------------------------------------------------- */
+typedef struct
+{
+ /* All fields are immutable after construction. */
+ gatomicrefcount ref_count;
+ GDBusSignalCallback callback;
+ gpointer user_data;
+ GDestroyNotify user_data_free_func;
+ guint id;
+ GMainContext *context;
+} SignalSubscriber;
+
+static SignalSubscriber *
+signal_subscriber_ref (SignalSubscriber *subscriber)
+{
+ g_atomic_ref_count_inc (&subscriber->ref_count);
+ return subscriber;
+}
+
+static void
+signal_subscriber_unref (SignalSubscriber *subscriber)
+{
+ if (g_atomic_ref_count_dec (&subscriber->ref_count))
+ {
+ /* Destroy the user data. It doesnt matter which thread
+ * signal_subscriber_unref() is called in (or whether its called with a
+ * lock held), as call_destroy_notify() always defers to the next
+ * #GMainContext iteration. */
+ call_destroy_notify (subscriber->context,
+ subscriber->user_data_free_func,
+ subscriber->user_data);
+
+ g_main_context_unref (subscriber->context);
+ g_free (subscriber);
+ }
+}
+
+typedef struct
+{
+ gchar *rule;
+ gchar *sender;
+ gchar *sender_unique_name; /* if sender is unique or org.freedesktop.DBus, then that name... otherwise blank */
+ gchar *interface_name;
+ gchar *member;
+ gchar *object_path;
+ gchar *arg0;
+ GDBusSignalFlags flags;
+ GPtrArray *subscribers; /* (owned) (element-type SignalSubscriber) */
+} SignalData;
+
+static void
+signal_data_free (SignalData *signal_data)
+{
+ g_free (signal_data->rule);
+ g_free (signal_data->sender);
+ g_free (signal_data->sender_unique_name);
+ g_free (signal_data->interface_name);
+ g_free (signal_data->member);
+ g_free (signal_data->object_path);
+ g_free (signal_data->arg0);
+ g_ptr_array_unref (signal_data->subscribers);
+ g_free (signal_data);
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
#ifdef G_OS_WIN32
#define CONNECTION_ENSURE_LOCK(obj) do { ; } while (FALSE)
#else
@@ -3238,69 +3303,6 @@ g_dbus_connection_remove_filter (GDBusConnection *connection,
/* ---------------------------------------------------------------------------------------------------- */
-typedef struct
-{
- gchar *rule;
- gchar *sender;
- gchar *sender_unique_name; /* if sender is unique or org.freedesktop.DBus, then that name... otherwise blank */
- gchar *interface_name;
- gchar *member;
- gchar *object_path;
- gchar *arg0;
- GDBusSignalFlags flags;
- GPtrArray *subscribers; /* (owned) (element-type SignalSubscriber) */
-} SignalData;
-
-static void
-signal_data_free (SignalData *signal_data)
-{
- g_free (signal_data->rule);
- g_free (signal_data->sender);
- g_free (signal_data->sender_unique_name);
- g_free (signal_data->interface_name);
- g_free (signal_data->member);
- g_free (signal_data->object_path);
- g_free (signal_data->arg0);
- g_ptr_array_unref (signal_data->subscribers);
- g_free (signal_data);
-}
-
-typedef struct
-{
- /* All fields are immutable after construction. */
- gatomicrefcount ref_count;
- GDBusSignalCallback callback;
- gpointer user_data;
- GDestroyNotify user_data_free_func;
- guint id;
- GMainContext *context;
-} SignalSubscriber;
-
-static SignalSubscriber *
-signal_subscriber_ref (SignalSubscriber *subscriber)
-{
- g_atomic_ref_count_inc (&subscriber->ref_count);
- return subscriber;
-}
-
-static void
-signal_subscriber_unref (SignalSubscriber *subscriber)
-{
- if (g_atomic_ref_count_dec (&subscriber->ref_count))
- {
- /* Destroy the user data. It doesnt matter which thread
- * signal_subscriber_unref() is called in (or whether its called with a
- * lock held), as call_destroy_notify() always defers to the next
- * #GMainContext iteration. */
- call_destroy_notify (subscriber->context,
- subscriber->user_data_free_func,
- subscriber->user_data);
-
- g_main_context_unref (subscriber->context);
- g_free (subscriber);
- }
-}
-
static gchar *
args_to_rule (const gchar *sender,
const gchar *interface_name,
--
2.30.2

View File

@@ -0,0 +1,81 @@
From f75e2d73645598e5f3aa064adfece95da435525f Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Thu, 14 Mar 2024 19:30:12 +0000
Subject: [PATCH 09/18] gdbusconnection: Factor out signal_data_new_take()
No functional changes, except that the implicit ownership-transfer
for the rule field becomes explicit (the local variable is set to NULL
afterwards).
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/f75e2d73645598e5f3aa064adfece95da435525f]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/gdbusconnection.c | 42 ++++++++++++++++++++++++++++++++----------
1 file changed, 32 insertions(+), 10 deletions(-)
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 4f31e8502..b8fd920d9 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -332,6 +332,30 @@ typedef struct
GPtrArray *subscribers; /* (owned) (element-type SignalSubscriber) */
} SignalData;
+static SignalData *
+signal_data_new_take (gchar *rule,
+ gchar *sender,
+ gchar *sender_unique_name,
+ gchar *interface_name,
+ gchar *member,
+ gchar *object_path,
+ gchar *arg0,
+ GDBusSignalFlags flags)
+{
+ SignalData *signal_data = g_new0 (SignalData, 1);
+
+ signal_data->rule = rule;
+ signal_data->sender = sender;
+ signal_data->sender_unique_name = sender_unique_name;
+ signal_data->interface_name = interface_name;
+ signal_data->member = member;
+ signal_data->object_path = object_path;
+ signal_data->arg0 = arg0;
+ signal_data->flags = flags;
+ signal_data->subscribers = g_ptr_array_new_with_free_func ((GDestroyNotify) signal_subscriber_unref);
+ return g_steal_pointer (&signal_data);
+}
+
static void
signal_data_free (SignalData *signal_data)
{
@@ -3569,16 +3593,14 @@ g_dbus_connection_signal_subscribe (GDBusConnection *connection,
goto out;
}
- signal_data = g_new0 (SignalData, 1);
- signal_data->rule = rule;
- signal_data->sender = g_strdup (sender);
- signal_data->sender_unique_name = g_strdup (sender_unique_name);
- signal_data->interface_name = g_strdup (interface_name);
- signal_data->member = g_strdup (member);
- signal_data->object_path = g_strdup (object_path);
- signal_data->arg0 = g_strdup (arg0);
- signal_data->flags = flags;
- signal_data->subscribers = g_ptr_array_new_with_free_func ((GDestroyNotify) signal_subscriber_unref);
+ signal_data = signal_data_new_take (g_steal_pointer (&rule),
+ g_strdup (sender),
+ g_strdup (sender_unique_name),
+ g_strdup (interface_name),
+ g_strdup (member),
+ g_strdup (object_path),
+ g_strdup (arg0),
+ flags);
g_ptr_array_add (signal_data->subscribers, subscriber);
g_hash_table_insert (connection->map_rule_to_signal_data,
--
2.30.2

View File

@@ -0,0 +1,108 @@
From 7f8b44ecdf5bc02e132de4c3242e961f8f27e9f2 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Tue, 23 Apr 2024 20:31:57 +0100
Subject: [PATCH 10/18] gdbusconnection: Factor out add_signal_data()
No functional changes.
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/7f8b44ecdf5bc02e132de4c3242e961f8f27e9f2]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/gdbusconnection.c | 64 +++++++++++++++++++++++++------------------
1 file changed, 37 insertions(+), 27 deletions(-)
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index b8fd920d9..3b170845c 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -3447,6 +3447,42 @@ is_signal_data_for_name_lost_or_acquired (SignalData *signal_data)
/* ---------------------------------------------------------------------------------------------------- */
+/* called in any thread, connection lock is held */
+static void
+add_signal_data (GDBusConnection *connection,
+ SignalData *signal_data)
+{
+ GPtrArray *signal_data_array;
+
+ g_hash_table_insert (connection->map_rule_to_signal_data,
+ signal_data->rule,
+ signal_data);
+
+ /* Add the match rule to the bus...
+ *
+ * Avoid adding match rules for NameLost and NameAcquired messages - the bus will
+ * always send such messages to us.
+ */
+ if (connection->flags & G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION)
+ {
+ if (!is_signal_data_for_name_lost_or_acquired (signal_data))
+ add_match_rule (connection, signal_data->rule);
+ }
+
+ signal_data_array = g_hash_table_lookup (connection->map_sender_unique_name_to_signal_data_array,
+ signal_data->sender_unique_name);
+ if (signal_data_array == NULL)
+ {
+ signal_data_array = g_ptr_array_new ();
+ g_hash_table_insert (connection->map_sender_unique_name_to_signal_data_array,
+ g_strdup (signal_data->sender_unique_name),
+ signal_data_array);
+ }
+ g_ptr_array_add (signal_data_array, signal_data);
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
/**
* g_dbus_connection_signal_subscribe:
* @connection: a #GDBusConnection
@@ -3536,7 +3572,6 @@ g_dbus_connection_signal_subscribe (GDBusConnection *connection,
gchar *rule;
SignalData *signal_data;
SignalSubscriber *subscriber;
- GPtrArray *signal_data_array;
const gchar *sender_unique_name;
/* Right now we abort if AddMatch() fails since it can only fail with the bus being in
@@ -3602,32 +3637,7 @@ g_dbus_connection_signal_subscribe (GDBusConnection *connection,
g_strdup (arg0),
flags);
g_ptr_array_add (signal_data->subscribers, subscriber);
-
- g_hash_table_insert (connection->map_rule_to_signal_data,
- signal_data->rule,
- signal_data);
-
- /* Add the match rule to the bus...
- *
- * Avoid adding match rules for NameLost and NameAcquired messages - the bus will
- * always send such messages to us.
- */
- if (connection->flags & G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION)
- {
- if (!is_signal_data_for_name_lost_or_acquired (signal_data))
- add_match_rule (connection, signal_data->rule);
- }
-
- signal_data_array = g_hash_table_lookup (connection->map_sender_unique_name_to_signal_data_array,
- signal_data->sender_unique_name);
- if (signal_data_array == NULL)
- {
- signal_data_array = g_ptr_array_new ();
- g_hash_table_insert (connection->map_sender_unique_name_to_signal_data_array,
- g_strdup (signal_data->sender_unique_name),
- signal_data_array);
- }
- g_ptr_array_add (signal_data_array, signal_data);
+ add_signal_data (connection, signal_data);
out:
g_hash_table_insert (connection->map_id_to_signal_data,
--
2.30.2

View File

@@ -0,0 +1,133 @@
From 1704bc6a70c0dcdc5555f23ebab8e3e7ed697998 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Thu, 14 Mar 2024 19:51:59 +0000
Subject: [PATCH 11/18] gdbusconnection: Factor out
remove_signal_data_if_unused
No functional change, just removing some nesting. The check for whether
signal_data->subscribers is empty changes from a conditional that tests
whether it is into an early-return if it isn't.
A subsequent commit will add additional conditions that make us consider
a SignalData to be still in use and therefore not eligible to be removed.
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/1704bc6a70c0dcdc5555f23ebab8e3e7ed697998]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/gdbusconnection.c | 83 +++++++++++++++++++++++++------------------
1 file changed, 48 insertions(+), 35 deletions(-)
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 3b170845c..114cdde29 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -3651,6 +3651,52 @@ g_dbus_connection_signal_subscribe (GDBusConnection *connection,
/* ---------------------------------------------------------------------------------------------------- */
+/*
+ * Called in any thread.
+ * Must hold the connection lock when calling this, unless
+ * connection->finalizing is TRUE.
+ * May free signal_data, so do not dereference it after this.
+ */
+static void
+remove_signal_data_if_unused (GDBusConnection *connection,
+ SignalData *signal_data)
+{
+ GPtrArray *signal_data_array;
+
+ if (signal_data->subscribers->len != 0)
+ return;
+
+ g_warn_if_fail (g_hash_table_remove (connection->map_rule_to_signal_data, signal_data->rule));
+
+ signal_data_array = g_hash_table_lookup (connection->map_sender_unique_name_to_signal_data_array,
+ signal_data->sender_unique_name);
+ g_warn_if_fail (signal_data_array != NULL);
+ g_warn_if_fail (g_ptr_array_remove (signal_data_array, signal_data));
+
+ if (signal_data_array->len == 0)
+ {
+ g_warn_if_fail (g_hash_table_remove (connection->map_sender_unique_name_to_signal_data_array,
+ signal_data->sender_unique_name));
+ }
+
+ /* remove the match rule from the bus unless NameLost or NameAcquired (see subscribe()) */
+ if ((connection->flags & G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION) &&
+ !is_signal_data_for_name_lost_or_acquired (signal_data) &&
+ !g_dbus_connection_is_closed (connection) &&
+ !connection->finalizing)
+ {
+ /* The check for g_dbus_connection_is_closed() means that
+ * sending the RemoveMatch message can't fail with
+ * G_IO_ERROR_CLOSED, because we're holding the lock,
+ * so on_worker_closed() can't happen between the check we just
+ * did, and releasing the lock later.
+ */
+ remove_match_rule (connection, signal_data->rule);
+ }
+
+ signal_data_free (signal_data);
+}
+
/* called in any thread */
/* must hold lock when calling this (except if connection->finalizing is TRUE)
* returns the number of removed subscribers */
@@ -3659,7 +3705,6 @@ unsubscribe_id_internal (GDBusConnection *connection,
guint subscription_id)
{
SignalData *signal_data;
- GPtrArray *signal_data_array;
guint n;
guint n_removed = 0;
@@ -3686,40 +3731,8 @@ unsubscribe_id_internal (GDBusConnection *connection,
GUINT_TO_POINTER (subscription_id)));
n_removed++;
g_ptr_array_remove_index_fast (signal_data->subscribers, n);
-
- if (signal_data->subscribers->len == 0)
- {
- g_warn_if_fail (g_hash_table_remove (connection->map_rule_to_signal_data, signal_data->rule));
-
- signal_data_array = g_hash_table_lookup (connection->map_sender_unique_name_to_signal_data_array,
- signal_data->sender_unique_name);
- g_warn_if_fail (signal_data_array != NULL);
- g_warn_if_fail (g_ptr_array_remove (signal_data_array, signal_data));
-
- if (signal_data_array->len == 0)
- {
- g_warn_if_fail (g_hash_table_remove (connection->map_sender_unique_name_to_signal_data_array,
- signal_data->sender_unique_name));
- }
-
- /* remove the match rule from the bus unless NameLost or NameAcquired (see subscribe()) */
- if ((connection->flags & G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION) &&
- !is_signal_data_for_name_lost_or_acquired (signal_data) &&
- !g_dbus_connection_is_closed (connection) &&
- !connection->finalizing)
- {
- /* The check for g_dbus_connection_is_closed() means that
- * sending the RemoveMatch message can't fail with
- * G_IO_ERROR_CLOSED, because we're holding the lock,
- * so on_worker_closed() can't happen between the check we just
- * did, and releasing the lock later.
- */
- remove_match_rule (connection, signal_data->rule);
- }
-
- signal_data_free (signal_data);
- }
-
+ /* May free signal_data */
+ remove_signal_data_if_unused (connection, signal_data);
goto out;
}
--
2.30.2

View File

@@ -0,0 +1,173 @@
From 5377b4d9061b73bb47af85cc99253a18dc58e83e Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Tue, 23 Apr 2024 20:39:05 +0100
Subject: [PATCH 12/18] gdbusconnection: Stop storing sender_unique_name in
SignalData
This will become confusing when we start tracking the owner of a
well-known-name sender, and it's redundant anyway. Instead, track the
1 bit of data that we actually need: whether it's a well-known name.
Strictly speaking this too is redundant, because it's syntactically
derivable from the sender, but only via extra string operations.
A subsequent commit will add a data structure to keep track of the
owner of a well-known-name sender, at which point this boolean will
be replaced by the presence or absence of that data structure.
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/5377b4d9061b73bb47af85cc99253a18dc58e83e]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/gdbusconnection.c | 36 ++++++++++++++++++++++++------------
1 file changed, 24 insertions(+), 12 deletions(-)
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 114cdde29..8c1d77b62 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -323,19 +323,19 @@ typedef struct
{
gchar *rule;
gchar *sender;
- gchar *sender_unique_name; /* if sender is unique or org.freedesktop.DBus, then that name... otherwise blank */
gchar *interface_name;
gchar *member;
gchar *object_path;
gchar *arg0;
GDBusSignalFlags flags;
GPtrArray *subscribers; /* (owned) (element-type SignalSubscriber) */
+ gboolean sender_is_its_own_owner;
} SignalData;
static SignalData *
signal_data_new_take (gchar *rule,
gchar *sender,
- gchar *sender_unique_name,
+ gboolean sender_is_its_own_owner,
gchar *interface_name,
gchar *member,
gchar *object_path,
@@ -346,7 +346,7 @@ signal_data_new_take (gchar *rule,
signal_data->rule = rule;
signal_data->sender = sender;
- signal_data->sender_unique_name = sender_unique_name;
+ signal_data->sender_is_its_own_owner = sender_is_its_own_owner;
signal_data->interface_name = interface_name;
signal_data->member = member;
signal_data->object_path = object_path;
@@ -361,7 +361,6 @@ signal_data_free (SignalData *signal_data)
{
g_free (signal_data->rule);
g_free (signal_data->sender);
- g_free (signal_data->sender_unique_name);
g_free (signal_data->interface_name);
g_free (signal_data->member);
g_free (signal_data->object_path);
@@ -3438,7 +3437,7 @@ remove_match_rule (GDBusConnection *connection,
static gboolean
is_signal_data_for_name_lost_or_acquired (SignalData *signal_data)
{
- return g_strcmp0 (signal_data->sender_unique_name, "org.freedesktop.DBus") == 0 &&
+ return g_strcmp0 (signal_data->sender, "org.freedesktop.DBus") == 0 &&
g_strcmp0 (signal_data->interface_name, "org.freedesktop.DBus") == 0 &&
g_strcmp0 (signal_data->object_path, "/org/freedesktop/DBus") == 0 &&
(g_strcmp0 (signal_data->member, "NameLost") == 0 ||
@@ -3450,7 +3449,8 @@ is_signal_data_for_name_lost_or_acquired (SignalData *signal_data)
/* called in any thread, connection lock is held */
static void
add_signal_data (GDBusConnection *connection,
- SignalData *signal_data)
+ SignalData *signal_data,
+ const char *sender_unique_name)
{
GPtrArray *signal_data_array;
@@ -3470,12 +3470,12 @@ add_signal_data (GDBusConnection *connection,
}
signal_data_array = g_hash_table_lookup (connection->map_sender_unique_name_to_signal_data_array,
- signal_data->sender_unique_name);
+ sender_unique_name);
if (signal_data_array == NULL)
{
signal_data_array = g_ptr_array_new ();
g_hash_table_insert (connection->map_sender_unique_name_to_signal_data_array,
- g_strdup (signal_data->sender_unique_name),
+ g_strdup (sender_unique_name),
signal_data_array);
}
g_ptr_array_add (signal_data_array, signal_data);
@@ -3572,6 +3572,7 @@ g_dbus_connection_signal_subscribe (GDBusConnection *connection,
gchar *rule;
SignalData *signal_data;
SignalSubscriber *subscriber;
+ gboolean sender_is_its_own_owner;
const gchar *sender_unique_name;
/* Right now we abort if AddMatch() fails since it can only fail with the bus being in
@@ -3607,6 +3608,11 @@ g_dbus_connection_signal_subscribe (GDBusConnection *connection,
rule = args_to_rule (sender, interface_name, member, object_path, arg0, flags);
if (sender != NULL && (g_dbus_is_unique_name (sender) || g_strcmp0 (sender, "org.freedesktop.DBus") == 0))
+ sender_is_its_own_owner = TRUE;
+ else
+ sender_is_its_own_owner = FALSE;
+
+ if (sender_is_its_own_owner)
sender_unique_name = sender;
else
sender_unique_name = "";
@@ -3630,14 +3636,14 @@ g_dbus_connection_signal_subscribe (GDBusConnection *connection,
signal_data = signal_data_new_take (g_steal_pointer (&rule),
g_strdup (sender),
- g_strdup (sender_unique_name),
+ sender_is_its_own_owner,
g_strdup (interface_name),
g_strdup (member),
g_strdup (object_path),
g_strdup (arg0),
flags);
g_ptr_array_add (signal_data->subscribers, subscriber);
- add_signal_data (connection, signal_data);
+ add_signal_data (connection, signal_data, sender_unique_name);
out:
g_hash_table_insert (connection->map_id_to_signal_data,
@@ -3661,22 +3667,28 @@ static void
remove_signal_data_if_unused (GDBusConnection *connection,
SignalData *signal_data)
{
+ const gchar *sender_unique_name;
GPtrArray *signal_data_array;
if (signal_data->subscribers->len != 0)
return;
+ if (signal_data->sender_is_its_own_owner)
+ sender_unique_name = signal_data->sender;
+ else
+ sender_unique_name = "";
+
g_warn_if_fail (g_hash_table_remove (connection->map_rule_to_signal_data, signal_data->rule));
signal_data_array = g_hash_table_lookup (connection->map_sender_unique_name_to_signal_data_array,
- signal_data->sender_unique_name);
+ sender_unique_name);
g_warn_if_fail (signal_data_array != NULL);
g_warn_if_fail (g_ptr_array_remove (signal_data_array, signal_data));
if (signal_data_array->len == 0)
{
g_warn_if_fail (g_hash_table_remove (connection->map_sender_unique_name_to_signal_data_array,
- signal_data->sender_unique_name));
+ sender_unique_name));
}
/* remove the match rule from the bus unless NameLost or NameAcquired (see subscribe()) */
--
2.30.2

View File

@@ -0,0 +1,513 @@
From 9114439d886137cfb903e109b612869535aa05b6 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Wed, 1 May 2024 15:43:09 +0100
Subject: [PATCH 13/18] gdbus: Track name owners for signal subscriptions
We will use this in a subsequent commit to prevent signals from an
impostor from being delivered to a subscriber.
To avoid message reordering leading to misleading situations, this does
not use the existing mechanism for watching bus name ownership, which
delivers the ownership changes to other main-contexts. Instead, it all
happens on the single thread used by the GDBusWorker, so the order in
which messages are received is the order in which they are processed.
[Backported to glib-2-74, resolving minor conflicts]
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/9114439d886137cfb903e109b612869535aa05b6]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/gdbusconnection.c | 350 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 343 insertions(+), 7 deletions(-)
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 8c1d77b62..1ac120bc5 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -320,6 +320,31 @@ signal_subscriber_unref (SignalSubscriber *subscriber)
}
typedef struct
+{
+ /*
+ * 1 reference while waiting for GetNameOwner() to finish
+ * 1 reference for each SignalData that points to this one as its
+ * shared_name_watcher
+ */
+ grefcount ref_count;
+
+ gchar *owner;
+ guint32 get_name_owner_serial;
+} WatchedName;
+
+static WatchedName *
+watched_name_new (void)
+{
+ WatchedName *watched_name = g_new0 (WatchedName, 1);
+
+ g_ref_count_init (&watched_name->ref_count);
+ watched_name->owner = NULL;
+ return g_steal_pointer (&watched_name);
+}
+
+typedef struct SignalData SignalData;
+
+struct SignalData
{
gchar *rule;
gchar *sender;
@@ -329,13 +354,36 @@ typedef struct
gchar *arg0;
GDBusSignalFlags flags;
GPtrArray *subscribers; /* (owned) (element-type SignalSubscriber) */
- gboolean sender_is_its_own_owner;
-} SignalData;
+
+ /*
+ * If the sender is a well-known name, this is an unowned SignalData
+ * representing the NameOwnerChanged signal that tracks its owner.
+ * NULL if sender is NULL.
+ * NULL if sender is its own owner (a unique name or DBUS_SERVICE_DBUS).
+ *
+ * Invariants: if not NULL, then
+ * shared_name_watcher->sender == DBUS_SERVICE_DBUS
+ * shared_name_watcher->interface_name == DBUS_INTERFACE_DBUS
+ * shared_name_watcher->member == "NameOwnerChanged"
+ * shared_name_watcher->object_path == DBUS_PATH_DBUS
+ * shared_name_watcher->arg0 == sender
+ * shared_name_watcher->flags == NONE
+ * shared_name_watcher->watched_name == NULL
+ */
+ SignalData *shared_name_watcher;
+
+ /*
+ * Non-NULL if this SignalData is another SignalData's shared_name_watcher.
+ * One reference for each SignalData that has this one as its
+ * shared_name_watcher.
+ * Otherwise NULL.
+ */
+ WatchedName *watched_name;
+};
static SignalData *
signal_data_new_take (gchar *rule,
gchar *sender,
- gboolean sender_is_its_own_owner,
gchar *interface_name,
gchar *member,
gchar *object_path,
@@ -346,7 +394,6 @@ signal_data_new_take (gchar *rule,
signal_data->rule = rule;
signal_data->sender = sender;
- signal_data->sender_is_its_own_owner = sender_is_its_own_owner;
signal_data->interface_name = interface_name;
signal_data->member = member;
signal_data->object_path = object_path;
@@ -359,6 +406,17 @@ signal_data_new_take (gchar *rule,
static void
signal_data_free (SignalData *signal_data)
{
+ /* The SignalData should not be freed while it still has subscribers */
+ g_assert (signal_data->subscribers->len == 0);
+
+ /* The SignalData should not be freed while it is watching for
+ * NameOwnerChanged on behalf of another SignalData */
+ g_assert (signal_data->watched_name == NULL);
+
+ /* The SignalData should be detached from its name watcher, if any,
+ * before it is freed */
+ g_assert (signal_data->shared_name_watcher == NULL);
+
g_free (signal_data->rule);
g_free (signal_data->sender);
g_free (signal_data->interface_name);
@@ -366,6 +424,7 @@ signal_data_free (SignalData *signal_data)
g_free (signal_data->object_path);
g_free (signal_data->arg0);
g_ptr_array_unref (signal_data->subscribers);
+
g_free (signal_data);
}
@@ -497,6 +556,7 @@ struct _GDBusConnection
/* Map used for managing method replies, protected by @lock */
GHashTable *map_method_serial_to_task; /* guint32 -> GTask* */
+ GHashTable *map_method_serial_to_name_watcher; /* guint32 -> unowned SignalData* */
/* Maps used for managing signal subscription, protected by @lock */
GHashTable *map_rule_to_signal_data; /* match rule (gchar*) -> SignalData */
@@ -745,6 +805,7 @@ g_dbus_connection_finalize (GObject *object)
g_error_free (connection->initialization_error);
g_hash_table_unref (connection->map_method_serial_to_task);
+ g_hash_table_unref (connection->map_method_serial_to_name_watcher);
g_hash_table_unref (connection->map_rule_to_signal_data);
g_hash_table_unref (connection->map_id_to_signal_data);
@@ -1149,6 +1210,7 @@ g_dbus_connection_init (GDBusConnection *connection)
g_mutex_init (&connection->init_lock);
connection->map_method_serial_to_task = g_hash_table_new (g_direct_hash, g_direct_equal);
+ connection->map_method_serial_to_name_watcher = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL);
connection->map_rule_to_signal_data = g_hash_table_new (g_str_hash,
g_str_equal);
@@ -2266,6 +2328,191 @@ g_dbus_connection_send_message_with_reply_sync (GDBusConnection *connecti
/* ---------------------------------------------------------------------------------------------------- */
+/*
+ * Called in any thread.
+ * Must hold the connection lock when calling this, unless
+ * connection->finalizing is TRUE.
+ */
+static void
+name_watcher_unref_watched_name (GDBusConnection *connection,
+ SignalData *name_watcher)
+{
+ WatchedName *watched_name = name_watcher->watched_name;
+
+ g_assert (watched_name != NULL);
+
+ if (!g_ref_count_dec (&watched_name->ref_count))
+ return;
+
+ /* Removing watched_name from the name_watcher may result in
+ * name_watcher being freed, so we must make sure name_watcher is no
+ * longer in map_method_serial_to_name_watcher.
+ *
+ * If we stop watching the name while our GetNameOwner call was still
+ * in-flight, then when the reply eventually arrives, we will not find
+ * its serial number in the map and harmlessly ignore it as a result. */
+ if (watched_name->get_name_owner_serial != 0)
+ g_hash_table_remove (connection->map_method_serial_to_name_watcher,
+ GUINT_TO_POINTER (watched_name->get_name_owner_serial));
+
+ name_watcher->watched_name = NULL;
+ g_free (watched_name->owner);
+ g_free (watched_name);
+}
+
+/* called in GDBusWorker thread with lock held */
+static void
+name_watcher_set_name_owner_unlocked (SignalData *name_watcher,
+ const char *new_owner)
+{
+ if (new_owner != NULL && new_owner[0] == '\0')
+ new_owner = NULL;
+
+ g_assert (name_watcher->watched_name != NULL);
+ g_set_str (&name_watcher->watched_name->owner, new_owner);
+}
+
+/* called in GDBusWorker thread with lock held */
+static void
+name_watcher_deliver_name_owner_changed_unlocked (SignalData *name_watcher,
+ GDBusMessage *message)
+{
+ GVariant *body;
+
+ body = g_dbus_message_get_body (message);
+
+ if (G_LIKELY (body != NULL && g_variant_is_of_type (body, G_VARIANT_TYPE ("(sss)"))))
+ {
+ const char *name;
+ const char *new_owner;
+
+ g_variant_get (body, "(&s&s&s)", &name, NULL, &new_owner);
+
+ /* Our caller already checked this */
+ g_assert (g_strcmp0 (name_watcher->arg0, name) == 0);
+
+ if (G_LIKELY (new_owner[0] == '\0' || g_dbus_is_unique_name (new_owner)))
+ name_watcher_set_name_owner_unlocked (name_watcher, new_owner);
+ else
+ g_warning ("Received NameOwnerChanged signal with invalid owner \"%s\" for \"%s\"",
+ new_owner, name);
+ }
+ else
+ {
+ g_warning ("Received NameOwnerChanged signal with unexpected "
+ "signature %s",
+ body == NULL ? "()" : g_variant_get_type_string (body));
+
+ }
+}
+
+/* called in GDBusWorker thread with lock held */
+static void
+name_watcher_deliver_get_name_owner_reply_unlocked (SignalData *name_watcher,
+ GDBusConnection *connection,
+ GDBusMessage *message)
+{
+ GDBusMessageType type;
+ GVariant *body;
+ WatchedName *watched_name;
+
+ watched_name = name_watcher->watched_name;
+ g_assert (watched_name != NULL);
+ g_assert (watched_name->get_name_owner_serial != 0);
+
+ type = g_dbus_message_get_message_type (message);
+ body = g_dbus_message_get_body (message);
+
+ if (type == G_DBUS_MESSAGE_TYPE_ERROR)
+ {
+ if (g_strcmp0 (g_dbus_message_get_error_name (message),
+ "org.freedesktop.DBus.Error.NameHasNoOwner"))
+ name_watcher_set_name_owner_unlocked (name_watcher, NULL);
+ /* else it's something like NoReply or AccessDenied, which tells
+ * us nothing - leave the owner set to whatever we most recently
+ * learned from NameOwnerChanged, or NULL */
+ }
+ else if (type != G_DBUS_MESSAGE_TYPE_METHOD_RETURN)
+ {
+ g_warning ("Received GetNameOwner reply with unexpected type %d",
+ type);
+ }
+ else if (G_LIKELY (body != NULL && g_variant_is_of_type (body, G_VARIANT_TYPE ("(s)"))))
+ {
+ const char *new_owner;
+
+ g_variant_get (body, "(&s)", &new_owner);
+
+ if (G_LIKELY (g_dbus_is_unique_name (new_owner)))
+ name_watcher_set_name_owner_unlocked (name_watcher, new_owner);
+ else
+ g_warning ("Received GetNameOwner reply with invalid owner \"%s\" for \"%s\"",
+ new_owner, name_watcher->arg0);
+ }
+ else
+ {
+ g_warning ("Received GetNameOwner reply with unexpected signature %s",
+ body == NULL ? "()" : g_variant_get_type_string (body));
+ }
+
+ g_hash_table_remove (connection->map_method_serial_to_name_watcher,
+ GUINT_TO_POINTER (watched_name->get_name_owner_serial));
+ watched_name->get_name_owner_serial = 0;
+}
+
+/* Called in a user thread, lock is held */
+static void
+name_watcher_call_get_name_owner_unlocked (GDBusConnection *connection,
+ SignalData *name_watcher)
+{
+ GDBusMessage *message;
+ GError *local_error = NULL;
+ WatchedName *watched_name;
+
+ g_assert (g_strcmp0 (name_watcher->sender, DBUS_SERVICE_DBUS) == 0);
+ g_assert (g_strcmp0 (name_watcher->interface_name, DBUS_INTERFACE_DBUS) == 0);
+ g_assert (g_strcmp0 (name_watcher->member, "NameOwnerChanged") == 0);
+ g_assert (g_strcmp0 (name_watcher->object_path, DBUS_PATH_DBUS) == 0);
+ /* arg0 of the NameOwnerChanged message is the well-known name whose owner
+ * we are interested in */
+ g_assert (g_dbus_is_name (name_watcher->arg0));
+ g_assert (name_watcher->flags == G_DBUS_SIGNAL_FLAGS_NONE);
+
+ watched_name = name_watcher->watched_name;
+ g_assert (watched_name != NULL);
+ g_assert (watched_name->owner == NULL);
+ g_assert (watched_name->get_name_owner_serial == 0);
+ g_assert (name_watcher->shared_name_watcher == NULL);
+
+ message = g_dbus_message_new_method_call (DBUS_SERVICE_DBUS,
+ DBUS_PATH_DBUS,
+ DBUS_INTERFACE_DBUS,
+ "GetNameOwner");
+ g_dbus_message_set_body (message, g_variant_new ("(s)", name_watcher->arg0));
+
+ if (g_dbus_connection_send_message_unlocked (connection, message,
+ G_DBUS_SEND_MESSAGE_FLAGS_NONE,
+ &watched_name->get_name_owner_serial,
+ &local_error))
+ {
+ g_assert (watched_name->get_name_owner_serial != 0);
+ g_hash_table_insert (connection->map_method_serial_to_name_watcher,
+ GUINT_TO_POINTER (watched_name->get_name_owner_serial),
+ name_watcher);
+ }
+ else
+ {
+ g_critical ("Error while sending GetNameOwner() message: %s",
+ local_error->message);
+ g_clear_error (&local_error);
+ g_assert (watched_name->get_name_owner_serial == 0);
+ }
+
+ g_object_unref (message);
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
typedef struct
{
guint id;
@@ -2389,6 +2636,7 @@ on_worker_message_received (GDBusWorker *worker,
{
guint32 reply_serial;
GTask *task;
+ SignalData *name_watcher;
reply_serial = g_dbus_message_get_reply_serial (message);
CONNECTION_LOCK (connection);
@@ -2404,6 +2652,19 @@ on_worker_message_received (GDBusWorker *worker,
{
//g_debug ("message reply/error for serial %d but no SendMessageData found for %p", reply_serial, connection);
}
+
+ name_watcher = g_hash_table_lookup (connection->map_method_serial_to_name_watcher,
+ GUINT_TO_POINTER (reply_serial));
+
+ if (name_watcher != NULL)
+ {
+ g_assert (name_watcher->watched_name != NULL);
+ g_assert (name_watcher->watched_name->get_name_owner_serial == reply_serial);
+ name_watcher_deliver_get_name_owner_reply_unlocked (name_watcher,
+ connection,
+ message);
+ }
+
CONNECTION_UNLOCK (connection);
}
else if (message_type == G_DBUS_MESSAGE_TYPE_SIGNAL)
@@ -3571,6 +3832,7 @@ g_dbus_connection_signal_subscribe (GDBusConnection *connection,
{
gchar *rule;
SignalData *signal_data;
+ SignalData *name_watcher = NULL;
SignalSubscriber *subscriber;
gboolean sender_is_its_own_owner;
const gchar *sender_unique_name;
@@ -3636,13 +3898,59 @@ g_dbus_connection_signal_subscribe (GDBusConnection *connection,
signal_data = signal_data_new_take (g_steal_pointer (&rule),
g_strdup (sender),
- sender_is_its_own_owner,
g_strdup (interface_name),
g_strdup (member),
g_strdup (object_path),
g_strdup (arg0),
flags);
g_ptr_array_add (signal_data->subscribers, subscriber);
+
+ /* If subscribing to a signal from a specific sender with a well-known
+ * name, we must first subscribe to NameOwnerChanged signals for that
+ * well-known name, so that we can match the current owner of the name
+ * against the sender of each signal. */
+ if (sender != NULL && !sender_is_its_own_owner)
+ {
+ gchar *name_owner_rule = NULL;
+
+ /* We already checked that sender != NULL implies MESSAGE_BUS_CONNECTION */
+ g_assert (connection->flags & G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION);
+
+ name_owner_rule = args_to_rule (DBUS_SERVICE_DBUS,
+ DBUS_INTERFACE_DBUS,
+ "NameOwnerChanged",
+ DBUS_PATH_DBUS,
+ sender,
+ G_DBUS_SIGNAL_FLAGS_NONE);
+ name_watcher = g_hash_table_lookup (connection->map_rule_to_signal_data, name_owner_rule);
+
+ if (name_watcher == NULL)
+ {
+ name_watcher = signal_data_new_take (g_steal_pointer (&name_owner_rule),
+ g_strdup (DBUS_SERVICE_DBUS),
+ g_strdup (DBUS_INTERFACE_DBUS),
+ g_strdup ("NameOwnerChanged"),
+ g_strdup (DBUS_PATH_DBUS),
+ g_strdup (sender),
+ G_DBUS_SIGNAL_FLAGS_NONE);
+ add_signal_data (connection, name_watcher, DBUS_SERVICE_DBUS);
+ }
+
+ if (name_watcher->watched_name == NULL)
+ {
+ name_watcher->watched_name = watched_name_new ();
+ name_watcher_call_get_name_owner_unlocked (connection, name_watcher);
+ }
+ else
+ {
+ g_ref_count_inc (&name_watcher->watched_name->ref_count);
+ }
+
+ signal_data->shared_name_watcher = name_watcher;
+
+ g_clear_pointer (&name_owner_rule, g_free);
+ }
+
add_signal_data (connection, signal_data, sender_unique_name);
out:
@@ -3670,10 +3978,18 @@ remove_signal_data_if_unused (GDBusConnection *connection,
const gchar *sender_unique_name;
GPtrArray *signal_data_array;
+ /* Cannot remove while there are still subscribers */
if (signal_data->subscribers->len != 0)
return;
- if (signal_data->sender_is_its_own_owner)
+ /* Cannot remove while another SignalData is still using this one
+ * as its shared_name_watcher, which holds watched_name->ref_count > 0 */
+ if (signal_data->watched_name != NULL)
+ return;
+
+ /* Point of no return: we have committed to removing it */
+
+ if (signal_data->sender != NULL && signal_data->shared_name_watcher == NULL)
sender_unique_name = signal_data->sender;
else
sender_unique_name = "";
@@ -3706,6 +4022,15 @@ remove_signal_data_if_unused (GDBusConnection *connection,
remove_match_rule (connection, signal_data->rule);
}
+ if (signal_data->shared_name_watcher != NULL)
+ {
+ SignalData *name_watcher = g_steal_pointer (&signal_data->shared_name_watcher);
+
+ name_watcher_unref_watched_name (connection, name_watcher);
+ /* May free signal_data */
+ remove_signal_data_if_unused (connection, name_watcher);
+ }
+
signal_data_free (signal_data);
}
@@ -3978,6 +4303,17 @@ schedule_callbacks (GDBusConnection *connection,
continue;
}
+ if (signal_data->watched_name != NULL)
+ {
+ /* Invariant: SignalData should only have a watched_name if it
+ * represents the NameOwnerChanged signal */
+ g_assert (g_strcmp0 (sender, DBUS_SERVICE_DBUS) == 0);
+ g_assert (g_strcmp0 (interface, DBUS_INTERFACE_DBUS) == 0);
+ g_assert (g_strcmp0 (path, DBUS_PATH_DBUS) == 0);
+ g_assert (g_strcmp0 (member, "NameOwnerChanged") == 0);
+ name_watcher_deliver_name_owner_changed_unlocked (signal_data, message);
+ }
+
for (m = 0; m < signal_data->subscribers->len; m++)
{
SignalSubscriber *subscriber = signal_data->subscribers->pdata[m];
@@ -4039,7 +4375,7 @@ distribute_signals (GDBusConnection *connection,
schedule_callbacks (connection, signal_data_array, message, sender);
}
- /* collect subscribers not matching on sender */
+ /* collect subscribers not matching on sender, or matching a well-known name */
signal_data_array = g_hash_table_lookup (connection->map_sender_unique_name_to_signal_data_array, "");
if (signal_data_array != NULL)
schedule_callbacks (connection, signal_data_array, message, sender);
--
2.30.2

View File

@@ -0,0 +1,75 @@
From 69799764cb40a2842d4891d4e1d72c3ce73964ed Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Thu, 14 Mar 2024 20:42:41 +0000
Subject: [PATCH 14/18] gdbusconnection: Don't deliver signals if the sender
doesn't match
Otherwise a malicious connection on a shared bus, especially the system
bus, could trick GDBus clients into processing signals sent by the
malicious connection as though they had come from the real owner of a
well-known service name.
Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/3268
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/69799764cb40a2842d4891d4e1d72c3ce73964ed]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/gdbusconnection.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 1ac120bc5..7cde0e3bf 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -4284,6 +4284,46 @@ schedule_callbacks (GDBusConnection *connection,
if (signal_data->object_path != NULL && g_strcmp0 (signal_data->object_path, path) != 0)
continue;
+ if (signal_data->shared_name_watcher != NULL)
+ {
+ /* We want signals from a specified well-known name, which means
+ * the signal's sender needs to be the unique name that currently
+ * owns that well-known name, and we will have found this
+ * SignalData in
+ * connection->map_sender_unique_name_to_signal_data_array[""]. */
+ const WatchedName *watched_name;
+ const char *current_owner;
+
+ g_assert (signal_data->sender != NULL);
+ /* Invariant: We never need to watch for the owner of a unique
+ * name, or for the owner of DBUS_SERVICE_DBUS, either of which
+ * is always its own owner */
+ g_assert (!g_dbus_is_unique_name (signal_data->sender));
+ g_assert (g_strcmp0 (signal_data->sender, DBUS_SERVICE_DBUS) != 0);
+
+ watched_name = signal_data->shared_name_watcher->watched_name;
+ g_assert (watched_name != NULL);
+ current_owner = watched_name->owner;
+
+ /* Skip the signal if the actual sender is not known to own
+ * the required name */
+ if (current_owner == NULL || g_strcmp0 (current_owner, sender) != 0)
+ continue;
+ }
+ else if (signal_data->sender != NULL)
+ {
+ /* We want signals from a unique name or o.fd.DBus... */
+ g_assert (g_dbus_is_unique_name (signal_data->sender)
+ || g_str_equal (signal_data->sender, DBUS_SERVICE_DBUS));
+
+ /* ... which means we must have found this SignalData in
+ * connection->map_sender_unique_name_to_signal_data_array[signal_data->sender],
+ * therefore we would only have found it if the signal's
+ * actual sender matches the required signal_data->sender */
+ g_assert (g_strcmp0 (signal_data->sender, sender) == 0);
+ }
+ /* else the sender is unspecified and we will accept anything */
+
if (signal_data->arg0 != NULL)
{
if (arg0 == NULL)
--
2.30.2

View File

@@ -0,0 +1,47 @@
From 505e2c644d02a5cf581fb85d145e820d51dc3f1b Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Fri, 8 Mar 2024 19:51:50 +0000
Subject: [PATCH 15/18] tests: Add a test for matching by two well-known names
The expected result is that because TEST_CONN_SERVICE owns
ALREADY_OWNED_NAME but not (yet) OWNED_LATER_NAME, the signal will be
delivered to the subscriber for the former but not the latter.
Before #3268 was fixed, it was incorrectly delivered to both.
Reproduces: https://gitlab.gnome.org/GNOME/glib/-/issues/3268 (partially)
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/505e2c644d02a5cf581fb85d145e820d51dc3f1b]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/tests/gdbus-subscribe.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/gio/tests/gdbus-subscribe.c b/gio/tests/gdbus-subscribe.c
index af100de7d..171d6107d 100644
--- a/gio/tests/gdbus-subscribe.c
+++ b/gio/tests/gdbus-subscribe.c
@@ -440,6 +440,19 @@ static const TestPlan plan_limit_by_well_known_name =
.iface = EXAMPLE_INTERFACE,
},
},
+ {
+ /* When the service sends a signal with the name it already owns,
+ * it should get through */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_SERVICE,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 1,
+ .received_by_proxy = 1
+ },
+ },
{
/* Service claims another name */
.action = TEST_ACTION_OWN_NAME,
--
2.30.2

View File

@@ -0,0 +1,62 @@
From 8338f7ac107f642283437d05d7b4d49ca8968cdf Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Fri, 8 Mar 2024 19:53:22 +0000
Subject: [PATCH 16/18] tests: Add a test for signal filtering by well-known
name
The vulnerability reported as GNOME/glib#3268 can be characterized
as: these signals from an attacker should not be delivered to either
the GDBusConnection or the GDBusProxy, but in fact they are (in at
least some scenarios).
Reproduces: https://gitlab.gnome.org/GNOME/glib/-/issues/3268
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/8338f7ac107f642283437d05d7b4d49ca8968cdf]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/tests/gdbus-subscribe.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/gio/tests/gdbus-subscribe.c b/gio/tests/gdbus-subscribe.c
index 171d6107d..5406ba7e2 100644
--- a/gio/tests/gdbus-subscribe.c
+++ b/gio/tests/gdbus-subscribe.c
@@ -440,6 +440,33 @@ static const TestPlan plan_limit_by_well_known_name =
.iface = EXAMPLE_INTERFACE,
},
},
+ {
+ /* Attacker wants to trick subscriber into thinking that service
+ * sent a signal */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_ATTACKER,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 0,
+ .received_by_proxy = 0
+ },
+ },
+ {
+ /* Attacker tries harder, by sending a signal unicast directly to
+ * the subscriber */
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_ATTACKER,
+ .unicast_to = TEST_CONN_SUBSCRIBER,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 0,
+ .received_by_proxy = 0
+ },
+ },
{
/* When the service sends a signal with the name it already owns,
* it should get through */
--
2.30.2

View File

@@ -0,0 +1,121 @@
From ff467241a37a0119d3c6df53548bb61fe4d4fbf9 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Tue, 23 Apr 2024 21:39:43 +0100
Subject: [PATCH 17/18] tests: Ensure that unsubscribing with GetNameOwner
in-flight doesn't crash
This was a bug that existed during development of this branch; make sure
it doesn't come back.
This test fails with a use-after-free and crash if we comment out the
part of name_watcher_unref_watched_name() that removes the name watcher
from `map_method_serial_to_name_watcher`.
It would also fail with an assertion failure if we asserted in
name_watcher_unref_watched_name() that get_name_owner_serial == 0
(i.e. that GetNameOwner is not in-flight at destruction).
Signed-off-by: Simon McVittie <smcv@collabora.com>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/ff467241a37a0119d3c6df53548bb61fe4d4fbf9]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/tests/gdbus-subscribe.c | 52 ++++++++++++++++++++++++++++++++++++-
1 file changed, 51 insertions(+), 1 deletion(-)
diff --git a/gio/tests/gdbus-subscribe.c b/gio/tests/gdbus-subscribe.c
index 5406ba7e2..4cba4f565 100644
--- a/gio/tests/gdbus-subscribe.c
+++ b/gio/tests/gdbus-subscribe.c
@@ -116,6 +116,7 @@ typedef struct
const char *member;
const char *arg0;
GDBusSignalFlags flags;
+ gboolean unsubscribe_immediately;
} TestSubscribe;
typedef struct
@@ -141,6 +142,7 @@ typedef struct
TestEmitSignal signal;
TestSubscribe subscribe;
TestOwnName own_name;
+ guint unsubscribe_undo_step;
} u;
} TestStep;
@@ -505,6 +507,43 @@ static const TestPlan plan_limit_by_well_known_name =
},
};
+static const TestPlan plan_unsubscribe_immediately =
+{
+ .description = "Unsubscribing before GetNameOwner can return doesn't result in a crash",
+ .steps = {
+ {
+ /* Service already owns one name */
+ .action = TEST_ACTION_OWN_NAME,
+ .u.own_name = {
+ .name = ALREADY_OWNED_NAME,
+ .owner = TEST_CONN_SERVICE
+ },
+ },
+ {
+ .action = TEST_ACTION_SUBSCRIBE,
+ .u.subscribe = {
+ .string_sender = ALREADY_OWNED_NAME,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .unsubscribe_immediately = TRUE
+ },
+ },
+ {
+ .action = TEST_ACTION_EMIT_SIGNAL,
+ .u.signal = {
+ .sender = TEST_CONN_SERVICE,
+ .path = EXAMPLE_PATH,
+ .iface = EXAMPLE_INTERFACE,
+ .member = FOO_SIGNAL,
+ .received_by_conn = 0,
+ /* The proxy can't unsubscribe, except by destroying the proxy
+ * completely, which we don't currently implement in this test */
+ .received_by_proxy = 1
+ },
+ },
+ },
+};
+
static const TestPlan plan_limit_to_message_bus =
{
.description = "A subscription to the message bus only accepts messages "
@@ -855,8 +894,18 @@ fixture_subscribe (Fixture *f,
subscribe->flags,
subscribed_signal_cb,
f, NULL);
+
g_assert_cmpuint (id, !=, 0);
- f->subscriptions[step_number] = id;
+
+ if (subscribe->unsubscribe_immediately)
+ {
+ g_test_message ("\tImmediately unsubscribing");
+ g_dbus_connection_signal_unsubscribe (subscriber, id);
+ }
+ else
+ {
+ f->subscriptions[step_number] = id;
+ }
}
if (f->mode != SUBSCRIPTION_MODE_CONN)
@@ -1287,6 +1336,7 @@ main (int argc,
ADD_SUBSCRIBE_TEST (nonexistent_unique_name);
ADD_SUBSCRIBE_TEST (limit_by_well_known_name);
ADD_SUBSCRIBE_TEST (limit_to_message_bus);
+ ADD_SUBSCRIBE_TEST (unsubscribe_immediately);
return g_test_run();
}
--
2.30.2

View File

@@ -0,0 +1,50 @@
From fe11c6a513a1b16462442e361bab753246c8de2e Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@debian.org>
Date: Mon, 6 May 2024 21:24:53 +0100
Subject: [PATCH 18/18] gdbus-proxy test: Wait before asserting name owner has
gone away
GDBusConnection sends each signal to recipients in a separate idle
callback, and there's no particular guarantee about the order in which
they're scheduled or dispatched. For the NameOwnerChanged signal that
reports the name becoming unowned, it's possible that g_bus_watch_name()
gets its idle callback called before the GDBusProxy:g-name-owner
machinery has updated the name owner, in which case the assertion
will fail.
Fixing GNOME/glib#3268 introduced a new subscription to NameOwnerChanged
which can alter the order of delivery, particularly in the case where
G_DBUS_PROXY_FLAGS_NO_MATCH_RULE was used (as tested in
/gdbus/proxy/no-match-rule). The resulting test failure is intermittent,
but reliably appears within 100 repetitions of that test.
Fixes: 511c5f5b "tests: Wait for gdbus-testserver to die when killing it"
Signed-off-by: Simon McVittie <smcv@debian.org>
CVE: CVE-2024-34397
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/fe11c6a513a1b16462442e361bab753246c8de2e]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
gio/tests/gdbus-proxy.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/gio/tests/gdbus-proxy.c b/gio/tests/gdbus-proxy.c
index eed75acf4..9303d0088 100644
--- a/gio/tests/gdbus-proxy.c
+++ b/gio/tests/gdbus-proxy.c
@@ -778,6 +778,12 @@ kill_test_service (GDBusConnection *connection)
while (!name_disappeared)
g_main_context_iteration (NULL, TRUE);
+ /* GDBusConnection doesn't guarantee that different subscriptions to the
+ * same signal will get their callbacks scheduled in any particular order,
+ * so make sure they have all happened */
+ while (g_main_context_iteration (NULL, FALSE))
+ continue;
+
g_bus_unwatch_name (watch_id);
#else
g_warning ("Can't kill com.example.TestService");
--
2.30.2

View File

@@ -31,6 +31,24 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
file://CVE-2023-32611-0002.patch \
file://CVE-2023-32643.patch \
file://CVE-2023-32636.patch \
file://CVE-2024-34397_01.patch \
file://CVE-2024-34397_02.patch \
file://CVE-2024-34397_03.patch \
file://CVE-2024-34397_04.patch \
file://CVE-2024-34397_05.patch \
file://CVE-2024-34397_06.patch \
file://CVE-2024-34397_07.patch \
file://CVE-2024-34397_08.patch \
file://CVE-2024-34397_09.patch \
file://CVE-2024-34397_10.patch \
file://CVE-2024-34397_11.patch \
file://CVE-2024-34397_12.patch \
file://CVE-2024-34397_13.patch \
file://CVE-2024-34397_14.patch \
file://CVE-2024-34397_15.patch \
file://CVE-2024-34397_16.patch \
file://CVE-2024-34397_17.patch \
file://CVE-2024-34397_18.patch \
"
SRC_URI:append:class-native = " file://relocate-modules.patch"

View File

@@ -17,7 +17,6 @@ python __anonymous() {
d.setVar("PACKAGES", "${PN} ${PN}-ptest")
d.setVar("PROVIDES", "${PN} ${PN}-ptest")
d.setVar("RPROVIDES", "${PN} ${PN}-ptest")
bbclassextend = d.getVar("BBCLASSEXTEND").replace("nativesdk", "").strip()
d.setVar("BBCLASSEXTEND", bbclassextend)
@@ -29,7 +28,8 @@ python __anonymous() {
# Remove any leftovers from original glibc recipe
RPROVIDES:${PN} = "${PN}"
RRECOMMENDS:${PN} = ""
RDEPENDS:${PN} = " glibc sed"
RDEPENDS:${PN} = " glibc sed bash"
RDEPENDS:${PN}-ptest = "${PN}"
DEPENDS += "sed"
export oe_srcdir="${exec_prefix}/src/debug/glibc/${PV}/"

View File

@@ -1,6 +1,6 @@
SRCBRANCH ?= "release/2.35/master"
PV = "2.35"
SRCREV_glibc ?= "54a666dc5c94897dab63856ba264ab2c53503303"
SRCREV_glibc ?= "72abffe225485d10ea76adde963c13157bf3b310"
SRCREV_localedef ?= "794da69788cbf9bf57b59a852f9f11307663fa87"
GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# ptest script for glibc - to run time related tests to
# facilitate Y2038 validation
# Run with 'ptest-runner glibc-tests'

View File

@@ -24,7 +24,7 @@ IMAGE_FSTYPES = "wic.vmdk wic.vhd wic.vhdx"
inherit core-image setuptools3
SRCREV ?= "4cf40d460852e5e8b4a48dc044fd1c9e650061b3"
SRCREV ?= "940c885c239be4139908c1c322cd335e02d27a92"
SRC_URI = "git://git.yoctoproject.org/poky;branch=kirkstone \
file://Yocto_Build_Appliance.vmx \
file://Yocto_Build_Appliance.vmxf \

View File

@@ -0,0 +1,30 @@
From 78fce372041d53cfeaaf2c11c71d07eef55ecfd1 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Wed, 8 May 2024 11:49:31 +0200
Subject: [PATCH] Fix buffer overread with `xmllint --htmlout`
Add a missing bounds check.
Upstream-Status: Backport from [https://gitlab.gnome.org/GNOME/libxml2/-/commit/2876ac5392a4e891b81e40e592c3ac6cb46016ce]
CVE: CVE-2024-34459
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
---
xmllint.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xmllint.c b/xmllint.c
index ee6bfdc..2f792f1 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -602,7 +602,7 @@ xmlHTMLPrintFileContext(xmlParserInputPtr input) {
len = strlen(buffer);
snprintf(&buffer[len], sizeof(buffer) - len, "\n");
cur = input->cur;
- while ((*cur == '\n') || (*cur == '\r'))
+ while ((cur > base) && ((*cur == '\n') || (*cur == '\r')))
cur--;
n = 0;
while ((cur != base) && (n++ < 80)) {
--
2.25.1

View File

@@ -32,6 +32,7 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar;subdir=${BP};name=testt
file://CVE-2023-45322-1.patch \
file://CVE-2023-45322-2.patch \
file://CVE-2024-25062.patch \
file://CVE-2024-34459.patch \
"
SRC_URI[archive.sha256sum] = "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee"

View File

@@ -145,7 +145,7 @@ do_install:append:class-target () {
ln -s ../${TARGET_SYS}/ext ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}/ext
fi
if [ "${TARGET_ARCH}" == "x86_64" -a "${MULTILIB_VARIANTS}" != "" ];then
if [ "${TARGET_ARCH}" = "x86_64" -a "${MULTILIB_VARIANTS}" != "" ];then
ln -sf ../${X86ARCH32}${TARGET_VENDOR}-${TARGET_OS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}/32
fi

View File

@@ -56,6 +56,8 @@ SRC_URI += "\
file://CVE-2024-24784.patch \
file://CVE-2024-24785.patch \
file://CVE-2023-45288.patch \
file://CVE-2024-24789.patch \
file://CVE-2024-24791.patch \
"
SRC_URI[main.sha256sum] = "a1a48b23afb206f95e7bbaa9b898d965f90826f6f1d1fc0c1d784ada0cd300fd"

View File

@@ -0,0 +1,78 @@
From c8e40338cf00f3c1d86c8fb23863ad67a4c72bcc Mon Sep 17 00:00:00 2001
From: Damien Neil <dneil@google.com>
Date: Tue, 14 May 2024 14:39:10 -0700
Subject: [PATCH] [release-branch.go1.21] archive/zip: treat truncated EOCDR
comment as an error
When scanning for an end of central directory record,
treat an EOCDR signature with a record containing a truncated
comment as an error. Previously, we would skip over the invalid
record and look for another one. Other implementations do not
do this (they either consider this a hard error, or just ignore
the truncated comment). This parser misalignment allowed
presenting entirely different archive contents to Go programs
and other zip decoders.
For #66869
Fixes #67553
Change-Id: I94e5cb028534bb5704588b8af27f1e22ea49c7c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/585397
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit 33d725e5758bf1fea62e6c77fc70b57a828a49f5)
Reviewed-on: https://go-review.googlesource.com/c/go/+/588795
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
CVE: CVE-2024-24789
Upstream-Status: Backport [https://github.com/golang/go/commit/c8e40338cf00f3c1d86c8fb23863ad67a4c72bcc]
Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com>
---
src/archive/zip/reader.go | 8 ++++++--
src/archive/zip/reader_test.go | 8 ++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/archive/zip/reader.go b/src/archive/zip/reader.go
index e40a2c6..987f543 100644
--- a/src/archive/zip/reader.go
+++ b/src/archive/zip/reader.go
@@ -644,9 +644,13 @@ func findSignatureInBlock(b []byte) int {
if b[i] == 'P' && b[i+1] == 'K' && b[i+2] == 0x05 && b[i+3] == 0x06 {
// n is length of comment
n := int(b[i+directoryEndLen-2]) | int(b[i+directoryEndLen-1])<<8
- if n+directoryEndLen+i <= len(b) {
- return i
+ if n+directoryEndLen+i > len(b) {
+ // Truncated comment.
+ // Some parsers (such as Info-ZIP) ignore the truncated comment
+ // rather than treating it as a hard error.
+ return -1
}
+ return i
}
}
return -1
diff --git a/src/archive/zip/reader_test.go b/src/archive/zip/reader_test.go
index a549153..7ac394d 100644
--- a/src/archive/zip/reader_test.go
+++ b/src/archive/zip/reader_test.go
@@ -487,6 +487,14 @@ var tests = []ZipTest{
},
},
},
+ // Issue 66869: Don't skip over an EOCDR with a truncated comment.
+ // The test file sneakily hides a second EOCDR before the first one;
+ // previously we would extract one file ("file") from this archive,
+ // while most other tools would reject the file or extract a different one ("FILE").
+ {
+ Name: "comment-truncated.zip",
+ Error: ErrFormat,
+ },
}
func TestReader(t *testing.T) {
--
2.40.0

View File

@@ -0,0 +1,359 @@
From c9be6ae748b7679b644a38182d456cb5a6ac06ee Mon Sep 17 00:00:00 2001
From: Damien Neil <dneil@google.com>
Date: Thu, 6 Jun 2024 12:50:46 -0700
Subject: [PATCH] [release-branch.go1.21] net/http: send body or close
connection on expect-100-continue requests
When sending a request with an "Expect: 100-continue" header,
we must send the request body before sending any further requests
on the connection.
When receiving a non-1xx response to an "Expect: 100-continue" request,
send the request body if the connection isn't being closed after
processing the response. In other words, if either the request
or response contains a "Connection: close" header, then skip sending
the request body (because the connection will not be used for
further requests), but otherwise send it.
Correct a comment on the server-side Expect: 100-continue handling
that implied sending the request body is optional. It isn't.
For #67555
Fixes #68199
Change-Id: Ia2f12091bee697771087f32ac347509ec5922d54
Reviewed-on: https://go-review.googlesource.com/c/go/+/591255
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
(cherry picked from commit cf501e05e138e6911f759a5db786e90b295499b9)
Reviewed-on: https://go-review.googlesource.com/c/go/+/595096
Reviewed-by: Joedian Reid <joedian@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
CVE: CVE-2024-24791
Upstream-Status: Backport [https://github.com/golang/go/commit/c9be6ae748b7679b644a38182d456cb5a6ac06ee ]
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
---
src/net/http/server.go | 25 ++--
src/net/http/transport.go | 34 ++++--
src/net/http/transport_test.go | 203 ++++++++++++++++++++-------------
3 files changed, 164 insertions(+), 98 deletions(-)
diff --git a/src/net/http/server.go b/src/net/http/server.go
index 4fc8fed..1648f1c 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -1297,16 +1297,21 @@ func (cw *chunkWriter) writeHeader(p []byte) {
// If the client wanted a 100-continue but we never sent it to
// them (or, more strictly: we never finished reading their
- // request body), don't reuse this connection because it's now
- // in an unknown state: we might be sending this response at
- // the same time the client is now sending its request body
- // after a timeout. (Some HTTP clients send Expect:
- // 100-continue but knowing that some servers don't support
- // it, the clients set a timer and send the body later anyway)
- // If we haven't seen EOF, we can't skip over the unread body
- // because we don't know if the next bytes on the wire will be
- // the body-following-the-timer or the subsequent request.
- // See Issue 11549.
+ // request body), don't reuse this connection.
+ //
+ // This behavior was first added on the theory that we don't know
+ // if the next bytes on the wire are going to be the remainder of
+ // the request body or the subsequent request (see issue 11549),
+ // but that's not correct: If we keep using the connection,
+ // the client is required to send the request body whether we
+ // asked for it or not.
+ //
+ // We probably do want to skip reusing the connection in most cases,
+ // however. If the client is offering a large request body that we
+ // don't intend to use, then it's better to close the connection
+ // than to read the body. For now, assume that if we're sending
+ // headers, the handler is done reading the body and we should
+ // drop the connection if we haven't seen EOF.
if ecr, ok := w.req.Body.(*expectContinueReader); ok && !ecr.sawEOF.isSet() {
w.closeAfterReply = true
}
diff --git a/src/net/http/transport.go b/src/net/http/transport.go
index 309194e..e46ddef 100644
--- a/src/net/http/transport.go
+++ b/src/net/http/transport.go
@@ -2282,17 +2282,12 @@ func (pc *persistConn) readResponse(rc requestAndChan, trace *httptrace.ClientTr
return
}
resCode := resp.StatusCode
- if continueCh != nil {
- if resCode == 100 {
- if trace != nil && trace.Got100Continue != nil {
- trace.Got100Continue()
- }
- continueCh <- struct{}{}
- continueCh = nil
- } else if resCode >= 200 {
- close(continueCh)
- continueCh = nil
+ if continueCh != nil && resCode == StatusContinue {
+ if trace != nil && trace.Got100Continue != nil {
+ trace.Got100Continue()
}
+ continueCh <- struct{}{}
+ continueCh = nil
}
is1xx := 100 <= resCode && resCode <= 199
// treat 101 as a terminal status, see issue 26161
@@ -2315,6 +2310,25 @@ func (pc *persistConn) readResponse(rc requestAndChan, trace *httptrace.ClientTr
if resp.isProtocolSwitch() {
resp.Body = newReadWriteCloserBody(pc.br, pc.conn)
}
+ if continueCh != nil {
+ // We send an "Expect: 100-continue" header, but the server
+ // responded with a terminal status and no 100 Continue.
+ //
+ // If we're going to keep using the connection, we need to send the request body.
+ // Tell writeLoop to skip sending the body if we're going to close the connection,
+ // or to send it otherwise.
+ //
+ // The case where we receive a 101 Switching Protocols response is a bit
+ // ambiguous, since we don't know what protocol we're switching to.
+ // Conceivably, it's one that doesn't need us to send the body.
+ // Given that we'll send the body if ExpectContinueTimeout expires,
+ // be consistent and always send it if we aren't closing the connection.
+ if resp.Close || rc.req.Close {
+ close(continueCh) // don't send the body; the connection will close
+ } else {
+ continueCh <- struct{}{} // send the body
+ }
+ }
resp.TLS = pc.tlsState
return
diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go
index 58f12af..8000ecc 100644
--- a/src/net/http/transport_test.go
+++ b/src/net/http/transport_test.go
@@ -1130,95 +1130,142 @@ func TestTransportGzip(t *testing.T) {
}
}
-// If a request has Expect:100-continue header, the request blocks sending body until the first response.
-// Premature consumption of the request body should not be occurred.
-func TestTransportExpect100Continue(t *testing.T) {
- setParallel(t)
- defer afterTest(t)
+// A transport100Continue test exercises Transport behaviors when sending a
+// request with an Expect: 100-continue header.
+type transport100ContinueTest struct {
+ t *testing.T
- ts := httptest.NewServer(HandlerFunc(func(rw ResponseWriter, req *Request) {
- switch req.URL.Path {
- case "/100":
- // This endpoint implicitly responds 100 Continue and reads body.
- if _, err := io.Copy(io.Discard, req.Body); err != nil {
- t.Error("Failed to read Body", err)
- }
- rw.WriteHeader(StatusOK)
- case "/200":
- // Go 1.5 adds Connection: close header if the client expect
- // continue but not entire request body is consumed.
- rw.WriteHeader(StatusOK)
- case "/500":
- rw.WriteHeader(StatusInternalServerError)
- case "/keepalive":
- // This hijacked endpoint responds error without Connection:close.
- _, bufrw, err := rw.(Hijacker).Hijack()
- if err != nil {
- log.Fatal(err)
- }
- bufrw.WriteString("HTTP/1.1 500 Internal Server Error\r\n")
- bufrw.WriteString("Content-Length: 0\r\n\r\n")
- bufrw.Flush()
- case "/timeout":
- // This endpoint tries to read body without 100 (Continue) response.
- // After ExpectContinueTimeout, the reading will be started.
- conn, bufrw, err := rw.(Hijacker).Hijack()
- if err != nil {
- log.Fatal(err)
- }
- if _, err := io.CopyN(io.Discard, bufrw, req.ContentLength); err != nil {
- t.Error("Failed to read Body", err)
- }
- bufrw.WriteString("HTTP/1.1 200 OK\r\n\r\n")
- bufrw.Flush()
- conn.Close()
- }
+ reqdone chan struct{}
+ resp *Response
+ respErr error
- }))
- defer ts.Close()
+ conn net.Conn
+ reader *bufio.Reader
+}
- tests := []struct {
- path string
- body []byte
- sent int
- status int
- }{
- {path: "/100", body: []byte("hello"), sent: 5, status: 200}, // Got 100 followed by 200, entire body is sent.
- {path: "/200", body: []byte("hello"), sent: 0, status: 200}, // Got 200 without 100. body isn't sent.
- {path: "/500", body: []byte("hello"), sent: 0, status: 500}, // Got 500 without 100. body isn't sent.
- {path: "/keepalive", body: []byte("hello"), sent: 0, status: 500}, // Although without Connection:close, body isn't sent.
- {path: "/timeout", body: []byte("hello"), sent: 5, status: 200}, // Timeout exceeded and entire body is sent.
+const transport100ContinueTestBody = "request body"
+
+// newTransport100ContinueTest creates a Transport and sends an Expect: 100-continue
+// request on it.
+func newTransport100ContinueTest(t *testing.T, timeout time.Duration) *transport100ContinueTest {
+ ln := newLocalListener(t)
+ defer ln.Close()
+
+ test := &transport100ContinueTest{
+ t: t,
+ reqdone: make(chan struct{}),
}
- c := ts.Client()
- for i, v := range tests {
- tr := &Transport{
- ExpectContinueTimeout: 2 * time.Second,
- }
- defer tr.CloseIdleConnections()
- c.Transport = tr
- body := bytes.NewReader(v.body)
- req, err := NewRequest("PUT", ts.URL+v.path, body)
- if err != nil {
- t.Fatal(err)
- }
+ tr := &Transport{
+ ExpectContinueTimeout: timeout,
+ }
+ go func() {
+ defer close(test.reqdone)
+ body := strings.NewReader(transport100ContinueTestBody)
+ req, _ := NewRequest("PUT", "http://"+ln.Addr().String(), body)
req.Header.Set("Expect", "100-continue")
- req.ContentLength = int64(len(v.body))
+ req.ContentLength = int64(len(transport100ContinueTestBody))
+ test.resp, test.respErr = tr.RoundTrip(req)
+ test.resp.Body.Close()
+ }()
- resp, err := c.Do(req)
- if err != nil {
- t.Fatal(err)
+ c, err := ln.Accept()
+ if err != nil {
+ t.Fatalf("Accept: %v", err)
+ }
+ t.Cleanup(func() {
+ c.Close()
+ })
+ br := bufio.NewReader(c)
+ _, err = ReadRequest(br)
+ if err != nil {
+ t.Fatalf("ReadRequest: %v", err)
+ }
+ test.conn = c
+ test.reader = br
+ t.Cleanup(func() {
+ <-test.reqdone
+ tr.CloseIdleConnections()
+ got, _ := io.ReadAll(test.reader)
+ if len(got) > 0 {
+ t.Fatalf("Transport sent unexpected bytes: %q", got)
}
- resp.Body.Close()
+ })
- sent := len(v.body) - body.Len()
- if v.status != resp.StatusCode {
- t.Errorf("test %d: status code should be %d but got %d. (%s)", i, v.status, resp.StatusCode, v.path)
- }
- if v.sent != sent {
- t.Errorf("test %d: sent body should be %d but sent %d. (%s)", i, v.sent, sent, v.path)
+ return test
+}
+
+// respond sends response lines from the server to the transport.
+func (test *transport100ContinueTest) respond(lines ...string) {
+ for _, line := range lines {
+ if _, err := test.conn.Write([]byte(line + "\r\n")); err != nil {
+ test.t.Fatalf("Write: %v", err)
}
}
+ if _, err := test.conn.Write([]byte("\r\n")); err != nil {
+ test.t.Fatalf("Write: %v", err)
+ }
+}
+
+// wantBodySent ensures the transport has sent the request body to the server.
+func (test *transport100ContinueTest) wantBodySent() {
+ got, err := io.ReadAll(io.LimitReader(test.reader, int64(len(transport100ContinueTestBody))))
+ if err != nil {
+ test.t.Fatalf("unexpected error reading body: %v", err)
+ }
+ if got, want := string(got), transport100ContinueTestBody; got != want {
+ test.t.Fatalf("unexpected body: got %q, want %q", got, want)
+ }
+}
+
+// wantRequestDone ensures the Transport.RoundTrip has completed with the expected status.
+func (test *transport100ContinueTest) wantRequestDone(want int) {
+ <-test.reqdone
+ if test.respErr != nil {
+ test.t.Fatalf("unexpected RoundTrip error: %v", test.respErr)
+ }
+ if got := test.resp.StatusCode; got != want {
+ test.t.Fatalf("unexpected response code: got %v, want %v", got, want)
+ }
+}
+
+func TestTransportExpect100ContinueSent(t *testing.T) {
+ test := newTransport100ContinueTest(t, 1*time.Hour)
+ // Server sends a 100 Continue response, and the client sends the request body.
+ test.respond("HTTP/1.1 100 Continue")
+ test.wantBodySent()
+ test.respond("HTTP/1.1 200", "Content-Length: 0")
+ test.wantRequestDone(200)
+}
+
+func TestTransportExpect100Continue200ResponseNoConnClose(t *testing.T) {
+ test := newTransport100ContinueTest(t, 1*time.Hour)
+ // No 100 Continue response, no Connection: close header.
+ test.respond("HTTP/1.1 200", "Content-Length: 0")
+ test.wantBodySent()
+ test.wantRequestDone(200)
+}
+
+func TestTransportExpect100Continue200ResponseWithConnClose(t *testing.T) {
+ test := newTransport100ContinueTest(t, 1*time.Hour)
+ // No 100 Continue response, Connection: close header set.
+ test.respond("HTTP/1.1 200", "Connection: close", "Content-Length: 0")
+ test.wantRequestDone(200)
+}
+
+func TestTransportExpect100Continue500ResponseNoConnClose(t *testing.T) {
+ test := newTransport100ContinueTest(t, 1*time.Hour)
+ // No 100 Continue response, no Connection: close header.
+ test.respond("HTTP/1.1 500", "Content-Length: 0")
+ test.wantBodySent()
+ test.wantRequestDone(500)
+}
+
+func TestTransportExpect100Continue500ResponseTimeout(t *testing.T) {
+ test := newTransport100ContinueTest(t, 5*time.Millisecond) // short timeout
+ test.wantBodySent() // after timeout
+ test.respond("HTTP/1.1 200", "Content-Length: 0")
+ test.wantRequestDone(200)
}
func TestSOCKS5Proxy(t *testing.T) {
--
2.40.0

View File

@@ -0,0 +1,34 @@
commit c2515a8f2be5dd23354c9891f41ad104000f88c4
Author: Nikita Popov <npopov@redhat.com>
Date: Tue Sep 26 16:51:40 2023 +0200
[Bitcode] Add some missing GetTypeByID failure checks
Print an error instead of crashing.
Fixes https://github.com/llvm/llvm-project/issues/67388.
Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/c2515a8f2be5dd23354c9891f41ad104000f88c4]
CVE: CVE-2023-46049
Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp 2022-01-20 13:31:59.000000000 -0800
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp 2024-07-28 21:35:31.062992219 -0700
@@ -1235,7 +1235,7 @@
}
Type *Ty = getTypeByID(Record[0]);
- if (Ty->isMetadataTy() || Ty->isVoidTy()) {
+ if (!Ty || Ty->isMetadataTy() || Ty->isVoidTy()) {
dropRecord();
break;
}
@@ -1277,7 +1277,7 @@
return error("Invalid record");
Type *Ty = getTypeByID(Record[0]);
- if (Ty->isMetadataTy() || Ty->isVoidTy())
+ if (!Ty || Ty->isMetadataTy() || Ty->isVoidTy())
return error("Invalid record");
MetadataList.assignValue(

View File

@@ -0,0 +1,85 @@
commit b1a5ee1febd8a903cec3dfdad61d57900dc3823e
Author: Florian Hahn <flo@fhahn.com>
Date: Wed Dec 20 16:56:15 2023 +0100
[ARM] Check all terms in emitPopInst when clearing Restored for LR. (#75527)
emitPopInst checks a single function exit MBB. If other paths also exit
the function and any of there terminators uses LR implicitly, it is not
save to clear the Restored bit.
Check all terminators for the function before clearing Restored.
This fixes a mis-compile in outlined-fn-may-clobber-lr-in-caller.ll
where the machine-outliner previously introduced BLs that clobbered LR
which in turn is used by the tail call return.
Alternative to #73553
Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/b1a5ee1febd8a903cec3dfdad61d57900dc3823e]
CVE: CVE-2024-31852
Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
---
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
index 025e43444f9c..a9acf338ebf5 100644
--- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
@@ -1236,9 +1236,6 @@ void ARMFrameLowering::emitPopInst(MachineBasicBlock &MBB,
// Fold the return instruction into the LDM.
DeleteRet = true;
LdmOpc = AFI->isThumbFunction() ? ARM::t2LDMIA_RET : ARM::LDMIA_RET;
- // We 'restore' LR into PC so it is not live out of the return block:
- // Clear Restored bit.
- Info.setRestored(false);
}
// If NoGap is true, pop consecutive registers and then leave the rest
@@ -2292,6 +2289,33 @@ void ARMFrameLowering::determineCalleeSaves(MachineFunction &MF,
AFI->setLRIsSpilled(SavedRegs.test(ARM::LR));
}
+void ARMFrameLowering::processFunctionBeforeFrameFinalized(
+ MachineFunction &MF, RegScavenger *RS) const {
+ TargetFrameLowering::processFunctionBeforeFrameFinalized(MF, RS);
+
+ MachineFrameInfo &MFI = MF.getFrameInfo();
+ if (!MFI.isCalleeSavedInfoValid())
+ return;
+
+ // Check if all terminators do not implicitly use LR. Then we can 'restore' LR
+ // into PC so it is not live out of the return block: Clear the Restored bit
+ // in that case.
+ for (CalleeSavedInfo &Info : MFI.getCalleeSavedInfo()) {
+ if (Info.getReg() != ARM::LR)
+ continue;
+ if (all_of(MF, [](const MachineBasicBlock &MBB) {
+ return all_of(MBB.terminators(), [](const MachineInstr &Term) {
+ return !Term.isReturn() || Term.getOpcode() == ARM::LDMIA_RET ||
+ Term.getOpcode() == ARM::t2LDMIA_RET ||
+ Term.getOpcode() == ARM::tPOP_RET;
+ });
+ })) {
+ Info.setRestored(false);
+ break;
+ }
+ }
+}
+
void ARMFrameLowering::getCalleeSaves(const MachineFunction &MF,
BitVector &SavedRegs) const {
TargetFrameLowering::getCalleeSaves(MF, SavedRegs);
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.h b/llvm/lib/Target/ARM/ARMFrameLowering.h
index 9822e2321bb4..266d642bb97b 100644
--- a/llvm/lib/Target/ARM/ARMFrameLowering.h
+++ b/llvm/lib/Target/ARM/ARMFrameLowering.h
@@ -58,6 +58,9 @@ public:
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
RegScavenger *RS) const override;
+ void processFunctionBeforeFrameFinalized(
+ MachineFunction &MF, RegScavenger *RS = nullptr) const override;
+
void adjustForSegmentedStacks(MachineFunction &MF,
MachineBasicBlock &MBB) const override;

View File

@@ -0,0 +1,117 @@
commit 0e16af8e4cf3a66ad5d078d52744ae2776f9c4b2
Author: ostannard <oliver.stannard@arm.com>
Date: Mon Feb 26 12:23:25 2024 +0000
[ARM] Update IsRestored for LR based on all returns (#82745)
PR #75527 fixed ARMFrameLowering to set the IsRestored flag for LR based
on all of the return instructions in the function, not just one.
However, there is also code in ARMLoadStoreOptimizer which changes
return instructions, but it set IsRestored based on the one instruction
it changed, not the whole function.
The fix is to factor out the code added in #75527, and also call it from
ARMLoadStoreOptimizer if it made a change to return instructions.
Fixes #80287.
(cherry picked from commit 749384c08e042739342c88b521c8ba5dac1b9276)
Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/0e16af8e4cf3a66ad5d078d52744ae2776f9c4b2]
CVE: CVE-2024-31852
Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
---
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
index a9acf338ebf5..13d3cbf650ed 100644
--- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
@@ -2289,10 +2289,7 @@ void ARMFrameLowering::determineCalleeSaves(MachineFunction &MF,
AFI->setLRIsSpilled(SavedRegs.test(ARM::LR));
}
-void ARMFrameLowering::processFunctionBeforeFrameFinalized(
- MachineFunction &MF, RegScavenger *RS) const {
- TargetFrameLowering::processFunctionBeforeFrameFinalized(MF, RS);
-
+void ARMFrameLowering::updateLRRestored(MachineFunction &MF) {
MachineFrameInfo &MFI = MF.getFrameInfo();
if (!MFI.isCalleeSavedInfoValid())
return;
@@ -2316,6 +2313,12 @@ void ARMFrameLowering::processFunctionBeforeFrameFinalized(
}
}
+void ARMFrameLowering::processFunctionBeforeFrameFinalized(
+ MachineFunction &MF, RegScavenger *RS) const {
+ TargetFrameLowering::processFunctionBeforeFrameFinalized(MF, RS);
+ updateLRRestored(MF);
+}
+
void ARMFrameLowering::getCalleeSaves(const MachineFunction &MF,
BitVector &SavedRegs) const {
TargetFrameLowering::getCalleeSaves(MF, SavedRegs);
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.h b/llvm/lib/Target/ARM/ARMFrameLowering.h
index 67505b61a5e1..b13b76d7086c 100644
--- a/llvm/lib/Target/ARM/ARMFrameLowering.h
+++ b/llvm/lib/Target/ARM/ARMFrameLowering.h
@@ -58,6 +58,10 @@ public:
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
RegScavenger *RS) const override;
+ /// Update the IsRestored flag on LR if it is spilled, based on the return
+ /// instructions.
+ static void updateLRRestored(MachineFunction &MF);
+
void processFunctionBeforeFrameFinalized(
MachineFunction &MF, RegScavenger *RS = nullptr) const override;
diff --git a/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
index fd06bfdf352c..561c1396190d 100644
--- a/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
+++ b/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
@@ -2060,17 +2060,6 @@ bool ARMLoadStoreOpt::MergeReturnIntoLDM(MachineBasicBlock &MBB) {
MO.setReg(ARM::PC);
PrevMI.copyImplicitOps(*MBB.getParent(), *MBBI);
MBB.erase(MBBI);
- // We now restore LR into PC so it is not live-out of the return block
- // anymore: Clear the CSI Restored bit.
- MachineFrameInfo &MFI = MBB.getParent()->getFrameInfo();
- // CSI should be fixed after PrologEpilog Insertion
- assert(MFI.isCalleeSavedInfoValid() && "CSI should be valid");
- for (CalleeSavedInfo &Info : MFI.getCalleeSavedInfo()) {
- if (Info.getReg() == ARM::LR) {
- Info.setRestored(false);
- break;
- }
- }
return true;
}
}
@@ -2118,16 +2107,24 @@ bool ARMLoadStoreOpt::runOnMachineFunction(MachineFunction &Fn) {
isThumb2 = AFI->isThumb2Function();
isThumb1 = AFI->isThumbFunction() && !isThumb2;
- bool Modified = false;
+ bool Modified = false, ModifiedLDMReturn = false;
for (MachineFunction::iterator MFI = Fn.begin(), E = Fn.end(); MFI != E;
++MFI) {
MachineBasicBlock &MBB = *MFI;
Modified |= LoadStoreMultipleOpti(MBB);
if (STI->hasV5TOps())
- Modified |= MergeReturnIntoLDM(MBB);
+ ModifiedLDMReturn |= MergeReturnIntoLDM(MBB);
if (isThumb1)
Modified |= CombineMovBx(MBB);
}
+ Modified |= ModifiedLDMReturn;
+
+ // If we merged a BX instruction into an LDM, we need to re-calculate whether
+ // LR is restored. This check needs to consider the whole function, not just
+ // the instruction(s) we changed, because there may be other BX returns which
+ // still need LR to be restored.
+ if (ModifiedLDMReturn)
+ ARMFrameLowering::updateLRRestored(Fn);
Allocator.DestroyAll();
return Modified;

View File

@@ -33,6 +33,9 @@ SRC_URI = "git://github.com/llvm/llvm-project.git;branch=${BRANCH};protocol=http
file://0007-llvm-allow-env-override-of-exe-path.patch;striplevel=2 \
file://0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch;striplevel=2 \
file://0001-Support-Add-missing-cstdint-header-to-Signals.h.patch;striplevel=2 \
file://CVE-2023-46049.patch;striplevel=2 \
file://CVE-2024-31852-1.patch;striplevel=2 \
file://CVE-2024-31852-2.patch;striplevel=2 \
"
UPSTREAM_CHECK_GITTAGREGEX = "llvmorg-(?P<pver>\d+(\.\d+)+)"

View File

@@ -5,7 +5,7 @@ LICENSE = "BSD-2-Clause & BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=1400bd9d09e8af56b9ec982b3d85797e"
SRC_URI = "http://gstreamer.freedesktop.org/src/orc/orc-${PV}.tar.xz"
SRC_URI[sha256sum] = "a66e3d8f2b7e65178d786a01ef61f2a0a0b4d0b8370de7ce134ba73da4af18f0"
SRC_URI[sha256sum] = "33ed2387f49b825fa1b9c3b0072e05f259141b895474ad085ae51143d3040cc0"
inherit meson pkgconfig gtk-doc

View File

@@ -0,0 +1,69 @@
From bd8153872e9c6fc98f4023df9c2deaffea2fa463 Mon Sep 17 00:00:00 2001
From: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 3 Jul 2024 21:34:29 -0400
Subject: [PATCH] 2024.07.04 (#295)
Co-authored-by: alex <772+alex@users.noreply.github.com>
CVE: CVE-2024-39689
Upstream-Status: Backport [https://github.com/certifi/python-certifi/commit/bd8153872e9c6fc98f4023df9c2deaffea2fa463]
Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com>
---
certifi/cacert.pem | 40 ----------------------------------------
1 file changed, 40 deletions(-)
diff --git a/certifi/cacert.pem b/certifi/cacert.pem
index 1bec256..6bb8cf8 100644
--- a/certifi/cacert.pem
+++ b/certifi/cacert.pem
@@ -3857,46 +3857,6 @@ DgQWBBQxCpCPtsad0kRLgLWi5h+xEk8blTAKBggqhkjOPQQDAwNoADBlAjEA31SQ
+RHUjE7AwWHCFUyqqx0LMV87HOIAl0Qx5v5zli/altP+CAezNIm8BZ/3Hobui3A=
-----END CERTIFICATE-----
-# Issuer: CN=GLOBALTRUST 2020 O=e-commerce monitoring GmbH
-# Subject: CN=GLOBALTRUST 2020 O=e-commerce monitoring GmbH
-# Label: "GLOBALTRUST 2020"
-# Serial: 109160994242082918454945253
-# MD5 Fingerprint: 8a:c7:6f:cb:6d:e3:cc:a2:f1:7c:83:fa:0e:78:d7:e8
-# SHA1 Fingerprint: d0:67:c1:13:51:01:0c:aa:d0:c7:6a:65:37:31:16:26:4f:53:71:a2
-# SHA256 Fingerprint: 9a:29:6a:51:82:d1:d4:51:a2:e3:7f:43:9b:74:da:af:a2:67:52:33:29:f9:0f:9a:0d:20:07:c3:34:e2:3c:9a
------BEGIN CERTIFICATE-----
-MIIFgjCCA2qgAwIBAgILWku9WvtPilv6ZeUwDQYJKoZIhvcNAQELBQAwTTELMAkG
-A1UEBhMCQVQxIzAhBgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkw
-FwYDVQQDExBHTE9CQUxUUlVTVCAyMDIwMB4XDTIwMDIxMDAwMDAwMFoXDTQwMDYx
-MDAwMDAwMFowTTELMAkGA1UEBhMCQVQxIzAhBgNVBAoTGmUtY29tbWVyY2UgbW9u
-aXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVTVCAyMDIwMIICIjANBgkq
-hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAri5WrRsc7/aVj6B3GyvTY4+ETUWiD59b
-RatZe1E0+eyLinjF3WuvvcTfk0Uev5E4C64OFudBc/jbu9G4UeDLgztzOG53ig9Z
-YybNpyrOVPu44sB8R85gfD+yc/LAGbaKkoc1DZAoouQVBGM+uq/ufF7MpotQsjj3
-QWPKzv9pj2gOlTblzLmMCcpL3TGQlsjMH/1WljTbjhzqLL6FLmPdqqmV0/0plRPw
-yJiT2S0WR5ARg6I6IqIoV6Lr/sCMKKCmfecqQjuCgGOlYx8ZzHyyZqjC0203b+J+
-BlHZRYQfEs4kUmSFC0iAToexIiIwquuuvuAC4EDosEKAA1GqtH6qRNdDYfOiaxaJ
-SaSjpCuKAsR49GiKweR6NrFvG5Ybd0mN1MkGco/PU+PcF4UgStyYJ9ORJitHHmkH
-r96i5OTUawuzXnzUJIBHKWk7buis/UDr2O1xcSvy6Fgd60GXIsUf1DnQJ4+H4xj0
-4KlGDfV0OoIu0G4skaMxXDtG6nsEEFZegB31pWXogvziB4xiRfUg3kZwhqG8k9Me
-dKZssCz3AwyIDMvUclOGvGBG85hqwvG/Q/lwIHfKN0F5VVJjjVsSn8VoxIidrPIw
-q7ejMZdnrY8XD2zHc+0klGvIg5rQmjdJBKuxFshsSUktq6HQjJLyQUp5ISXbY9e2
-nKd+Qmn7OmMCAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
-AQYwHQYDVR0OBBYEFNwuH9FhN3nkq9XVsxJxaD1qaJwiMB8GA1UdIwQYMBaAFNwu
-H9FhN3nkq9XVsxJxaD1qaJwiMA0GCSqGSIb3DQEBCwUAA4ICAQCR8EICaEDuw2jA
-VC/f7GLDw56KoDEoqoOOpFaWEhCGVrqXctJUMHytGdUdaG/7FELYjQ7ztdGl4wJC
-XtzoRlgHNQIw4Lx0SsFDKv/bGtCwr2zD/cuz9X9tAy5ZVp0tLTWMstZDFyySCstd
-6IwPS3BD0IL/qMy/pJTAvoe9iuOTe8aPmxadJ2W8esVCgmxcB9CpwYhgROmYhRZf
-+I/KARDOJcP5YBugxZfD0yyIMaK9MOzQ0MAS8cE54+X1+NZK3TTN+2/BT+MAi1bi
-kvcoskJ3ciNnxz8RFbLEAwW+uxF7Cr+obuf/WEPPm2eggAe2HcqtbepBEX4tdJP7
-wry+UUTF72glJ4DjyKDUEuzZpTcdN3y0kcra1LGWge9oXHYQSa9+pTeAsRxSvTOB
-TI/53WXZFM2KJVj04sWDpQmQ1GwUY7VA3+vA/MRYfg0UFodUJ25W5HCEuGwyEn6C
-MUO+1918oa2u1qsgEu8KwxCMSZY13At1XrFP1U80DhEgB3VDRemjEdqso5nCtnkn
-4rnvyOL2NSl6dPrFf4IFYqYK6miyeUcGbvJXqBUzxvd4Sj1Ce2t+/vdG6tHrju+I
-aFvowdlxfv1k7/9nR4hYJS8+hge9+6jlgqispdNpQ80xiEmEU5LAsTkbOYMBMMTy
-qfrQA71yN2BWHzZ8vTmR9W0Nv3vXkg==
------END CERTIFICATE-----
-
# Issuer: CN=ANF Secure Server Root CA O=ANF Autoridad de Certificacion OU=ANF CA Raiz
# Subject: CN=ANF Secure Server Root CA O=ANF Autoridad de Certificacion OU=ANF CA Raiz
# Label: "ANF Secure Server Root CA"
--
2.40.0

View File

@@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=67da0714c3f9471067b729eca6c9fbe8"
SRC_URI += "file://CVE-2022-23491.patch \
file://CVE-2023-37920.patch \
file://CVE-2024-39689.patch \
"
SRC_URI[sha256sum] = "78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872"

View File

@@ -2,17 +2,17 @@ DESCRIPTION = "Python Jinja2: A small but fast and easy to use stand-alone templ
HOMEPAGE = "https://pypi.org/project/Jinja2/"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=5dc88300786f1c214c1e9827a5229462"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=5dc88300786f1c214c1e9827a5229462"
SRC_URI[sha256sum] = "ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90"
SRC_URI[sha256sum] = "4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369"
PYPI_PACKAGE = "Jinja2"
PYPI_PACKAGE = "jinja2"
CVE_PRODUCT = "jinja2 jinja"
CLEANBROKEN = "1"
inherit pypi setuptools3
inherit pypi python_flit_core
inherit ${@bb.utils.filter('DISTRO_FEATURES', 'ptest', d)}
SRC_URI += " \

View File

@@ -1,5 +1,5 @@
require python-pycryptodome.inc
inherit setuptools3
inherit python_setuptools_build_meta
SRC_URI[sha256sum] = "e04e40a7f8c1669195536a37979dd87da2c32dbdc73d6fe35f0077b0c17c803b"

View File

@@ -1,5 +1,5 @@
require python-pycryptodome.inc
inherit setuptools3
inherit python_setuptools_build_meta
SRC_URI[sha256sum] = "2ce76ed0081fd6ac8c74edc75b9d14eca2064173af79843c24fa62573263c1f2"

View File

@@ -0,0 +1,124 @@
From e0264a61119d551658d9445af38323ba94fc16db Mon Sep 17 00:00:00 2001
From: "Jason R. Coombs" <jaraco@jaraco.com>
Date: Thu, 22 Aug 2024 19:24:33 -0400
Subject: [PATCH] CVE-2024-8088: Sanitize names in zipfile.Path. (GH-122906)
Upstream-Status: Backport from https://github.com/python/cpython/commit/e0264a61119d551658d9445af38323ba94fc16db
CVE: CVE-2024-8088
Signed-off-by: Rohini Sangam <rsangam@mvista.com>
---
Lib/test/test_zipfile.py | 17 ++++++
Lib/zipfile.py | 61 ++++++++++++++++++-
2 files changed, 77 insertions(+), 1 deletion(-)
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 32c0170..a60dc11 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -3280,6 +3280,23 @@ with zipfile.ZipFile(io.BytesIO(), "w") as zf:
zipfile.Path(zf)
zf.extractall(source_path.parent)
+ def test_malformed_paths(self):
+ """
+ Path should handle malformed paths.
+ """
+ data = io.BytesIO()
+ zf = zipfile.ZipFile(data, "w")
+ zf.writestr("/one-slash.txt", b"content")
+ zf.writestr("//two-slash.txt", b"content")
+ zf.writestr("../parent.txt", b"content")
+ zf.filename = ''
+ root = zipfile.Path(zf)
+ assert list(map(str, root.iterdir())) == [
+ 'one-slash.txt',
+ 'two-slash.txt',
+ 'parent.txt',
+ ]
+
class StripExtraTests(unittest.TestCase):
# Note: all of the "z" characters are technically invalid, but up
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index 7d18bc2..cbac8d9 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -9,6 +9,7 @@ import io
import itertools
import os
import posixpath
+import re
import shutil
import stat
import struct
@@ -2182,7 +2183,65 @@ def _difference(minuend, subtrahend):
return itertools.filterfalse(set(subtrahend).__contains__, minuend)
-class CompleteDirs(ZipFile):
+class SanitizedNames:
+ """
+ ZipFile mix-in to ensure names are sanitized.
+ """
+
+ def namelist(self):
+ return list(map(self._sanitize, super().namelist()))
+
+ @staticmethod
+ def _sanitize(name):
+ r"""
+ Ensure a relative path with posix separators and no dot names.
+ Modeled after
+ https://github.com/python/cpython/blob/bcc1be39cb1d04ad9fc0bd1b9193d3972835a57c/Lib/zipfile/__init__.py#L1799-L1813
+ but provides consistent cross-platform behavior.
+ >>> san = SanitizedNames._sanitize
+ >>> san('/foo/bar')
+ 'foo/bar'
+ >>> san('//foo.txt')
+ 'foo.txt'
+ >>> san('foo/.././bar.txt')
+ 'foo/bar.txt'
+ >>> san('foo../.bar.txt')
+ 'foo../.bar.txt'
+ >>> san('\\foo\\bar.txt')
+ 'foo/bar.txt'
+ >>> san('D:\\foo.txt')
+ 'D/foo.txt'
+ >>> san('\\\\server\\share\\file.txt')
+ 'server/share/file.txt'
+ >>> san('\\\\?\\GLOBALROOT\\Volume3')
+ '?/GLOBALROOT/Volume3'
+ >>> san('\\\\.\\PhysicalDrive1\\root')
+ 'PhysicalDrive1/root'
+ Retain any trailing slash.
+ >>> san('abc/')
+ 'abc/'
+ Raises a ValueError if the result is empty.
+ >>> san('../..')
+ Traceback (most recent call last):
+ ...
+ ValueError: Empty filename
+ """
+
+ def allowed(part):
+ return part and part not in {'..', '.'}
+
+ # Remove the drive letter.
+ # Don't use ntpath.splitdrive, because that also strips UNC paths
+ bare = re.sub('^([A-Z]):', r'\1', name, flags=re.IGNORECASE)
+ clean = bare.replace('\\', '/')
+ parts = clean.split('/')
+ joined = '/'.join(filter(allowed, parts))
+ if not joined:
+ raise ValueError("Empty filename")
+ return joined + '/' * name.endswith('/')
+
+
+class CompleteDirs(SanitizedNames, ZipFile):
"""
A ZipFile subclass that ensures that implied directories
are always included in the namelist.
--
2.35.7

View File

@@ -36,6 +36,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
file://deterministic_imports.patch \
file://0001-Avoid-shebang-overflow-on-python-config.py.patch \
file://0001-test_storlines-skip-due-to-load-variability.patch \
file://CVE-2024-8088.patch \
"
SRC_URI:append:class-native = " \
@@ -106,7 +107,8 @@ CACHED_CONFIGUREVARS = " \
PACKAGECONFIG:class-target ??= "readline gdbm ${@bb.utils.filter('DISTRO_FEATURES', 'lto', d)}"
PACKAGECONFIG:class-native ??= "readline gdbm"
PACKAGECONFIG:class-nativesdk ??= "readline gdbm"
PACKAGECONFIG[readline] = ",,readline"
PACKAGECONFIG[readline] = "--with-readline=readline,,readline,,,editline"
PACKAGECONFIG[editline] = "--with-readline=editline,,libedit,,,readline"
# Use profile guided optimisation by running PyBench inside qemu-user
PACKAGECONFIG[pgo] = "--enable-optimizations,,qemu-native"
PACKAGECONFIG[tk] = ",,tk"
@@ -118,7 +120,7 @@ do_configure:prepend () {
cat > ${B}/Modules/Setup.local << EOF
*disabled*
${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '_gdbm _dbm', d)}
${@bb.utils.contains('PACKAGECONFIG', 'readline', '', 'readline', d)}
${@bb.utils.contains_any('PACKAGECONFIG', 'readline editline', '', 'readline', d)}
EOF
}

View File

@@ -109,6 +109,10 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
file://scsi-disk-ensure-block-size-is-non-zero-and-changes-limited-to-bits-8-15.patch \
file://CVE-2023-42467.patch \
file://CVE-2023-6683.patch \
file://CVE-2024-7409-0001.patch \
file://CVE-2024-7409-0002.patch \
file://CVE-2024-7409-0003.patch \
file://CVE-2024-7409-0004.patch \
"
UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"

View File

@@ -0,0 +1,162 @@
From fb1c2aaa981e0a2fa6362c9985f1296b74f055ac Mon Sep 17 00:00:00 2001
From: Eric Blake <eblake@redhat.com>
Date: Wed, 7 Aug 2024 08:50:01 -0500
Subject: [PATCH] nbd/server: Plumb in new args to nbd_client_add()
Upcoming patches to fix a CVE need to track an opaque pointer passed
in by the owner of a client object, as well as request for a time
limit on how fast negotiation must complete. Prepare for that by
changing the signature of nbd_client_new() and adding an accessor to
get at the opaque pointer, although for now the two servers
(qemu-nbd.c and blockdev-nbd.c) do not change behavior even though
they pass in a new default timeout value.
Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20240807174943.771624-11-eblake@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
[eblake: s/LIMIT/MAX_SECS/ as suggested by Dan]
Signed-off-by: Eric Blake <eblake@redhat.com>
CVE: CVE-2024-7409
Upstream-Status: Backport [https://github.com/qemu/qemu/commit/fb1c2aaa981e0a2fa6362c9985f1296b74f055ac]
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
blockdev-nbd.c | 6 ++++--
include/block/nbd.h | 11 ++++++++++-
nbd/server.c | 20 +++++++++++++++++---
qemu-nbd.c | 4 +++-
4 files changed, 34 insertions(+), 7 deletions(-)
diff --git a/blockdev-nbd.c b/blockdev-nbd.c
index bdfa7ed3a..b9e8dc78f 100644
--- a/blockdev-nbd.c
+++ b/blockdev-nbd.c
@@ -59,8 +59,10 @@ static void nbd_accept(QIONetListener *listener, QIOChannelSocket *cioc,
nbd_update_server_watch(nbd_server);
qio_channel_set_name(QIO_CHANNEL(cioc), "nbd-server");
- nbd_client_new(cioc, nbd_server->tlscreds, nbd_server->tlsauthz,
- nbd_blockdev_client_closed);
+ /* TODO - expose handshake timeout as QMP option */
+ nbd_client_new(cioc, NBD_DEFAULT_HANDSHAKE_MAX_SECS,
+ nbd_server->tlscreds, nbd_server->tlsauthz,
+ nbd_blockdev_client_closed, NULL);
}
static void nbd_update_server_watch(NBDServerData *s)
diff --git a/include/block/nbd.h b/include/block/nbd.h
index 78d101b77..b71a29724 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -27,6 +27,12 @@
extern const BlockExportDriver blk_exp_nbd;
+/*
+ * NBD_DEFAULT_HANDSHAKE_MAX_SECS: Number of seconds in which client must
+ * succeed at NBD_OPT_GO before being forcefully dropped as too slow.
+ */
+#define NBD_DEFAULT_HANDSHAKE_MAX_SECS 10
+
/* Handshake phase structs - this struct is passed on the wire */
struct NBDOption {
@@ -338,9 +344,12 @@ AioContext *nbd_export_aio_context(NBDExport *exp);
NBDExport *nbd_export_find(const char *name);
void nbd_client_new(QIOChannelSocket *sioc,
+ uint32_t handshake_max_secs,
QCryptoTLSCreds *tlscreds,
const char *tlsauthz,
- void (*close_fn)(NBDClient *, bool));
+ void (*close_fn)(NBDClient *, bool),
+ void *owner);
+void *nbd_client_owner(NBDClient *client);
void nbd_client_get(NBDClient *client);
void nbd_client_put(NBDClient *client);
diff --git a/nbd/server.c b/nbd/server.c
index 4630dd732..12680c8dc 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -121,9 +121,11 @@ struct NBDClient {
int refcount;
void (*close_fn)(NBDClient *client, bool negotiated);
+ void *owner;
NBDExport *exp;
QCryptoTLSCreds *tlscreds;
char *tlsauthz;
+ uint32_t handshake_max_secs;
QIOChannelSocket *sioc; /* The underlying data channel */
QIOChannel *ioc; /* The current I/O channel which may differ (eg TLS) */
@@ -2703,6 +2705,7 @@ static coroutine_fn void nbd_co_client_start(void *opaque)
qemu_co_mutex_init(&client->send_lock);
+ /* TODO - utilize client->handshake_max_secs */
if (nbd_negotiate(client, &local_err)) {
if (local_err) {
error_report_err(local_err);
@@ -2715,14 +2718,17 @@ static coroutine_fn void nbd_co_client_start(void *opaque)
}
/*
- * Create a new client listener using the given channel @sioc.
+ * Create a new client listener using the given channel @sioc and @owner.
* Begin servicing it in a coroutine. When the connection closes, call
- * @close_fn with an indication of whether the client completed negotiation.
+ * @close_fn with an indication of whether the client completed negotiation
+ * within @handshake_max_secs seconds (0 for unbounded).
*/
void nbd_client_new(QIOChannelSocket *sioc,
+ uint32_t handshake_max_secs,
QCryptoTLSCreds *tlscreds,
const char *tlsauthz,
- void (*close_fn)(NBDClient *, bool))
+ void (*close_fn)(NBDClient *, bool),
+ void *owner)
{
NBDClient *client;
Coroutine *co;
@@ -2734,12 +2740,20 @@ void nbd_client_new(QIOChannelSocket *sioc,
object_ref(OBJECT(client->tlscreds));
}
client->tlsauthz = g_strdup(tlsauthz);
+ client->handshake_max_secs = handshake_max_secs;
client->sioc = sioc;
object_ref(OBJECT(client->sioc));
client->ioc = QIO_CHANNEL(sioc);
object_ref(OBJECT(client->ioc));
client->close_fn = close_fn;
+ client->owner = owner;
co = qemu_coroutine_create(nbd_co_client_start, client);
qemu_coroutine_enter(co);
}
+
+void *
+nbd_client_owner(NBDClient *client)
+{
+ return client->owner;
+}
diff --git a/qemu-nbd.c b/qemu-nbd.c
index c6c20df68..f48abf379 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -363,7 +363,9 @@ static void nbd_accept(QIONetListener *listener, QIOChannelSocket *cioc,
nb_fds++;
nbd_update_server_watch();
- nbd_client_new(cioc, tlscreds, tlsauthz, nbd_client_closed);
+ /* TODO - expose handshake timeout as command line option */
+ nbd_client_new(cioc, NBD_DEFAULT_HANDSHAKE_MAX_SECS,
+ tlscreds, tlsauthz, nbd_client_closed, NULL);
}
static void nbd_update_server_watch(void)
--
2.25.1

View File

@@ -0,0 +1,174 @@
From c8a76dbd90c2f48df89b75bef74917f90a59b623 Mon Sep 17 00:00:00 2001
From: Eric Blake <eblake@redhat.com>
Date: Tue, 6 Aug 2024 13:53:00 -0500
Subject: [PATCH] nbd/server: CVE-2024-7409: Cap default max-connections to 100
Allowing an unlimited number of clients to any web service is a recipe
for a rudimentary denial of service attack: the client merely needs to
open lots of sockets without closing them, until qemu no longer has
any more fds available to allocate.
For qemu-nbd, we default to allowing only 1 connection unless more are
explicitly asked for (-e or --shared); this was historically picked as
a nice default (without an explicit -t, a non-persistent qemu-nbd goes
away after a client disconnects, without needing any additional
follow-up commands), and we are not going to change that interface now
(besides, someday we want to point people towards qemu-storage-daemon
instead of qemu-nbd).
But for qemu proper, and the newer qemu-storage-daemon, the QMP
nbd-server-start command has historically had a default of unlimited
number of connections, in part because unlike qemu-nbd it is
inherently persistent until nbd-server-stop. Allowing multiple client
sockets is particularly useful for clients that can take advantage of
MULTI_CONN (creating parallel sockets to increase throughput),
although known clients that do so (such as libnbd's nbdcopy) typically
use only 8 or 16 connections (the benefits of scaling diminish once
more sockets are competing for kernel attention). Picking a number
large enough for typical use cases, but not unlimited, makes it
slightly harder for a malicious client to perform a denial of service
merely by opening lots of connections withot progressing through the
handshake.
This change does not eliminate CVE-2024-7409 on its own, but reduces
the chance for fd exhaustion or unlimited memory usage as an attack
surface. On the other hand, by itself, it makes it more obvious that
with a finite limit, we have the problem of an unauthenticated client
holding 100 fds opened as a way to block out a legitimate client from
being able to connect; thus, later patches will further add timeouts
to reject clients that are not making progress.
This is an INTENTIONAL change in behavior, and will break any client
of nbd-server-start that was not passing an explicit max-connections
parameter, yet expects more than 100 simultaneous connections. We are
not aware of any such client (as stated above, most clients aware of
MULTI_CONN get by just fine on 8 or 16 connections, and probably cope
with later connections failing by relying on the earlier connections;
libvirt has not yet been passing max-connections, but generally
creates NBD servers with the intent for a single client for the sake
of live storage migration; meanwhile, the KubeSAN project anticipates
a large cluster sharing multiple clients [up to 8 per node, and up to
100 nodes in a cluster], but it currently uses qemu-nbd with an
explicit --shared=0 rather than qemu-storage-daemon with
nbd-server-start).
We considered using a deprecation period (declare that omitting
max-parameters is deprecated, and make it mandatory in 3 releases -
then we don't need to pick an arbitrary default); that has zero risk
of breaking any apps that accidentally depended on more than 100
connections, and where such breakage might not be noticed under unit
testing but only under the larger loads of production usage. But it
does not close the denial-of-service hole until far into the future,
and requires all apps to change to add the parameter even if 100 was
good enough. It also has a drawback that any app (like libvirt) that
is accidentally relying on an unlimited default should seriously
consider their own CVE now, at which point they are going to change to
pass explicit max-connections sooner than waiting for 3 qemu releases.
Finally, if our changed default breaks an app, that app can always
pass in an explicit max-parameters with a larger value.
It is also intentional that the HMP interface to nbd-server-start is
not changed to expose max-connections (any client needing to fine-tune
things should be using QMP).
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20240807174943.771624-12-eblake@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
[ericb: Expand commit message to summarize Dan's argument for why we
break corner-case back-compat behavior without a deprecation period]
Signed-off-by: Eric Blake <eblake@redhat.com>
CVE: CVE-2024-7409
Upstream-Status: Backport [https://github.com/qemu/qemu/commit/c8a76dbd90c2f48df89b75bef74917f90a59b623]
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
block/monitor/block-hmp-cmds.c | 3 ++-
blockdev-nbd.c | 8 ++++++++
include/block/nbd.h | 7 +++++++
qapi/block-export.json | 4 ++--
4 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c
index 2ac4aedff..32a666b5d 100644
--- a/block/monitor/block-hmp-cmds.c
+++ b/block/monitor/block-hmp-cmds.c
@@ -411,7 +411,8 @@ void hmp_nbd_server_start(Monitor *mon, const QDict *qdict)
goto exit;
}
- nbd_server_start(addr, NULL, NULL, 0, &local_err);
+ nbd_server_start(addr, NULL, NULL, NBD_DEFAULT_MAX_CONNECTIONS,
+ &local_err);
qapi_free_SocketAddress(addr);
if (local_err != NULL) {
goto exit;
diff --git a/blockdev-nbd.c b/blockdev-nbd.c
index b9e8dc78f..4bd90bac1 100644
--- a/blockdev-nbd.c
+++ b/blockdev-nbd.c
@@ -171,6 +171,10 @@ void nbd_server_start(SocketAddress *addr, const char *tls_creds,
void nbd_server_start_options(NbdServerOptions *arg, Error **errp)
{
+ if (!arg->has_max_connections) {
+ arg->max_connections = NBD_DEFAULT_MAX_CONNECTIONS;
+ }
+
nbd_server_start(arg->addr, arg->tls_creds, arg->tls_authz,
arg->max_connections, errp);
}
@@ -183,6 +187,10 @@ void qmp_nbd_server_start(SocketAddressLegacy *addr,
{
SocketAddress *addr_flat = socket_address_flatten(addr);
+ if (!has_max_connections) {
+ max_connections = NBD_DEFAULT_MAX_CONNECTIONS;
+ }
+
nbd_server_start(addr_flat, tls_creds, tls_authz, max_connections, errp);
qapi_free_SocketAddress(addr_flat);
}
diff --git a/include/block/nbd.h b/include/block/nbd.h
index b71a29724..a31c34a8a 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -33,6 +33,13 @@ extern const BlockExportDriver blk_exp_nbd;
*/
#define NBD_DEFAULT_HANDSHAKE_MAX_SECS 10
+/*
+ * NBD_DEFAULT_MAX_CONNECTIONS: Number of client sockets to allow at
+ * once; must be large enough to allow a MULTI_CONN-aware client like
+ * nbdcopy to create its typical number of 8-16 sockets.
+ */
+#define NBD_DEFAULT_MAX_CONNECTIONS 100
+
/* Handshake phase structs - this struct is passed on the wire */
struct NBDOption {
diff --git a/qapi/block-export.json b/qapi/block-export.json
index c1b92ce1c..181d7238f 100644
--- a/qapi/block-export.json
+++ b/qapi/block-export.json
@@ -21,7 +21,7 @@
# recreated on the fly while the NBD server is active.
# If missing, it will default to denying access (since 4.0).
# @max-connections: The maximum number of connections to allow at the same
-# time, 0 for unlimited. (since 5.2; default: 0)
+# time, 0 for unlimited. (since 5.2; default: 100)
#
# Since: 4.2
##
@@ -50,7 +50,7 @@
# recreated on the fly while the NBD server is active.
# If missing, it will default to denying access (since 4.0).
# @max-connections: The maximum number of connections to allow at the same
-# time, 0 for unlimited. (since 5.2; default: 0)
+# time, 0 for unlimited. (since 5.2; default: 100)
#
# Returns: error if the server is already running.
#
--
2.25.1

View File

@@ -0,0 +1,122 @@
From b9b72cb3ce15b693148bd09cef7e50110566d8a0 Mon Sep 17 00:00:00 2001
From: Eric Blake <eblake@redhat.com>
Date: Thu, 8 Aug 2024 16:05:08 -0500
Subject: [PATCH] nbd/server: CVE-2024-7409: Drop non-negotiating clients
A client that opens a socket but does not negotiate is merely hogging
qemu's resources (an open fd and a small amount of memory); and a
malicious client that can access the port where NBD is listening can
attempt a denial of service attack by intentionally opening and
abandoning lots of unfinished connections. The previous patch put a
default bound on the number of such ongoing connections, but once that
limit is hit, no more clients can connect (including legitimate ones).
The solution is to insist that clients complete handshake within a
reasonable time limit, defaulting to 10 seconds. A client that has
not successfully completed NBD_OPT_GO by then (including the case of
where the client didn't know TLS credentials to even reach the point
of NBD_OPT_GO) is wasting our time and does not deserve to stay
connected. Later patches will allow fine-tuning the limit away from
the default value (including disabling it for doing integration
testing of the handshake process itself).
Note that this patch in isolation actually makes it more likely to see
qemu SEGV after nbd-server-stop, as any client socket still connected
when the server shuts down will now be closed after 10 seconds rather
than at the client's whims. That will be addressed in the next patch.
For a demo of this patch in action:
$ qemu-nbd -f raw -r -t -e 10 file &
$ nbdsh --opt-mode -c '
H = list()
for i in range(20):
print(i)
H.insert(i, nbd.NBD())
H[i].set_opt_mode(True)
H[i].connect_uri("nbd://localhost")
'
$ kill $!
where later connections get to start progressing once earlier ones are
forcefully dropped for taking too long, rather than hanging.
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20240807174943.771624-13-eblake@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
[eblake: rebase to changes earlier in series, reduce scope of timer]
Signed-off-by: Eric Blake <eblake@redhat.com>
CVE: CVE-2024-7409
Upstream-Status: Backport [https://gitlab.com/qemu-project/qemu/-/commit/b9b72cb3ce15b693148bd09cef7e50110566d8a0]
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
nbd/server.c | 28 +++++++++++++++++++++++++++-
nbd/trace-events | 1 +
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/nbd/server.c b/nbd/server.c
index 12680c8dc..1bb253726 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -2698,22 +2698,48 @@ static void nbd_client_receive_next_request(NBDClient *client)
}
}
+static void nbd_handshake_timer_cb(void *opaque)
+{
+ QIOChannel *ioc = opaque;
+
+ trace_nbd_handshake_timer_cb();
+ qio_channel_shutdown(ioc, QIO_CHANNEL_SHUTDOWN_BOTH, NULL);
+}
+
static coroutine_fn void nbd_co_client_start(void *opaque)
{
NBDClient *client = opaque;
Error *local_err = NULL;
+ QEMUTimer *handshake_timer = NULL;
qemu_co_mutex_init(&client->send_lock);
- /* TODO - utilize client->handshake_max_secs */
+ /*
+ * Create a timer to bound the time spent in negotiation. If the
+ * timer expires, it is likely nbd_negotiate will fail because the
+ * socket was shutdown.
+ */
+ if (client->handshake_max_secs > 0) {
+ handshake_timer = aio_timer_new(qemu_get_aio_context(),
+ QEMU_CLOCK_REALTIME,
+ SCALE_NS,
+ nbd_handshake_timer_cb,
+ client->sioc);
+ timer_mod(handshake_timer,
+ qemu_clock_get_ns(QEMU_CLOCK_REALTIME) +
+ client->handshake_max_secs * NANOSECONDS_PER_SECOND);
+ }
+
if (nbd_negotiate(client, &local_err)) {
if (local_err) {
error_report_err(local_err);
}
+ timer_free(handshake_timer);
client_close(client, false);
return;
}
+ timer_free(handshake_timer);
nbd_client_receive_next_request(client);
}
diff --git a/nbd/trace-events b/nbd/trace-events
index c4919a2dd..553546f1f 100644
--- a/nbd/trace-events
+++ b/nbd/trace-events
@@ -73,3 +73,4 @@ nbd_co_receive_request_decode_type(uint64_t handle, uint16_t type, const char *n
nbd_co_receive_request_payload_received(uint64_t handle, uint32_t len) "Payload received: handle = %" PRIu64 ", len = %" PRIu32
nbd_co_receive_align_compliance(const char *op, uint64_t from, uint32_t len, uint32_t align) "client sent non-compliant unaligned %s request: from=0x%" PRIx64 ", len=0x%" PRIx32 ", align=0x%" PRIx32
nbd_trip(void) "Reading request"
+nbd_handshake_timer_cb(void) "client took too long to negotiate"
--
2.25.1

View File

@@ -0,0 +1,163 @@
From 3e7ef738c8462c45043a1d39f702a0990406a3b3 Mon Sep 17 00:00:00 2001
From: Eric Blake <eblake@redhat.com>
Date: Wed, 7 Aug 2024 12:23:13 -0500
Subject: [PATCH] nbd/server: CVE-2024-7409: Close stray clients at server-stop
A malicious client can attempt to connect to an NBD server, and then
intentionally delay progress in the handshake, including if it does
not know the TLS secrets. Although the previous two patches reduce
this behavior by capping the default max-connections parameter and
killing slow clients, they did not eliminate the possibility of a
client waiting to close the socket until after the QMP nbd-server-stop
command is executed, at which point qemu would SEGV when trying to
dereference the NULL nbd_server global which is no longer present.
This amounts to a denial of service attack. Worse, if another NBD
server is started before the malicious client disconnects, I cannot
rule out additional adverse effects when the old client interferes
with the connection count of the new server (although the most likely
is a crash due to an assertion failure when checking
nbd_server->connections > 0).
For environments without this patch, the CVE can be mitigated by
ensuring (such as via a firewall) that only trusted clients can
connect to an NBD server. Note that using frameworks like libvirt
that ensure that TLS is used and that nbd-server-stop is not executed
while any trusted clients are still connected will only help if there
is also no possibility for an untrusted client to open a connection
but then stall on the NBD handshake.
Given the previous patches, it would be possible to guarantee that no
clients remain connected by having nbd-server-stop sleep for longer
than the default handshake deadline before finally freeing the global
nbd_server object, but that could make QMP non-responsive for a long
time. So intead, this patch fixes the problem by tracking all client
sockets opened while the server is running, and forcefully closing any
such sockets remaining without a completed handshake at the time of
nbd-server-stop, then waiting until the coroutines servicing those
sockets notice the state change. nbd-server-stop now has a second
AIO_WAIT_WHILE_UNLOCKED (the first is indirectly through the
blk_exp_close_all_type() that disconnects all clients that completed
handshakes), but forced socket shutdown is enough to progress the
coroutines and quickly tear down all clients before the server is
freed, thus finally fixing the CVE.
This patch relies heavily on the fact that nbd/server.c guarantees
that it only calls nbd_blockdev_client_closed() from the main loop
(see the assertion in nbd_client_put() and the hoops used in
nbd_client_put_nonzero() to achieve that); if we did not have that
guarantee, we would also need a mutex protecting our accesses of the
list of connections to survive re-entrancy from independent iothreads.
Although I did not actually try to test old builds, it looks like this
problem has existed since at least commit 862172f45c (v2.12.0, 2017) -
even back when that patch started using a QIONetListener to handle
listening on multiple sockets, nbd_server_free() was already unaware
that the nbd_blockdev_client_closed callback can be reached later by a
client thread that has not completed handshakes (and therefore the
client's socket never got added to the list closed in
nbd_export_close_all), despite that patch intentionally tearing down
the QIONetListener to prevent new clients.
Reported-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
Fixes: CVE-2024-7409
CC: qemu-stable@nongnu.org
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20240807174943.771624-14-eblake@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
CVE: CVE-2024-7409
Upstream-Status: Backport [https://gitlab.com/qemu-project/qemu/-/commit/3e7ef738c8462c45043a1d39f702a0990406a3b3]
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
blockdev-nbd.c | 35 ++++++++++++++++++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/blockdev-nbd.c b/blockdev-nbd.c
index 4bd90bac1..c71ca38d2 100644
--- a/blockdev-nbd.c
+++ b/blockdev-nbd.c
@@ -21,12 +21,18 @@
#include "io/channel-socket.h"
#include "io/net-listener.h"
+typedef struct NBDConn {
+ QIOChannelSocket *cioc;
+ QLIST_ENTRY(NBDConn) next;
+} NBDConn;
+
typedef struct NBDServerData {
QIONetListener *listener;
QCryptoTLSCreds *tlscreds;
char *tlsauthz;
uint32_t max_connections;
uint32_t connections;
+ QLIST_HEAD(, NBDConn) conns;
} NBDServerData;
static NBDServerData *nbd_server;
@@ -46,6 +52,14 @@ bool nbd_server_is_running(void)
static void nbd_blockdev_client_closed(NBDClient *client, bool ignored)
{
+ NBDConn *conn = nbd_client_owner(client);
+
+ assert(qemu_mutex_iothread_locked() && nbd_server);
+
+ object_unref(OBJECT(conn->cioc));
+ QLIST_REMOVE(conn, next);
+ g_free(conn);
+
nbd_client_put(client);
assert(nbd_server->connections > 0);
nbd_server->connections--;
@@ -55,14 +69,20 @@ static void nbd_blockdev_client_closed(NBDClient *client, bool ignored)
static void nbd_accept(QIONetListener *listener, QIOChannelSocket *cioc,
gpointer opaque)
{
+ NBDConn *conn = g_new0(NBDConn, 1);
+
+ assert(qemu_mutex_iothread_locked() && nbd_server);
nbd_server->connections++;
+ object_ref(OBJECT(cioc));
+ conn->cioc = cioc;
+ QLIST_INSERT_HEAD(&nbd_server->conns, conn, next);
nbd_update_server_watch(nbd_server);
qio_channel_set_name(QIO_CHANNEL(cioc), "nbd-server");
/* TODO - expose handshake timeout as QMP option */
nbd_client_new(cioc, NBD_DEFAULT_HANDSHAKE_MAX_SECS,
nbd_server->tlscreds, nbd_server->tlsauthz,
- nbd_blockdev_client_closed, NULL);
+ nbd_blockdev_client_closed, conn);
}
static void nbd_update_server_watch(NBDServerData *s)
@@ -76,12 +96,25 @@ static void nbd_update_server_watch(NBDServerData *s)
static void nbd_server_free(NBDServerData *server)
{
+ NBDConn *conn, *tmp;
+
if (!server) {
return;
}
+ /*
+ * Forcefully close the listener socket, and any clients that have
+ * not yet disconnected on their own.
+ */
qio_net_listener_disconnect(server->listener);
object_unref(OBJECT(server->listener));
+ QLIST_FOREACH_SAFE(conn, &server->conns, next, tmp) {
+ qio_channel_shutdown(QIO_CHANNEL(conn->cioc), QIO_CHANNEL_SHUTDOWN_BOTH,
+ NULL);
+ }
+
+ AIO_WAIT_WHILE(NULL, server->connections > 0);
+
if (server->tlscreds) {
object_unref(OBJECT(server->tlscreds));
}
--
2.25.1

View File

@@ -0,0 +1,87 @@
From a35268a3ac1b5f0058e5b7c1a041a7e86d9da067 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@ruby-lang.org>
Date: Mon, 10 Jun 2024 11:46:53 +0000
Subject: [PATCH] Fix expanding size at ungetc/ungetbyte
CVE: CVE-2024-27280
Upstream-Status: Backport [https://github.com/ruby/stringio/commit/a35268a3ac1b5f0058e5b7c1a041a7e86d9da067]
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
---
ext/stringio/stringio.c | 2 +-
test/stringio/test_stringio.rb | 25 +++++++++++++++++++++----
2 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 8df07e8..b2e8632 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -984,7 +984,7 @@ strio_unget_bytes(struct StringIO *ptr, const char *cp, long cl)
len = RSTRING_LEN(str);
rest = pos - len;
if (cl > pos) {
- long ex = (rest < 0 ? cl-pos : cl+rest);
+ long ex = cl - (rest < 0 ? pos : len);
rb_str_modify_expand(str, ex);
rb_str_set_len(str, len + ex);
s = RSTRING_PTR(str);
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index e0b4504..4853513 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -757,6 +757,15 @@ class TestStringIO < Test::Unit::TestCase
assert_equal("b""\0""a", s.string)
end
+ def test_ungetc_fill
+ count = 100
+ s = StringIO.new
+ s.print 'a' * count
+ s.ungetc('b' * (count * 5))
+ assert_equal((count * 5), s.string.size)
+ assert_match(/\Ab+\z/, s.string)
+ end
+
def test_ungetbyte_pos
b = '\\b00010001 \\B00010001 \\b1 \\B1 \\b000100011'
s = StringIO.new( b )
@@ -782,6 +791,15 @@ class TestStringIO < Test::Unit::TestCase
assert_equal("b""\0""a", s.string)
end
+ def test_ungetbyte_fill
+ count = 100
+ s = StringIO.new
+ s.print 'a' * count
+ s.ungetbyte('b' * (count * 5))
+ assert_equal((count * 5), s.string.size)
+ assert_match(/\Ab+\z/, s.string)
+ end
+
def test_frozen
s = StringIO.new
s.freeze
@@ -825,18 +843,17 @@ class TestStringIO < Test::Unit::TestCase
end
def test_overflow
- omit if RbConfig::SIZEOF["void*"] > RbConfig::SIZEOF["long"]
+ return if RbConfig::SIZEOF["void*"] > RbConfig::SIZEOF["long"]
limit = RbConfig::LIMITS["INTPTR_MAX"] - 0x10
assert_separately(%w[-rstringio], "#{<<-"begin;"}\n#{<<-"end;"}")
begin;
limit = #{limit}
ary = []
- while true
+ begin
x = "a"*0x100000
break if [x].pack("p").unpack("i!")[0] < 0
ary << x
- omit if ary.size > 100
- end
+ end while ary.size <= 100
s = StringIO.new(x)
s.gets("xxx", limit)
assert_equal(0x100000, s.pos)
--
2.40.0

View File

@@ -0,0 +1,29 @@
From 989a2355808a63fc45367785c82ffd46d18c900a Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Date: Fri, 12 Apr 2024 15:01:47 +1000
Subject: [PATCH] Fix Use-After-Free issue for Regexp
Co-authored-by: Isaac Peka <7493006+isaac-peka@users.noreply.github.com>
Upstream-Status: Backport [https://github.com/ruby/ruby/commit/989a2355808a63fc45367785c82ffd46d18c900a]
CVE: CVE-2024-27282
Signed-off-by: Ashish Sharma <asharma@mvista.com>
regexec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/regexec.c b/regexec.c
index 73694ab14a0b0a..140691ad42489f 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3449,8 +3449,8 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
CASE(OP_MEMORY_END_PUSH_REC) MOP_IN(OP_MEMORY_END_PUSH_REC);
GET_MEMNUM_INC(mem, p);
STACK_GET_MEM_START(mem, stkp); /* should be before push mem-end. */
- STACK_PUSH_MEM_END(mem, s);
mem_start_stk[mem] = GET_STACK_INDEX(stkp);
+ STACK_PUSH_MEM_END(mem, s);
MOP_OUT;
JUMP;

View File

@@ -34,6 +34,8 @@ SRC_URI = "http://cache.ruby-lang.org/pub/ruby/${SHRT_VER}/ruby-${PV}.tar.gz \
file://CVE-2023-36617_1.patch \
file://CVE-2023-36617_2.patch \
file://CVE-2024-27281.patch \
file://CVE-2024-27280.patch \
file://CVE-2024-27282.patch \
"
UPSTREAM_CHECK_URI = "https://www.ruby-lang.org/en/downloads/"

View File

@@ -0,0 +1,33 @@
From 4d4547cf13cca820ff7e0f859ba83e1a610b9fd0 Mon Sep 17 00:00:00 2001
From: Huai-Yuan Liu <qq810974084@gmail.com>
Date: Tue, 4 Jun 2024 11:52:15 +0000
Subject: [PATCH] check null return of ACPI_ALLOCATE_ZEROED in
AcpiDbConvertToPackage ACPI_ALLOCATE_ZEROED may fails, Elements
might be null and will cause null pointer dereference later.
Signed-off-by: Huai-Yuan Liu <qq810974084@gmail.com>
CVE: CVE-2024-24856
Upstream-Status: Backport [https://github.com/acpica/acpica/commit/4d4547cf13cca820ff7e0f859ba83e1a610b9fd0]
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
---
source/components/debugger/dbconvert.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/source/components/debugger/dbconvert.c b/source/components/debugger/dbconvert.c
index 55307d0..c17a5ab 100644
--- a/source/components/debugger/dbconvert.c
+++ b/source/components/debugger/dbconvert.c
@@ -354,6 +354,8 @@ AcpiDbConvertToPackage (
Elements = ACPI_ALLOCATE_ZEROED (
DB_DEFAULT_PKG_ELEMENTS * sizeof (ACPI_OBJECT));
+ if (!Elements)
+ return (AE_NO_MEMORY);
This = String;
for (i = 0; i < (DB_DEFAULT_PKG_ELEMENTS - 1); i++)
--
2.40.0

View File

@@ -16,7 +16,9 @@ COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
DEPENDS = "m4-native flex-native bison-native"
SRC_URI = "https://acpica.org/sites/acpica/files/acpica-unix-${PV}.tar.gz"
SRC_URI = "https://acpica.org/sites/acpica/files/acpica-unix-${PV}.tar.gz \
file://CVE-2024-24856.patch \
"
SRC_URI[sha256sum] = "2511f85828820d747fa3e2c3433d3a38c22db3d9c2fd900e1a84eb4173cb5992"
UPSTREAM_CHECK_URI = "https://acpica.org/downloads"

View File

@@ -0,0 +1,45 @@
From 77dc7f699beba606937b7ea23b50cf5974fa64b1 Mon Sep 17 00:00:00 2001
From: Ken Sharp <Ken.Sharp@artifex.com>
Date: Thu, 25 Jan 2024 11:55:49 +0000
Subject: [PATCH] Bug 707510 - don't allow PDF files with bad Filters to
overflow the debug buffer
Item #2 of the report.
Allocate a buffer to hold the filter name, instead of assuming it will
fit in a fixed buffer.
Reviewed all the other PDFDEBUG cases, no others use a fixed buffer like
this.
CVE: CVE-2024-29506
Upstream-Status: Backport [https://cgit.ghostscript.com/cgi-bin/cgit.cgi/ghostpdl.git/commit/?id=77dc7f699beba606937b7ea23b50cf5974fa64b1]
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
---
pdf/pdf_file.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/pdf/pdf_file.c b/pdf/pdf_file.c
index 214d448..93c2402 100644
--- a/pdf/pdf_file.c
+++ b/pdf/pdf_file.c
@@ -767,10 +767,14 @@ static int pdfi_apply_filter(pdf_context *ctx, pdf_dict *dict, pdf_name *n, pdf_
if (ctx->args.pdfdebug)
{
- char str[100];
+ char *str;
+ str = gs_alloc_bytes(ctx->memory, n->length + 1, "temp string for debug");
+ if (str == NULL)
+ return_error(gs_error_VMerror);
memcpy(str, (const char *)n->data, n->length);
str[n->length] = '\0';
dmprintf1(ctx->memory, "FILTER NAME:%s\n", str);
+ gs_free_object(ctx->memory, str, "temp string for debug");
}
if (pdfi_name_is(n, "RunLengthDecode")) {
--
2.40.0

View File

@@ -0,0 +1,45 @@
From 917b3a71fb20748965254631199ad98210d6c2fb Mon Sep 17 00:00:00 2001
From: Ken Sharp <Ken.Sharp@artifex.com>
Date: Thu, 25 Jan 2024 11:58:22 +0000
Subject: [PATCH] Bug 707510 - don't use strlen on passwords
Item #1 of the report. This looks like an oversight when first coding
the routine. We should use the PostScript string length, because
PostScript strings may not be NULL terminated (and as here may contain
internal NULL characters).
Fix the R6 handler which has the same problem too.
CVE: CVE-2024-29509
Upstream-Status: Backport [https://cgit.ghostscript.com/cgi-bin/cgit.cgi/ghostpdl.git/commit/?id=917b3a71fb20748965254631199ad98210d6c2fb]
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
---
pdf/pdf_sec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pdf/pdf_sec.c b/pdf/pdf_sec.c
index ff60805..2bb59e1 100644
--- a/pdf/pdf_sec.c
+++ b/pdf/pdf_sec.c
@@ -1250,7 +1250,7 @@ static int check_password_R5(pdf_context *ctx, char *Password, int PasswordLen,
if (code < 0) {
pdf_string *P = NULL, *P_UTF8 = NULL;
- code = pdfi_object_alloc(ctx, PDF_STRING, strlen(ctx->encryption.Password), (pdf_obj **)&P);
+ code = pdfi_object_alloc(ctx, PDF_STRING, PasswordLen, (pdf_obj **)&P);
if (code < 0) {
return code;
}
@@ -1300,7 +1300,7 @@ static int check_password_R6(pdf_context *ctx, char *Password, int PasswordLen,
if (code < 0) {
pdf_string *P = NULL, *P_UTF8 = NULL;
- code = pdfi_object_alloc(ctx, PDF_STRING, strlen(ctx->encryption.Password), (pdf_obj **)&P);
+ code = pdfi_object_alloc(ctx, PDF_STRING, PasswordLen, (pdf_obj **)&P);
if (code < 0)
return code;
memcpy(P->data, Password, PasswordLen);
--
2.40.0

View File

@@ -0,0 +1,100 @@
From 638159c43dbb48425a187d244ec288d252d0ecf4 Mon Sep 17 00:00:00 2001
From: Chris Liddell <chris.liddell@artifex.com>
Date: Wed, 31 Jan 2024 14:08:18 +0000
Subject: [PATCH 1/2] Bug 707510(5): Reject OCRLanguage changes after SAFER
enabled
In the devices that support OCR, OCRLanguage really ought never to be set from
PostScript, so reject attempts to change it if path_control_active is true.
CVE: CVE-2024-29511
Upstream-Status: Backport [https://cgit.ghostscript.com/cgi-bin/cgit.cgi/ghostpdl.git/commit/?id=3d4cfdc1a44b1969a0f14c86673a372654d443c4]
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
---
devices/gdevocr.c | 15 ++++++++++-----
devices/gdevpdfocr.c | 15 ++++++++++-----
devices/vector/gdevpdfp.c | 15 ++++++++++-----
3 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/devices/gdevocr.c b/devices/gdevocr.c
index 88c759c..287b74b 100644
--- a/devices/gdevocr.c
+++ b/devices/gdevocr.c
@@ -187,11 +187,16 @@ ocr_put_params(gx_device *dev, gs_param_list *plist)
switch (code = param_read_string(plist, (param_name = "OCRLanguage"), &langstr)) {
case 0:
- len = langstr.size;
- if (len >= sizeof(pdev->language))
- len = sizeof(pdev->language)-1;
- memcpy(pdev->language, langstr.data, len);
- pdev->language[len] = 0;
+ if (pdev->memory->gs_lib_ctx->core->path_control_active) {
+ return_error(gs_error_invalidaccess);
+ }
+ else {
+ len = langstr.size;
+ if (len >= sizeof(pdev->language))
+ len = sizeof(pdev->language)-1;
+ memcpy(pdev->language, langstr.data, len);
+ pdev->language[len] = 0;
+ }
break;
case 1:
break;
diff --git a/devices/gdevpdfocr.c b/devices/gdevpdfocr.c
index 8dd5a59..4c694e3 100644
--- a/devices/gdevpdfocr.c
+++ b/devices/gdevpdfocr.c
@@ -50,11 +50,16 @@ pdfocr_put_some_params(gx_device * dev, gs_param_list * plist)
switch (code = param_read_string(plist, (param_name = "OCRLanguage"), &langstr)) {
case 0:
- len = langstr.size;
- if (len >= sizeof(pdf_dev->ocr.language))
- len = sizeof(pdf_dev->ocr.language)-1;
- memcpy(pdf_dev->ocr.language, langstr.data, len);
- pdf_dev->ocr.language[len] = 0;
+ if (pdf_dev->memory->gs_lib_ctx->core->path_control_active) {
+ return_error(gs_error_invalidaccess);
+ }
+ else {
+ len = langstr.size;
+ if (len >= sizeof(pdf_dev->ocr.language))
+ len = sizeof(pdf_dev->ocr.language)-1;
+ memcpy(pdf_dev->ocr.language, langstr.data, len);
+ pdf_dev->ocr.language[len] = 0;
+ }
break;
case 1:
break;
diff --git a/devices/vector/gdevpdfp.c b/devices/vector/gdevpdfp.c
index 42fa1c5..23e9bc8 100644
--- a/devices/vector/gdevpdfp.c
+++ b/devices/vector/gdevpdfp.c
@@ -458,11 +458,16 @@ gdev_pdf_put_params_impl(gx_device * dev, const gx_device_pdf * save_dev, gs_par
gs_param_string langstr;
switch (code = param_read_string(plist, (param_name = "OCRLanguage"), &langstr)) {
case 0:
- len = langstr.size;
- if (len >= sizeof(pdev->ocr_language))
- len = sizeof(pdev->ocr_language)-1;
- memcpy(pdev->ocr_language, langstr.data, len);
- pdev->ocr_language[len] = 0;
+ if (pdev->memory->gs_lib_ctx->core->path_control_active) {
+ return_error(gs_error_invalidaccess);
+ }
+ else {
+ len = langstr.size;
+ if (len >= sizeof(pdev->ocr_language))
+ len = sizeof(pdev->ocr_language)-1;
+ memcpy(pdev->ocr_language, langstr.data, len);
+ pdev->ocr_language[len] = 0;
+ }
break;
case 1:
break;
--
2.40.0

View File

@@ -0,0 +1,219 @@
From 360153f3aa63c8fef0d507eccde75f46342c5264 Mon Sep 17 00:00:00 2001
From: Chris Liddell <chris.liddell@artifex.com>
Date: Wed, 31 Jan 2024 14:08:18 +0000
Subject: [PATCH 2/2] Bug 707510(5)2: The original fix was overly aggressive
The way the default OCRLanguage value was set was for the relevant get_params
methods to check if the value had been set, and if not return a default value.
This could result in the first time the put_params seeing that value being after
path control has been enabled, meaning it would throw an invalidaccess error.
This changes how we set the default: they now uses an init_device method, so
the string is populated from the device's creation. This works correctly for
both the default value, and for values set on the command line.
CVE: CVE-2024-29511
Upstream-Status: Backport [https://git.ghostscript.com/?p=ghostpdl.git;a=patch;h=638159c43dbb48425a187d244ec288d252d0ecf4]
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
---
devices/gdevocr.c | 17 ++++++++++++++++-
devices/gdevpdfocr.c | 28 ++++++++++++++++++++++------
devices/vector/gdevpdf.c | 15 +++++++++++++++
devices/vector/gdevpdfp.c | 3 ++-
4 files changed, 55 insertions(+), 8 deletions(-)
diff --git a/devices/gdevocr.c b/devices/gdevocr.c
index 287b74b..a616ef4 100644
--- a/devices/gdevocr.c
+++ b/devices/gdevocr.c
@@ -30,6 +30,7 @@
#define X_DPI 72
#define Y_DPI 72
+static dev_proc_initialize_device(ocr_initialize_device);
static dev_proc_print_page(ocr_print_page);
static dev_proc_print_page(hocr_print_page);
static dev_proc_get_params(ocr_get_params);
@@ -55,6 +56,7 @@ ocr_initialize_device_procs(gx_device *dev)
{
gdev_prn_initialize_device_procs_gray_bg(dev);
+ set_dev_proc(dev, initialize_device, ocr_initialize_device);
set_dev_proc(dev, open_device, ocr_open);
set_dev_proc(dev, close_device, ocr_close);
set_dev_proc(dev, get_params, ocr_get_params);
@@ -79,6 +81,7 @@ hocr_initialize_device_procs(gx_device *dev)
{
gdev_prn_initialize_device_procs_gray_bg(dev);
+ set_dev_proc(dev, initialize_device, ocr_initialize_device);
set_dev_proc(dev, open_device, ocr_open);
set_dev_proc(dev, close_device, hocr_close);
set_dev_proc(dev, get_params, ocr_get_params);
@@ -102,6 +105,17 @@ const gx_device_ocr gs_hocr_device =
#define HOCR_HEADER "<html>\n <body>\n"
#define HOCR_TRAILER " </body>\n</html>\n"
+static int
+ocr_initialize_device(gx_device *dev)
+{
+ gx_device_ocr *odev = (gx_device_ocr *)dev;
+ const char *default_ocr_lang = "eng";
+
+ odev->language[0] = '\0';
+ strcpy(odev->language, default_ocr_lang);
+ return 0;
+}
+
static int
ocr_open(gx_device *pdev)
{
@@ -187,7 +201,8 @@ ocr_put_params(gx_device *dev, gs_param_list *plist)
switch (code = param_read_string(plist, (param_name = "OCRLanguage"), &langstr)) {
case 0:
- if (pdev->memory->gs_lib_ctx->core->path_control_active) {
+ if (pdev->memory->gs_lib_ctx->core->path_control_active
+ && (strlen(pdev->language) != langstr.size || memcmp(pdev->language, langstr.data, langstr.size) != 0)) {
return_error(gs_error_invalidaccess);
}
else {
diff --git a/devices/gdevpdfocr.c b/devices/gdevpdfocr.c
index 4c694e3..e4f9862 100644
--- a/devices/gdevpdfocr.c
+++ b/devices/gdevpdfocr.c
@@ -33,9 +33,9 @@
#include "gdevpdfimg.h"
#include "tessocr.h"
-int pdf_ocr_open(gx_device *pdev);
-int pdf_ocr_close(gx_device *pdev);
-
+static dev_proc_initialize_device(pdf_ocr_initialize_device);
+static dev_proc_open_device(pdf_ocr_open);
+static dev_proc_close_device(pdf_ocr_close);
static int
pdfocr_put_some_params(gx_device * dev, gs_param_list * plist)
@@ -50,7 +50,8 @@ pdfocr_put_some_params(gx_device * dev, gs_param_list * plist)
switch (code = param_read_string(plist, (param_name = "OCRLanguage"), &langstr)) {
case 0:
- if (pdf_dev->memory->gs_lib_ctx->core->path_control_active) {
+ if (pdf_dev->memory->gs_lib_ctx->core->path_control_active
+ && (strlen(pdf_dev->ocr.language) != langstr.size || memcmp(pdf_dev->ocr.language, langstr.data, langstr.size) != 0)) {
return_error(gs_error_invalidaccess);
}
else {
@@ -152,6 +153,8 @@ pdfocr8_initialize_device_procs(gx_device *dev)
{
gdev_prn_initialize_device_procs_gray(dev);
+ set_dev_proc(dev, initialize_device, pdf_ocr_initialize_device);
+ set_dev_proc(dev, initialize_device, pdf_ocr_initialize_device);
set_dev_proc(dev, open_device, pdf_ocr_open);
set_dev_proc(dev, output_page, gdev_prn_output_page_seekable);
set_dev_proc(dev, close_device, pdf_ocr_close);
@@ -185,6 +188,7 @@ pdfocr24_initialize_device_procs(gx_device *dev)
{
gdev_prn_initialize_device_procs_rgb(dev);
+ set_dev_proc(dev, initialize_device, pdf_ocr_initialize_device);
set_dev_proc(dev, open_device, pdf_ocr_open);
set_dev_proc(dev, output_page, gdev_prn_output_page_seekable);
set_dev_proc(dev, close_device, pdf_ocr_close);
@@ -216,6 +220,7 @@ pdfocr32_initialize_device_procs(gx_device *dev)
{
gdev_prn_initialize_device_procs_cmyk8(dev);
+ set_dev_proc(dev, initialize_device, pdf_ocr_initialize_device);
set_dev_proc(dev, open_device, pdf_ocr_open);
set_dev_proc(dev, output_page, gdev_prn_output_page_seekable);
set_dev_proc(dev, close_device, pdf_ocr_close);
@@ -703,7 +708,18 @@ ocr_end_page(gx_device_pdf_image *dev)
return 0;
}
-int
+static int
+pdf_ocr_initialize_device(gx_device *dev)
+{
+ gx_device_pdf_image *ppdev = (gx_device_pdf_image *)dev;
+ const char *default_ocr_lang = "eng";
+
+ ppdev->ocr.language[0] = '\0';
+ strcpy(ppdev->ocr.language, default_ocr_lang);
+ return 0;
+}
+
+static int
pdf_ocr_open(gx_device *pdev)
{
gx_device_pdf_image *ppdev;
@@ -726,7 +742,7 @@ pdf_ocr_open(gx_device *pdev)
return 0;
}
-int
+static int
pdf_ocr_close(gx_device *pdev)
{
gx_device_pdf_image *pdf_dev;
diff --git a/devices/vector/gdevpdf.c b/devices/vector/gdevpdf.c
index 9ab562c..5caabb8 100644
--- a/devices/vector/gdevpdf.c
+++ b/devices/vector/gdevpdf.c
@@ -206,6 +206,7 @@ device_pdfwrite_finalize(const gs_memory_t *cmem, void *vpdev)
}
/* Driver procedures */
+static dev_proc_initialize_device(pdfwrite_initialize_device);
static dev_proc_open_device(pdf_open);
static dev_proc_output_page(pdf_output_page);
static dev_proc_close_device(pdf_close);
@@ -223,6 +224,7 @@ static dev_proc_close_device(pdf_close);
static void
pdfwrite_initialize_device_procs(gx_device *dev)
{
+ set_dev_proc(dev, initialize_device, pdfwrite_initialize_device);
set_dev_proc(dev, open_device, pdf_open);
set_dev_proc(dev, get_initial_matrix, gx_upright_get_initial_matrix);
set_dev_proc(dev, output_page, pdf_output_page);
@@ -766,6 +768,19 @@ pdf_reset_text(gx_device_pdf * pdev)
pdf_reset_text_state(pdev->text);
}
+static int
+pdfwrite_initialize_device(gx_device *dev)
+{
+#if OCR_VERSION > 0
+ gx_device_pdf *pdev = (gx_device_pdf *) dev;
+ const char *default_ocr_lang = "eng";
+ pdev->ocr_language[0] = '\0';
+ strcpy(pdev->ocr_language, default_ocr_lang);
+#endif
+ return 0;
+}
+
+
/* Open the device. */
static int
pdf_open(gx_device * dev)
diff --git a/devices/vector/gdevpdfp.c b/devices/vector/gdevpdfp.c
index 23e9bc8..42a1794 100644
--- a/devices/vector/gdevpdfp.c
+++ b/devices/vector/gdevpdfp.c
@@ -458,7 +458,8 @@ gdev_pdf_put_params_impl(gx_device * dev, const gx_device_pdf * save_dev, gs_par
gs_param_string langstr;
switch (code = param_read_string(plist, (param_name = "OCRLanguage"), &langstr)) {
case 0:
- if (pdev->memory->gs_lib_ctx->core->path_control_active) {
+ if (pdev->memory->gs_lib_ctx->core->path_control_active
+ && (strlen(pdev->ocr_language) != langstr.size || memcmp(pdev->ocr_language, langstr.data, langstr.size) != 0)) {
return_error(gs_error_invalidaccess);
}
else {
--
2.40.0

View File

@@ -50,6 +50,10 @@ SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/d
file://CVE-2024-33871-0002.patch \
file://CVE-2024-29510.patch \
file://CVE-2023-52722.patch \
file://CVE-2024-29511-0001.patch \
file://CVE-2024-29511-0002.patch \
file://CVE-2024-29509.patch \
file://CVE-2024-29506.patch \
"
SRC_URI = "${SRC_URI_BASE} \

View File

@@ -38,6 +38,8 @@ SRC_URI[sha256sum] = "ba6d02f15ba04aba9c23fd5f236bb234eab9d5209e95d1c4df85c44d5f
# upstream-wontfix: upstream has documented that reported function is not thread-safe
CVE_CHECK_IGNORE += "CVE-2023-30571"
# cpe-incorrect: this vulnerability was not in any release; introduced in v3.7.3-14-g91f27004; fixed in b6a97948
CVE_CHECK_IGNORE += "CVE-2024-37407"
inherit autotools update-alternatives pkgconfig

View File

@@ -21,16 +21,12 @@ do_compile[noexec] = "1"
do_install() {
oe_runmake install prefix=${prefix} DESTDIR=${D}
rm -rf ${D}${mandir}/man3/crypt.3
rm -rf ${D}${mandir}/man3/crypt_r.3
rm -rf ${D}${mandir}/man3/getspnam.3
rm -rf ${D}${mandir}/man5/passwd.5
}
# Only deliveres man-pages so FILES:${PN} gets everything
FILES:${PN}-doc = ""
FILES:${PN} = "${mandir}/*"
inherit update-alternatives
ALTERNATIVE_PRIORITY = "100"
ALTERNATIVE:${PN} = "passwd.5 getspnam.3 crypt.3"
ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5"
ALTERNATIVE_LINK_NAME[getspnam.3] = "${mandir}/man3/getspnam.3"
ALTERNATIVE_LINK_NAME[crypt.3] = "${mandir}/man3/crypt.3"

View File

@@ -0,0 +1,79 @@
From ed0c7c7e0e8f7298352646b2fd6e06a11e242ace Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
Date: Sun, 2 Jun 2024 12:40:16 +0200
Subject: Properly re-implement userinfo parsing (rfc2396)
* src/url.c (url_skip_credentials): Properly re-implement userinfo parsing (rfc2396)
The reason why the implementation is based on RFC 2396, an outdated standard,
is that the whole file is based on that RFC, and mixing standard here might be
dangerous.
Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/wget.git/commit/?id=ed0c7c7e0e8f7298352646b2fd6e06a11e242ace]
CVE: CVE-2024-38428
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
---
src/url.c | 40 ++++++++++++++++++++++++++++++++++------
1 file changed, 34 insertions(+), 6 deletions(-)
diff --git a/src/url.c b/src/url.c
index 69e948b..07c3bc8 100644
--- a/src/url.c
+++ b/src/url.c
@@ -41,6 +41,7 @@ as that of the covered work. */
#include "url.h"
#include "host.h" /* for is_valid_ipv6_address */
#include "c-strcase.h"
+#include "c-ctype.h"
#ifdef HAVE_ICONV
# include <iconv.h>
@@ -526,12 +527,39 @@ scheme_leading_string (enum url_scheme scheme)
static const char *
url_skip_credentials (const char *url)
{
- /* Look for '@' that comes before terminators, such as '/', '?',
- '#', or ';'. */
- const char *p = (const char *)strpbrk (url, "@/?#;");
- if (!p || *p != '@')
- return url;
- return p + 1;
+ /*
+ * This whole file implements https://www.rfc-editor.org/rfc/rfc2396 .
+ * RFC 2396 is outdated since 2005 and needs a rewrite or a thorough re-visit.
+ *
+ * The RFC says
+ * server = [ [ userinfo "@" ] hostport ]
+ * userinfo = *( unreserved | escaped | ";" | ":" | "&" | "=" | "+" | "$" | "," )
+ * unreserved = alphanum | mark
+ * mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
+ */
+ static const char *allowed = "-_.!~*'();:&=+$,";
+
+ for (const char *p = url; *p; p++)
+ {
+ if (c_isalnum(*p))
+ continue;
+
+ if (strchr(allowed, *p))
+ continue;
+
+ if (*p == '%' && c_isxdigit(p[1]) && c_isxdigit(p[2]))
+ {
+ p += 2;
+ continue;
+ }
+
+ if (*p == '@')
+ return p + 1;
+
+ break;
+ }
+
+ return url;
}
/* Parse credentials contained in [BEG, END). The region is expected
--
cgit v1.1

View File

@@ -1,5 +1,6 @@
SRC_URI = "${GNU_MIRROR}/wget/wget-${PV}.tar.gz \
file://0002-improve-reproducibility.patch \
file://CVE-2024-38428.patch \
"
SRC_URI[sha256sum] = "81542f5cefb8faacc39bbbc6c82ded80e3e4a88505ae72ea51df27525bcde04c"

Some files were not shown because too many files have changed in this diff Show More