aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-support')
-rw-r--r--meta-oe/recipes-support/ace-cloud-editor/ace-cloud-editor_git.bb2
-rw-r--r--meta-oe/recipes-support/anthy/anthy_9100h.bb4
-rw-r--r--meta-oe/recipes-support/avro/avro-c_1.9.2.bb2
-rw-r--r--meta-oe/recipes-support/bdwgc/bdwgc_8.0.4.bb2
-rw-r--r--meta-oe/recipes-support/c-ares/c-ares/0001-fix-configure-error-mv-libcares.pc.cmakein-to-libcar.patch27
-rw-r--r--meta-oe/recipes-support/c-ares/c-ares/CVE-2022-4904.patch67
-rw-r--r--meta-oe/recipes-support/c-ares/c-ares/CVE-2023-31130.patch329
-rw-r--r--meta-oe/recipes-support/c-ares/c-ares/CVE-2023-31147.patch717
-rw-r--r--meta-oe/recipes-support/c-ares/c-ares/CVE-2023-32067.patch84
-rw-r--r--meta-oe/recipes-support/c-ares/c-ares/cmake-install-libcares.pc.patch84
-rw-r--r--meta-oe/recipes-support/c-ares/c-ares_1.16.1.bb27
-rw-r--r--meta-oe/recipes-support/c-ares/c-ares_1.18.1.bb30
-rw-r--r--meta-oe/recipes-support/ceres-solver/ceres-solver_1.14.0.bb2
-rw-r--r--meta-oe/recipes-support/cli11/cli11_1.8.0.bb2
-rw-r--r--meta-oe/recipes-support/cmark/cmark_git.bb2
-rw-r--r--meta-oe/recipes-support/daemonize/daemonize_git.bb2
-rw-r--r--meta-oe/recipes-support/digitemp/digitemp_3.7.2.bb2
-rw-r--r--meta-oe/recipes-support/dstat/dstat_0.7.4.bb4
-rw-r--r--meta-oe/recipes-support/epeg/epeg_git.bb2
-rw-r--r--meta-oe/recipes-support/fmt/fmt_6.2.0.bb2
-rw-r--r--meta-oe/recipes-support/freerdp/freerdp_git.bb2
-rw-r--r--meta-oe/recipes-support/function2/function2_4.0.0.bb2
-rw-r--r--meta-oe/recipes-support/gd/gd_2.3.0.bb2
-rw-r--r--meta-oe/recipes-support/gflags/gflags_2.2.2.bb2
-rw-r--r--meta-oe/recipes-support/glog/glog_0.3.5.bb2
-rw-r--r--meta-oe/recipes-support/gnulib/gnulib_2018-12-18.bb (renamed from meta-oe/recipes-support/gnulib/gnulib_2018-03-07.03.bb)2
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools_2.7.90.bb2
-rw-r--r--meta-oe/recipes-support/gpm/gpm_git.bb2
-rw-r--r--meta-oe/recipes-support/hidapi/hidapi_git.bb2
-rw-r--r--meta-oe/recipes-support/hunspell/hunspell-dictionaries.bb2
-rw-r--r--meta-oe/recipes-support/hunspell/hunspell_1.7.0.bb2
-rw-r--r--meta-oe/recipes-support/hwdata/hwdata_git.bb2
-rw-r--r--meta-oe/recipes-support/iksemel/iksemel_1.5.bb2
-rw-r--r--meta-oe/recipes-support/imagemagick/imagemagick_7.0.9.bb2
-rw-r--r--meta-oe/recipes-support/inih/libinih_git.bb2
-rw-r--r--meta-oe/recipes-support/iniparser/iniparser_4.1.bb2
-rw-r--r--meta-oe/recipes-support/inotify-tools/inotify-tools_git.bb2
-rwxr-xr-xmeta-oe/recipes-support/lcov/lcov_1.14.bb2
-rw-r--r--meta-oe/recipes-support/libatasmart/libatasmart_0.19.bb2
-rw-r--r--meta-oe/recipes-support/libb64/libb64/0001-example-Do-not-run-the-tests.patch27
-rw-r--r--meta-oe/recipes-support/libb64/libb64/0002-use-BUFSIZ-as-buffer-size.patch57
-rw-r--r--meta-oe/recipes-support/libb64/libb64/0003-fix-integer-overflows.patch77
-rw-r--r--meta-oe/recipes-support/libb64/libb64/0004-Fix-off-by-one-error.patch26
-rw-r--r--meta-oe/recipes-support/libb64/libb64/0005-make-overriding-CFLAGS-possible.patch40
-rw-r--r--meta-oe/recipes-support/libb64/libb64/0006-do-not-export-the-CHARS_PER_LINE-variable.patch27
-rw-r--r--meta-oe/recipes-support/libb64/libb64/0007-initialize-encoder-decoder-state-in-the-constructors.patch44
-rw-r--r--meta-oe/recipes-support/libb64/libb64_1.2.1.bb39
-rw-r--r--meta-oe/recipes-support/libbytesize/libbytesize_2.2.bb2
-rw-r--r--meta-oe/recipes-support/libcereal/libcereal_1.3.0.bb2
-rw-r--r--meta-oe/recipes-support/libcyusbserial/libcyusbserial_git.bb2
-rw-r--r--meta-oe/recipes-support/libfann/libfann_git.bb2
-rw-r--r--meta-oe/recipes-support/libgit2/libgit2_0.28.4.bb2
-rw-r--r--meta-oe/recipes-support/libgusb/libgusb_git.bb2
-rw-r--r--meta-oe/recipes-support/libharu/libharu_2.3.0.bb2
-rw-r--r--meta-oe/recipes-support/libiio/libiio_git.bb2
-rw-r--r--meta-oe/recipes-support/libmicrohttpd/libmicrohttpd/CVE-2021-3466.patch158
-rw-r--r--meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.70.bb3
-rw-r--r--meta-oe/recipes-support/libmimetic/libmimetic_0.9.8.bb2
-rw-r--r--meta-oe/recipes-support/libmxml/libmxml_3.1.bb2
-rw-r--r--meta-oe/recipes-support/libp11/libp11_0.4.10.bb2
-rw-r--r--meta-oe/recipes-support/librsync/librsync_2.3.1.bb2
-rw-r--r--meta-oe/recipes-support/libsoc/libsoc_0.8.2.bb2
-rw-r--r--meta-oe/recipes-support/libssh/files/CVE-2020-16135-1.patch40
-rw-r--r--meta-oe/recipes-support/libssh/files/CVE-2020-16135-2.patch42
-rw-r--r--meta-oe/recipes-support/libssh/files/CVE-2020-16135-3.patch70
-rw-r--r--meta-oe/recipes-support/libssh/files/CVE-2020-16135-4.patch34
-rw-r--r--meta-oe/recipes-support/libssh/libssh_0.8.9.bb8
-rw-r--r--meta-oe/recipes-support/libssh2/files/CVE-2020-22218.patch39
-rw-r--r--meta-oe/recipes-support/libssh2/libssh2_1.9.0.bb1
-rw-r--r--meta-oe/recipes-support/libteam/libteam_1.30.bb2
-rw-r--r--meta-oe/recipes-support/libtinyxml2/libtinyxml2_8.0.0.bb2
-rw-r--r--meta-oe/recipes-support/libusbg/libusbg_git.bb2
-rw-r--r--meta-oe/recipes-support/libusbgx/libusbgx_git.bb2
-rw-r--r--meta-oe/recipes-support/libutempter/libutempter.bb2
-rw-r--r--meta-oe/recipes-support/lio-utils/lio-utils_4.1.bb2
-rw-r--r--meta-oe/recipes-support/lvm2/lvm2.inc2
-rw-r--r--meta-oe/recipes-support/mcelog/mce-inject_git.bb2
-rw-r--r--meta-oe/recipes-support/mcelog/mce-test_git.bb2
-rw-r--r--meta-oe/recipes-support/mcelog/mcelog_168.bb2
-rw-r--r--meta-oe/recipes-support/multipath-tools/files/CVE-2022-41973.patch154
-rw-r--r--meta-oe/recipes-support/multipath-tools/files/CVE-2022-41974.patch162
-rw-r--r--meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb7
-rw-r--r--meta-oe/recipes-support/ne10/ne10_1.2.1.bb2
-rw-r--r--meta-oe/recipes-support/nss/nss/0001-Bug-1812671-build-failure-while-implicitly-casting-S.patch46
-rw-r--r--meta-oe/recipes-support/nss/nss/0001-Bug-1826650-cmd-ecperf-fix-dangling-pointer-warning-.patch75
-rw-r--r--meta-oe/recipes-support/nss/nss/CVE-2020-12403_1.patch65
-rw-r--r--meta-oe/recipes-support/nss/nss/CVE-2020-12403_2.patch80
-rw-r--r--meta-oe/recipes-support/nss/nss/CVE-2020-25648.patch163
-rw-r--r--meta-oe/recipes-support/nss/nss/CVE-2021-43527.patch283
-rw-r--r--meta-oe/recipes-support/nss/nss/CVE-2022-22747.patch63
-rw-r--r--meta-oe/recipes-support/nss/nss/CVE-2023-0767.patch124
-rw-r--r--meta-oe/recipes-support/nss/nss_3.51.1.bb14
-rw-r--r--meta-oe/recipes-support/numactl/numactl_git.bb2
-rw-r--r--meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Allow-only-X509-certs-to-verify-the-SAML-token-signa.patch35
-rw-r--r--meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Properly-check-authorization-on-incoming-guestOps-re.patch39
-rw-r--r--meta-oe/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb4
-rw-r--r--meta-oe/recipes-support/opencl/clinfo_2.2.18.04.06.bb2
-rw-r--r--meta-oe/recipes-support/opencv/ade_0.1.1f.bb2
-rw-r--r--meta-oe/recipes-support/opencv/opencv_4.1.0.bb12
-rw-r--r--meta-oe/recipes-support/openldap/openldap/CVE-2021-27212.patch31
-rw-r--r--meta-oe/recipes-support/openldap/openldap/CVE-2022-29155.patch277
-rw-r--r--meta-oe/recipes-support/openldap/openldap/CVE-2023-2953-1.patch30
-rw-r--r--meta-oe/recipes-support/openldap/openldap/CVE-2023-2953-2.patch76
-rw-r--r--meta-oe/recipes-support/openldap/openldap_2.4.57.bb5
-rw-r--r--meta-oe/recipes-support/opensc/opensc/CVE-2023-40660.patch55
-rw-r--r--meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-1.patch47
-rw-r--r--meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-2.patch32
-rw-r--r--meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-3.patch31
-rw-r--r--meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-4.patch28
-rw-r--r--meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-5.patch30
-rw-r--r--meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-6.patch30
-rw-r--r--meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-7.patch40
-rw-r--r--meta-oe/recipes-support/opensc/opensc_0.20.0.bb10
-rw-r--r--meta-oe/recipes-support/picocom/picocom_git.bb2
-rw-r--r--meta-oe/recipes-support/pidgin/funyahoo-plusplus_git.bb2
-rw-r--r--meta-oe/recipes-support/pidgin/icyque_git.bb2
-rw-r--r--meta-oe/recipes-support/pidgin/purple-skypeweb_git.bb2
-rw-r--r--meta-oe/recipes-support/poco/poco_1.9.4.bb2
-rw-r--r--meta-oe/recipes-support/pps-tools/pps-tools_1.0.2.bb2
-rw-r--r--meta-oe/recipes-support/remmina/remmina_1.3.6.bb2
-rw-r--r--meta-oe/recipes-support/rsnapshot/rsnapshot_git.bb2
-rw-r--r--meta-oe/recipes-support/sass/libsass_3.6.3.bb2
-rw-r--r--meta-oe/recipes-support/sass/sassc_git.bb2
-rw-r--r--meta-oe/recipes-support/satyr/satyr_0.28.bb2
-rw-r--r--meta-oe/recipes-support/serial-utils/pty-forward-native.bb2
-rw-r--r--meta-oe/recipes-support/serial-utils/serial-forward_git.bb2
-rw-r--r--meta-oe/recipes-support/span-lite/span-lite_git.bb2
-rw-r--r--meta-oe/recipes-support/spdlog/spdlog_1.5.0.bb2
-rw-r--r--meta-oe/recipes-support/spitools/spitools_git.bb2
-rw-r--r--meta-oe/recipes-support/syslog-ng/files/CVE-2022-38725.patch629
-rw-r--r--meta-oe/recipes-support/syslog-ng/syslog-ng_3.24.1.bb1
-rw-r--r--meta-oe/recipes-support/thin-provisioning-tools/thin-provisioning-tools_0.8.5.bb2
-rw-r--r--meta-oe/recipes-support/toscoterm/toscoterm_git.bb2
-rw-r--r--meta-oe/recipes-support/udisks/udisks2/CVE-2021-3802.patch63
-rw-r--r--meta-oe/recipes-support/udisks/udisks2_git.bb3
-rw-r--r--meta-oe/recipes-support/uhubctl/uhubctl_2.1.0.bb2
-rw-r--r--meta-oe/recipes-support/uthash/uthash_2.1.0.bb2
-rw-r--r--meta-oe/recipes-support/utouch/utouch-evemu_git.bb2
-rw-r--r--meta-oe/recipes-support/utouch/utouch-frame_git.bb2
-rw-r--r--meta-oe/recipes-support/utouch/utouch-mtview_git.bb2
-rw-r--r--meta-oe/recipes-support/websocketpp/websocketpp_0.8.2.bb2
-rw-r--r--meta-oe/recipes-support/xdelta/xdelta3_3.1.0.bb2
-rw-r--r--meta-oe/recipes-support/xorg-xrdp/xorgxrdp_0.2.5.bb2
-rw-r--r--meta-oe/recipes-support/xrdp/xrdp_0.9.11.bb2
-rw-r--r--meta-oe/recipes-support/xxhash/xxhash_0.7.3.bb2
-rw-r--r--meta-oe/recipes-support/zbar/zbar_git.bb2
-rw-r--r--meta-oe/recipes-support/zchunk/zchunk_1.1.6.bb2
147 files changed, 4780 insertions, 241 deletions
diff --git a/meta-oe/recipes-support/ace-cloud-editor/ace-cloud-editor_git.bb b/meta-oe/recipes-support/ace-cloud-editor/ace-cloud-editor_git.bb
index 4ea6c8a295..8df94d91e2 100644
--- a/meta-oe/recipes-support/ace-cloud-editor/ace-cloud-editor_git.bb
+++ b/meta-oe/recipes-support/ace-cloud-editor/ace-cloud-editor_git.bb
@@ -4,7 +4,7 @@ SUMMARY = "Ace is a code editor written in JavaScript. This repository has only
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=794d11c5219c59c9efa2487c2b4066b2"
-SRC_URI = "git://github.com/ajaxorg/ace-builds.git;protocol=https"
+SRC_URI = "git://github.com/ajaxorg/ace-builds.git;protocol=https;branch=master"
PV = "02.07.17+git${SRCPV}"
SRCREV = "812e2c56aed246931a667f16c28b096e34597016"
diff --git a/meta-oe/recipes-support/anthy/anthy_9100h.bb b/meta-oe/recipes-support/anthy/anthy_9100h.bb
index a65d324eae..b464c00003 100644
--- a/meta-oe/recipes-support/anthy/anthy_9100h.bb
+++ b/meta-oe/recipes-support/anthy/anthy_9100h.bb
@@ -10,8 +10,8 @@ SRC_URI = "http://osdn.dl.sourceforge.jp/anthy/37536/anthy-9100h.tar.gz \
file://2ch_t.patch \
"
-SRC_URI_append_class-target = "file://target-helpers.patch"
-SRC_URI_append_class-native = "file://native-helpers.patch"
+SRC_URI_append_class-target = " file://target-helpers.patch"
+SRC_URI_append_class-native = " file://native-helpers.patch"
SRC_URI[md5sum] = "1f558ff7ed296787b55bb1c6cf131108"
SRC_URI[sha256sum] = "d256f075f018b4a3cb0d165ed6151fda4ba7db1621727e0eb54569b6e2275547"
diff --git a/meta-oe/recipes-support/avro/avro-c_1.9.2.bb b/meta-oe/recipes-support/avro/avro-c_1.9.2.bb
index 0642179fb3..e85f341f1f 100644
--- a/meta-oe/recipes-support/avro/avro-c_1.9.2.bb
+++ b/meta-oe/recipes-support/avro/avro-c_1.9.2.bb
@@ -9,7 +9,7 @@ DEPENDS = "jansson zlib xz"
BRANCH = "branch-1.9"
SRCREV = "bf20128ca6138a830b2ea13e0490f3df6b035639"
-SRC_URI = "git://github.com/apache/avro;branch=${BRANCH} \
+SRC_URI = "git://github.com/apache/avro;branch=${BRANCH};protocol=https \
file://0001-cmake-Use-GNUInstallDirs-instead-of-hard-coded-paths.patch;patchdir=../../ \
"
diff --git a/meta-oe/recipes-support/bdwgc/bdwgc_8.0.4.bb b/meta-oe/recipes-support/bdwgc/bdwgc_8.0.4.bb
index 407de21385..d7d0b9c154 100644
--- a/meta-oe/recipes-support/bdwgc/bdwgc_8.0.4.bb
+++ b/meta-oe/recipes-support/bdwgc/bdwgc_8.0.4.bb
@@ -24,7 +24,7 @@ LIC_FILES_CHKSUM = "file://README.QUICK;md5=81b447d779e278628c843aef92f088fa"
DEPENDS = "libatomic-ops"
SRCREV = "d3dede3ce4462cd82a15f161af797ca51654546a"
-SRC_URI = "git://github.com/ivmai/bdwgc.git;branch=release-8_0"
+SRC_URI = "git://github.com/ivmai/bdwgc.git;branch=release-8_0;protocol=https"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/c-ares/c-ares/0001-fix-configure-error-mv-libcares.pc.cmakein-to-libcar.patch b/meta-oe/recipes-support/c-ares/c-ares/0001-fix-configure-error-mv-libcares.pc.cmakein-to-libcar.patch
deleted file mode 100644
index 8f15f8424c..0000000000
--- a/meta-oe/recipes-support/c-ares/c-ares/0001-fix-configure-error-mv-libcares.pc.cmakein-to-libcar.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From f2f1e134bf5d9d0789942848e03006af8d926cf8 Mon Sep 17 00:00:00 2001
-From: Wang Mingyu <wangmy@cn.fujitsu.com>
-Date: Tue, 17 Mar 2020 12:53:35 +0800
-Subject: [PATCH] fix configure error : mv libcares.pc.cmakein to
- libcares.pc.cmake
-
-Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
----
- CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 3a5878d..c2e5740 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -563,7 +563,7 @@ IF (CARES_STATIC)
- ENDIF()
-
- # Write ares_config.h configuration file. This is used only for the build.
--CONFIGURE_FILE (libcares.pc.cmakein ${PROJECT_BINARY_DIR}/libcares.pc @ONLY)
-+CONFIGURE_FILE (libcares.pc.cmake ${PROJECT_BINARY_DIR}/libcares.pc @ONLY)
-
-
-
---
-2.17.1
-
diff --git a/meta-oe/recipes-support/c-ares/c-ares/CVE-2022-4904.patch b/meta-oe/recipes-support/c-ares/c-ares/CVE-2022-4904.patch
new file mode 100644
index 0000000000..fb0aee372f
--- /dev/null
+++ b/meta-oe/recipes-support/c-ares/c-ares/CVE-2022-4904.patch
@@ -0,0 +1,67 @@
+From 9903253c347f9e0bffd285ae3829aef251cc852d Mon Sep 17 00:00:00 2001
+From: hopper-vul <118949689+hopper-vul@users.noreply.github.com>
+Date: Wed, 18 Jan 2023 22:14:26 +0800
+Subject: [PATCH] Add str len check in config_sortlist to avoid stack overflow
+ (#497)
+
+In ares_set_sortlist, it calls config_sortlist(..., sortstr) to parse
+the input str and initialize a sortlist configuration.
+
+However, ares_set_sortlist has not any checks about the validity of the input str.
+It is very easy to create an arbitrary length stack overflow with the unchecked
+`memcpy(ipbuf, str, q-str);` and `memcpy(ipbufpfx, str, q-str);`
+statements in the config_sortlist call, which could potentially cause severe
+security impact in practical programs.
+
+This commit add necessary check for `ipbuf` and `ipbufpfx` which avoid the
+potential stack overflows.
+
+fixes #496
+
+Fix By: @hopper-vul
+
+CVE: CVE-2022-4904
+Upstream-Status: Backport [https://github.com/c-ares/c-ares/commit/9903253c347f9e0bffd285ae3829aef251cc852d]
+
+Signed-off-by: Peter Marko <peter.marko@siemens.com>
+Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
+---
+ src/lib/ares_init.c | 4 ++++
+ test/ares-test-init.cc | 2 ++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/src/lib/ares_init.c b/src/lib/ares_init.c
+index 51668a5c..3f9cec65 100644
+--- a/src/lib/ares_init.c
++++ b/src/lib/ares_init.c
+@@ -1913,6 +1913,8 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
+ q = str;
+ while (*q && *q != '/' && *q != ';' && !ISSPACE(*q))
+ q++;
++ if (q-str >= 16)
++ return ARES_EBADSTR;
+ memcpy(ipbuf, str, q-str);
+ ipbuf[q-str] = '\0';
+ /* Find the prefix */
+@@ -1921,6 +1923,8 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
+ const char *str2 = q+1;
+ while (*q && *q != ';' && !ISSPACE(*q))
+ q++;
++ if (q-str >= 32)
++ return ARES_EBADSTR;
+ memcpy(ipbufpfx, str, q-str);
+ ipbufpfx[q-str] = '\0';
+ str = str2;
+diff --git a/test/ares-test-init.cc b/test/ares-test-init.cc
+index 63c6a228..ee845181 100644
+--- a/test/ares-test-init.cc
++++ b/test/ares-test-init.cc
+@@ -275,6 +275,8 @@ TEST_F(DefaultChannelTest, SetAddresses) {
+
+ TEST_F(DefaultChannelTest, SetSortlistFailures) {
+ EXPECT_EQ(ARES_ENODATA, ares_set_sortlist(nullptr, "1.2.3.4"));
++ EXPECT_EQ(ARES_EBADSTR, ares_set_sortlist(channel_, "111.111.111.111*/16"));
++ EXPECT_EQ(ARES_EBADSTR, ares_set_sortlist(channel_, "111.111.111.111/255.255.255.240*"));
+ EXPECT_EQ(ARES_SUCCESS, ares_set_sortlist(channel_, "xyzzy ; lwk"));
+ EXPECT_EQ(ARES_SUCCESS, ares_set_sortlist(channel_, "xyzzy ; 0x123"));
+ }
diff --git a/meta-oe/recipes-support/c-ares/c-ares/CVE-2023-31130.patch b/meta-oe/recipes-support/c-ares/c-ares/CVE-2023-31130.patch
new file mode 100644
index 0000000000..603d2687d5
--- /dev/null
+++ b/meta-oe/recipes-support/c-ares/c-ares/CVE-2023-31130.patch
@@ -0,0 +1,329 @@
+From f22cc01039b6473b736d3bf438f56a2654cdf2b2 Mon Sep 17 00:00:00 2001
+From: Brad House <brad@brad-house.com>
+Date: Mon, 22 May 2023 06:51:34 -0400
+Subject: [PATCH] Merge pull request from GHSA-x6mf-cxr9-8q6v
+
+* Merged latest OpenBSD changes for inet_net_pton_ipv6() into c-ares.
+* Always use our own IP conversion functions now, do not delegate to OS
+ so we can have consistency in testing and fuzzing.
+* Removed bogus test cases that never should have passed.
+* Add new test case for crash bug found.
+
+Fix By: Brad House (@bradh352)
+
+Upstream-Status: Backport [https://github.com/c-ares/c-ares/commit/f22cc01039b6473b736d3bf438f56a2654cdf2b2]
+CVE: CVE-2023-31130
+
+Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
+---
+ src/lib/inet_net_pton.c | 155 ++++++++++++++++++++-----------------
+ test/ares-test-internal.cc | 7 +-
+ 2 files changed, 86 insertions(+), 76 deletions(-)
+
+diff --git a/src/lib/inet_net_pton.c b/src/lib/inet_net_pton.c
+index 840de506..fc50425b 100644
+--- a/src/lib/inet_net_pton.c
++++ b/src/lib/inet_net_pton.c
+@@ -1,19 +1,20 @@
+
+ /*
+- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
++ * Copyright (c) 2012 by Gilles Chehade <gilles@openbsd.org>
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+- * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
++ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
++ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
++ * SOFTWARE.
+ */
+
+ #include "ares_setup.h"
+@@ -35,9 +36,6 @@
+
+ const struct ares_in6_addr ares_in6addr_any = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
+
+-
+-#ifndef HAVE_INET_NET_PTON
+-
+ /*
+ * static int
+ * inet_net_pton_ipv4(src, dst, size)
+@@ -60,7 +58,7 @@ const struct ares_in6_addr ares_in6addr_any = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ * Paul Vixie (ISC), June 1996
+ */
+ static int
+-inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size)
++ares_inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size)
+ {
+ static const char xdigits[] = "0123456789abcdef";
+ static const char digits[] = "0123456789";
+@@ -261,19 +259,14 @@ getv4(const char *src, unsigned char *dst, int *bitsp)
+ }
+
+ static int
+-inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size)
++ares_inet_pton6(const char *src, unsigned char *dst)
+ {
+ static const char xdigits_l[] = "0123456789abcdef",
+- xdigits_u[] = "0123456789ABCDEF";
++ xdigits_u[] = "0123456789ABCDEF";
+ unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
+ const char *xdigits, *curtok;
+- int ch, saw_xdigit;
++ int ch, saw_xdigit, count_xdigit;
+ unsigned int val;
+- int digits;
+- int bits;
+- size_t bytes;
+- int words;
+- int ipv4;
+
+ memset((tp = tmp), '\0', NS_IN6ADDRSZ);
+ endp = tp + NS_IN6ADDRSZ;
+@@ -283,22 +276,22 @@ inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size)
+ if (*++src != ':')
+ goto enoent;
+ curtok = src;
+- saw_xdigit = 0;
++ saw_xdigit = count_xdigit = 0;
+ val = 0;
+- digits = 0;
+- bits = -1;
+- ipv4 = 0;
+ while ((ch = *src++) != '\0') {
+ const char *pch;
+
+ if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
+ pch = strchr((xdigits = xdigits_u), ch);
+ if (pch != NULL) {
++ if (count_xdigit >= 4)
++ goto enoent;
+ val <<= 4;
+- val |= aresx_sztoui(pch - xdigits);
+- if (++digits > 4)
++ val |= (pch - xdigits);
++ if (val > 0xffff)
+ goto enoent;
+ saw_xdigit = 1;
++ count_xdigit++;
+ continue;
+ }
+ if (ch == ':') {
+@@ -308,78 +301,107 @@ inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size)
+ goto enoent;
+ colonp = tp;
+ continue;
+- } else if (*src == '\0')
++ } else if (*src == '\0') {
+ goto enoent;
++ }
+ if (tp + NS_INT16SZ > endp)
+- return (0);
+- *tp++ = (unsigned char)((val >> 8) & 0xff);
+- *tp++ = (unsigned char)(val & 0xff);
++ goto enoent;
++ *tp++ = (unsigned char) (val >> 8) & 0xff;
++ *tp++ = (unsigned char) val & 0xff;
+ saw_xdigit = 0;
+- digits = 0;
++ count_xdigit = 0;
+ val = 0;
+ continue;
+ }
+ if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
+- getv4(curtok, tp, &bits) > 0) {
+- tp += NS_INADDRSZ;
++ ares_inet_net_pton_ipv4(curtok, tp, INADDRSZ) > 0) {
++ tp += INADDRSZ;
+ saw_xdigit = 0;
+- ipv4 = 1;
++ count_xdigit = 0;
+ break; /* '\0' was seen by inet_pton4(). */
+ }
+- if (ch == '/' && getbits(src, &bits) > 0)
+- break;
+ goto enoent;
+ }
+ if (saw_xdigit) {
+ if (tp + NS_INT16SZ > endp)
+ goto enoent;
+- *tp++ = (unsigned char)((val >> 8) & 0xff);
+- *tp++ = (unsigned char)(val & 0xff);
++ *tp++ = (unsigned char) (val >> 8) & 0xff;
++ *tp++ = (unsigned char) val & 0xff;
+ }
+- if (bits == -1)
+- bits = 128;
+-
+- words = (bits + 15) / 16;
+- if (words < 2)
+- words = 2;
+- if (ipv4)
+- words = 8;
+- endp = tmp + 2 * words;
+-
+ if (colonp != NULL) {
+ /*
+ * Since some memmove()'s erroneously fail to handle
+ * overlapping regions, we'll do the shift by hand.
+ */
+- const ares_ssize_t n = tp - colonp;
+- ares_ssize_t i;
++ const int n = tp - colonp;
++ int i;
+
+ if (tp == endp)
+ goto enoent;
+ for (i = 1; i <= n; i++) {
+- *(endp - i) = *(colonp + n - i);
+- *(colonp + n - i) = 0;
++ endp[- i] = colonp[n - i];
++ colonp[n - i] = 0;
+ }
+ tp = endp;
+ }
+ if (tp != endp)
+ goto enoent;
+
+- bytes = (bits + 7) / 8;
+- if (bytes > size)
+- goto emsgsize;
+- memcpy(dst, tmp, bytes);
+- return (bits);
++ memcpy(dst, tmp, NS_IN6ADDRSZ);
++ return (1);
+
+- enoent:
++enoent:
+ SET_ERRNO(ENOENT);
+ return (-1);
+
+- emsgsize:
++emsgsize:
+ SET_ERRNO(EMSGSIZE);
+ return (-1);
+ }
+
++static int
++ares_inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size)
++{
++ struct ares_in6_addr in6;
++ int ret;
++ int bits;
++ size_t bytes;
++ char buf[INET6_ADDRSTRLEN + sizeof("/128")];
++ char *sep;
++ const char *errstr;
++
++ if (strlen(src) >= sizeof buf) {
++ SET_ERRNO(EMSGSIZE);
++ return (-1);
++ }
++ strncpy(buf, src, sizeof buf);
++
++ sep = strchr(buf, '/');
++ if (sep != NULL)
++ *sep++ = '\0';
++
++ ret = ares_inet_pton6(buf, (unsigned char *)&in6);
++ if (ret != 1)
++ return (-1);
++
++ if (sep == NULL)
++ bits = 128;
++ else {
++ if (!getbits(sep, &bits)) {
++ SET_ERRNO(ENOENT);
++ return (-1);
++ }
++ }
++
++ bytes = (bits + 7) / 8;
++ if (bytes > size) {
++ SET_ERRNO(EMSGSIZE);
++ return (-1);
++ }
++ memcpy(dst, &in6, bytes);
++ return (bits);
++}
++
+ /*
+ * int
+ * inet_net_pton(af, src, dst, size)
+@@ -403,18 +425,15 @@ ares_inet_net_pton(int af, const char *src, void *dst, size_t size)
+ {
+ switch (af) {
+ case AF_INET:
+- return (inet_net_pton_ipv4(src, dst, size));
++ return (ares_inet_net_pton_ipv4(src, dst, size));
+ case AF_INET6:
+- return (inet_net_pton_ipv6(src, dst, size));
++ return (ares_inet_net_pton_ipv6(src, dst, size));
+ default:
+ SET_ERRNO(EAFNOSUPPORT);
+ return (-1);
+ }
+ }
+
+-#endif /* HAVE_INET_NET_PTON */
+-
+-#ifndef HAVE_INET_PTON
+ int ares_inet_pton(int af, const char *src, void *dst)
+ {
+ int result;
+@@ -434,11 +453,3 @@ int ares_inet_pton(int af, const char *src, void *dst)
+ return 0;
+ return (result > -1 ? 1 : -1);
+ }
+-#else /* HAVE_INET_PTON */
+-int ares_inet_pton(int af, const char *src, void *dst)
+-{
+- /* just relay this to the underlying function */
+- return inet_pton(af, src, dst);
+-}
+-
+-#endif
+diff --git a/test/ares-test-internal.cc b/test/ares-test-internal.cc
+index 96d4edec..161f0a5c 100644
+--- a/test/ares-test-internal.cc
++++ b/test/ares-test-internal.cc
+@@ -81,6 +81,7 @@ TEST_F(LibraryTest, InetPtoN) {
+ EXPECT_EQ(0, ares_inet_net_pton(AF_INET6, "12:34::ff/0", &a6, sizeof(a6)));
+ EXPECT_EQ(16 * 8, ares_inet_net_pton(AF_INET6, "12:34::ffff:0.2", &a6, sizeof(a6)));
+ EXPECT_EQ(16 * 8, ares_inet_net_pton(AF_INET6, "1234:1234:1234:1234:1234:1234:1234:1234", &a6, sizeof(a6)));
++ EXPECT_EQ(2, ares_inet_net_pton(AF_INET6, "0::00:00:00/2", &a6, sizeof(a6)));
+
+ // Various malformed versions
+ EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "", &a4, sizeof(a4)));
+@@ -118,11 +119,9 @@ TEST_F(LibraryTest, InetPtoN) {
+ EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, ":1234:1234:1234:1234:1234:1234:1234:1234", &a6, sizeof(a6)));
+ EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, ":1234:1234:1234:1234:1234:1234:1234:1234:", &a6, sizeof(a6)));
+ EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "1234:1234:1234:1234:1234:1234:1234:1234:5678", &a6, sizeof(a6)));
+- // TODO(drysdale): check whether the next two tests should give -1.
+- EXPECT_EQ(0, ares_inet_net_pton(AF_INET6, "1234:1234:1234:1234:1234:1234:1234:1234:5678:5678", &a6, sizeof(a6)));
+- EXPECT_EQ(0, ares_inet_net_pton(AF_INET6, "1234:1234:1234:1234:1234:1234:1234:1234:5678:5678:5678", &a6, sizeof(a6)));
++ EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "1234:1234:1234:1234:1234:1234:1234:1234:5678:5678", &a6, sizeof(a6)));
++ EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "1234:1234:1234:1234:1234:1234:1234:1234:5678:5678:5678", &a6, sizeof(a6)));
+ EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ffff:257.2.3.4", &a6, sizeof(a6)));
+- EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ffff:002.2.3.4", &a6, sizeof(a6)));
+ EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ffff:1.2.3.4.5.6", &a6, sizeof(a6)));
+ EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ffff:1.2.3.4.5", &a6, sizeof(a6)));
+ EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ffff:1.2.3.z", &a6, sizeof(a6)));
+--
+2.25.1
+
diff --git a/meta-oe/recipes-support/c-ares/c-ares/CVE-2023-31147.patch b/meta-oe/recipes-support/c-ares/c-ares/CVE-2023-31147.patch
new file mode 100644
index 0000000000..ba17721a58
--- /dev/null
+++ b/meta-oe/recipes-support/c-ares/c-ares/CVE-2023-31147.patch
@@ -0,0 +1,717 @@
+From 823df3b989e59465d17b0a2eb1239a5fc048b4e5 Mon Sep 17 00:00:00 2001
+From: Brad House <brad@brad-house.com>
+Date: Mon, 22 May 2023 06:51:06 -0400
+Subject: [PATCH] Merge pull request from GHSA-8r8p-23f3-64c2
+
+* segment random number generation into own file
+
+* abstract random code to make it more modular so we can have multiple backends
+
+* rand: add support for arc4random_buf() and also direct CARES_RANDOM_FILE reading
+
+* autotools: fix detection of arc4random_buf
+
+* rework initial rc4 seed for PRNG as last fallback
+
+* rc4: more proper implementation, simplified for clarity
+
+* clarifications
+
+Upstream-Status: Backport [https://github.com/c-ares/c-ares/commit/823df3b989e59465d17b0a2eb1239a5fc048b4e5]
+CVE: CVE-2023-31147
+
+Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
+---
+ CMakeLists.txt | 2 +
+ configure.ac | 1 +
+ m4/cares-functions.m4 | 85 +++++++++++
+ src/lib/Makefile.inc | 1 +
+ src/lib/ares_config.h.cmake | 3 +
+ src/lib/ares_destroy.c | 3 +
+ src/lib/ares_init.c | 82 ++---------
+ src/lib/ares_private.h | 19 ++-
+ src/lib/ares_query.c | 36 +----
+ src/lib/ares_rand.c | 274 ++++++++++++++++++++++++++++++++++++
+ 10 files changed, 387 insertions(+), 119 deletions(-)
+ create mode 100644 src/lib/ares_rand.c
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 194485a3..1fb9af55 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -386,6 +386,8 @@ CHECK_SYMBOL_EXISTS (strncasecmp "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRNCAS
+ CHECK_SYMBOL_EXISTS (strncmpi "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRNCMPI)
+ CHECK_SYMBOL_EXISTS (strnicmp "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRNICMP)
+ CHECK_SYMBOL_EXISTS (writev "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_WRITEV)
++CHECK_SYMBOL_EXISTS (arc4random_buf "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_ARC4RANDOM_BUF)
++
+
+ # On Android, the system headers may define __system_property_get(), but excluded
+ # from libc. We need to perform a link test instead of a header/symbol test.
+diff --git a/configure.ac b/configure.ac
+index 1d0fb5ce..9a763696 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -683,6 +683,7 @@ CARES_CHECK_FUNC_STRNCASECMP
+ CARES_CHECK_FUNC_STRNCMPI
+ CARES_CHECK_FUNC_STRNICMP
+ CARES_CHECK_FUNC_WRITEV
++CARES_CHECK_FUNC_ARC4RANDOM_BUF
+
+
+ dnl check for AF_INET6
+diff --git a/m4/cares-functions.m4 b/m4/cares-functions.m4
+index 0f3992c7..d4f4f994 100644
+--- a/m4/cares-functions.m4
++++ b/m4/cares-functions.m4
+@@ -3753,3 +3753,88 @@ AC_DEFUN([CARES_CHECK_FUNC_WRITEV], [
+ ac_cv_func_writev="no"
+ fi
+ ])
++
++dnl CARES_CHECK_FUNC_ARC4RANDOM_BUF
++dnl -------------------------------------------------
++dnl Verify if arc4random_buf is available, prototyped, and
++dnl can be compiled. If all of these are true, and
++dnl usage has not been previously disallowed with
++dnl shell variable cares_disallow_arc4random_buf, then
++dnl HAVE_ARC4RANDOM_BUF will be defined.
++
++AC_DEFUN([CARES_CHECK_FUNC_ARC4RANDOM_BUF], [
++ AC_REQUIRE([CARES_INCLUDES_STDLIB])dnl
++ #
++ tst_links_arc4random_buf="unknown"
++ tst_proto_arc4random_buf="unknown"
++ tst_compi_arc4random_buf="unknown"
++ tst_allow_arc4random_buf="unknown"
++ #
++ AC_MSG_CHECKING([if arc4random_buf can be linked])
++ AC_LINK_IFELSE([
++ AC_LANG_FUNC_LINK_TRY([arc4random_buf])
++ ],[
++ AC_MSG_RESULT([yes])
++ tst_links_arc4random_buf="yes"
++ ],[
++ AC_MSG_RESULT([no])
++ tst_links_arc4random_buf="no"
++ ])
++ #
++ if test "$tst_links_arc4random_buf" = "yes"; then
++ AC_MSG_CHECKING([if arc4random_buf is prototyped])
++ AC_EGREP_CPP([arc4random_buf],[
++ $cares_includes_stdlib
++ ],[
++ AC_MSG_RESULT([yes])
++ tst_proto_arc4random_buf="yes"
++ ],[
++ AC_MSG_RESULT([no])
++ tst_proto_arc4random_buf="no"
++ ])
++ fi
++ #
++ if test "$tst_proto_arc4random_buf" = "yes"; then
++ AC_MSG_CHECKING([if arc4random_buf is compilable])
++ AC_COMPILE_IFELSE([
++ AC_LANG_PROGRAM([[
++ $cares_includes_stdlib
++ ]],[[
++ arc4random_buf(NULL, 0);
++ return 1;
++ ]])
++ ],[
++ AC_MSG_RESULT([yes])
++ tst_compi_arc4random_buf="yes"
++ ],[
++ AC_MSG_RESULT([no])
++ tst_compi_arc4random_buf="no"
++ ])
++ fi
++ #
++ if test "$tst_compi_arc4random_buf" = "yes"; then
++ AC_MSG_CHECKING([if arc4random_buf usage allowed])
++ if test "x$cares_disallow_arc4random_buf" != "xyes"; then
++ AC_MSG_RESULT([yes])
++ tst_allow_arc4random_buf="yes"
++ else
++ AC_MSG_RESULT([no])
++ tst_allow_arc4random_buf="no"
++ fi
++ fi
++ #
++ AC_MSG_CHECKING([if arc4random_buf might be used])
++ if test "$tst_links_arc4random_buf" = "yes" &&
++ test "$tst_proto_arc4random_buf" = "yes" &&
++ test "$tst_compi_arc4random_buf" = "yes" &&
++ test "$tst_allow_arc4random_buf" = "yes"; then
++ AC_MSG_RESULT([yes])
++ AC_DEFINE_UNQUOTED(HAVE_ARC4RANDOM_BUF, 1,
++ [Define to 1 if you have the arc4random_buf function.])
++ ac_cv_func_arc4random_buf="yes"
++ else
++ AC_MSG_RESULT([no])
++ ac_cv_func_arc4random_buf="no"
++ fi
++])
++
+diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
+index a3b060c2..72a7673c 100644
+--- a/src/lib/Makefile.inc
++++ b/src/lib/Makefile.inc
+@@ -45,6 +45,7 @@ CSOURCES = ares__addrinfo2hostent.c \
+ ares_platform.c \
+ ares_process.c \
+ ares_query.c \
++ ares_rand.c \
+ ares_search.c \
+ ares_send.c \
+ ares_strcasecmp.c \
+diff --git a/src/lib/ares_config.h.cmake b/src/lib/ares_config.h.cmake
+index fddb7853..798820a3 100644
+--- a/src/lib/ares_config.h.cmake
++++ b/src/lib/ares_config.h.cmake
+@@ -346,6 +346,9 @@
+ /* Define to 1 if you need the memory.h header file even with stdlib.h */
+ #cmakedefine NEED_MEMORY_H
+
++/* Define if have arc4random_buf() */
++#cmakedefine HAVE_ARC4RANDOM_BUF
++
+ /* a suitable file/device to read random data from */
+ #cmakedefine CARES_RANDOM_FILE "@CARES_RANDOM_FILE@"
+
+diff --git a/src/lib/ares_destroy.c b/src/lib/ares_destroy.c
+index fed2009a..0447af4c 100644
+--- a/src/lib/ares_destroy.c
++++ b/src/lib/ares_destroy.c
+@@ -90,6 +90,9 @@ void ares_destroy(ares_channel channel)
+ if (channel->resolvconf_path)
+ ares_free(channel->resolvconf_path);
+
++ if (channel->rand_state)
++ ares__destroy_rand_state(channel->rand_state);
++
+ ares_free(channel);
+ }
+
+diff --git a/src/lib/ares_init.c b/src/lib/ares_init.c
+index de5d86c9..2607ed6f 100644
+--- a/src/lib/ares_init.c
++++ b/src/lib/ares_init.c
+@@ -72,7 +72,6 @@ static int config_nameserver(struct server_state **servers, int *nservers,
+ static int set_search(ares_channel channel, const char *str);
+ static int set_options(ares_channel channel, const char *str);
+ static const char *try_option(const char *p, const char *q, const char *opt);
+-static int init_id_key(rc4_key* key,int key_data_len);
+
+ static int config_sortlist(struct apattern **sortlist, int *nsort,
+ const char *str);
+@@ -149,6 +148,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
+ channel->sock_funcs = NULL;
+ channel->sock_func_cb_data = NULL;
+ channel->resolvconf_path = NULL;
++ channel->rand_state = NULL;
+
+ channel->last_server = 0;
+ channel->last_timeout_processed = (time_t)now.tv_sec;
+@@ -202,9 +202,13 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
+ /* Generate random key */
+
+ if (status == ARES_SUCCESS) {
+- status = init_id_key(&channel->id_key, ARES_ID_KEY_LEN);
++ channel->rand_state = ares__init_rand_state();
++ if (channel->rand_state == NULL) {
++ status = ARES_ENOMEM;
++ }
++
+ if (status == ARES_SUCCESS)
+- channel->next_id = ares__generate_new_id(&channel->id_key);
++ channel->next_id = ares__generate_new_id(channel->rand_state);
+ else
+ DEBUGF(fprintf(stderr, "Error: init_id_key failed: %s\n",
+ ares_strerror(status)));
+@@ -224,6 +228,8 @@ done:
+ ares_free(channel->lookups);
+ if(channel->resolvconf_path)
+ ares_free(channel->resolvconf_path);
++ if (channel->rand_state)
++ ares__destroy_rand_state(channel->rand_state);
+ ares_free(channel);
+ return status;
+ }
+@@ -2495,76 +2501,6 @@ static int sortlist_alloc(struct apattern **sortlist, int *nsort,
+ return 1;
+ }
+
+-/* initialize an rc4 key. If possible a cryptographically secure random key
+- is generated using a suitable function (for example win32's RtlGenRandom as
+- described in
+- http://blogs.msdn.com/michael_howard/archive/2005/01/14/353379.aspx
+- otherwise the code defaults to cross-platform albeit less secure mechanism
+- using rand
+-*/
+-static void randomize_key(unsigned char* key,int key_data_len)
+-{
+- int randomized = 0;
+- int counter=0;
+-#ifdef WIN32
+- BOOLEAN res;
+- if (ares_fpSystemFunction036)
+- {
+- res = (*ares_fpSystemFunction036) (key, key_data_len);
+- if (res)
+- randomized = 1;
+- }
+-#else /* !WIN32 */
+-#ifdef CARES_RANDOM_FILE
+- FILE *f = fopen(CARES_RANDOM_FILE, "rb");
+- if(f) {
+- setvbuf(f, NULL, _IONBF, 0);
+- counter = aresx_uztosi(fread(key, 1, key_data_len, f));
+- fclose(f);
+- }
+-#endif
+-#endif /* WIN32 */
+-
+- if (!randomized) {
+- for (;counter<key_data_len;counter++)
+- key[counter]=(unsigned char)(rand() % 256); /* LCOV_EXCL_LINE */
+- }
+-}
+-
+-static int init_id_key(rc4_key* key,int key_data_len)
+-{
+- unsigned char index1;
+- unsigned char index2;
+- unsigned char* state;
+- short counter;
+- unsigned char *key_data_ptr = 0;
+-
+- key_data_ptr = ares_malloc(key_data_len);
+- if (!key_data_ptr)
+- return ARES_ENOMEM;
+- memset(key_data_ptr, 0, key_data_len);
+-
+- state = &key->state[0];
+- for(counter = 0; counter < 256; counter++)
+- /* unnecessary AND but it keeps some compilers happier */
+- state[counter] = (unsigned char)(counter & 0xff);
+- randomize_key(key->state,key_data_len);
+- key->x = 0;
+- key->y = 0;
+- index1 = 0;
+- index2 = 0;
+- for(counter = 0; counter < 256; counter++)
+- {
+- index2 = (unsigned char)((key_data_ptr[index1] + state[counter] +
+- index2) % 256);
+- ARES_SWAP_BYTE(&state[counter], &state[index2]);
+-
+- index1 = (unsigned char)((index1 + 1) % key_data_len);
+- }
+- ares_free(key_data_ptr);
+- return ARES_SUCCESS;
+-}
+-
+ void ares_set_local_ip4(ares_channel channel, unsigned int local_ip)
+ {
+ channel->local_ip4 = local_ip;
+diff --git a/src/lib/ares_private.h b/src/lib/ares_private.h
+index 60d69e08..518b5c33 100644
+--- a/src/lib/ares_private.h
++++ b/src/lib/ares_private.h
+@@ -101,8 +101,6 @@ W32_FUNC const char *_w32_GetHostsFile (void);
+
+ #endif
+
+-#define ARES_ID_KEY_LEN 31
+-
+ #include "ares_ipv6.h"
+ #include "ares_llist.h"
+
+@@ -262,12 +260,8 @@ struct apattern {
+ unsigned short type;
+ };
+
+-typedef struct rc4_key
+-{
+- unsigned char state[256];
+- unsigned char x;
+- unsigned char y;
+-} rc4_key;
++struct ares_rand_state;
++typedef struct ares_rand_state ares_rand_state;
+
+ struct ares_channeldata {
+ /* Configuration data */
+@@ -302,8 +296,8 @@ struct ares_channeldata {
+
+ /* ID to use for next query */
+ unsigned short next_id;
+- /* key to use when generating new ids */
+- rc4_key id_key;
++ /* random state to use when generating new ids */
++ ares_rand_state *rand_state;
+
+ /* Generation number to use for the next TCP socket open/close */
+ int tcp_connection_generation;
+@@ -359,7 +353,10 @@ void ares__close_sockets(ares_channel channel, struct server_state *server);
+ int ares__get_hostent(FILE *fp, int family, struct hostent **host);
+ int ares__read_line(FILE *fp, char **buf, size_t *bufsize);
+ void ares__free_query(struct query *query);
+-unsigned short ares__generate_new_id(rc4_key* key);
++
++ares_rand_state *ares__init_rand_state(void);
++void ares__destroy_rand_state(ares_rand_state *state);
++unsigned short ares__generate_new_id(ares_rand_state *state);
+ struct timeval ares__tvnow(void);
+ int ares__expand_name_validated(const unsigned char *encoded,
+ const unsigned char *abuf,
+diff --git a/src/lib/ares_query.c b/src/lib/ares_query.c
+index 508274db..42323bec 100644
+--- a/src/lib/ares_query.c
++++ b/src/lib/ares_query.c
+@@ -33,32 +33,6 @@ struct qquery {
+
+ static void qcallback(void *arg, int status, int timeouts, unsigned char *abuf, int alen);
+
+-static void rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len)
+-{
+- unsigned char x;
+- unsigned char y;
+- unsigned char* state;
+- unsigned char xorIndex;
+- int counter;
+-
+- x = key->x;
+- y = key->y;
+-
+- state = &key->state[0];
+- for(counter = 0; counter < buffer_len; counter ++)
+- {
+- x = (unsigned char)((x + 1) % 256);
+- y = (unsigned char)((state[x] + y) % 256);
+- ARES_SWAP_BYTE(&state[x], &state[y]);
+-
+- xorIndex = (unsigned char)((state[x] + state[y]) % 256);
+-
+- buffer_ptr[counter] = (unsigned char)(buffer_ptr[counter]^state[xorIndex]);
+- }
+- key->x = x;
+- key->y = y;
+-}
+-
+ static struct query* find_query_by_id(ares_channel channel, unsigned short id)
+ {
+ unsigned short qid;
+@@ -78,7 +52,6 @@ static struct query* find_query_by_id(ares_channel channel, unsigned short id)
+ return NULL;
+ }
+
+-
+ /* a unique query id is generated using an rc4 key. Since the id may already
+ be used by a running query (as infrequent as it may be), a lookup is
+ performed per id generation. In practice this search should happen only
+@@ -89,19 +62,12 @@ static unsigned short generate_unique_id(ares_channel channel)
+ unsigned short id;
+
+ do {
+- id = ares__generate_new_id(&channel->id_key);
++ id = ares__generate_new_id(channel->rand_state);
+ } while (find_query_by_id(channel, id));
+
+ return (unsigned short)id;
+ }
+
+-unsigned short ares__generate_new_id(rc4_key* key)
+-{
+- unsigned short r=0;
+- rc4(key, (unsigned char *)&r, sizeof(r));
+- return r;
+-}
+-
+ void ares_query(ares_channel channel, const char *name, int dnsclass,
+ int type, ares_callback callback, void *arg)
+ {
+diff --git a/src/lib/ares_rand.c b/src/lib/ares_rand.c
+new file mode 100644
+index 00000000..a564bc23
+--- /dev/null
++++ b/src/lib/ares_rand.c
+@@ -0,0 +1,274 @@
++/* Copyright 1998 by the Massachusetts Institute of Technology.
++ * Copyright (C) 2007-2013 by Daniel Stenberg
++ *
++ * Permission to use, copy, modify, and distribute this
++ * software and its documentation for any purpose and without
++ * fee is hereby granted, provided that the above copyright
++ * notice appear in all copies and that both that copyright
++ * notice and this permission notice appear in supporting
++ * documentation, and that the name of M.I.T. not be used in
++ * advertising or publicity pertaining to distribution of the
++ * software without specific, written prior permission.
++ * M.I.T. makes no representations about the suitability of
++ * this software for any purpose. It is provided "as is"
++ * without express or implied warranty.
++ */
++
++#include "ares_setup.h"
++#include "ares.h"
++#include "ares_private.h"
++#include "ares_nowarn.h"
++#include <stdlib.h>
++
++typedef enum {
++ ARES_RAND_OS = 1, /* OS-provided such as RtlGenRandom or arc4random */
++ ARES_RAND_FILE = 2, /* OS file-backed random number generator */
++ ARES_RAND_RC4 = 3 /* Internal RC4 based PRNG */
++} ares_rand_backend;
++
++typedef struct ares_rand_rc4
++{
++ unsigned char S[256];
++ size_t i;
++ size_t j;
++} ares_rand_rc4;
++
++struct ares_rand_state
++{
++ ares_rand_backend type;
++ union {
++ FILE *rand_file;
++ ares_rand_rc4 rc4;
++ } state;
++};
++
++
++/* Define RtlGenRandom = SystemFunction036. This is in advapi32.dll. There is
++ * no need to dynamically load this, other software used widely does not.
++ * http://blogs.msdn.com/michael_howard/archive/2005/01/14/353379.aspx
++ * https://docs.microsoft.com/en-us/windows/win32/api/ntsecapi/nf-ntsecapi-rtlgenrandom
++ */
++#ifdef _WIN32
++BOOLEAN WINAPI SystemFunction036(PVOID RandomBuffer, ULONG RandomBufferLength);
++# ifndef RtlGenRandom
++# define RtlGenRandom(a,b) SystemFunction036(a,b)
++# endif
++#endif
++
++
++#define ARES_RC4_KEY_LEN 32 /* 256 bits */
++
++static unsigned int ares_u32_from_ptr(void *addr)
++{
++ if (sizeof(void *) == 8) {
++ return (unsigned int)((((size_t)addr >> 32) & 0xFFFFFFFF) | ((size_t)addr & 0xFFFFFFFF));
++ }
++ return (unsigned int)((size_t)addr & 0xFFFFFFFF);
++}
++
++
++/* initialize an rc4 key as the last possible fallback. */
++static void ares_rc4_generate_key(ares_rand_rc4 *rc4_state, unsigned char *key, size_t key_len)
++{
++ size_t i;
++ size_t len = 0;
++ unsigned int data;
++ struct timeval tv;
++
++ if (key_len != ARES_RC4_KEY_LEN)
++ return;
++
++ /* Randomness is hard to come by. Maybe the system randomizes heap and stack addresses.
++ * Maybe the current timestamp give us some randomness.
++ * Use rc4_state (heap), &i (stack), and ares__tvnow()
++ */
++ data = ares_u32_from_ptr(rc4_state);
++ memcpy(key + len, &data, sizeof(data));
++ len += sizeof(data);
++
++ data = ares_u32_from_ptr(&i);
++ memcpy(key + len, &data, sizeof(data));
++ len += sizeof(data);
++
++ tv = ares__tvnow();
++ data = (unsigned int)((tv.tv_sec | tv.tv_usec) & 0xFFFFFFFF);
++ memcpy(key + len, &data, sizeof(data));
++ len += sizeof(data);
++
++ srand(ares_u32_from_ptr(rc4_state) | ares_u32_from_ptr(&i) | (unsigned int)((tv.tv_sec | tv.tv_usec) & 0xFFFFFFFF));
++
++ for (i=len; i<key_len; i++) {
++ key[i]=(unsigned char)(rand() % 256); /* LCOV_EXCL_LINE */
++ }
++}
++
++
++static void ares_rc4_init(ares_rand_rc4 *rc4_state)
++{
++ unsigned char key[ARES_RC4_KEY_LEN];
++ size_t i;
++ size_t j;
++
++ ares_rc4_generate_key(rc4_state, key, sizeof(key));
++
++ for (i = 0; i < sizeof(rc4_state->S); i++) {
++ rc4_state->S[i] = i & 0xFF;
++ }
++
++ for(i = 0, j = 0; i < 256; i++) {
++ j = (j + rc4_state->S[i] + key[i % sizeof(key)]) % 256;
++ ARES_SWAP_BYTE(&rc4_state->S[i], &rc4_state->S[j]);
++ }
++
++ rc4_state->i = 0;
++ rc4_state->j = 0;
++}
++
++/* Just outputs the key schedule, no need to XOR with any data since we have none */
++static void ares_rc4_prng(ares_rand_rc4 *rc4_state, unsigned char *buf, int len)
++{
++ unsigned char *S = rc4_state->S;
++ size_t i = rc4_state->i;
++ size_t j = rc4_state->j;
++ size_t cnt;
++
++ for (cnt=0; cnt<len; cnt++) {
++ i = (i + 1) % 256;
++ j = (j + S[i]) % 256;
++
++ ARES_SWAP_BYTE(&S[i], &S[j]);
++ buf[cnt] = S[(S[i] + S[j]) % 256];
++ }
++
++ rc4_state->i = i;
++ rc4_state->j = j;
++}
++
++
++static int ares__init_rand_engine(ares_rand_state *state)
++{
++ memset(state, 0, sizeof(*state));
++
++#if defined(HAVE_ARC4RANDOM_BUF) || defined(_WIN32)
++ state->type = ARES_RAND_OS;
++ return 1;
++#elif defined(CARES_RANDOM_FILE)
++ state->type = ARES_RAND_FILE;
++ state->state.rand_file = fopen(CARES_RANDOM_FILE, "rb");
++ if (state->state.rand_file) {
++ setvbuf(state->state.rand_file, NULL, _IONBF, 0);
++ return 1;
++ }
++ /* Fall-Thru on failure to RC4 */
++#endif
++
++ state->type = ARES_RAND_RC4;
++ ares_rc4_init(&state->state.rc4);
++
++ /* Currently cannot fail */
++ return 1;
++}
++
++
++ares_rand_state *ares__init_rand_state()
++{
++ ares_rand_state *state = NULL;
++
++ state = ares_malloc(sizeof(*state));
++ if (!state)
++ return NULL;
++
++ if (!ares__init_rand_engine(state)) {
++ ares_free(state);
++ return NULL;
++ }
++
++ return state;
++}
++
++
++static void ares__clear_rand_state(ares_rand_state *state)
++{
++ if (!state)
++ return;
++
++ switch (state->type) {
++ case ARES_RAND_OS:
++ break;
++ case ARES_RAND_FILE:
++ fclose(state->state.rand_file);
++ break;
++ case ARES_RAND_RC4:
++ break;
++ }
++}
++
++
++static void ares__reinit_rand(ares_rand_state *state)
++{
++ ares__clear_rand_state(state);
++ ares__init_rand_engine(state);
++}
++
++
++void ares__destroy_rand_state(ares_rand_state *state)
++{
++ if (!state)
++ return;
++
++ ares__clear_rand_state(state);
++ ares_free(state);
++}
++
++
++static void ares__rand_bytes(ares_rand_state *state, unsigned char *buf, size_t len)
++{
++
++ while (1) {
++ size_t rv;
++ size_t bytes_read = 0;
++
++ switch (state->type) {
++ case ARES_RAND_OS:
++#ifdef _WIN32
++ RtlGenRandom(buf, len);
++ return;
++#elif defined(HAVE_ARC4RANDOM_BUF)
++ arc4random_buf(buf, len);
++ return;
++#else
++ /* Shouldn't be possible to be here */
++ break;
++#endif
++
++ case ARES_RAND_FILE:
++ while (1) {
++ size_t rv = fread(buf + bytes_read, 1, len - bytes_read, state->state.rand_file);
++ if (rv == 0)
++ break; /* critical error, will reinit rand state */
++
++ bytes_read += rv;
++ if (bytes_read == len)
++ return;
++ }
++ break;
++
++ case ARES_RAND_RC4:
++ ares_rc4_prng(&state->state.rc4, buf, len);
++ return;
++ }
++
++ /* If we didn't return before we got here, that means we had a critical rand
++ * failure and need to reinitialized */
++ ares__reinit_rand(state);
++ }
++}
++
++unsigned short ares__generate_new_id(ares_rand_state *state)
++{
++ unsigned short r=0;
++
++ ares__rand_bytes(state, (unsigned char *)&r, sizeof(r));
++ return r;
++}
++
+--
+2.25.1
+
diff --git a/meta-oe/recipes-support/c-ares/c-ares/CVE-2023-32067.patch b/meta-oe/recipes-support/c-ares/c-ares/CVE-2023-32067.patch
new file mode 100644
index 0000000000..63192d3c81
--- /dev/null
+++ b/meta-oe/recipes-support/c-ares/c-ares/CVE-2023-32067.patch
@@ -0,0 +1,84 @@
+From b9b8413cfdb70a3f99e1573333b23052d57ec1ae Mon Sep 17 00:00:00 2001
+From: Brad House <brad@brad-house.com>
+Date: Mon, 22 May 2023 06:51:49 -0400
+Subject: [PATCH] Merge pull request from GHSA-9g78-jv2r-p7vc
+
+Link: https://github.com/c-ares/c-ares/releases/tag/cares-1_19_1
+
+Upstream-Status: Backport [https://github.com/c-ares/c-ares/commit/b9b8413cfdb70a3f99e1573333b23052d57ec1ae]
+CVE: CVE-2023-32067
+Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
+---
+ src/lib/ares_process.c | 41 +++++++++++++++++++++++++----------------
+ 1 file changed, 25 insertions(+), 16 deletions(-)
+
+diff --git a/src/lib/ares_process.c b/src/lib/ares_process.c
+index bf0cde464..6cac0a99f 100644
+--- a/src/lib/ares_process.c
++++ b/src/lib/ares_process.c
+@@ -470,7 +470,7 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
+ {
+ struct server_state *server;
+ int i;
+- ares_ssize_t count;
++ ares_ssize_t read_len;
+ unsigned char buf[MAXENDSSZ + 1];
+ #ifdef HAVE_RECVFROM
+ ares_socklen_t fromlen;
+@@ -513,32 +513,41 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
+ /* To reduce event loop overhead, read and process as many
+ * packets as we can. */
+ do {
+- if (server->udp_socket == ARES_SOCKET_BAD)
+- count = 0;
+-
+- else {
+- if (server->addr.family == AF_INET)
++ if (server->udp_socket == ARES_SOCKET_BAD) {
++ read_len = -1;
++ } else {
++ if (server->addr.family == AF_INET) {
+ fromlen = sizeof(from.sa4);
+- else
++ } else {
+ fromlen = sizeof(from.sa6);
+- count = socket_recvfrom(channel, server->udp_socket, (void *)buf,
+- sizeof(buf), 0, &from.sa, &fromlen);
++ }
++ read_len = socket_recvfrom(channel, server->udp_socket, (void *)buf,
++ sizeof(buf), 0, &from.sa, &fromlen);
+ }
+
+- if (count == -1 && try_again(SOCKERRNO))
++ if (read_len == 0) {
++ /* UDP is connectionless, so result code of 0 is a 0-length UDP
++ * packet, and not an indication the connection is closed like on
++ * tcp */
+ continue;
+- else if (count <= 0)
++ } else if (read_len < 0) {
++ if (try_again(SOCKERRNO))
++ continue;
++
+ handle_error(channel, i, now);
++
+ #ifdef HAVE_RECVFROM
+- else if (!same_address(&from.sa, &server->addr))
++ } else if (!same_address(&from.sa, &server->addr)) {
+ /* The address the response comes from does not match the address we
+ * sent the request to. Someone may be attempting to perform a cache
+ * poisoning attack. */
+- break;
++ continue;
+ #endif
+- else
+- process_answer(channel, buf, (int)count, i, 0, now);
+- } while (count > 0);
++
++ } else {
++ process_answer(channel, buf, (int)read_len, i, 0, now);
++ }
++ } while (read_len >= 0);
+ }
+ }
+
diff --git a/meta-oe/recipes-support/c-ares/c-ares/cmake-install-libcares.pc.patch b/meta-oe/recipes-support/c-ares/c-ares/cmake-install-libcares.pc.patch
deleted file mode 100644
index 0eb7e4bbb3..0000000000
--- a/meta-oe/recipes-support/c-ares/c-ares/cmake-install-libcares.pc.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 12414304245cce6ef0e8b9547949be5109845353 Mon Sep 17 00:00:00 2001
-From: Changqing Li <changqing.li@windriver.com>
-Date: Tue, 24 Jul 2018 13:33:33 +0800
-Subject: [PATCH] cmake: Install libcares.pc
-
-Prepare and install libcares.pc file during cmake build, so libraries
-using pkg-config to find libcares will not fail.
-
-Signed-off-by: Alexey Firago <alexey_firago@mentor.com>
-
-update to 1.14.0, fix patch warning
-
-Signed-off-by: Changqing Li <changqing.li@windriver.com>
----
- CMakeLists.txt | 28 +++++++++++++++++++++++-----
- 1 file changed, 23 insertions(+), 5 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index fd123e1..3a5878d 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -214,22 +214,25 @@ ADD_DEFINITIONS(${SYSFLAGS})
-
-
- # Tell C-Ares about libraries to depend on
-+# Also pass these libraries to pkg-config file
-+SET(CARES_PRIVATE_LIBS_LIST)
- IF (HAVE_LIBRESOLV)
-- LIST (APPEND CARES_DEPENDENT_LIBS resolv)
-+ LIST (APPEND CARES_PRIVATE_LIBS_LIST "-lresolv")
- ENDIF ()
- IF (HAVE_LIBNSL)
-- LIST (APPEND CARES_DEPENDENT_LIBS nsl)
-+ LIST (APPEND CARES_PRIVATE_LIBS_LIST "-lnsl")
- ENDIF ()
- IF (HAVE_LIBSOCKET)
-- LIST (APPEND CARES_DEPENDENT_LIBS socket)
-+ LIST (APPEND CARES_PRIVATE_LIBS_LIST "-lsocket")
- ENDIF ()
- IF (HAVE_LIBRT)
-- LIST (APPEND CARES_DEPENDENT_LIBS rt)
-+ LIST (APPEND CARES_PRIVATE_LIBS_LIST "-lrt")
- ENDIF ()
- IF (WIN32)
-- LIST (APPEND CARES_DEPENDENT_LIBS ws2_32 Advapi32)
-+ LIST (APPEND CARES_PRIVATE_LIBS_LIST "-lws2_32")
- ENDIF ()
-
-+string (REPLACE ";" " " CARES_PRIVATE_LIBS "${CARES_PRIVATE_LIBS_LIST}")
-
- # When checking for symbols, we need to make sure we set the proper
- # headers, libraries, and definitions for the detection to work properly
-@@ -554,6 +557,15 @@ CONFIGURE_FILE (ares_build.h.cmake ${PROJECT_BINARY_DIR}/ares_build.h)
- # Write ares_config.h configuration file. This is used only for the build.
- CONFIGURE_FILE (ares_config.h.cmake ${PROJECT_BINARY_DIR}/ares_config.h)
-
-+# Pass required CFLAGS to pkg-config in case of static library
-+IF (CARES_STATIC)
-+ SET (CPPFLAG_CARES_STATICLIB "-DCARES_STATICLIB")
-+ENDIF()
-+
-+# Write ares_config.h configuration file. This is used only for the build.
-+CONFIGURE_FILE (libcares.pc.cmakein ${PROJECT_BINARY_DIR}/libcares.pc @ONLY)
-+
-+
-
- # TRANSFORM_MAKEFILE_INC
- #
-@@ -728,6 +740,12 @@ IF (CARES_INSTALL)
- INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/libcares.pc" COMPONENT Devel DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
- ENDIF ()
-
-+# pkg-config file
-+IF (CARES_INSTALL)
-+ SET (PKGCONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
-+ INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/libcares.pc" DESTINATION ${PKGCONFIG_INSTALL_DIR})
-+ENDIF ()
-+
- # Legacy chain-building variables (provided for compatibility with old code).
- # Don't use these, external code should be updated to refer to the aliases directly (e.g., Cares::cares).
- SET (CARES_FOUND 1 CACHE INTERNAL "CARES LIBRARY FOUND")
---
-2.17.1
-
diff --git a/meta-oe/recipes-support/c-ares/c-ares_1.16.1.bb b/meta-oe/recipes-support/c-ares/c-ares_1.16.1.bb
deleted file mode 100644
index 67dd701807..0000000000
--- a/meta-oe/recipes-support/c-ares/c-ares_1.16.1.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (c) 2012-2014 LG Electronics, Inc.
-SUMMARY = "c-ares is a C library that resolves names asynchronously."
-HOMEPAGE = "http://daniel.haxx.se/projects/c-ares/"
-SECTION = "libs"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE.md;md5=fb997454c8d62aa6a47f07a8cd48b006"
-
-PV = "1.16.0+gitr${SRCPV}"
-
-SRC_URI = "\
- git://github.com/c-ares/c-ares.git \
- file://cmake-install-libcares.pc.patch \
- file://0001-fix-configure-error-mv-libcares.pc.cmakein-to-libcar.patch \
-"
-SRCREV = "74a1426ba60e2cd7977e53a22ef839c87415066e"
-
-UPSTREAM_CHECK_GITTAGREGEX = "cares-(?P<pver>\d+_(\d_?)+)"
-
-S = "${WORKDIR}/git"
-
-inherit cmake pkgconfig
-
-PACKAGES =+ "${PN}-utils"
-
-FILES_${PN}-utils = "${bindir}"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-oe/recipes-support/c-ares/c-ares_1.18.1.bb b/meta-oe/recipes-support/c-ares/c-ares_1.18.1.bb
new file mode 100644
index 0000000000..2aa7897608
--- /dev/null
+++ b/meta-oe/recipes-support/c-ares/c-ares_1.18.1.bb
@@ -0,0 +1,30 @@
+# Copyright (c) 2012-2014 LG Electronics, Inc.
+SUMMARY = "c-ares is a C library that resolves names asynchronously."
+HOMEPAGE = "http://daniel.haxx.se/projects/c-ares/"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=fb997454c8d62aa6a47f07a8cd48b006"
+
+SRC_URI = "git://github.com/c-ares/c-ares.git;branch=main;protocol=https \
+ file://CVE-2022-4904.patch \
+ file://CVE-2023-31130.patch \
+ file://CVE-2023-31147.patch \
+ file://CVE-2023-32067.patch \
+ "
+SRCREV = "2aa086f822aad5017a6f2061ef656f237a62d0ed"
+
+UPSTREAM_CHECK_GITTAGREGEX = "cares-(?P<pver>\d+_(\d_?)+)"
+
+S = "${WORKDIR}/git"
+
+inherit cmake pkgconfig
+
+PACKAGES =+ "${PN}-utils"
+
+FILES_${PN}-utils = "${bindir}"
+
+BBCLASSEXTEND = "native nativesdk"
+
+# this vulneribility applies only when cross-compiling using autotools
+# yocto cross-compiles via cmake which is also listed as official workaround
+CVE_CHECK_WHITELIST += "CVE-2023-31124"
diff --git a/meta-oe/recipes-support/ceres-solver/ceres-solver_1.14.0.bb b/meta-oe/recipes-support/ceres-solver/ceres-solver_1.14.0.bb
index 105610be5a..e0e50366d4 100644
--- a/meta-oe/recipes-support/ceres-solver/ceres-solver_1.14.0.bb
+++ b/meta-oe/recipes-support/ceres-solver/ceres-solver_1.14.0.bb
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=35e00f0c4c96a0820a03e0b31e6416be"
DEPENDS = "libeigen glog"
-SRC_URI = "git://github.com/ceres-solver/ceres-solver.git"
+SRC_URI = "git://github.com/ceres-solver/ceres-solver.git;branch=master;protocol=https"
SRCREV = "facb199f3eda902360f9e1d5271372b7e54febe1"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/cli11/cli11_1.8.0.bb b/meta-oe/recipes-support/cli11/cli11_1.8.0.bb
index dd129cbec9..a49eab72fd 100644
--- a/meta-oe/recipes-support/cli11/cli11_1.8.0.bb
+++ b/meta-oe/recipes-support/cli11/cli11_1.8.0.bb
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=b73927b18d5c6cd8d2ed28a6ad539733"
SRCREV = "13becaddb657eacd090537719a669d66d393b8b2"
PV .= "+git${SRCPV}"
-SRC_URI += "gitsm://github.com/CLIUtils/CLI11 \
+SRC_URI += "gitsm://github.com/CLIUtils/CLI11;branch=main;protocol=https \
file://0001-Add-CLANG_TIDY-check.patch \
file://0001-Use-GNUInstallDirs-instead-of-hard-coded-path.patch \
"
diff --git a/meta-oe/recipes-support/cmark/cmark_git.bb b/meta-oe/recipes-support/cmark/cmark_git.bb
index f74a39b500..4f07beb317 100644
--- a/meta-oe/recipes-support/cmark/cmark_git.bb
+++ b/meta-oe/recipes-support/cmark/cmark_git.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "https://github.com/commonmark/cmark"
LICENSE = "BSD-2-Clause & MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=81f9cae6293cc0345a9144b78152ab62"
-SRC_URI = "git://github.com/commonmark/cmark.git"
+SRC_URI = "git://github.com/commonmark/cmark.git;branch=master;protocol=https"
SRCREV = "8daa6b1495124f0b67e6034130e12d7be83e38bd"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/daemonize/daemonize_git.bb b/meta-oe/recipes-support/daemonize/daemonize_git.bb
index c76632781a..f46dec59fc 100644
--- a/meta-oe/recipes-support/daemonize/daemonize_git.bb
+++ b/meta-oe/recipes-support/daemonize/daemonize_git.bb
@@ -7,7 +7,7 @@ PV = "1.7.8"
inherit autotools
SRCREV = "18869a797dab12bf1c917ba3b4782fef484c407c"
-SRC_URI = "git://github.com/bmc/daemonize.git \
+SRC_URI = "git://github.com/bmc/daemonize.git;branch=master;protocol=https \
"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/digitemp/digitemp_3.7.2.bb b/meta-oe/recipes-support/digitemp/digitemp_3.7.2.bb
index 9fcc278d35..cac2b4fd61 100644
--- a/meta-oe/recipes-support/digitemp/digitemp_3.7.2.bb
+++ b/meta-oe/recipes-support/digitemp/digitemp_3.7.2.bb
@@ -4,7 +4,7 @@ DEPENDS = "libusb1"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=44fee82a1d2ed0676cf35478283e0aa0"
-SRC_URI = "git://github.com/bcl/digitemp"
+SRC_URI = "git://github.com/bcl/digitemp;branch=master;protocol=https"
SRCREV = "a162e63aad35358aab325388f3d5e88121606419"
diff --git a/meta-oe/recipes-support/dstat/dstat_0.7.4.bb b/meta-oe/recipes-support/dstat/dstat_0.7.4.bb
index 74af54ca53..18c3cdf82c 100644
--- a/meta-oe/recipes-support/dstat/dstat_0.7.4.bb
+++ b/meta-oe/recipes-support/dstat/dstat_0.7.4.bb
@@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
DEPENDS += "asciidoc-native xmlto-native"
-SRC_URI = "git://github.com/dagwieers/dstat.git \
+SRC_URI = "git://github.com/dagwieers/dstat.git;branch=master;protocol=https \
file://0001-change-dstat-to-python3.patch \
"
@@ -21,4 +21,4 @@ do_install() {
oe_runmake 'DESTDIR=${D}' install
}
-RDEPENDS_${PN} += "python3-core python3-misc python3-resource python3-shell python3-unixadmin"
+RDEPENDS_${PN} += "python3-core python3-misc python3-resource python3-shell python3-six python3-unixadmin"
diff --git a/meta-oe/recipes-support/epeg/epeg_git.bb b/meta-oe/recipes-support/epeg/epeg_git.bb
index 8ca574014b..bdffe4ba78 100644
--- a/meta-oe/recipes-support/epeg/epeg_git.bb
+++ b/meta-oe/recipes-support/epeg/epeg_git.bb
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=e7732a9290ea1e4b034fdc15cf49968d \
file://COPYING-PLAIN;md5=f59cacc08235a546b0c34a5422133035"
DEPENDS = "jpeg libexif"
-SRC_URI = "git://github.com/mattes/epeg.git"
+SRC_URI = "git://github.com/mattes/epeg.git;branch=master;protocol=https"
SRCREV = "9a175cd67eaa61fe45413d8da82da72936567047"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/fmt/fmt_6.2.0.bb b/meta-oe/recipes-support/fmt/fmt_6.2.0.bb
index 05dc94a990..1a05f0d547 100644
--- a/meta-oe/recipes-support/fmt/fmt_6.2.0.bb
+++ b/meta-oe/recipes-support/fmt/fmt_6.2.0.bb
@@ -4,7 +4,7 @@ HOMEPAGE = "https://fmt.dev"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=af88d758f75f3c5c48a967501f24384b"
-SRC_URI += "git://github.com/fmtlib/fmt"
+SRC_URI += "git://github.com/fmtlib/fmt;branch=master;protocol=https"
SRCREV = "9bdd1596cef1b57b9556f8bef32dc4a32322ef3e"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/freerdp/freerdp_git.bb b/meta-oe/recipes-support/freerdp/freerdp_git.bb
index 82ef561fbe..309acfbffc 100644
--- a/meta-oe/recipes-support/freerdp/freerdp_git.bb
+++ b/meta-oe/recipes-support/freerdp/freerdp_git.bb
@@ -16,7 +16,7 @@ PKGV = "${GITPKGVTAG}"
# 2.0.0 release
SRCREV = "5ab2bed8749747b8e4b2ed431fd102bc726be684"
-SRC_URI = "git://github.com/FreeRDP/FreeRDP.git \
+SRC_URI = "git://github.com/FreeRDP/FreeRDP.git;branch=master;protocol=https \
file://winpr-makecert-Build-with-install-RPATH.patch \
"
diff --git a/meta-oe/recipes-support/function2/function2_4.0.0.bb b/meta-oe/recipes-support/function2/function2_4.0.0.bb
index 556a25aa14..07aa669375 100644
--- a/meta-oe/recipes-support/function2/function2_4.0.0.bb
+++ b/meta-oe/recipes-support/function2/function2_4.0.0.bb
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
SRCREV = "d2acdb6c3c7612a6133cd03464ef941161258f4e"
PV .= "+git${SRCPV}"
-SRC_URI += "gitsm://github.com/Naios/function2"
+SRC_URI += "gitsm://github.com/Naios/function2;branch=master;protocol=https"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/gd/gd_2.3.0.bb b/meta-oe/recipes-support/gd/gd_2.3.0.bb
index eec8a05ae8..8adb7db4d1 100644
--- a/meta-oe/recipes-support/gd/gd_2.3.0.bb
+++ b/meta-oe/recipes-support/gd/gd_2.3.0.bb
@@ -13,7 +13,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=8e5bc8627b9494741c905d65238c66b7"
DEPENDS = "freetype libpng jpeg zlib tiff"
-SRC_URI = "git://github.com/libgd/libgd.git;branch=master \
+SRC_URI = "git://github.com/libgd/libgd.git;branch=master;protocol=https \
"
SRCREV = "b079fa06223c3ab862c8f0eea58a968727971988"
diff --git a/meta-oe/recipes-support/gflags/gflags_2.2.2.bb b/meta-oe/recipes-support/gflags/gflags_2.2.2.bb
index 6eea0c00ec..4379c2d9e1 100644
--- a/meta-oe/recipes-support/gflags/gflags_2.2.2.bb
+++ b/meta-oe/recipes-support/gflags/gflags_2.2.2.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "https://github.com/gflags/gflags"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING.txt;md5=c80d1a3b623f72bb85a4c75b556551df"
-SRC_URI = "git://github.com/gflags/gflags.git"
+SRC_URI = "git://github.com/gflags/gflags.git;branch=master;protocol=https"
SRCREV = "e171aa2d15ed9eb17054558e0b3a6a413bb01067"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/glog/glog_0.3.5.bb b/meta-oe/recipes-support/glog/glog_0.3.5.bb
index 56bf515544..55ca838cd7 100644
--- a/meta-oe/recipes-support/glog/glog_0.3.5.bb
+++ b/meta-oe/recipes-support/glog/glog_0.3.5.bb
@@ -7,7 +7,7 @@ LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=dc9db360e0bbd4e46672f3fd91dd6c4b"
SRC_URI = " \
- git://github.com/google/glog.git;nobranch=1 \
+ git://github.com/google/glog.git;nobranch=1;protocol=https \
file://0001-Rework-CMake-glog-VERSION-management.patch \
file://0002-Find-Libunwind-during-configure.patch \
file://0003-installation-path-fix.patch \
diff --git a/meta-oe/recipes-support/gnulib/gnulib_2018-03-07.03.bb b/meta-oe/recipes-support/gnulib/gnulib_2018-12-18.bb
index 146747eee1..ac46b5676c 100644
--- a/meta-oe/recipes-support/gnulib/gnulib_2018-03-07.03.bb
+++ b/meta-oe/recipes-support/gnulib/gnulib_2018-12-18.bb
@@ -13,7 +13,7 @@ LICENSE = "LGPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=56a22a6e5bcce45e2c8ac184f81412b5"
SRCREV = "0d6e3307bbdb8df4d56043d5f373eeeffe4cbef3"
-SRC_URI = "git://git.sv.gnu.org/gnulib.git \
+SRC_URI = "git://git.sv.gnu.org/gnulib.git;branch=master \
"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/gperftools/gperftools_2.7.90.bb b/meta-oe/recipes-support/gperftools/gperftools_2.7.90.bb
index b7b7839313..1a1f7db5cf 100644
--- a/meta-oe/recipes-support/gperftools/gperftools_2.7.90.bb
+++ b/meta-oe/recipes-support/gperftools/gperftools_2.7.90.bb
@@ -4,7 +4,7 @@ LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=762732742c73dc6c7fbe8632f06c059a"
SRCREV = "db7aa547abb5abdd558587a15502584cbc825438"
-SRC_URI = "git://github.com/gperftools/gperftools \
+SRC_URI = "git://github.com/gperftools/gperftools;branch=master;protocol=https \
file://0001-Support-Atomic-ops-on-clang.patch \
file://0001-fix-build-with-musl-libc.patch \
file://0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch \
diff --git a/meta-oe/recipes-support/gpm/gpm_git.bb b/meta-oe/recipes-support/gpm/gpm_git.bb
index 3800d147f9..6bf071d89e 100644
--- a/meta-oe/recipes-support/gpm/gpm_git.bb
+++ b/meta-oe/recipes-support/gpm/gpm_git.bb
@@ -13,7 +13,7 @@ SRCREV = "1fd19417b8a4dd9945347e98dfa97e4cfd798d77"
DEPENDS = "ncurses bison-native"
-SRC_URI = "git://github.com/telmich/gpm;protocol=git \
+SRC_URI = "git://github.com/telmich/gpm;protocol=https;branch=master \
file://init \
file://gpm.service.in \
file://0001-Use-sigemptyset-API-instead-of-__sigemptyset.patch \
diff --git a/meta-oe/recipes-support/hidapi/hidapi_git.bb b/meta-oe/recipes-support/hidapi/hidapi_git.bb
index a34797ff51..1cc3acac2c 100644
--- a/meta-oe/recipes-support/hidapi/hidapi_git.bb
+++ b/meta-oe/recipes-support/hidapi/hidapi_git.bb
@@ -8,7 +8,7 @@ DEPENDS = "libusb udev"
PV = "0.7.99+0.8.0-rc1+git${SRCPV}"
SRCREV = "d17db57b9d4354752e0af42f5f33007a42ef2906"
-SRC_URI = "git://github.com/signal11/hidapi.git"
+SRC_URI = "git://github.com/signal11/hidapi.git;branch=master;protocol=https"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/hunspell/hunspell-dictionaries.bb b/meta-oe/recipes-support/hunspell/hunspell-dictionaries.bb
index 3da67d1e3a..2e902ca4cb 100644
--- a/meta-oe/recipes-support/hunspell/hunspell-dictionaries.bb
+++ b/meta-oe/recipes-support/hunspell/hunspell-dictionaries.bb
@@ -135,7 +135,7 @@ RDEPENDS_${PN} = "hunspell"
PV = "0.0.0+git${SRCPV}"
SRCREV = "820a65e539e34a3a8c2a855d2450b84745c624ee"
-SRC_URI = "git://github.com/wooorm/dictionaries.git"
+SRC_URI = "git://github.com/wooorm/dictionaries.git;branch=master;protocol=https"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/hunspell/hunspell_1.7.0.bb b/meta-oe/recipes-support/hunspell/hunspell_1.7.0.bb
index c2fb4fa05b..63d68ea06b 100644
--- a/meta-oe/recipes-support/hunspell/hunspell_1.7.0.bb
+++ b/meta-oe/recipes-support/hunspell/hunspell_1.7.0.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = " \
"
SRCREV = "4ddd8ed5ca6484b930b111aec50c2750a6119a0f"
-SRC_URI = "git://github.com/${BPN}/${BPN}.git"
+SRC_URI = "git://github.com/${BPN}/${BPN}.git;branch=master;protocol=https"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/hwdata/hwdata_git.bb b/meta-oe/recipes-support/hwdata/hwdata_git.bb
index 5f3e3f686a..1d0c640003 100644
--- a/meta-oe/recipes-support/hwdata/hwdata_git.bb
+++ b/meta-oe/recipes-support/hwdata/hwdata_git.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=1556547711e8246992b999edd9445a57"
PV = "0.333"
SRCREV = "2de52be0d00015fa6cde70bb845fa9b86cf6f420"
-SRC_URI = "git://github.com/vcrhonek/${BPN}.git"
+SRC_URI = "git://github.com/vcrhonek/${BPN}.git;branch=master;protocol=https"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/iksemel/iksemel_1.5.bb b/meta-oe/recipes-support/iksemel/iksemel_1.5.bb
index 986984d1ff..ac23630d01 100644
--- a/meta-oe/recipes-support/iksemel/iksemel_1.5.bb
+++ b/meta-oe/recipes-support/iksemel/iksemel_1.5.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499"
SRCREV = "978b733462e41efd5db72bc9974cb3b0d1d5f6fa"
PV = "1.5+git${SRCPV}"
-SRC_URI = "git://github.com/meduketto/iksemel.git;protocol=https \
+SRC_URI = "git://github.com/meduketto/iksemel.git;protocol=https;branch=master \
file://fix-configure-option-parsing.patch \
file://avoid-obsolete-gnutls-apis.patch"
diff --git a/meta-oe/recipes-support/imagemagick/imagemagick_7.0.9.bb b/meta-oe/recipes-support/imagemagick/imagemagick_7.0.9.bb
index 3f7d06e261..21f51ff155 100644
--- a/meta-oe/recipes-support/imagemagick/imagemagick_7.0.9.bb
+++ b/meta-oe/recipes-support/imagemagick/imagemagick_7.0.9.bb
@@ -10,7 +10,7 @@ DEPENDS = "lcms bzip2 jpeg libpng tiff zlib fftw freetype libtool"
BASE_PV := "${PV}"
PV .= "_13"
-SRC_URI = "git://github.com/ImageMagick/ImageMagick.git "
+SRC_URI = "git://github.com/ImageMagick/ImageMagick.git;branch=main;protocol=https"
SRCREV = "15b935d64f613b5a0fc9d3fead5c6ec1b0e3908f"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/inih/libinih_git.bb b/meta-oe/recipes-support/inih/libinih_git.bb
index 227e2a7b7c..4c3c8f0fa7 100644
--- a/meta-oe/recipes-support/inih/libinih_git.bb
+++ b/meta-oe/recipes-support/inih/libinih_git.bb
@@ -9,7 +9,7 @@ PR = "r3"
# The github repository provides a cmake and pkg-config integration
SRCREV = "c858aff8c31fa63ef4d1e0176c10e5928cde9a23"
-SRC_URI = "git://github.com/OSSystems/inih.git \
+SRC_URI = "git://github.com/OSSystems/inih.git;branch=master;protocol=https \
"
UPSTREAM_CHECK_COMMITS = "1"
diff --git a/meta-oe/recipes-support/iniparser/iniparser_4.1.bb b/meta-oe/recipes-support/iniparser/iniparser_4.1.bb
index f4b553a578..f3593fb5ff 100644
--- a/meta-oe/recipes-support/iniparser/iniparser_4.1.bb
+++ b/meta-oe/recipes-support/iniparser/iniparser_4.1.bb
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=e02baf71c76e0650e667d7da133379ac"
DEPENDS = "doxygen-native"
-SRC_URI = "git://github.com/ndevilla/iniparser.git;protocol=https \
+SRC_URI = "git://github.com/ndevilla/iniparser.git;protocol=https;branch=master \
file://Add-CMake-support.patch"
# tag 4.1
diff --git a/meta-oe/recipes-support/inotify-tools/inotify-tools_git.bb b/meta-oe/recipes-support/inotify-tools/inotify-tools_git.bb
index f42abeb2ba..1d84bfd498 100644
--- a/meta-oe/recipes-support/inotify-tools/inotify-tools_git.bb
+++ b/meta-oe/recipes-support/inotify-tools/inotify-tools_git.bb
@@ -8,7 +8,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=ac6c26e52aea428ee7f56dc2c56424c6"
SRCREV = "cfa93aa19f81d85b63cd64da30c7499890d4c07d"
PV = "3.20.2.2"
-SRC_URI = "git://github.com/rvoicilas/${BPN} \
+SRC_URI = "git://github.com/rvoicilas/${BPN};branch=master;protocol=https \
file://0001-Makefile.am-add-build-rule-for-README.patch \
"
diff --git a/meta-oe/recipes-support/lcov/lcov_1.14.bb b/meta-oe/recipes-support/lcov/lcov_1.14.bb
index 0cc8b31b3f..5e8fb938cf 100755
--- a/meta-oe/recipes-support/lcov/lcov_1.14.bb
+++ b/meta-oe/recipes-support/lcov/lcov_1.14.bb
@@ -59,7 +59,7 @@ SRC_URI[md5sum] = "0220d01753469f83921f8f41ae5054c1"
SRC_URI[sha256sum] = "14995699187440e0ae4da57fe3a64adc0a3c5cf14feab971f8db38fb7d8f071a"
do_install() {
- oe_runmake install PREFIX=${D}${prefix} CFG_DIR=${D}${sysconfdir}
+ oe_runmake install PREFIX=${D}${prefix} CFG_DIR=${D}${sysconfdir} LCOV_PERL_PATH="/usr/bin/env perl"
}
BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-oe/recipes-support/libatasmart/libatasmart_0.19.bb b/meta-oe/recipes-support/libatasmart/libatasmart_0.19.bb
index 4cfb732932..d084a3b9b1 100644
--- a/meta-oe/recipes-support/libatasmart/libatasmart_0.19.bb
+++ b/meta-oe/recipes-support/libatasmart/libatasmart_0.19.bb
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1"
DEPENDS = "udev"
SRCREV = "de6258940960443038b4c1651dfda3620075e870"
-SRC_URI = "git://git.0pointer.de/libatasmart.git \
+SRC_URI = "git://git.0pointer.de/libatasmart.git;branch=master \
file://0001-Makefile.am-add-CFLAGS-and-LDFLAGS-definiton.patch \
"
diff --git a/meta-oe/recipes-support/libb64/libb64/0001-example-Do-not-run-the-tests.patch b/meta-oe/recipes-support/libb64/libb64/0001-example-Do-not-run-the-tests.patch
new file mode 100644
index 0000000000..ea3ddfb64b
--- /dev/null
+++ b/meta-oe/recipes-support/libb64/libb64/0001-example-Do-not-run-the-tests.patch
@@ -0,0 +1,27 @@
+From 68f66d1583be670eb8d5f3f38dbd5dd1d63b733c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 27 Mar 2021 21:41:04 -0700
+Subject: [PATCH] example: Do not run the tests
+
+Upstream-Status: Inappropritate [Cross-compile specific]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ examples/Makefile | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/examples/Makefile b/examples/Makefile
+index d9667a5..554b346 100644
+--- a/examples/Makefile
++++ b/examples/Makefile
+@@ -33,11 +33,8 @@ depend: $(SOURCES)
+ makedepend -f- $(CFLAGS) $(SOURCES) 2> /dev/null 1> depend
+
+ test-c-example1: c-example1
+- ./c-example1
+
+ test-c-example2: c-example2
+- ./c-example2 loremgibson.txt encoded.txt decoded.txt
+- diff -q loremgibson.txt decoded.txt
+
+ test: test-c-example1 test-c-example2
+
diff --git a/meta-oe/recipes-support/libb64/libb64/0002-use-BUFSIZ-as-buffer-size.patch b/meta-oe/recipes-support/libb64/libb64/0002-use-BUFSIZ-as-buffer-size.patch
new file mode 100644
index 0000000000..10ec8e14a8
--- /dev/null
+++ b/meta-oe/recipes-support/libb64/libb64/0002-use-BUFSIZ-as-buffer-size.patch
@@ -0,0 +1,57 @@
+From ee03e265804a07a0da5028b86960031bd7ab86b2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 27 Mar 2021 22:01:13 -0700
+Subject: [PATCH] use BUFSIZ as buffer size
+
+Author: Jakub Wilk <jwilk@debian.org>
+Bug: http://sourceforge.net/tracker/?func=detail&atid=785907&aid=3591336&group_id=152942
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ include/b64/decode.h | 3 ++-
+ include/b64/encode.h | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/include/b64/decode.h b/include/b64/decode.h
+index 12b16ea..e9019f3 100644
+--- a/include/b64/decode.h
++++ b/include/b64/decode.h
+@@ -8,6 +8,7 @@ For details, see http://sourceforge.net/projects/libb64
+ #ifndef BASE64_DECODE_H
+ #define BASE64_DECODE_H
+
++#include <cstdio>
+ #include <iostream>
+
+ namespace base64
+@@ -22,7 +23,7 @@ namespace base64
+ base64_decodestate _state;
+ int _buffersize;
+
+- decoder(int buffersize_in = BUFFERSIZE)
++ decoder(int buffersize_in = BUFSIZ)
+ : _buffersize(buffersize_in)
+ {}
+
+diff --git a/include/b64/encode.h b/include/b64/encode.h
+index 5d807d9..e7a7035 100644
+--- a/include/b64/encode.h
++++ b/include/b64/encode.h
+@@ -8,6 +8,7 @@ For details, see http://sourceforge.net/projects/libb64
+ #ifndef BASE64_ENCODE_H
+ #define BASE64_ENCODE_H
+
++#include <cstdio>
+ #include <iostream>
+
+ namespace base64
+@@ -22,7 +23,7 @@ namespace base64
+ base64_encodestate _state;
+ int _buffersize;
+
+- encoder(int buffersize_in = BUFFERSIZE)
++ encoder(int buffersize_in = BUFSIZ)
+ : _buffersize(buffersize_in)
+ {}
+
diff --git a/meta-oe/recipes-support/libb64/libb64/0003-fix-integer-overflows.patch b/meta-oe/recipes-support/libb64/libb64/0003-fix-integer-overflows.patch
new file mode 100644
index 0000000000..8854bb6af4
--- /dev/null
+++ b/meta-oe/recipes-support/libb64/libb64/0003-fix-integer-overflows.patch
@@ -0,0 +1,77 @@
+From 7b30fbc3d47dfaf38d8ce8b8949a69d2984dac76 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 27 Mar 2021 22:06:03 -0700
+Subject: [PATCH] fix integer overflows
+
+Author: Jakub Wilk <jwilk@debian.org>
+Bug: http://sourceforge.net/tracker/?func=detail&aid=3591129&group_id=152942&atid=785907
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/cdecode.c | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/src/cdecode.c b/src/cdecode.c
+index a6c0a42..4e47e9f 100644
+--- a/src/cdecode.c
++++ b/src/cdecode.c
+@@ -9,10 +9,11 @@ For details, see http://sourceforge.net/projects/libb64
+
+ int base64_decode_value(char value_in)
+ {
+- static const char decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51};
++ static const signed char decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51};
+ static const char decoding_size = sizeof(decoding);
++ if (value_in < 43) return -1;
+ value_in -= 43;
+- if (value_in < 0 || value_in >= decoding_size) return -1;
++ if (value_in > decoding_size) return -1;
+ return decoding[(int)value_in];
+ }
+
+@@ -26,7 +27,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex
+ {
+ const char* codechar = code_in;
+ char* plainchar = plaintext_out;
+- char fragment;
++ int fragment;
+
+ *plainchar = state_in->plainchar;
+
+@@ -42,7 +43,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex
+ state_in->plainchar = *plainchar;
+ return plainchar - plaintext_out;
+ }
+- fragment = (char)base64_decode_value(*codechar++);
++ fragment = base64_decode_value(*codechar++);
+ } while (fragment < 0);
+ *plainchar = (fragment & 0x03f) << 2;
+ case step_b:
+@@ -53,7 +54,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex
+ state_in->plainchar = *plainchar;
+ return plainchar - plaintext_out;
+ }
+- fragment = (char)base64_decode_value(*codechar++);
++ fragment = base64_decode_value(*codechar++);
+ } while (fragment < 0);
+ *plainchar++ |= (fragment & 0x030) >> 4;
+ *plainchar = (fragment & 0x00f) << 4;
+@@ -65,7 +66,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex
+ state_in->plainchar = *plainchar;
+ return plainchar - plaintext_out;
+ }
+- fragment = (char)base64_decode_value(*codechar++);
++ fragment = base64_decode_value(*codechar++);
+ } while (fragment < 0);
+ *plainchar++ |= (fragment & 0x03c) >> 2;
+ *plainchar = (fragment & 0x003) << 6;
+@@ -77,7 +78,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex
+ state_in->plainchar = *plainchar;
+ return plainchar - plaintext_out;
+ }
+- fragment = (char)base64_decode_value(*codechar++);
++ fragment = base64_decode_value(*codechar++);
+ } while (fragment < 0);
+ *plainchar++ |= (fragment & 0x03f);
+ }
diff --git a/meta-oe/recipes-support/libb64/libb64/0004-Fix-off-by-one-error.patch b/meta-oe/recipes-support/libb64/libb64/0004-Fix-off-by-one-error.patch
new file mode 100644
index 0000000000..e19dbad08d
--- /dev/null
+++ b/meta-oe/recipes-support/libb64/libb64/0004-Fix-off-by-one-error.patch
@@ -0,0 +1,26 @@
+From 8144fd9e02bd5ccd1e080297b19a1e9eb4d3ff96 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 27 Mar 2021 22:07:15 -0700
+Subject: [PATCH] Fix off by one error
+
+Launchpad bug #1501176 reported by William McCall on 2015-09-30
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/cdecode.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/cdecode.c b/src/cdecode.c
+index 4e47e9f..45da4e1 100644
+--- a/src/cdecode.c
++++ b/src/cdecode.c
+@@ -13,7 +13,7 @@ int base64_decode_value(char value_in)
+ static const char decoding_size = sizeof(decoding);
+ if (value_in < 43) return -1;
+ value_in -= 43;
+- if (value_in > decoding_size) return -1;
++ if (value_in >= decoding_size) return -1;
+ return decoding[(int)value_in];
+ }
+
diff --git a/meta-oe/recipes-support/libb64/libb64/0005-make-overriding-CFLAGS-possible.patch b/meta-oe/recipes-support/libb64/libb64/0005-make-overriding-CFLAGS-possible.patch
new file mode 100644
index 0000000000..e93015ee48
--- /dev/null
+++ b/meta-oe/recipes-support/libb64/libb64/0005-make-overriding-CFLAGS-possible.patch
@@ -0,0 +1,40 @@
+From a7914d5ffee6ffdfb3f2b8ebcc22c8367d078301 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 27 Mar 2021 22:08:43 -0700
+Subject: [PATCH] make overriding CFLAGS possible
+
+Author: Jakub Wilk <jwilk@debian.org>
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ base64/Makefile | 2 +-
+ src/Makefile | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/base64/Makefile b/base64/Makefile
+index 30a2c5c..783a248 100644
+--- a/base64/Makefile
++++ b/base64/Makefile
+@@ -3,7 +3,7 @@ BINARIES = base64
+ # Build flags (uncomment one)
+ #############################
+ # Release build flags
+-CFLAGS += -O3
++CFLAGS ?= -O3
+ #############################
+ # Debug build flags
+ #CFLAGS += -g
+diff --git a/src/Makefile b/src/Makefile
+index 28b2382..48801fc 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -3,7 +3,7 @@ LIBRARIES = libb64.a
+ # Build flags (uncomment one)
+ #############################
+ # Release build flags
+-CFLAGS += -O3
++CFLAGS ?= -O3
+ #############################
+ # Debug build flags
+ #CFLAGS += -g
diff --git a/meta-oe/recipes-support/libb64/libb64/0006-do-not-export-the-CHARS_PER_LINE-variable.patch b/meta-oe/recipes-support/libb64/libb64/0006-do-not-export-the-CHARS_PER_LINE-variable.patch
new file mode 100644
index 0000000000..9ba08c87ee
--- /dev/null
+++ b/meta-oe/recipes-support/libb64/libb64/0006-do-not-export-the-CHARS_PER_LINE-variable.patch
@@ -0,0 +1,27 @@
+From a1b9bb4af819ed389675f16e4a521efeda4cc3f3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 27 Mar 2021 22:10:48 -0700
+Subject: [PATCH] do not export the CHARS_PER_LINE variable
+
+The library exports a variable named "CHARS_PER_LINE". This is a generic name that could conflict with a name in user's code.
+Please either rename the variable or make it static.
+
+Upstream-Status: Submitted [http://sourceforge.net/tracker/?func=detail&aid=3591420&group_id=152942&atid=785907]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/cencode.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/cencode.c b/src/cencode.c
+index 03ba5b6..3df62a8 100644
+--- a/src/cencode.c
++++ b/src/cencode.c
+@@ -7,7 +7,7 @@ For details, see http://sourceforge.net/projects/libb64
+
+ #include <b64/cencode.h>
+
+-const int CHARS_PER_LINE = 72;
++static const int CHARS_PER_LINE = 72;
+
+ void base64_init_encodestate(base64_encodestate* state_in)
+ {
diff --git a/meta-oe/recipes-support/libb64/libb64/0007-initialize-encoder-decoder-state-in-the-constructors.patch b/meta-oe/recipes-support/libb64/libb64/0007-initialize-encoder-decoder-state-in-the-constructors.patch
new file mode 100644
index 0000000000..fdf8339bed
--- /dev/null
+++ b/meta-oe/recipes-support/libb64/libb64/0007-initialize-encoder-decoder-state-in-the-constructors.patch
@@ -0,0 +1,44 @@
+From c1ba44d83cc7d9d756cfb063717852eae9d03328 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 27 Mar 2021 22:12:41 -0700
+Subject: [PATCH] initialize encoder/decoder state in the constructors
+
+Author: Jakub Wilk <jwilk@debian.org>
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ include/b64/decode.h | 4 +++-
+ include/b64/encode.h | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/include/b64/decode.h b/include/b64/decode.h
+index e9019f3..aefb7bc 100644
+--- a/include/b64/decode.h
++++ b/include/b64/decode.h
+@@ -25,7 +25,9 @@ namespace base64
+
+ decoder(int buffersize_in = BUFSIZ)
+ : _buffersize(buffersize_in)
+- {}
++ {
++ base64_init_decodestate(&_state);
++ }
+
+ int decode(char value_in)
+ {
+diff --git a/include/b64/encode.h b/include/b64/encode.h
+index e7a7035..33848b3 100644
+--- a/include/b64/encode.h
++++ b/include/b64/encode.h
+@@ -25,7 +25,9 @@ namespace base64
+
+ encoder(int buffersize_in = BUFSIZ)
+ : _buffersize(buffersize_in)
+- {}
++ {
++ base64_init_encodestate(&_state);
++ }
+
+ int encode(char value_in)
+ {
diff --git a/meta-oe/recipes-support/libb64/libb64_1.2.1.bb b/meta-oe/recipes-support/libb64/libb64_1.2.1.bb
new file mode 100644
index 0000000000..64a34fece7
--- /dev/null
+++ b/meta-oe/recipes-support/libb64/libb64_1.2.1.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Base64 Encoding/Decoding Routines"
+DESCRIPTION = "base64 encoding/decoding library - runtime library \
+libb64 is a library of ANSI C routines for fast encoding/decoding data into \
+and from a base64-encoded format"
+HOMEPAGE = "http://libb64.sourceforge.net/"
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=ce551aad762074c7ab618a0e07a8dca3"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}/${BP}.zip \
+ file://0001-example-Do-not-run-the-tests.patch \
+ file://0002-use-BUFSIZ-as-buffer-size.patch \
+ file://0003-fix-integer-overflows.patch \
+ file://0004-Fix-off-by-one-error.patch \
+ file://0005-make-overriding-CFLAGS-possible.patch \
+ file://0006-do-not-export-the-CHARS_PER_LINE-variable.patch \
+ file://0007-initialize-encoder-decoder-state-in-the-constructors.patch \
+ "
+SRC_URI[sha256sum] = "20106f0ba95cfd9c35a13c71206643e3fb3e46512df3e2efb2fdbf87116314b2"
+
+PARALLEL_MAKE = ""
+
+CFLAGS += "-fPIC"
+
+do_configure () {
+ :
+}
+
+do_compile () {
+ oe_runmake
+ ${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,${BPN}.so.0 src/*.o -o src/${BPN}.so.0
+}
+
+do_install () {
+ install -d ${D}${includedir}/b64
+ install -Dm 0644 ${B}/src/libb64.a ${D}${libdir}/libb64.a
+ install -Dm 0644 ${B}/src/libb64.so.0 ${D}${libdir}/libb64.so.0
+ ln -s libb64.so.0 ${D}${libdir}/libb64.so
+ install -Dm 0644 ${S}/include/b64/*.h ${D}${includedir}/b64/
+}
diff --git a/meta-oe/recipes-support/libbytesize/libbytesize_2.2.bb b/meta-oe/recipes-support/libbytesize/libbytesize_2.2.bb
index a954499c69..527de93e40 100644
--- a/meta-oe/recipes-support/libbytesize/libbytesize_2.2.bb
+++ b/meta-oe/recipes-support/libbytesize/libbytesize_2.2.bb
@@ -10,7 +10,7 @@ S = "${WORKDIR}/git"
B = "${S}"
SRCREV = "e64e752a28a4a41b0a43cba3bedf9571c22af807"
-SRC_URI = "git://github.com/rhinstaller/libbytesize;branch=master"
+SRC_URI = "git://github.com/rhinstaller/libbytesize;branch=master;protocol=https"
inherit gettext autotools python3native
diff --git a/meta-oe/recipes-support/libcereal/libcereal_1.3.0.bb b/meta-oe/recipes-support/libcereal/libcereal_1.3.0.bb
index 6fc5881c59..ac6aedfd50 100644
--- a/meta-oe/recipes-support/libcereal/libcereal_1.3.0.bb
+++ b/meta-oe/recipes-support/libcereal/libcereal_1.3.0.bb
@@ -7,7 +7,7 @@ LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e612690af2f575dfd02e2e91443cea23"
SRCREV = "02eace19a99ce3cd564ca4e379753d69af08c2c8"
-SRC_URI = "git://github.com/USCiLab/cereal.git"
+SRC_URI = "git://github.com/USCiLab/cereal.git;branch=master;protocol=https"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/libcyusbserial/libcyusbserial_git.bb b/meta-oe/recipes-support/libcyusbserial/libcyusbserial_git.bb
index 74b5e21e23..c6878577ef 100644
--- a/meta-oe/recipes-support/libcyusbserial/libcyusbserial_git.bb
+++ b/meta-oe/recipes-support/libcyusbserial/libcyusbserial_git.bb
@@ -8,7 +8,7 @@ DEPENDS = "libusb udev"
PV = "1.0.0+git${SRCPV}"
SRCREV = "655e2d544183d094f0e2d119c7e0c6206a0ddb3f"
-SRC_URI = "git://github.com/cyrozap/${BPN}.git"
+SRC_URI = "git://github.com/cyrozap/${BPN}.git;branch=master;protocol=https"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/libfann/libfann_git.bb b/meta-oe/recipes-support/libfann/libfann_git.bb
index eae24461dc..5ab484d8a5 100644
--- a/meta-oe/recipes-support/libfann/libfann_git.bb
+++ b/meta-oe/recipes-support/libfann/libfann_git.bb
@@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.md;md5=f14599a2f089f6ff8c97e2baa4e3d575"
inherit cmake
SRCREV ?= "7ec1fc7e5bd734f1d3c89b095e630e83c86b9be1"
-SRC_URI = "git://github.com/libfann/fann.git;branch=master \
+SRC_URI = "git://github.com/libfann/fann.git;branch=master;protocol=https \
"
PV = "2.2.0+git${SRCPV}"
diff --git a/meta-oe/recipes-support/libgit2/libgit2_0.28.4.bb b/meta-oe/recipes-support/libgit2/libgit2_0.28.4.bb
index 9b9c191049..c971491b1c 100644
--- a/meta-oe/recipes-support/libgit2/libgit2_0.28.4.bb
+++ b/meta-oe/recipes-support/libgit2/libgit2_0.28.4.bb
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=3f2cd5d3cccd71d62066ba619614592b"
DEPENDS = "curl openssl zlib libssh2 libgcrypt"
-SRC_URI = "git://github.com/libgit2/libgit2.git;branch=maint/v0.28"
+SRC_URI = "git://github.com/libgit2/libgit2.git;branch=maint/v0.28;protocol=https"
SRCREV = "106a5f27586504ea371528191f0ea3aac2ad432b"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/libgusb/libgusb_git.bb b/meta-oe/recipes-support/libgusb/libgusb_git.bb
index e3c0bdd15e..a26c234652 100644
--- a/meta-oe/recipes-support/libgusb/libgusb_git.bb
+++ b/meta-oe/recipes-support/libgusb/libgusb_git.bb
@@ -6,7 +6,7 @@ DEPENDS = "glib-2.0 libusb"
inherit meson gobject-introspection gtk-doc gettext vala
-SRC_URI = "git://github.com/hughsie/libgusb.git"
+SRC_URI = "git://github.com/hughsie/libgusb.git;branch=master;protocol=https"
SRCREV = "636efc0624aa2a88174220fcabc9764c13d7febf"
PV = "0.3.0+git${SRCPV}"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/libharu/libharu_2.3.0.bb b/meta-oe/recipes-support/libharu/libharu_2.3.0.bb
index 2d1a37c421..86b5ba540f 100644
--- a/meta-oe/recipes-support/libharu/libharu_2.3.0.bb
+++ b/meta-oe/recipes-support/libharu/libharu_2.3.0.bb
@@ -6,7 +6,7 @@ DESCRIPTION = "libHaru is a library for generating PDF files. \
LICENSE = "Zlib"
LIC_FILES_CHKSUM = "file://README;md5=3ee6bc1f64d9cc7907f44840c8e50cb1"
-SRC_URI = "git://github.com/libharu/libharu.git;branch=2_3 \
+SRC_URI = "git://github.com/libharu/libharu.git;branch=2_3;protocol=https \
file://libharu-RELEASE_2_3_0_cmake.patch \
"
diff --git a/meta-oe/recipes-support/libiio/libiio_git.bb b/meta-oe/recipes-support/libiio/libiio_git.bb
index f83d9c9225..8fbe474485 100644
--- a/meta-oe/recipes-support/libiio/libiio_git.bb
+++ b/meta-oe/recipes-support/libiio/libiio_git.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING.txt;md5=7c13b3376cea0ce68d2d2da0a1b3a72c"
SRCREV = "5f5af2e417129ad8f4e05fc5c1b730f0694dca12"
PV = "0.19+git${SRCPV}"
-SRC_URI = "git://github.com/analogdevicesinc/libiio.git;protocol=https"
+SRC_URI = "git://github.com/analogdevicesinc/libiio.git;protocol=https;branch=main"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd/CVE-2021-3466.patch b/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd/CVE-2021-3466.patch
new file mode 100644
index 0000000000..ff792d4daa
--- /dev/null
+++ b/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd/CVE-2021-3466.patch
@@ -0,0 +1,158 @@
+From 86d9a61be6395220714b1a50d5144e65668961f6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ernst=20Sj=C3=B6strand?= <ernst.sjostrand@verisure.com>
+Date: Tue, 21 Dec 2021 11:05:22 +0000
+Subject: [PATCH] Fix buffer overflow in url parser and add test
+
+Reference:
+https://git.gnunet.org/libmicrohttpd.git/commit/?id=a110ae6276660bee3caab30e9ff3f12f85cf3241
+
+Upstream-Status: Backport
+CVE: CVE-2021-3466
+
+Signed-off-by: Ernst Sjöstrand <ernst.sjostrand@verisure.com>
+---
+ src/microhttpd/postprocessor.c | 18 ++++++--
+ src/microhttpd/test_postprocessor.c | 66 +++++++++++++++++++++++++++++
+ 2 files changed, 80 insertions(+), 4 deletions(-)
+
+diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c
+index b7f6b10..ebd1686 100644
+--- a/src/microhttpd/postprocessor.c
++++ b/src/microhttpd/postprocessor.c
+@@ -137,8 +137,7 @@ struct MHD_PostProcessor
+ void *cls;
+
+ /**
+- * Encoding as given by the headers of the
+- * connection.
++ * Encoding as given by the headers of the connection.
+ */
+ const char *encoding;
+
+@@ -586,7 +585,7 @@ post_process_urlencoded (struct MHD_PostProcessor *pp,
+ pp->state = PP_Error;
+ break;
+ case PP_Callback:
+- if ( (pp->buffer_pos + (end_key - start_key) >
++ if ( (pp->buffer_pos + (end_key - start_key) >=
+ pp->buffer_size) ||
+ (pp->buffer_pos + (end_key - start_key) <
+ pp->buffer_pos) )
+@@ -636,6 +635,11 @@ post_process_urlencoded (struct MHD_PostProcessor *pp,
+ {
+ if (NULL == end_key)
+ end_key = &post_data[poff];
++ if (pp->buffer_pos + (end_key - start_key) >= pp->buffer_size)
++ {
++ pp->state = PP_Error;
++ return MHD_NO;
++ }
+ memcpy (&kbuf[pp->buffer_pos],
+ start_key,
+ end_key - start_key);
+@@ -663,6 +667,11 @@ post_process_urlencoded (struct MHD_PostProcessor *pp,
+ last_escape);
+ pp->must_ikvi = false;
+ }
++ if (PP_Error == pp->state)
++ {
++ /* State in error, returning failure */
++ return MHD_NO;
++ }
+ return MHD_YES;
+ }
+
+@@ -1424,7 +1433,8 @@ MHD_destroy_post_processor (struct MHD_PostProcessor *pp)
+ the post-processing may have been interrupted
+ at any stage */
+ if ( (pp->xbuf_pos > 0) ||
+- (pp->state != PP_Done) )
++ ( (pp->state != PP_Done) &&
++ (pp->state != PP_Init) ) )
+ ret = MHD_NO;
+ else
+ ret = MHD_YES;
+diff --git a/src/microhttpd/test_postprocessor.c b/src/microhttpd/test_postprocessor.c
+index 2c37565..cba486d 100644
+--- a/src/microhttpd/test_postprocessor.c
++++ b/src/microhttpd/test_postprocessor.c
+@@ -451,6 +451,71 @@ test_empty_value (void)
+ }
+
+
++static enum MHD_Result
++value_checker2 (void *cls,
++ enum MHD_ValueKind kind,
++ const char *key,
++ const char *filename,
++ const char *content_type,
++ const char *transfer_encoding,
++ const char *data,
++ uint64_t off,
++ size_t size)
++{
++ return MHD_YES;
++}
++
++
++static int
++test_overflow ()
++{
++ struct MHD_Connection connection;
++ struct MHD_HTTP_Header header;
++ struct MHD_PostProcessor *pp;
++ size_t i;
++ size_t j;
++ size_t delta;
++ char *buf;
++
++ memset (&connection, 0, sizeof (struct MHD_Connection));
++ memset (&header, 0, sizeof (struct MHD_HTTP_Header));
++ connection.headers_received = &header;
++ header.header = MHD_HTTP_HEADER_CONTENT_TYPE;
++ header.value = MHD_HTTP_POST_ENCODING_FORM_URLENCODED;
++ header.header_size = strlen (header.header);
++ header.value_size = strlen (header.value);
++ header.kind = MHD_HEADER_KIND;
++ for (i = 128; i < 1024 * 1024; i += 1024)
++ {
++ pp = MHD_create_post_processor (&connection,
++ 1024,
++ &value_checker2,
++ NULL);
++ buf = malloc (i);
++ if (NULL == buf)
++ return 1;
++ memset (buf, 'A', i);
++ buf[i / 2] = '=';
++ delta = 1 + (MHD_random_ () % (i - 1));
++ j = 0;
++ while (j < i)
++ {
++ if (j + delta > i)
++ delta = i - j;
++ if (MHD_NO ==
++ MHD_post_process (pp,
++ &buf[j],
++ delta))
++ break;
++ j += delta;
++ }
++ free (buf);
++ MHD_destroy_post_processor (pp);
++ }
++ return 0;
++}
++
++
+ int
+ main (int argc, char *const *argv)
+ {
+@@ -463,6 +528,7 @@ main (int argc, char *const *argv)
+ errorCount += test_multipart ();
+ errorCount += test_nested_multipart ();
+ errorCount += test_empty_value ();
++ errorCount += test_overflow ();
+ if (errorCount != 0)
+ fprintf (stderr, "Error (code: %u)\n", errorCount);
+ return errorCount != 0; /* 0 == pass */
diff --git a/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.70.bb b/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.70.bb
index 94976d2e98..9d5e85e1ad 100644
--- a/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.70.bb
+++ b/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.70.bb
@@ -7,7 +7,8 @@ SECTION = "net"
DEPENDS = "file"
SRC_URI = "${GNU_MIRROR}/libmicrohttpd/${BPN}-${PV}.tar.gz \
-"
+ file://CVE-2021-3466.patch \
+ "
SRC_URI[md5sum] = "dcd6045ecb4ea18c120afedccbd1da74"
SRC_URI[sha256sum] = "90d0a3d396f96f9bc41eb0f7e8187796049285fabef82604acd4879590977307"
diff --git a/meta-oe/recipes-support/libmimetic/libmimetic_0.9.8.bb b/meta-oe/recipes-support/libmimetic/libmimetic_0.9.8.bb
index 590c4ebc28..fc0b1ee495 100644
--- a/meta-oe/recipes-support/libmimetic/libmimetic_0.9.8.bb
+++ b/meta-oe/recipes-support/libmimetic/libmimetic_0.9.8.bb
@@ -10,7 +10,7 @@ LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b49da7df0ca479ef01ff7f2d799eabee"
SRCREV = "50486af99b4f9b35522d7b3de40b6ce107505279"
-SRC_URI += "git://github.com/LadislavSopko/mimetic/ \
+SRC_URI += "git://github.com/LadislavSopko/mimetic/;branch=master;protocol=https \
file://0001-libmimetic-Removing-test-directory-from-the-Makefile.patch \
file://0001-mimetic-Check-for-MMAP_FAILED-return-from-mmap.patch \
"
diff --git a/meta-oe/recipes-support/libmxml/libmxml_3.1.bb b/meta-oe/recipes-support/libmxml/libmxml_3.1.bb
index 4e77d6cc02..fd3369d8df 100644
--- a/meta-oe/recipes-support/libmxml/libmxml_3.1.bb
+++ b/meta-oe/recipes-support/libmxml/libmxml_3.1.bb
@@ -4,7 +4,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
HOMEPAGE = "https://www.msweet.org/mxml/"
BUGTRACKER = "https://github.com/michaelrsweet/mxml/issues"
-SRC_URI = "git://github.com/michaelrsweet/mxml.git"
+SRC_URI = "git://github.com/michaelrsweet/mxml.git;branch=master;protocol=https"
SRCREV = "e483e5fd8a33386fd46967681521bdd2da2b548f"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/libp11/libp11_0.4.10.bb b/meta-oe/recipes-support/libp11/libp11_0.4.10.bb
index 7fe0640d94..142002a262 100644
--- a/meta-oe/recipes-support/libp11/libp11_0.4.10.bb
+++ b/meta-oe/recipes-support/libp11/libp11_0.4.10.bb
@@ -9,7 +9,7 @@ LICENSE = "LGPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=fad9b3332be894bab9bc501572864b29"
DEPENDS = "libtool openssl"
-SRC_URI = "git://github.com/OpenSC/libp11.git"
+SRC_URI = "git://github.com/OpenSC/libp11.git;branch=master;protocol=https"
SRCREV = "973d31f3f58d5549ddd8b1f822ce8f72186f9d68"
UPSTREAM_CHECK_GITTAGREGEX = "libp11-(?P<pver>\d+(\.\d+)+)"
diff --git a/meta-oe/recipes-support/librsync/librsync_2.3.1.bb b/meta-oe/recipes-support/librsync/librsync_2.3.1.bb
index 004c93d0f9..fddece8d1f 100644
--- a/meta-oe/recipes-support/librsync/librsync_2.3.1.bb
+++ b/meta-oe/recipes-support/librsync/librsync_2.3.1.bb
@@ -4,7 +4,7 @@ AUTHOR = "Martin Pool, Andrew Tridgell, Donovan Baarda, Adam Schubert"
LICENSE = "LGPLv2.1+"
LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499"
-SRC_URI = "git://github.com/librsync/librsync.git"
+SRC_URI = "git://github.com/librsync/librsync.git;branch=master;protocol=https"
SRCREV = "27f738650c20fef1285f11d85a34e5094a71c06f"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/libsoc/libsoc_0.8.2.bb b/meta-oe/recipes-support/libsoc/libsoc_0.8.2.bb
index 8b773aefa5..f6fc0e36b6 100644
--- a/meta-oe/recipes-support/libsoc/libsoc_0.8.2.bb
+++ b/meta-oe/recipes-support/libsoc/libsoc_0.8.2.bb
@@ -10,7 +10,7 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=e0bfebea12a718922225ba987b2126a5"
inherit autotools pkgconfig python3-dir
SRCREV = "fd1ad6e7823fa76d8db0d3c5884faffa8ffddafb"
-SRC_URI = "git://github.com/jackmitch/libsoc.git"
+SRC_URI = "git://github.com/jackmitch/libsoc.git;branch=master;protocol=https"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/libssh/files/CVE-2020-16135-1.patch b/meta-oe/recipes-support/libssh/files/CVE-2020-16135-1.patch
new file mode 100644
index 0000000000..2944a44622
--- /dev/null
+++ b/meta-oe/recipes-support/libssh/files/CVE-2020-16135-1.patch
@@ -0,0 +1,40 @@
+From 533d881b0f4b24c72b35ecc97fa35d295d063e53 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@cryptomilk.org>
+Date: Wed, 3 Jun 2020 10:04:09 +0200
+Subject: [PATCH] sftpserver: Add missing NULL check for ssh_buffer_new()
+
+Thanks to Ramin Farajpour Cami for spotting this.
+
+Fixes T232
+
+Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
+Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
+Reviewed-by: Jakub Jelen <jjelen@redhat.com>
+
+Upstream-Status: Backport [https://gitlab.com/libssh/libssh-mirror/-/commit/533d881b0f4b24c72b35ecc97fa35d295d063e53]
+CVE: CVE-2020-16135
+Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
+---
+ src/sftpserver.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/sftpserver.c b/src/sftpserver.c
+index 5a2110e58..b639a2ce3 100644
+--- a/src/sftpserver.c
++++ b/src/sftpserver.c
+@@ -67,6 +67,12 @@ sftp_client_message sftp_get_client_message(sftp_session sftp) {
+
+ /* take a copy of the whole packet */
+ msg->complete_message = ssh_buffer_new();
++ if (msg->complete_message == NULL) {
++ ssh_set_error_oom(session);
++ sftp_client_message_free(msg);
++ return NULL;
++ }
++
+ ssh_buffer_add_data(msg->complete_message,
+ ssh_buffer_get(payload),
+ ssh_buffer_get_len(payload));
+--
+GitLab
+
diff --git a/meta-oe/recipes-support/libssh/files/CVE-2020-16135-2.patch b/meta-oe/recipes-support/libssh/files/CVE-2020-16135-2.patch
new file mode 100644
index 0000000000..3c4ff0c614
--- /dev/null
+++ b/meta-oe/recipes-support/libssh/files/CVE-2020-16135-2.patch
@@ -0,0 +1,42 @@
+From 2782cb0495b7450bd8fe43ce4af886b66fea6c40 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@cryptomilk.org>
+Date: Wed, 3 Jun 2020 10:05:51 +0200
+Subject: [PATCH] sftpserver: Add missing return check for
+ ssh_buffer_add_data()
+
+Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
+Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
+Reviewed-by: Jakub Jelen <jjelen@redhat.com>
+
+Upstream-Status: Backport [https://gitlab.com/libssh/libssh-mirror/-/commit/2782cb0495b7450bd8fe43ce4af886b66fea6c40]
+CVE: CVE-2020-16135
+Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
+---
+ src/sftpserver.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/src/sftpserver.c b/src/sftpserver.c
+index b639a2ce3..9117f155f 100644
+--- a/src/sftpserver.c
++++ b/src/sftpserver.c
+@@ -73,9 +73,14 @@ sftp_client_message sftp_get_client_message(sftp_session sftp) {
+ return NULL;
+ }
+
+- ssh_buffer_add_data(msg->complete_message,
+- ssh_buffer_get(payload),
+- ssh_buffer_get_len(payload));
++ rc = ssh_buffer_add_data(msg->complete_message,
++ ssh_buffer_get(payload),
++ ssh_buffer_get_len(payload));
++ if (rc < 0) {
++ ssh_set_error_oom(session);
++ sftp_client_message_free(msg);
++ return NULL;
++ }
+
+ ssh_buffer_get_u32(payload, &msg->id);
+
+--
+GitLab
+
diff --git a/meta-oe/recipes-support/libssh/files/CVE-2020-16135-3.patch b/meta-oe/recipes-support/libssh/files/CVE-2020-16135-3.patch
new file mode 100644
index 0000000000..03a8ac156a
--- /dev/null
+++ b/meta-oe/recipes-support/libssh/files/CVE-2020-16135-3.patch
@@ -0,0 +1,70 @@
+From 10b3ebbe61a7031a3dae97f05834442220447181 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@cryptomilk.org>
+Date: Wed, 3 Jun 2020 10:10:11 +0200
+Subject: [PATCH] buffer: Reformat ssh_buffer_add_data()
+
+Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
+Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
+Reviewed-by: Jakub Jelen <jjelen@redhat.com>
+
+Upstream-Status: Backport [https://gitlab.com/libssh/libssh-mirror/-/commit/10b3ebbe61a7031a3dae97f05834442220447181]
+CVE: CVE-2020-16135
+Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
+---
+ src/buffer.c | 35 ++++++++++++++++++-----------------
+ 1 file changed, 18 insertions(+), 17 deletions(-)
+
+diff --git a/src/buffer.c b/src/buffer.c
+index a2e6246af..476bc1358 100644
+--- a/src/buffer.c
++++ b/src/buffer.c
+@@ -299,28 +299,29 @@ int ssh_buffer_reinit(struct ssh_buffer_struct *buffer)
+ */
+ int ssh_buffer_add_data(struct ssh_buffer_struct *buffer, const void *data, uint32_t len)
+ {
+- buffer_verify(buffer);
++ buffer_verify(buffer);
+
+- if (data == NULL) {
+- return -1;
+- }
++ if (data == NULL) {
++ return -1;
++ }
+
+- if (buffer->used + len < len) {
+- return -1;
+- }
++ if (buffer->used + len < len) {
++ return -1;
++ }
+
+- if (buffer->allocated < (buffer->used + len)) {
+- if(buffer->pos > 0)
+- buffer_shift(buffer);
+- if (realloc_buffer(buffer, buffer->used + len) < 0) {
+- return -1;
++ if (buffer->allocated < (buffer->used + len)) {
++ if (buffer->pos > 0) {
++ buffer_shift(buffer);
++ }
++ if (realloc_buffer(buffer, buffer->used + len) < 0) {
++ return -1;
++ }
+ }
+- }
+
+- memcpy(buffer->data+buffer->used, data, len);
+- buffer->used+=len;
+- buffer_verify(buffer);
+- return 0;
++ memcpy(buffer->data + buffer->used, data, len);
++ buffer->used += len;
++ buffer_verify(buffer);
++ return 0;
+ }
+
+ /**
+--
+GitLab
+
diff --git a/meta-oe/recipes-support/libssh/files/CVE-2020-16135-4.patch b/meta-oe/recipes-support/libssh/files/CVE-2020-16135-4.patch
new file mode 100644
index 0000000000..8e9a4c3f5c
--- /dev/null
+++ b/meta-oe/recipes-support/libssh/files/CVE-2020-16135-4.patch
@@ -0,0 +1,34 @@
+From 245ad744b5ab0582fef7cf3905a717b791d7e08b Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@cryptomilk.org>
+Date: Wed, 3 Jun 2020 10:11:21 +0200
+Subject: [PATCH] buffer: Add NULL check for 'buffer' argument
+
+Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
+Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
+Reviewed-by: Jakub Jelen <jjelen@redhat.com>
+
+Upstream-Status: Backport [https://gitlab.com/libssh/libssh-mirror/-/commit/245ad744b5ab0582fef7cf3905a717b791d7e08b]
+CVE: CVE-2020-16135
+Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
+---
+ src/buffer.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/buffer.c b/src/buffer.c
+index 476bc1358..ce12f491a 100644
+--- a/src/buffer.c
++++ b/src/buffer.c
+@@ -299,6 +299,10 @@ int ssh_buffer_reinit(struct ssh_buffer_struct *buffer)
+ */
+ int ssh_buffer_add_data(struct ssh_buffer_struct *buffer, const void *data, uint32_t len)
+ {
++ if (buffer == NULL) {
++ return -1;
++ }
++
+ buffer_verify(buffer);
+
+ if (data == NULL) {
+--
+GitLab
+
diff --git a/meta-oe/recipes-support/libssh/libssh_0.8.9.bb b/meta-oe/recipes-support/libssh/libssh_0.8.9.bb
index 39ed8a8fbb..0fb07a0eb7 100644
--- a/meta-oe/recipes-support/libssh/libssh_0.8.9.bb
+++ b/meta-oe/recipes-support/libssh/libssh_0.8.9.bb
@@ -6,7 +6,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=dabb4958b830e5df11d2b0ed8ea255a0"
DEPENDS = "zlib openssl libgcrypt"
-SRC_URI = "git://git.libssh.org/projects/libssh.git;branch=stable-0.8"
+SRC_URI = "git://git.libssh.org/projects/libssh.git;branch=stable-0.8 \
+ file://CVE-2020-16135-1.patch \
+ file://CVE-2020-16135-2.patch \
+ file://CVE-2020-16135-3.patch \
+ file://CVE-2020-16135-4.patch \
+ "
+
SRCREV = "04685a74df9ce1db1bc116a83a0da78b4f4fa1f8"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/libssh2/files/CVE-2020-22218.patch b/meta-oe/recipes-support/libssh2/files/CVE-2020-22218.patch
new file mode 100644
index 0000000000..49dbde737f
--- /dev/null
+++ b/meta-oe/recipes-support/libssh2/files/CVE-2020-22218.patch
@@ -0,0 +1,39 @@
+From 642eec48ff3adfdb7a9e562b6d7fc865d1733f45 Mon Sep 17 00:00:00 2001
+From: lutianxiong <lutianxiong@huawei.com>
+Date: Fri, 29 May 2020 01:25:40 +0800
+Subject: [PATCH] transport.c: fix use-of-uninitialized-value (#476)
+
+file:transport.c
+
+notes:
+return error if malloc(0)
+
+credit:
+lutianxiong
+
+Bug: https://github.com/libssh2/libssh2/pull/476
+Upstream-Status: Backport [https://github.com/libssh2/libssh2/commit/642eec48ff3adfdb7a9e562b6d7fc865d1733f45
+&
+https://github.com/libssh2/libssh2/commit/0b44e558f311671f6e6d14c559bc1c9bda59b8df]
+CVE: CVE-2020-22218
+Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
+---
+ src/transport.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/transport.c b/src/transport.c
+index 45e445c..35e7df3 100644
+--- a/src/transport.c
++++ b/src/transport.c
+@@ -465,7 +465,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
+ * or less (including length, padding length, payload,
+ * padding, and MAC.)."
+ */
+- if(total_num > LIBSSH2_PACKET_MAXPAYLOAD) {
++ if(total_num > LIBSSH2_PACKET_MAXPAYLOAD || total_num == 0) {
+ return LIBSSH2_ERROR_OUT_OF_BOUNDARY;
+ }
+
+--
+2.25.1
+
diff --git a/meta-oe/recipes-support/libssh2/libssh2_1.9.0.bb b/meta-oe/recipes-support/libssh2/libssh2_1.9.0.bb
index c1f337a440..e11e663769 100644
--- a/meta-oe/recipes-support/libssh2/libssh2_1.9.0.bb
+++ b/meta-oe/recipes-support/libssh2/libssh2_1.9.0.bb
@@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=c5cf34fc0acb44b082ef50ef5e4354ca"
SRC_URI = "http://www.libssh2.org/download/${BP}.tar.gz \
file://CVE-2019-17498.patch \
+ file://CVE-2020-22218.patch \
"
SRC_URI[md5sum] = "1beefafe8963982adc84b408b2959927"
SRC_URI[sha256sum] = "d5fb8bd563305fd1074dda90bd053fb2d29fc4bce048d182f96eaa466dfadafd"
diff --git a/meta-oe/recipes-support/libteam/libteam_1.30.bb b/meta-oe/recipes-support/libteam/libteam_1.30.bb
index 9cd02b0c09..d04660ca10 100644
--- a/meta-oe/recipes-support/libteam/libteam_1.30.bb
+++ b/meta-oe/recipes-support/libteam/libteam_1.30.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
DEPENDS = "libnl libdaemon jansson"
-SRC_URI = "git://github.com/jpirko/libteam \
+SRC_URI = "git://github.com/jpirko/libteam;branch=master;protocol=https \
file://0001-include-sys-select.h-for-fd_set-definition.patch \
file://0002-teamd-Re-adjust-include-header-order.patch \
file://0001-team_basic_test.py-disable-RedHat-specific-test.patch \
diff --git a/meta-oe/recipes-support/libtinyxml2/libtinyxml2_8.0.0.bb b/meta-oe/recipes-support/libtinyxml2/libtinyxml2_8.0.0.bb
index a2491cf9e6..2a33284b8a 100644
--- a/meta-oe/recipes-support/libtinyxml2/libtinyxml2_8.0.0.bb
+++ b/meta-oe/recipes-support/libtinyxml2/libtinyxml2_8.0.0.bb
@@ -4,7 +4,7 @@ SECTION = "libs"
LICENSE = "Zlib"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=135624eef03e1f1101b9ba9ac9b5fffd"
-SRC_URI = "git://github.com/leethomason/tinyxml2.git"
+SRC_URI = "git://github.com/leethomason/tinyxml2.git;branch=master;protocol=https"
SRCREV = "bf15233ad88390461f6ab0dbcf046cce643c5fcb"
diff --git a/meta-oe/recipes-support/libusbg/libusbg_git.bb b/meta-oe/recipes-support/libusbg/libusbg_git.bb
index 97d60a6a8a..6edac56fef 100644
--- a/meta-oe/recipes-support/libusbg/libusbg_git.bb
+++ b/meta-oe/recipes-support/libusbg/libusbg_git.bb
@@ -8,7 +8,7 @@ inherit autotools
PV = "0.1.0"
SRCREV = "a826d136e0e8fa53815f1ba05893e6dd74208c15"
-SRC_URI = "git://github.com/libusbg/libusbg.git \
+SRC_URI = "git://github.com/libusbg/libusbg.git;branch=master;protocol=https \
file://0001-Fix-out-of-tree-builds.patch \
"
diff --git a/meta-oe/recipes-support/libusbgx/libusbgx_git.bb b/meta-oe/recipes-support/libusbgx/libusbgx_git.bb
index d73ca61060..b88941d6e3 100644
--- a/meta-oe/recipes-support/libusbgx/libusbgx_git.bb
+++ b/meta-oe/recipes-support/libusbgx/libusbgx_git.bb
@@ -11,7 +11,7 @@ PV = "0.2.0+git${SRCPV}"
SRCREV = "45c14ef4d5d7ced0fbf984208de44ced6d5ed898"
SRCBRANCH = "master"
SRC_URI = " \
- git://github.com/libusbgx/libusbgx.git;branch=${SRCBRANCH} \
+ git://github.com/libusbgx/libusbgx.git;branch=${SRCBRANCH};protocol=https \
file://gadget-start \
file://usbgx.initd \
file://usbgx.service \
diff --git a/meta-oe/recipes-support/libutempter/libutempter.bb b/meta-oe/recipes-support/libutempter/libutempter.bb
index b8a700b7b7..d259f166d1 100644
--- a/meta-oe/recipes-support/libutempter/libutempter.bb
+++ b/meta-oe/recipes-support/libutempter/libutempter.bb
@@ -10,7 +10,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
SRCREV = "3ef74fff310f09e2601e241b9f042cd39d591018"
PV = "1.1.6-alt2+git${SRCPV}"
-SRC_URI = "git://git.altlinux.org/people/ldv/packages/libutempter.git \
+SRC_URI = "git://git.altlinux.org/people/ldv/packages/libutempter.git;branch=master \
file://0001-Fix-macro-error.patch \
file://0002-Proper-macro-path-generation.patch \
file://libutempter-remove-glibc-assumption.patch \
diff --git a/meta-oe/recipes-support/lio-utils/lio-utils_4.1.bb b/meta-oe/recipes-support/lio-utils/lio-utils_4.1.bb
index 0fb4a6e516..aab81461a4 100644
--- a/meta-oe/recipes-support/lio-utils/lio-utils_4.1.bb
+++ b/meta-oe/recipes-support/lio-utils/lio-utils_4.1.bb
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://debian/copyright;md5=c3ea231a32635cbb5debedf3e88aa3df
PV = "4.1+git${SRCPV}"
-SRC_URI = "git://github.com/Datera/lio-utils.git \
+SRC_URI = "git://github.com/Datera/lio-utils.git;branch=master;protocol=https \
file://0001-Makefiles-Respect-environment-variables-and-add-LDFL.patch \
"
SRCREV = "0ac9091c1ff7a52d5435a4f4449e82637142e06e"
diff --git a/meta-oe/recipes-support/lvm2/lvm2.inc b/meta-oe/recipes-support/lvm2/lvm2.inc
index 2fe97d5713..d0fb33d118 100644
--- a/meta-oe/recipes-support/lvm2/lvm2.inc
+++ b/meta-oe/recipes-support/lvm2/lvm2.inc
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=12713b4d9386533feeb07d6e4831765a \
DEPENDS += "libaio"
-SRC_URI = "git://sourceware.org/git/lvm2.git \
+SRC_URI = "git://sourceware.org/git/lvm2.git;branch=master \
file://lvm.conf \
file://0001-implement-libc-specific-reopen_stream.patch \
file://0002-Guard-use-of-mallinfo-with-__GLIBC__.patch \
diff --git a/meta-oe/recipes-support/mcelog/mce-inject_git.bb b/meta-oe/recipes-support/mcelog/mce-inject_git.bb
index cc33cbaf28..8241bd2342 100644
--- a/meta-oe/recipes-support/mcelog/mce-inject_git.bb
+++ b/meta-oe/recipes-support/mcelog/mce-inject_git.bb
@@ -4,7 +4,7 @@ software level into a running Linux kernel. This is intended for \
validation of the kernel machine check handler."
SECTION = "System Environment/Base"
-SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git"
+SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git;branch=master"
SRCREV = "4cbe46321b4a81365ff3aafafe63967264dbfec5"
diff --git a/meta-oe/recipes-support/mcelog/mce-test_git.bb b/meta-oe/recipes-support/mcelog/mce-test_git.bb
index 35fb944702..f245515216 100644
--- a/meta-oe/recipes-support/mcelog/mce-test_git.bb
+++ b/meta-oe/recipes-support/mcelog/mce-test_git.bb
@@ -10,7 +10,7 @@ containment and recovery, ACPI/APEI support etc."
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
-SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mce-test.git;protocol=git \
+SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mce-test.git;protocol=git;branch=master \
file://makefile-remove-ldflags.patch \
file://0001-gcov_merge.py-scov_merge.py-switch-to-python3.patch \
"
diff --git a/meta-oe/recipes-support/mcelog/mcelog_168.bb b/meta-oe/recipes-support/mcelog/mcelog_168.bb
index e2ef6ea589..c464132176 100644
--- a/meta-oe/recipes-support/mcelog/mcelog_168.bb
+++ b/meta-oe/recipes-support/mcelog/mcelog_168.bb
@@ -5,7 +5,7 @@ and should run on all Linux systems that need error handling."
HOMEPAGE = "http://mcelog.org/"
SECTION = "System Environment/Base"
-SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git;protocol=http; \
+SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git;protocol=http;branch=master \
file://run-ptest \
"
diff --git a/meta-oe/recipes-support/multipath-tools/files/CVE-2022-41973.patch b/meta-oe/recipes-support/multipath-tools/files/CVE-2022-41973.patch
new file mode 100644
index 0000000000..d06ef44f68
--- /dev/null
+++ b/meta-oe/recipes-support/multipath-tools/files/CVE-2022-41973.patch
@@ -0,0 +1,154 @@
+From cb57b930fa690ab79b3904846634681685e3470f Mon Sep 17 00:00:00 2001
+From: Martin Wilck <mwilck@suse.com>
+Date: Thu, 1 Sep 2022 19:21:30 +0200
+Subject: [PATCH] multipath-tools: use /run instead of /dev/shm
+
+/dev/shm may have unsafe permissions. Use /run instead.
+Use systemd's tmpfiles.d mechanism to create /run/multipath
+early during boot.
+
+For backward compatibilty, make the runtime directory configurable
+via the "runtimedir" make variable.
+
+Signed-off-by: Martin Wilck <mwilck@suse.com>
+Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
+
+CVE: CVE-2022-41973
+Upstream-Status: Backport [https://github.com/opensvc/multipath-tools/commit/cb57b930fa690ab79b3904846634681685e3470f]
+Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
+---
+ .gitignore | 2 ++
+ Makefile.inc | 7 ++++++-
+ libmultipath/defaults.h | 3 +--
+ multipath/Makefile | 11 ++++++++---
+ multipath/{multipath.rules => multipath.rules.in} | 4 ++--
+ multipath/tmpfiles.conf.in | 1 +
+ 6 files changed, 20 insertions(+), 8 deletions(-)
+ rename multipath/{multipath.rules => multipath.rules.in} (95%)
+ create mode 100644 multipath/tmpfiles.conf.in
+
+diff --git a/.gitignore b/.gitignore
+index 9926756b..f90b0350 100644
+--- a/.gitignore
++++ b/.gitignore
+@@ -8,6 +8,8 @@
+ *.d
+ kpartx/kpartx
+ multipath/multipath
++multipath/multipath.rules
++multipath/tmpfiles.conf
+ multipathd/multipathd
+ mpathpersist/mpathpersist
+ .nfs*
+diff --git a/Makefile.inc b/Makefile.inc
+index 4eb08eed..648f91b4 100644
+--- a/Makefile.inc
++++ b/Makefile.inc
+@@ -44,6 +44,7 @@ exec_prefix = $(prefix)
+ usr_prefix = $(prefix)
+ bindir = $(exec_prefix)/usr/sbin
+ libudevdir = $(prefix)/$(SYSTEMDPATH)/udev
++tmpfilesdir = $(prefix)/$(SYSTEMDPATH)/tmpfiles.d
+ udevrulesdir = $(libudevdir)/rules.d
+ multipathdir = $(TOPDIR)/libmultipath
+ man8dir = $(prefix)/usr/share/man/man8
+@@ -60,6 +61,7 @@ libdmmpdir = $(TOPDIR)/libdmmp
+ nvmedir = $(TOPDIR)/libmultipath/nvme
+ includedir = $(prefix)/usr/include
+ pkgconfdir = $(usrlibdir)/pkgconfig
++runtimedir := /$(RUN)
+
+ GZIP = gzip -9 -c
+ RM = rm -f
+@@ -95,7 +97,10 @@ OPTFLAGS += -Wextra -Wstrict-prototypes -Wformat=2 -Werror=implicit-int \
+ -Wno-unused-parameter -Werror=cast-qual \
+ -Werror=discarded-qualifiers
+
+-CPPFLAGS := -Wp,-D_FORTIFY_SOURCE=2
++CPPFLAGS := $(FORTIFY_OPT) \
++ -DBIN_DIR=\"$(bindir)\" -DMULTIPATH_DIR=\"$(plugindir)\" -DRUN_DIR=\"${RUN}\" \
++ -DRUNTIME_DIR=\"$(runtimedir)\" \
++ -DCONFIG_DIR=\"$(configdir)\" -DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP
+ CFLAGS := $(OPTFLAGS) -DBIN_DIR=\"$(bindir)\" -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\" \
+ -MMD -MP $(CFLAGS)
+ BIN_CFLAGS = -fPIE -DPIE
+diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
+index c2164c16..908e0ca3 100644
+--- a/libmultipath/defaults.h
++++ b/libmultipath/defaults.h
+@@ -64,8 +64,7 @@
+ #define DEFAULT_WWIDS_FILE "/etc/multipath/wwids"
+ #define DEFAULT_PRKEYS_FILE "/etc/multipath/prkeys"
+ #define DEFAULT_CONFIG_DIR "/etc/multipath/conf.d"
+-#define MULTIPATH_SHM_BASE "/dev/shm/multipath/"
+-
++#define MULTIPATH_SHM_BASE RUNTIME_DIR "/multipath/"
+
+ static inline char *set_default(char *str)
+ {
+diff --git a/multipath/Makefile b/multipath/Makefile
+index e720c7f6..28976546 100644
+--- a/multipath/Makefile
++++ b/multipath/Makefile
+@@ -12,7 +12,7 @@ EXEC = multipath
+
+ OBJS = main.o
+
+-all: $(EXEC)
++all: $(EXEC) multipath.rules tmpfiles.conf
+
+ $(EXEC): $(OBJS) $(multipathdir)/libmultipath.so $(mpathcmddir)/libmpathcmd.so
+ $(CC) $(CFLAGS) $(OBJS) -o $(EXEC) $(LDFLAGS) $(LIBDEPS)
+@@ -26,7 +26,9 @@ install:
+ $(INSTALL_PROGRAM) -m 755 mpathconf $(DESTDIR)$(bindir)/
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(udevrulesdir)
+ $(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)$(udevrulesdir)
+- $(INSTALL_PROGRAM) -m 644 $(EXEC).rules $(DESTDIR)$(libudevdir)/rules.d/62-multipath.rules
++ $(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)$(udevrulesdir)/56-multipath.rules
++ $(INSTALL_PROGRAM) -d $(DESTDIR)$(tmpfilesdir)
++ $(INSTALL_PROGRAM) -m 644 tmpfiles.conf $(DESTDIR)$(tmpfilesdir)/multipath.conf
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(man8dir)
+ $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(man8dir)
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir)
+@@ -43,9 +45,12 @@ uninstall:
+ $(RM) $(DESTDIR)$(man8dir)/mpathconf.8.gz
+
+ clean: dep_clean
+- $(RM) core *.o $(EXEC) *.gz
++ $(RM) core *.o $(EXEC) multipath.rules tmpfiles.conf
+
+ include $(wildcard $(OBJS:.o=.d))
+
+ dep_clean:
+ $(RM) $(OBJS:.o=.d)
++
++%: %.in
++ sed 's,@RUNTIME_DIR@,$(runtimedir),' $< >$@
+diff --git a/multipath/multipath.rules b/multipath/multipath.rules.in
+similarity index 95%
+rename from multipath/multipath.rules
+rename to multipath/multipath.rules.in
+index 0486bf70..5fb499e6 100644
+--- a/multipath/multipath.rules
++++ b/multipath/multipath.rules.in
+@@ -1,8 +1,8 @@
+ # Set DM_MULTIPATH_DEVICE_PATH if the device should be handled by multipath
+ SUBSYSTEM!="block", GOTO="end_mpath"
+ KERNEL!="sd*|dasd*|nvme*", GOTO="end_mpath"
+-ACTION=="remove", TEST=="/dev/shm/multipath/find_multipaths/$major:$minor", \
+- RUN+="/usr/bin/rm -f /dev/shm/multipath/find_multipaths/$major:$minor"
++ACTION=="remove", TEST=="@RUNTIME_DIR@/multipath/find_multipaths/$major:$minor", \
++ RUN+="/usr/bin/rm -f @RUNTIME_DIR@/multipath/find_multipaths/$major:$minor"
+ ACTION!="add|change", GOTO="end_mpath"
+
+ IMPORT{cmdline}="nompath"
+diff --git a/multipath/tmpfiles.conf.in b/multipath/tmpfiles.conf.in
+new file mode 100644
+index 00000000..21be438a
+--- /dev/null
++++ b/multipath/tmpfiles.conf.in
+@@ -0,0 +1 @@
++d @RUNTIME_DIR@/multipath 0700 root root -
+--
+2.25.1
+
diff --git a/meta-oe/recipes-support/multipath-tools/files/CVE-2022-41974.patch b/meta-oe/recipes-support/multipath-tools/files/CVE-2022-41974.patch
new file mode 100644
index 0000000000..dcc2cd49ef
--- /dev/null
+++ b/meta-oe/recipes-support/multipath-tools/files/CVE-2022-41974.patch
@@ -0,0 +1,162 @@
+From 0168696f95b5c610c3861ced8ef98accd1a83b91 Mon Sep 17 00:00:00 2001
+From: Benjamin Marzinski <bmarzins@redhat.com>
+Date: Tue, 27 Sep 2022 12:36:37 +0200
+Subject: [PATCH] multipathd: ignore duplicated multipathd command keys
+
+multipath adds rather than or-s the values of command keys. Fix this.
+Also, return an invalid fingerprint if a key is used more than once.
+
+References:
+https://nvd.nist.gov/vuln/detail/CVE-2022-41974
+https://github.com/opensvc/multipath-tools/issues/59
+
+Upstream-Status: Backport [https://github.com/openSUSE/multipath-tools/commit/fbbf280a0e26026c19879d938ebb2a8200b6357c]
+CVE: CVE-2022-41974
+
+Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
+Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
+---
+ multipathd/cli.c | 8 ++--
+ multipathd/main.c | 104 +++++++++++++++++++++++-----------------------
+ 2 files changed, 57 insertions(+), 55 deletions(-)
+
+diff --git a/multipathd/cli.c b/multipathd/cli.c
+index 800c0fbe..0a266761 100644
+--- a/multipathd/cli.c
++++ b/multipathd/cli.c
+@@ -336,9 +336,11 @@ fingerprint(vector vec)
+ if (!vec)
+ return 0;
+
+- vector_foreach_slot(vec, kw, i)
+- fp += kw->code;
+-
++ vector_foreach_slot(vec, kw, i) {
++ if (fp & kw->code)
++ return (uint64_t)-1;
++ fp |= kw->code;
++ }
+ return fp;
+ }
+
+diff --git a/multipathd/main.c b/multipathd/main.c
+index 8baf9abe..975287d2 100644
+--- a/multipathd/main.c
++++ b/multipathd/main.c
+@@ -1522,61 +1522,61 @@ uxlsnrloop (void * ap)
+ /* Tell main thread that thread has started */
+ post_config_state(DAEMON_CONFIGURE);
+
+- set_handler_callback(LIST+PATHS, cli_list_paths);
+- set_handler_callback(LIST+PATHS+FMT, cli_list_paths_fmt);
+- set_handler_callback(LIST+PATHS+RAW+FMT, cli_list_paths_raw);
+- set_handler_callback(LIST+PATH, cli_list_path);
+- set_handler_callback(LIST+MAPS, cli_list_maps);
+- set_handler_callback(LIST+STATUS, cli_list_status);
+- set_unlocked_handler_callback(LIST+DAEMON, cli_list_daemon);
+- set_handler_callback(LIST+MAPS+STATUS, cli_list_maps_status);
+- set_handler_callback(LIST+MAPS+STATS, cli_list_maps_stats);
+- set_handler_callback(LIST+MAPS+FMT, cli_list_maps_fmt);
+- set_handler_callback(LIST+MAPS+RAW+FMT, cli_list_maps_raw);
+- set_handler_callback(LIST+MAPS+TOPOLOGY, cli_list_maps_topology);
+- set_handler_callback(LIST+TOPOLOGY, cli_list_maps_topology);
+- set_handler_callback(LIST+MAPS+JSON, cli_list_maps_json);
+- set_handler_callback(LIST+MAP+TOPOLOGY, cli_list_map_topology);
+- set_handler_callback(LIST+MAP+FMT, cli_list_map_fmt);
+- set_handler_callback(LIST+MAP+RAW+FMT, cli_list_map_fmt);
+- set_handler_callback(LIST+MAP+JSON, cli_list_map_json);
+- set_handler_callback(LIST+CONFIG+LOCAL, cli_list_config_local);
+- set_handler_callback(LIST+CONFIG, cli_list_config);
+- set_handler_callback(LIST+BLACKLIST, cli_list_blacklist);
+- set_handler_callback(LIST+DEVICES, cli_list_devices);
+- set_handler_callback(LIST+WILDCARDS, cli_list_wildcards);
+- set_handler_callback(RESET+MAPS+STATS, cli_reset_maps_stats);
+- set_handler_callback(RESET+MAP+STATS, cli_reset_map_stats);
+- set_handler_callback(ADD+PATH, cli_add_path);
+- set_handler_callback(DEL+PATH, cli_del_path);
+- set_handler_callback(ADD+MAP, cli_add_map);
+- set_handler_callback(DEL+MAP, cli_del_map);
+- set_handler_callback(SWITCH+MAP+GROUP, cli_switch_group);
++ set_handler_callback(LIST|PATHS, cli_list_paths);
++ set_handler_callback(LIST|PATHS|FMT, cli_list_paths_fmt);
++ set_handler_callback(LIST|PATHS|RAW|FMT, cli_list_paths_raw);
++ set_handler_callback(LIST|PATH, cli_list_path);
++ set_handler_callback(LIST|MAPS, cli_list_maps);
++ set_handler_callback(LIST|STATUS, cli_list_status);
++ set_unlocked_handler_callback(LIST|DAEMON, cli_list_daemon);
++ set_handler_callback(LIST|MAPS|STATUS, cli_list_maps_status);
++ set_handler_callback(LIST|MAPS|STATS, cli_list_maps_stats);
++ set_handler_callback(LIST|MAPS|FMT, cli_list_maps_fmt);
++ set_handler_callback(LIST|MAPS|RAW|FMT, cli_list_maps_raw);
++ set_handler_callback(LIST|MAPS|TOPOLOGY, cli_list_maps_topology);
++ set_handler_callback(LIST|TOPOLOGY, cli_list_maps_topology);
++ set_handler_callback(LIST|MAPS|JSON, cli_list_maps_json);
++ set_handler_callback(LIST|MAP|TOPOLOGY, cli_list_map_topology);
++ set_handler_callback(LIST|MAP|FMT, cli_list_map_fmt);
++ set_handler_callback(LIST|MAP|RAW|FMT, cli_list_map_fmt);
++ set_handler_callback(LIST|MAP|JSON, cli_list_map_json);
++ set_handler_callback(LIST|CONFIG|LOCAL, cli_list_config_local);
++ set_handler_callback(LIST|CONFIG, cli_list_config);
++ set_handler_callback(LIST|BLACKLIST, cli_list_blacklist);
++ set_handler_callback(LIST|DEVICES, cli_list_devices);
++ set_handler_callback(LIST|WILDCARDS, cli_list_wildcards);
++ set_handler_callback(RESET|MAPS|STATS, cli_reset_maps_stats);
++ set_handler_callback(RESET|MAP|STATS, cli_reset_map_stats);
++ set_handler_callback(ADD|PATH, cli_add_path);
++ set_handler_callback(DEL|PATH, cli_del_path);
++ set_handler_callback(ADD|MAP, cli_add_map);
++ set_handler_callback(DEL|MAP, cli_del_map);
++ set_handler_callback(SWITCH|MAP|GROUP, cli_switch_group);
+ set_unlocked_handler_callback(RECONFIGURE, cli_reconfigure);
+- set_handler_callback(SUSPEND+MAP, cli_suspend);
+- set_handler_callback(RESUME+MAP, cli_resume);
+- set_handler_callback(RESIZE+MAP, cli_resize);
+- set_handler_callback(RELOAD+MAP, cli_reload);
+- set_handler_callback(RESET+MAP, cli_reassign);
+- set_handler_callback(REINSTATE+PATH, cli_reinstate);
+- set_handler_callback(FAIL+PATH, cli_fail);
+- set_handler_callback(DISABLEQ+MAP, cli_disable_queueing);
+- set_handler_callback(RESTOREQ+MAP, cli_restore_queueing);
+- set_handler_callback(DISABLEQ+MAPS, cli_disable_all_queueing);
+- set_handler_callback(RESTOREQ+MAPS, cli_restore_all_queueing);
++ set_handler_callback(SUSPEND|MAP, cli_suspend);
++ set_handler_callback(RESUME|MAP, cli_resume);
++ set_handler_callback(RESIZE|MAP, cli_resize);
++ set_handler_callback(RELOAD|MAP, cli_reload);
++ set_handler_callback(RESET|MAP, cli_reassign);
++ set_handler_callback(REINSTATE|PATH, cli_reinstate);
++ set_handler_callback(FAIL|PATH, cli_fail);
++ set_handler_callback(DISABLEQ|MAP, cli_disable_queueing);
++ set_handler_callback(RESTOREQ|MAP, cli_restore_queueing);
++ set_handler_callback(DISABLEQ|MAPS, cli_disable_all_queueing);
++ set_handler_callback(RESTOREQ|MAPS, cli_restore_all_queueing);
+ set_unlocked_handler_callback(QUIT, cli_quit);
+ set_unlocked_handler_callback(SHUTDOWN, cli_shutdown);
+- set_handler_callback(GETPRSTATUS+MAP, cli_getprstatus);
+- set_handler_callback(SETPRSTATUS+MAP, cli_setprstatus);
+- set_handler_callback(UNSETPRSTATUS+MAP, cli_unsetprstatus);
+- set_handler_callback(FORCEQ+DAEMON, cli_force_no_daemon_q);
+- set_handler_callback(RESTOREQ+DAEMON, cli_restore_no_daemon_q);
+- set_handler_callback(GETPRKEY+MAP, cli_getprkey);
+- set_handler_callback(SETPRKEY+MAP+KEY, cli_setprkey);
+- set_handler_callback(UNSETPRKEY+MAP, cli_unsetprkey);
+- set_handler_callback(SETMARGINAL+PATH, cli_set_marginal);
+- set_handler_callback(UNSETMARGINAL+PATH, cli_unset_marginal);
+- set_handler_callback(UNSETMARGINAL+MAP, cli_unset_all_marginal);
++ set_handler_callback(GETPRSTATUS|MAP, cli_getprstatus);
++ set_handler_callback(SETPRSTATUS|MAP, cli_setprstatus);
++ set_handler_callback(UNSETPRSTATUS|MAP, cli_unsetprstatus);
++ set_handler_callback(FORCEQ|DAEMON, cli_force_no_daemon_q);
++ set_handler_callback(RESTOREQ|DAEMON, cli_restore_no_daemon_q);
++ set_handler_callback(GETPRKEY|MAP, cli_getprkey);
++ set_handler_callback(SETPRKEY|MAP|KEY, cli_setprkey);
++ set_handler_callback(UNSETPRKEY|MAP, cli_unsetprkey);
++ set_handler_callback(SETMARGINAL|PATH, cli_set_marginal);
++ set_handler_callback(UNSETMARGINAL|PATH, cli_unset_marginal);
++ set_handler_callback(UNSETMARGINAL|MAP, cli_unset_all_marginal);
+
+ umask(077);
+ uxsock_listen(&uxsock_trigger, ux_sock, ap);
+--
+2.25.1
+
diff --git a/meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb b/meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb
index 8b0c89338f..e14e494366 100644
--- a/meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb
+++ b/meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb
@@ -29,7 +29,7 @@ DEPENDS = "libdevmapper \
LICENSE = "GPLv2"
-SRC_URI = "git://git.opensvc.com/multipath-tools/.git;protocol=http \
+SRC_URI = "git://github.com/opensvc/multipath-tools.git;protocol=http;branch=master \
file://multipathd.oe \
file://multipath.conf.example \
file://0021-RH-fixup-udev-rules-for-redhat.patch \
@@ -45,6 +45,8 @@ SRC_URI = "git://git.opensvc.com/multipath-tools/.git;protocol=http \
file://0031-Always-use-devmapper-for-kpartx.patch \
file://0001-fix-bug-of-do_compile-and-do_install.patch \
file://0001-add-explicit-dependency-on-libraries.patch \
+ file://CVE-2022-41973.patch \
+ file://CVE-2022-41974.patch \
"
LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
@@ -117,3 +119,6 @@ FILES_kpartx = "${base_sbindir}/kpartx \
RDEPENDS_${PN} += "kpartx"
PARALLEL_MAKE = ""
+
+FILES:${PN}-libs += "usr/lib/*.so.*"
+FILES:${PN}-libs += "usr/lib/tmpfiles.d/*"
diff --git a/meta-oe/recipes-support/ne10/ne10_1.2.1.bb b/meta-oe/recipes-support/ne10/ne10_1.2.1.bb
index f37ccde1cb..6cb53212a4 100644
--- a/meta-oe/recipes-support/ne10/ne10_1.2.1.bb
+++ b/meta-oe/recipes-support/ne10/ne10_1.2.1.bb
@@ -4,7 +4,7 @@ LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e7fe20c9be97be5579e3ab5d92d3a218"
SECTION = "libs"
-SRC_URI = "git://github.com/projectNe10/Ne10.git \
+SRC_URI = "git://github.com/projectNe10/Ne10.git;branch=master;protocol=https \
file://0001-CMakeLists.txt-Remove-mthumb-interwork.patch \
file://0001-Dont-specify-march-explicitly.patch \
"
diff --git a/meta-oe/recipes-support/nss/nss/0001-Bug-1812671-build-failure-while-implicitly-casting-S.patch b/meta-oe/recipes-support/nss/nss/0001-Bug-1812671-build-failure-while-implicitly-casting-S.patch
new file mode 100644
index 0000000000..b935d9eec5
--- /dev/null
+++ b/meta-oe/recipes-support/nss/nss/0001-Bug-1812671-build-failure-while-implicitly-casting-S.patch
@@ -0,0 +1,46 @@
+From 4e7e332b25a2794f381323518e52d8d95273b69e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Kren=C5=BEelok?= <fkrenzel@redhat.com>
+Date: Mon, 30 Jan 2023 12:59:20 +0000
+Subject: [PATCH] Bug 1812671 - build failure while implicitly casting
+ SECStatus to PRUInt32. r=nss-reviewers,mt
+
+Author of the patch: Bob Relyea <rrelyea@redhat.com>
+
+Differential Revision: https://phabricator.services.mozilla.com/D167983
+
+--HG--
+extra : moz-landing-system : lando
+---
+ lib/ssl/ssl3exthandle.c | 2 +-
+ lib/ssl/sslsnce.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/ssl/ssl3exthandle.c b/lib/ssl/ssl3exthandle.c
+index b5ae62f39..7134447bf 100644
+--- a/lib/ssl/ssl3exthandle.c
++++ b/lib/ssl/ssl3exthandle.c
+@@ -201,7 +201,7 @@ ssl3_FreeSniNameArray(TLSExtensionData *xtnData)
+ * Clients sends a filled in session ticket if one is available, and otherwise
+ * sends an empty ticket. Servers always send empty tickets.
+ */
+-PRInt32
++SECStatus
+ ssl3_ClientSendSessionTicketXtn(const sslSocket *ss, TLSExtensionData *xtnData,
+ sslBuffer *buf, PRBool *added)
+ {
+diff --git a/lib/ssl/sslsnce.c b/lib/ssl/sslsnce.c
+index 56edafa1f..49f041c97 100644
+--- a/lib/ssl/sslsnce.c
++++ b/lib/ssl/sslsnce.c
+@@ -1820,7 +1820,7 @@ ssl_GetSelfEncryptKeyPair(SECKEYPublicKey **pubKey,
+ return SECSuccess;
+ }
+
+-static PRBool
++static SECStatus
+ ssl_GenerateSelfEncryptKeys(void *pwArg, PRUint8 *keyName,
+ PK11SymKey **aesKey, PK11SymKey **macKey);
+
+--
+2.40.1
+
diff --git a/meta-oe/recipes-support/nss/nss/0001-Bug-1826650-cmd-ecperf-fix-dangling-pointer-warning-.patch b/meta-oe/recipes-support/nss/nss/0001-Bug-1826650-cmd-ecperf-fix-dangling-pointer-warning-.patch
new file mode 100644
index 0000000000..dc7e172aae
--- /dev/null
+++ b/meta-oe/recipes-support/nss/nss/0001-Bug-1826650-cmd-ecperf-fix-dangling-pointer-warning-.patch
@@ -0,0 +1,75 @@
+From cbf5a2bce75ca2c2fd3e247796b9892f5298584e Mon Sep 17 00:00:00 2001
+From: "John M. Schanck" <jschanck@mozilla.com>
+Date: Thu, 13 Apr 2023 17:43:46 +0000
+Subject: [PATCH] Bug 1826650 - cmd/ecperf: fix dangling pointer warning on gcc
+ 13. r=djackson
+
+Differential Revision: https://phabricator.services.mozilla.com/D174822
+
+--HG--
+extra : moz-landing-system : lando
+---
+ cmd/ecperf/ecperf.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/cmd/ecperf/ecperf.c b/cmd/ecperf/ecperf.c
+index 705d68f35..a07004d8e 100644
+--- a/cmd/ecperf/ecperf.c
++++ b/cmd/ecperf/ecperf.c
+@@ -53,6 +53,7 @@ PKCS11Thread(void *data)
+ SECItem sig;
+ CK_SESSION_HANDLE session;
+ CK_RV crv;
++ void *tmp = NULL;
+
+ threadData->status = SECSuccess;
+ threadData->count = 0;
+@@ -68,6 +69,7 @@ PKCS11Thread(void *data)
+ if (threadData->isSign) {
+ sig.data = sigData;
+ sig.len = sizeof(sigData);
++ tmp = threadData->p2;
+ threadData->p2 = (void *)&sig;
+ }
+
+@@ -79,6 +81,10 @@ PKCS11Thread(void *data)
+ }
+ threadData->count++;
+ }
++
++ if (threadData->isSign) {
++ threadData->p2 = tmp;
++ }
+ return;
+ }
+
+@@ -89,6 +95,7 @@ genericThread(void *data)
+ int iters = threadData->iters;
+ unsigned char sigData[256];
+ SECItem sig;
++ void *tmp = NULL;
+
+ threadData->status = SECSuccess;
+ threadData->count = 0;
+@@ -96,6 +103,7 @@ genericThread(void *data)
+ if (threadData->isSign) {
+ sig.data = sigData;
+ sig.len = sizeof(sigData);
++ tmp = threadData->p2;
+ threadData->p2 = (void *)&sig;
+ }
+
+@@ -107,6 +115,10 @@ genericThread(void *data)
+ }
+ threadData->count++;
+ }
++
++ if (threadData->isSign) {
++ threadData->p2 = tmp;
++ }
+ return;
+ }
+
+--
+2.40.1
+
diff --git a/meta-oe/recipes-support/nss/nss/CVE-2020-12403_1.patch b/meta-oe/recipes-support/nss/nss/CVE-2020-12403_1.patch
new file mode 100644
index 0000000000..a229a2d20f
--- /dev/null
+++ b/meta-oe/recipes-support/nss/nss/CVE-2020-12403_1.patch
@@ -0,0 +1,65 @@
+From 9ff9d3925d31ab265a965ab1d16d76c496ddb5c8 Mon Sep 17 00:00:00 2001
+From: Benjamin Beurdouche <bbeurdouche@mozilla.com>
+Date: Sat, 18 Jul 2020 00:13:38 +0000
+Subject: [PATCH] Bug 1636771 - Fix incorrect call to Chacha20Poly1305 by
+ PKCS11. r=jcj,kjacobs,rrelyea
+
+Differential Revision: https://phabricator.services.mozilla.com/D74801
+
+--HG--
+extra : moz-landing-system : lando
+---
+ nss/gtests/pk11_gtest/pk11_chacha20poly1305_unittest.cc | 11 +++++++++--
+ nss/lib/freebl/chacha20poly1305.c | 2 +-
+ 2 files changed, 10 insertions(+), 3 deletions(-)
+
+CVE: CVE-2020-12403
+Upstream-Status: Backport [https://github.com/nss-dev/nss/commit/9ff9d3925d31ab265a965ab1d16d76c496ddb5c8]
+Comment: Refreshed path for whole patchset
+Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
+
+diff --git a/nss/gtests/pk11_gtest/pk11_chacha20poly1305_unittest.cc b/nss/gtests/pk11_gtest/pk11_chacha20poly1305_unittest.cc
+index 41f9da71d6..3ea17678d9 100644
+--- a/nss/gtests/pk11_gtest/pk11_chacha20poly1305_unittest.cc
++++ b/nss/gtests/pk11_gtest/pk11_chacha20poly1305_unittest.cc
+@@ -45,7 +45,7 @@ class Pkcs11ChaCha20Poly1305Test
+ SECItem params = {siBuffer, reinterpret_cast<unsigned char*>(&aead_params),
+ sizeof(aead_params)};
+
+- // Encrypt with bad parameters.
++ // Encrypt with bad parameters (TagLen is too long).
+ unsigned int encrypted_len = 0;
+ std::vector<uint8_t> encrypted(data_len + aead_params.ulTagLen);
+ aead_params.ulTagLen = 158072;
+@@ -54,9 +54,16 @@ class Pkcs11ChaCha20Poly1305Test
+ &encrypted_len, encrypted.size(), data, data_len);
+ EXPECT_EQ(SECFailure, rv);
+ EXPECT_EQ(0U, encrypted_len);
+- aead_params.ulTagLen = 16;
++
++ // Encrypt with bad parameters (TagLen is too short).
++ aead_params.ulTagLen = 2;
++ rv = PK11_Encrypt(key.get(), kMech, &params, encrypted.data(),
++ &encrypted_len, encrypted.size(), data, data_len);
++ EXPECT_EQ(SECFailure, rv);
++ EXPECT_EQ(0U, encrypted_len);
+
+ // Encrypt.
++ aead_params.ulTagLen = 16;
+ rv = PK11_Encrypt(key.get(), kMech, &params, encrypted.data(),
+ &encrypted_len, encrypted.size(), data, data_len);
+
+diff --git a/nss/lib/freebl/chacha20poly1305.c b/nss/lib/freebl/chacha20poly1305.c
+index 970c6436da..5c294a9eaf 100644
+--- a/nss/lib/freebl/chacha20poly1305.c
++++ b/nss/lib/freebl/chacha20poly1305.c
+@@ -81,7 +81,7 @@ ChaCha20Poly1305_InitContext(ChaCha20Poly1305Context *ctx,
+ PORT_SetError(SEC_ERROR_BAD_KEY);
+ return SECFailure;
+ }
+- if (tagLen == 0 || tagLen > 16) {
++ if (tagLen != 16) {
+ PORT_SetError(SEC_ERROR_INPUT_LEN);
+ return SECFailure;
+ }
+
diff --git a/meta-oe/recipes-support/nss/nss/CVE-2020-12403_2.patch b/meta-oe/recipes-support/nss/nss/CVE-2020-12403_2.patch
new file mode 100644
index 0000000000..7b093d0cda
--- /dev/null
+++ b/meta-oe/recipes-support/nss/nss/CVE-2020-12403_2.patch
@@ -0,0 +1,80 @@
+From 06b2b1c50bd4eaa7f65d858e5e3f44f678cb3c45 Mon Sep 17 00:00:00 2001
+From: Benjamin Beurdouche <bbeurdouche@mozilla.com>
+Date: Sat, 18 Jul 2020 00:13:14 +0000
+Subject: [PATCH] Bug 1636771 - Disable PKCS11 incremental mode for ChaCha20.
+ r=kjacobs,rrelyea
+
+Depends on D74801
+
+Differential Revision: https://phabricator.services.mozilla.com/D83994
+
+--HG--
+extra : moz-landing-system : lando
+---
+ nss/gtests/pk11_gtest/pk11_cipherop_unittest.cc | 49 +++++++++++++++++++++
+ nss/lib/softoken/pkcs11c.c | 1 +
+ 2 files changed, 50 insertions(+)
+
+CVE: CVE-2020-12403
+Upstream-Status: Backport [https://github.com/nss-dev/nss/commit/06b2b1c50bd4eaa7f65d858e5e3f44f678cb3c45]
+Comment: Refreshed path for whole patchset and removed change for pkcs11c.c
+Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
+
+diff --git a/nss/gtests/pk11_gtest/pk11_cipherop_unittest.cc b/nss/gtests/pk11_gtest/pk11_cipherop_unittest.cc
+index 38982fd885..700750cc90 100644
+--- a/nss/gtests/pk11_gtest/pk11_cipherop_unittest.cc
++++ b/nss/gtests/pk11_gtest/pk11_cipherop_unittest.cc
+@@ -77,4 +77,53 @@ TEST(Pkcs11CipherOp, SingleCtxMultipleUnalignedCipherOps) {
+ NSS_ShutdownContext(globalctx);
+ }
+
++TEST(Pkcs11CipherOp, SingleCtxMultipleUnalignedCipherOpsChaCha20) {
++ PK11SlotInfo* slot;
++ PK11SymKey* key;
++ PK11Context* ctx;
++
++ NSSInitContext* globalctx =
++ NSS_InitContext("", "", "", "", NULL,
++ NSS_INIT_READONLY | NSS_INIT_NOCERTDB | NSS_INIT_NOMODDB |
++ NSS_INIT_FORCEOPEN | NSS_INIT_NOROOTINIT);
++
++ const CK_MECHANISM_TYPE cipher = CKM_NSS_CHACHA20_CTR;
++
++ slot = PK11_GetInternalSlot();
++ ASSERT_TRUE(slot);
++
++ // Use arbitrary bytes for the ChaCha20 key and IV
++ uint8_t key_bytes[32];
++ for (size_t i = 0; i < 32; i++) {
++ key_bytes[i] = i;
++ }
++ SECItem keyItem = {siBuffer, key_bytes, 32};
++
++ uint8_t iv_bytes[16];
++ for (size_t i = 0; i < 16; i++) {
++ key_bytes[i] = i;
++ }
++ SECItem ivItem = {siBuffer, iv_bytes, 16};
++
++ SECItem* param = PK11_ParamFromIV(cipher, &ivItem);
++
++ key = PK11_ImportSymKey(slot, cipher, PK11_OriginUnwrap, CKA_ENCRYPT,
++ &keyItem, NULL);
++ ctx = PK11_CreateContextBySymKey(cipher, CKA_ENCRYPT, key, param);
++ ASSERT_TRUE(key);
++ ASSERT_TRUE(ctx);
++
++ uint8_t outbuf[128];
++ // This is supposed to fail for Chacha20. This is because the underlying
++ // PK11_CipherOp operation is calling the C_EncryptUpdate function for
++ // which multi-part is disabled for ChaCha20 in counter mode.
++ ASSERT_EQ(GetBytes(ctx, outbuf, 7), SECFailure);
++
++ PK11_FreeSymKey(key);
++ PK11_FreeSlot(slot);
++ SECITEM_FreeItem(param, PR_TRUE);
++ PK11_DestroyContext(ctx, PR_TRUE);
++ NSS_ShutdownContext(globalctx);
++}
++
+ } // namespace nss_test
diff --git a/meta-oe/recipes-support/nss/nss/CVE-2020-25648.patch b/meta-oe/recipes-support/nss/nss/CVE-2020-25648.patch
new file mode 100644
index 0000000000..f30d4d32cd
--- /dev/null
+++ b/meta-oe/recipes-support/nss/nss/CVE-2020-25648.patch
@@ -0,0 +1,163 @@
+# HG changeset patch
+# User Daiki Ueno <dueno@redhat.com>
+# Date 1602524521 0
+# Node ID 57bbefa793232586d27cee83e74411171e128361
+# Parent 6e3bc17f05086854ffd2b06f7fae9371f7a0c174
+Bug 1641480, TLS 1.3: tighten CCS handling in compatibility mode, r=mt
+
+This makes the server reject CCS when the client doesn't indicate the
+use of the middlebox compatibility mode with a non-empty
+ClientHello.legacy_session_id, or it sends multiple CCS in a row.
+
+Differential Revision: https://phabricator.services.mozilla.com/D79994
+
+Upstream-Status: Backport
+CVE: CVE-2020-25648
+Reference to upstream patch: https://hg.mozilla.org/projects/nss/rev/57bbefa793232586d27cee83e74411171e128361
+Signed-off-by: Mathieu Dubois-Briand <mbriand@witekio.com>
+
+diff --color -Naur nss-3.51.1_old/nss/gtests/ssl_gtest/ssl_tls13compat_unittest.cc nss-3.51.1/nss/gtests/ssl_gtest/ssl_tls13compat_unittest.cc
+--- nss-3.51.1_old/nss/gtests/ssl_gtest/ssl_tls13compat_unittest.cc 2022-12-08 16:05:47.447142660 +0100
++++ nss-3.51.1/nss/gtests/ssl_gtest/ssl_tls13compat_unittest.cc 2022-12-08 16:12:32.645932052 +0100
+@@ -348,6 +348,85 @@
+ client_->CheckErrorCode(SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT);
+ }
+
++// The server rejects a ChangeCipherSpec if the client advertises an
++// empty session ID.
++TEST_F(TlsConnectStreamTls13, ChangeCipherSpecAfterClientHelloEmptySid) {
++ EnsureTlsSetup();
++ ConfigureVersion(SSL_LIBRARY_VERSION_TLS_1_3);
++
++ StartConnect();
++ client_->Handshake(); // Send ClientHello
++ client_->SendDirect(DataBuffer(kCannedCcs, sizeof(kCannedCcs))); // Send CCS
++
++ server_->ExpectSendAlert(kTlsAlertUnexpectedMessage);
++ server_->Handshake(); // Consume ClientHello and CCS
++ server_->CheckErrorCode(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);
++}
++
++// The server rejects multiple ChangeCipherSpec even if the client
++// indicates compatibility mode with non-empty session ID.
++TEST_F(Tls13CompatTest, ChangeCipherSpecAfterClientHelloTwice) {
++ EnsureTlsSetup();
++ ConfigureVersion(SSL_LIBRARY_VERSION_TLS_1_3);
++ EnableCompatMode();
++
++ StartConnect();
++ client_->Handshake(); // Send ClientHello
++ // Send CCS twice in a row
++ client_->SendDirect(DataBuffer(kCannedCcs, sizeof(kCannedCcs)));
++ client_->SendDirect(DataBuffer(kCannedCcs, sizeof(kCannedCcs)));
++
++ server_->ExpectSendAlert(kTlsAlertUnexpectedMessage);
++ server_->Handshake(); // Consume ClientHello and CCS.
++ server_->CheckErrorCode(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);
++}
++
++// The client rejects a ChangeCipherSpec if it advertises an empty
++// session ID.
++TEST_F(TlsConnectStreamTls13, ChangeCipherSpecAfterServerHelloEmptySid) {
++ EnsureTlsSetup();
++ ConfigureVersion(SSL_LIBRARY_VERSION_TLS_1_3);
++
++ // To replace Finished with a CCS below
++ auto filter = MakeTlsFilter<TlsHandshakeDropper>(server_);
++ filter->SetHandshakeTypes({kTlsHandshakeFinished});
++ filter->EnableDecryption();
++
++ StartConnect();
++ client_->Handshake(); // Send ClientHello
++ server_->Handshake(); // Consume ClientHello, and
++ // send ServerHello..CertificateVerify
++ // Send CCS
++ server_->SendDirect(DataBuffer(kCannedCcs, sizeof(kCannedCcs)));
++ client_->ExpectSendAlert(kTlsAlertUnexpectedMessage);
++ client_->Handshake(); // Consume ClientHello and CCS
++ client_->CheckErrorCode(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);
++}
++
++// The client rejects multiple ChangeCipherSpec in a row even if the
++// client indicates compatibility mode with non-empty session ID.
++TEST_F(Tls13CompatTest, ChangeCipherSpecAfterServerHelloTwice) {
++ EnsureTlsSetup();
++ ConfigureVersion(SSL_LIBRARY_VERSION_TLS_1_3);
++ EnableCompatMode();
++
++ // To replace Finished with a CCS below
++ auto filter = MakeTlsFilter<TlsHandshakeDropper>(server_);
++ filter->SetHandshakeTypes({kTlsHandshakeFinished});
++ filter->EnableDecryption();
++
++ StartConnect();
++ client_->Handshake(); // Send ClientHello
++ server_->Handshake(); // Consume ClientHello, and
++ // send ServerHello..CertificateVerify
++ // the ServerHello is followed by CCS
++ // Send another CCS
++ server_->SendDirect(DataBuffer(kCannedCcs, sizeof(kCannedCcs)));
++ client_->ExpectSendAlert(kTlsAlertUnexpectedMessage);
++ client_->Handshake(); // Consume ClientHello and CCS
++ client_->CheckErrorCode(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);
++}
++
+ // If we negotiate 1.2, we abort.
+ TEST_F(TlsConnectStreamTls13, ChangeCipherSpecBeforeClientHello12) {
+ EnsureTlsSetup();
+diff --color -Naur nss-3.51.1_old/nss/lib/ssl/ssl3con.c nss-3.51.1/nss/lib/ssl/ssl3con.c
+--- nss-3.51.1_old/nss/lib/ssl/ssl3con.c 2022-12-08 16:05:47.471142833 +0100
++++ nss-3.51.1/nss/lib/ssl/ssl3con.c 2022-12-08 16:12:42.037994262 +0100
+@@ -6711,7 +6711,11 @@
+
+ /* TLS 1.3: We sent a session ID. The server's should match. */
+ if (!IS_DTLS(ss) && (sentRealSid || sentFakeSid)) {
+- return sidMatch;
++ if (sidMatch) {
++ ss->ssl3.hs.allowCcs = PR_TRUE;
++ return PR_TRUE;
++ }
++ return PR_FALSE;
+ }
+
+ /* TLS 1.3 (no SID)/DTLS 1.3: The server shouldn't send a session ID. */
+@@ -8730,6 +8734,7 @@
+ errCode = PORT_GetError();
+ goto alert_loser;
+ }
++ ss->ssl3.hs.allowCcs = PR_TRUE;
+ }
+
+ /* TLS 1.3 requires that compression include only null. */
+@@ -13058,8 +13063,15 @@
+ ss->ssl3.hs.ws != idle_handshake &&
+ cText->buf->len == 1 &&
+ cText->buf->buf[0] == change_cipher_spec_choice) {
+- /* Ignore the CCS. */
+- return SECSuccess;
++ if (ss->ssl3.hs.allowCcs) {
++ /* Ignore the first CCS. */
++ ss->ssl3.hs.allowCcs = PR_FALSE;
++ return SECSuccess;
++ }
++
++ /* Compatibility mode is not negotiated. */
++ alert = unexpected_message;
++ PORT_SetError(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);
+ }
+
+ if (IS_DTLS(ss) ||
+diff --color -Naur nss-3.51.1_old/nss/lib/ssl/sslimpl.h nss-3.51.1/nss/lib/ssl/sslimpl.h
+--- nss-3.51.1_old/nss/lib/ssl/sslimpl.h 2022-12-08 16:05:47.471142833 +0100
++++ nss-3.51.1/nss/lib/ssl/sslimpl.h 2022-12-08 16:12:45.106014567 +0100
+@@ -711,6 +711,10 @@
+ * or received. */
+ PRBool receivedCcs; /* A server received ChangeCipherSpec
+ * before the handshake started. */
++ PRBool allowCcs; /* A server allows ChangeCipherSpec
++ * as the middlebox compatibility mode
++ * is explicitly indicarted by
++ * legacy_session_id in TLS 1.3 ClientHello. */
+ PRBool clientCertRequested; /* True if CertificateRequest received. */
+ ssl3KEADef kea_def_mutable; /* Used to hold the writable kea_def
+ * we use for TLS 1.3 */
diff --git a/meta-oe/recipes-support/nss/nss/CVE-2021-43527.patch b/meta-oe/recipes-support/nss/nss/CVE-2021-43527.patch
new file mode 100644
index 0000000000..cf3ea63cac
--- /dev/null
+++ b/meta-oe/recipes-support/nss/nss/CVE-2021-43527.patch
@@ -0,0 +1,283 @@
+Description: fix heap overflow when verifying DSA/RSA-PSS DER-encoded signatures
+Origin: Provided by Mozilla
+
+CVE: CVE-2021-43527
+Upstream-Status: Backport [http://archive.ubuntu.com/ubuntu/pool/main/n/nss/nss_3.35-2ubuntu2.13.debian.tar.xz]
+Comment: Refreshed hunk 1 and 6 due to fuzz
+Signed-off-by: Sana Kazi <Sana.Kazi@kpit.com>
+
+--- a/nss/lib/cryptohi/secvfy.c
++++ b/nss/lib/cryptohi/secvfy.c
+@@ -164,6 +164,37 @@
+ PR_FALSE /*XXX: unsafeAllowMissingParameters*/);
+ }
+
++static unsigned int
++checkedSignatureLen(const SECKEYPublicKey *pubk)
++{
++ unsigned int sigLen = SECKEY_SignatureLen(pubk);
++ if (sigLen == 0) {
++ /* Error set by SECKEY_SignatureLen */
++ return sigLen;
++ }
++ unsigned int maxSigLen;
++ switch (pubk->keyType) {
++ case rsaKey:
++ case rsaPssKey:
++ maxSigLen = (RSA_MAX_MODULUS_BITS + 7) / 8;
++ break;
++ case dsaKey:
++ maxSigLen = DSA_MAX_SIGNATURE_LEN;
++ break;
++ case ecKey:
++ maxSigLen = 2 * MAX_ECKEY_LEN;
++ break;
++ default:
++ PORT_SetError(SEC_ERROR_UNSUPPORTED_KEYALG);
++ return 0;
++ }
++ if (sigLen > maxSigLen) {
++ PORT_SetError(SEC_ERROR_INVALID_KEY);
++ return 0;
++ }
++ return sigLen;
++}
++
+ /*
+ * decode the ECDSA or DSA signature from it's DER wrapping.
+ * The unwrapped/raw signature is placed in the buffer pointed
+@@ -174,38 +205,38 @@ decodeECorDSASignature(SECOidTag algid,
+ unsigned int len)
+ {
+ SECItem *dsasig = NULL; /* also used for ECDSA */
+- SECStatus rv = SECSuccess;
+
+- if ((algid != SEC_OID_ANSIX9_DSA_SIGNATURE) &&
+- (algid != SEC_OID_ANSIX962_EC_PUBLIC_KEY)) {
+- if (sig->len != len) {
+- PORT_SetError(SEC_ERROR_BAD_DER);
+- return SECFailure;
++ /* Safety: Ensure algId is as expected and that signature size is within maxmimums */
++ if (algid == SEC_OID_ANSIX9_DSA_SIGNATURE) {
++ if (len > DSA_MAX_SIGNATURE_LEN) {
++ goto loser;
+ }
+-
+- PORT_Memcpy(dsig, sig->data, sig->len);
+- return SECSuccess;
+- }
+-
+- if (algid == SEC_OID_ANSIX962_EC_PUBLIC_KEY) {
++ } else if (algid == SEC_OID_ANSIX962_EC_PUBLIC_KEY) {
+ if (len > MAX_ECKEY_LEN * 2) {
+- PORT_SetError(SEC_ERROR_BAD_DER);
+- return SECFailure;
++ goto loser;
+ }
+- }
+- dsasig = DSAU_DecodeDerSigToLen((SECItem *)sig, len);
+-
+- if ((dsasig == NULL) || (dsasig->len != len)) {
+- rv = SECFailure;
+ } else {
+- PORT_Memcpy(dsig, dsasig->data, dsasig->len);
++ goto loser;
+ }
+
+- if (dsasig != NULL)
++ /* Decode and pad to length */
++ dsasig = DSAU_DecodeDerSigToLen((SECItem *)sig, len);
++ if (dsasig == NULL) {
++ goto loser;
++ }
++ if (dsasig->len != len) {
+ SECITEM_FreeItem(dsasig, PR_TRUE);
+- if (rv == SECFailure)
+- PORT_SetError(SEC_ERROR_BAD_DER);
+- return rv;
++ goto loser;
++ }
++
++ PORT_Memcpy(dsig, dsasig->data, len);
++ SECITEM_FreeItem(dsasig, PR_TRUE);
++
++ return SECSuccess;
++
++loser:
++ PORT_SetError(SEC_ERROR_BAD_DER);
++ return SECFailure;
+ }
+
+ const SEC_ASN1Template hashParameterTemplate[] =
+@@ -231,7 +262,7 @@ SECStatus
+ sec_DecodeSigAlg(const SECKEYPublicKey *key, SECOidTag sigAlg,
+ const SECItem *param, SECOidTag *encalg, SECOidTag *hashalg)
+ {
+- int len;
++ unsigned int len;
+ PLArenaPool *arena;
+ SECStatus rv;
+ SECItem oid;
+@@ -458,48 +489,52 @@ vfy_CreateContext(const SECKEYPublicKey
+ cx->pkcs1RSADigestInfo = NULL;
+ rv = SECSuccess;
+ if (sig) {
+- switch (type) {
+- case rsaKey:
+- rv = recoverPKCS1DigestInfo(hashAlg, &cx->hashAlg,
+- &cx->pkcs1RSADigestInfo,
+- &cx->pkcs1RSADigestInfoLen,
+- cx->key,
+- sig, wincx);
+- break;
+- case rsaPssKey:
+- sigLen = SECKEY_SignatureLen(key);
+- if (sigLen == 0) {
+- /* error set by SECKEY_SignatureLen */
+- rv = SECFailure;
++ rv = SECFailure;
++ if (type == rsaKey) {
++ rv = recoverPKCS1DigestInfo(hashAlg, &cx->hashAlg,
++ &cx->pkcs1RSADigestInfo,
++ &cx->pkcs1RSADigestInfoLen,
++ cx->key,
++ sig, wincx);
++ } else {
++ sigLen = checkedSignatureLen(key);
++ /* Check signature length is within limits */
++ if (sigLen == 0) {
++ /* error set by checkedSignatureLen */
++ rv = SECFailure;
++ goto loser;
++ }
++ if (sigLen > sizeof(cx->u)) {
++ PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
++ rv = SECFailure;
++ goto loser;
++ }
++ switch (type) {
++ case rsaPssKey:
++ if (sig->len != sigLen) {
++ PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
++ rv = SECFailure;
++ goto loser;
++ }
++ PORT_Memcpy(cx->u.buffer, sig->data, sigLen);
++ rv = SECSuccess;
+ break;
+- }
+- if (sig->len != sigLen) {
+- PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
+- rv = SECFailure;
++ case ecKey:
++ case dsaKey:
++ /* decodeECorDSASignature will check sigLen == sig->len after padding */
++ rv = decodeECorDSASignature(encAlg, sig, cx->u.buffer, sigLen);
+ break;
+- }
+- PORT_Memcpy(cx->u.buffer, sig->data, sigLen);
+- break;
+- case dsaKey:
+- case ecKey:
+- sigLen = SECKEY_SignatureLen(key);
+- if (sigLen == 0) {
+- /* error set by SECKEY_SignatureLen */
++ default:
++ /* Unreachable */
+ rv = SECFailure;
+- break;
+- }
+- rv = decodeECorDSASignature(encAlg, sig, cx->u.buffer, sigLen);
+- break;
+- default:
+- rv = SECFailure;
+- PORT_SetError(SEC_ERROR_UNSUPPORTED_KEYALG);
+- break;
++ goto loser;
++ }
++ }
++ if (rv != SECSuccess) {
++ goto loser;
+ }
+ }
+
+- if (rv)
+- goto loser;
+-
+ /* check hash alg again, RSA may have changed it.*/
+ if (HASH_GetHashTypeByOidTag(cx->hashAlg) == HASH_AlgNULL) {
+ /* error set by HASH_GetHashTypeByOidTag */
+@@ -634,11 +669,16 @@ VFY_EndWithSignature(VFYContext *cx, SEC
+ switch (cx->key->keyType) {
+ case ecKey:
+ case dsaKey:
+- dsasig.data = cx->u.buffer;
+- dsasig.len = SECKEY_SignatureLen(cx->key);
++ dsasig.len = checkedSignatureLen(cx->key);
+ if (dsasig.len == 0) {
+ return SECFailure;
+ }
++ if (dsasig.len > sizeof(cx->u)) {
++ PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
++ return SECFailure;
++ }
++ dsasig.data = cx->u.buffer;
++
+ if (sig) {
+ rv = decodeECorDSASignature(cx->encAlg, sig, dsasig.data,
+ dsasig.len);
+@@ -667,8 +698,13 @@
+ }
+
+ rsasig.data = cx->u.buffer;
+- rsasig.len = SECKEY_SignatureLen(cx->key);
++ rsasig.len = checkedSignatureLen(cx->key);
+ if (rsasig.len == 0) {
++ /* Error set by checkedSignatureLen */
++ return SECFailure;
++ }
++ if (rsasig.len > sizeof(cx->u)) {
++ PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
+ return SECFailure;
+ }
+ if (sig) {
+@@ -743,7 +788,6 @@ vfy_VerifyDigest(const SECItem *digest,
+ SECStatus rv;
+ VFYContext *cx;
+ SECItem dsasig; /* also used for ECDSA */
+-
+ rv = SECFailure;
+
+ cx = vfy_CreateContext(key, sig, encAlg, hashAlg, NULL, wincx);
+@@ -751,19 +795,25 @@ vfy_VerifyDigest(const SECItem *digest,
+ switch (key->keyType) {
+ case rsaKey:
+ rv = verifyPKCS1DigestInfo(cx, digest);
++ /* Error (if any) set by verifyPKCS1DigestInfo */
+ break;
+- case dsaKey:
+ case ecKey:
++ case dsaKey:
+ dsasig.data = cx->u.buffer;
+- dsasig.len = SECKEY_SignatureLen(cx->key);
++ dsasig.len = checkedSignatureLen(cx->key);
+ if (dsasig.len == 0) {
++ /* Error set by checkedSignatureLen */
++ rv = SECFailure;
+ break;
+ }
+- if (PK11_Verify(cx->key, &dsasig, (SECItem *)digest, cx->wincx) !=
+- SECSuccess) {
++ if (dsasig.len > sizeof(cx->u)) {
++ PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
++ rv = SECFailure;
++ break;
++ }
++ rv = PK11_Verify(cx->key, &dsasig, (SECItem *)digest, cx->wincx);
++ if (rv != SECSuccess) {
+ PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
+- } else {
+- rv = SECSuccess;
+ }
+ break;
+ default:
diff --git a/meta-oe/recipes-support/nss/nss/CVE-2022-22747.patch b/meta-oe/recipes-support/nss/nss/CVE-2022-22747.patch
new file mode 100644
index 0000000000..cccb73187d
--- /dev/null
+++ b/meta-oe/recipes-support/nss/nss/CVE-2022-22747.patch
@@ -0,0 +1,63 @@
+# HG changeset patch
+# User John M. Schanck <jschanck@mozilla.com>
+# Date 1633990165 0
+# Node ID 7ff99e71f3e37faed12bc3cc90a3eed27e3418d0
+# Parent f80fafd04cf82b4d315c8fe42bb4639703f6ee4f
+Bug 1735028 - check for missing signedData field r=keeler
+
+Differential Revision: https://phabricator.services.mozilla.com/D128112
+
+Upstream-Status: Backport [https://hg.mozilla.org/projects/nss/raw-rev/7ff99e71f3e37faed12bc3cc90a3eed27e3418d0]
+CVE: CVE-2022-22747
+Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
+
+diff --git a/nss/gtests/certdb_gtest/decode_certs_unittest.cc b/nss/gtests/certdb_gtest/decode_certs_unittest.cc
+--- a/nss/gtests/certdb_gtest/decode_certs_unittest.cc
++++ b/nss/gtests/certdb_gtest/decode_certs_unittest.cc
+@@ -21,8 +21,21 @@ TEST_F(DecodeCertsTest, EmptyCertPackage
+ unsigned char emptyCertPackage[] = {0x30, 0x0f, 0x06, 0x09, 0x60, 0x86,
+ 0x48, 0x01, 0x86, 0xf8, 0x42, 0x02,
+ 0x05, 0xa0, 0x02, 0x30, 0x00};
+ EXPECT_EQ(nullptr, CERT_DecodeCertFromPackage(
+ reinterpret_cast<char*>(emptyCertPackage),
+ sizeof(emptyCertPackage)));
+ EXPECT_EQ(SEC_ERROR_BAD_DER, PR_GetError());
+ }
++
++TEST_F(DecodeCertsTest, EmptySignedData) {
++ // This represents a PKCS#7 ContentInfo of contentType
++ // 1.2.840.113549.1.7.2 (signedData) with missing content.
++ unsigned char emptySignedData[] = {0x30, 0x80, 0x06, 0x09, 0x2a, 0x86,
++ 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07,
++ 0x02, 0x00, 0x00, 0x05, 0x00};
++
++ EXPECT_EQ(nullptr,
++ CERT_DecodeCertFromPackage(reinterpret_cast<char*>(emptySignedData),
++ sizeof(emptySignedData)));
++ EXPECT_EQ(SEC_ERROR_BAD_DER, PR_GetError());
++}
+diff --git a/nss/lib/pkcs7/certread.c b/nss/lib/pkcs7/certread.c
+--- a/nss/lib/pkcs7/certread.c
++++ b/nss/lib/pkcs7/certread.c
+@@ -134,16 +134,21 @@ SEC_ReadPKCS7Certs(SECItem *pkcs7Item, C
+ pkcs7Item) != SECSuccess) {
+ goto done;
+ }
+
+ if (GetContentTypeTag(&contentInfo) != SEC_OID_PKCS7_SIGNED_DATA) {
+ goto done;
+ }
+
++ if (contentInfo.content.signedData == NULL) {
++ PORT_SetError(SEC_ERROR_BAD_DER);
++ goto done;
++ }
++
+ rv = SECSuccess;
+
+ certs = contentInfo.content.signedData->certificates;
+ if (certs) {
+ count = 0;
+
+ while (*certs) {
+ count++;
diff --git a/meta-oe/recipes-support/nss/nss/CVE-2023-0767.patch b/meta-oe/recipes-support/nss/nss/CVE-2023-0767.patch
new file mode 100644
index 0000000000..ec3b4a092a
--- /dev/null
+++ b/meta-oe/recipes-support/nss/nss/CVE-2023-0767.patch
@@ -0,0 +1,124 @@
+
+# HG changeset patch
+# User John M. Schanck <jschanck@mozilla.com>
+# Date 1675974326 0
+# Node ID 62f6b3e9024dd72ba3af9ce23848d7573b934f18
+# Parent 52b4b7d3d3ebdb25fbf2cf1c101bfad3721680f4
+Bug 1804640 - improve handling of unknown PKCS#12 safe bag types. r=rrelyea
+
+Differential Revision: https://phabricator.services.mozilla.com/D167443
+
+CVE: CVE-2023-0767
+Upstream-Status: Backport [https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/nss/2:3.35-2ubuntu2.16/nss_3.35-2ubuntu2.16.debian.tar.xz]
+Signed-off-by: Virendra Thakur <virendra.thakur@kpit.com>
+
+diff --git a/nss/lib/pkcs12/p12d.c b/nss/lib/pkcs12/p12d.c
+--- a/nss/lib/pkcs12/p12d.c
++++ b/nss/lib/pkcs12/p12d.c
+@@ -332,41 +332,48 @@ sec_pkcs12_decoder_safe_bag_update(void
+ unsigned long len, int depth,
+ SEC_ASN1EncodingPart data_kind)
+ {
+ sec_PKCS12SafeContentsContext *safeContentsCtx =
+ (sec_PKCS12SafeContentsContext *)arg;
+ SEC_PKCS12DecoderContext *p12dcx;
+ SECStatus rv;
+
+- /* make sure that we are not skipping the current safeBag,
+- * and that there are no errors. If so, just return rather
+- * than continuing to process.
+- */
+- if (!safeContentsCtx || !safeContentsCtx->p12dcx ||
+- safeContentsCtx->p12dcx->error || safeContentsCtx->skipCurrentSafeBag) {
++ if (!safeContentsCtx || !safeContentsCtx->p12dcx || !safeContentsCtx->currentSafeBagA1Dcx) {
+ return;
+ }
+ p12dcx = safeContentsCtx->p12dcx;
+
++ /* make sure that there are no errors and we are not skipping the current safeBag */
++ if (p12dcx->error || safeContentsCtx->skipCurrentSafeBag) {
++ goto loser;
++ }
++
+ rv = SEC_ASN1DecoderUpdate(safeContentsCtx->currentSafeBagA1Dcx, data, len);
+ if (rv != SECSuccess) {
+ p12dcx->errorValue = PORT_GetError();
++ p12dcx->error = PR_TRUE;
++ goto loser;
++ }
++
++ /* The update may have set safeContentsCtx->skipCurrentSafeBag, and we
++ * may not get another opportunity to clean up the decoder context.
++ */
++ if (safeContentsCtx->skipCurrentSafeBag) {
+ goto loser;
+ }
+
+ return;
+
+ loser:
+- /* set the error, and finish the decoder context. because there
++ /* Finish the decoder context. Because there
+ * is not a way of returning an error message, it may be worth
+ * while to do a check higher up and finish any decoding contexts
+ * that are still open.
+ */
+- p12dcx->error = PR_TRUE;
+ SEC_ASN1DecoderFinish(safeContentsCtx->currentSafeBagA1Dcx);
+ safeContentsCtx->currentSafeBagA1Dcx = NULL;
+ return;
+ }
+
+ /* notify function for decoding safeBags. This function is
+ * used to filter safeBag types which are not supported,
+ * initiate the decoding of nested safe contents, and decode
+diff --git a/nss/lib/pkcs12/p12t.h b/nss/lib/pkcs12/p12t.h
+--- a/nss/lib/pkcs12/p12t.h
++++ b/nss/lib/pkcs12/p12t.h
+@@ -68,16 +68,17 @@ struct sec_PKCS12SafeBagStr {
+ /* Dependent upon the type of bag being used. */
+ union {
+ SECKEYPrivateKeyInfo *pkcs8KeyBag;
+ SECKEYEncryptedPrivateKeyInfo *pkcs8ShroudedKeyBag;
+ sec_PKCS12CertBag *certBag;
+ sec_PKCS12CRLBag *crlBag;
+ sec_PKCS12SecretBag *secretBag;
+ sec_PKCS12SafeContents *safeContents;
++ SECItem *unknownBag;
+ } safeBagContent;
+
+ sec_PKCS12Attribute **attribs;
+
+ /* used locally */
+ SECOidData *bagTypeTag;
+ PLArenaPool *arena;
+ unsigned int nAttribs;
+diff --git a/nss/lib/pkcs12/p12tmpl.c b/nss/lib/pkcs12/p12tmpl.c
+--- a/nss/lib/pkcs12/p12tmpl.c
++++ b/nss/lib/pkcs12/p12tmpl.c
+@@ -25,22 +25,22 @@ sec_pkcs12_choose_safe_bag_type(void *sr
+ if (src_or_dest == NULL) {
+ return NULL;
+ }
+
+ safeBag = (sec_PKCS12SafeBag *)src_or_dest;
+
+ oiddata = SECOID_FindOID(&safeBag->safeBagType);
+ if (oiddata == NULL) {
+- return SEC_ASN1_GET(SEC_AnyTemplate);
++ return SEC_ASN1_GET(SEC_PointerToAnyTemplate);
+ }
+
+ switch (oiddata->offset) {
+ default:
+- theTemplate = SEC_ASN1_GET(SEC_AnyTemplate);
++ theTemplate = SEC_ASN1_GET(SEC_PointerToAnyTemplate);
+ break;
+ case SEC_OID_PKCS12_V1_KEY_BAG_ID:
+ theTemplate = SEC_ASN1_GET(SECKEY_PointerToPrivateKeyInfoTemplate);
+ break;
+ case SEC_OID_PKCS12_V1_CERT_BAG_ID:
+ theTemplate = sec_PKCS12PointerToCertBagTemplate;
+ break;
+ case SEC_OID_PKCS12_V1_CRL_BAG_ID:
+
diff --git a/meta-oe/recipes-support/nss/nss_3.51.1.bb b/meta-oe/recipes-support/nss/nss_3.51.1.bb
index ac046ed0fe..af842ee67c 100644
--- a/meta-oe/recipes-support/nss/nss_3.51.1.bb
+++ b/meta-oe/recipes-support/nss/nss_3.51.1.bb
@@ -37,6 +37,14 @@ SRC_URI = "http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${VERSIO
file://0001-Bug-1631576-Force-a-fixed-length-for-DSA-exponentiat.patch \
file://CVE-2020-12401.patch \
file://CVE-2020-6829_12400.patch \
+ file://CVE-2020-12403_1.patch \
+ file://CVE-2020-12403_2.patch \
+ file://CVE-2020-25648.patch \
+ file://CVE-2021-43527.patch \
+ file://CVE-2022-22747.patch \
+ file://CVE-2023-0767.patch \
+ file://0001-Bug-1812671-build-failure-while-implicitly-casting-S.patch;patchdir=nss \
+ file://0001-Bug-1826650-cmd-ecperf-fix-dangling-pointer-warning-.patch;patchdir=nss \
"
SRC_URI[md5sum] = "6acaf1ddff69306ae30a908881c6f233"
@@ -287,5 +295,11 @@ RDEPENDS_${PN}-smime = "perl"
BBCLASSEXTEND = "native nativesdk"
+CVE_PRODUCT += "network_security_services"
+
# CVE-2006-5201 affects only Sun Solaris
CVE_CHECK_WHITELIST += "CVE-2006-5201"
+
+# CVES CVE-2017-11695 CVE-2017-11696 CVE-2017-11697 CVE-2017-11698 only affect
+# the legacy db (libnssdbm), only compiled with --enable-legacy-db.
+CVE_CHECK_WHITELIST += "CVE-2017-11695 CVE-2017-11696 CVE-2017-11697 CVE-2017-11698"
diff --git a/meta-oe/recipes-support/numactl/numactl_git.bb b/meta-oe/recipes-support/numactl/numactl_git.bb
index 20b7fed862..af082237c3 100644
--- a/meta-oe/recipes-support/numactl/numactl_git.bb
+++ b/meta-oe/recipes-support/numactl/numactl_git.bb
@@ -13,7 +13,7 @@ LIC_FILES_CHKSUM = "file://README.md;beginline=19;endline=32;md5=f8ff2391624f28e
SRCREV = "5d9f16722e3df49dc618a9f361bd482559695db7"
PV = "2.0.13+git${SRCPV}"
-SRC_URI = "git://github.com/numactl/numactl \
+SRC_URI = "git://github.com/numactl/numactl;branch=master;protocol=https \
file://Fix-the-test-output-format.patch \
file://Makefile \
file://run-ptest \
diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Allow-only-X509-certs-to-verify-the-SAML-token-signa.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Allow-only-X509-certs-to-verify-the-SAML-token-signa.patch
new file mode 100644
index 0000000000..38daa05817
--- /dev/null
+++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Allow-only-X509-certs-to-verify-the-SAML-token-signa.patch
@@ -0,0 +1,35 @@
+From 7f3cced1e140ed36c6f8f66d7f4098323b0463b2 Mon Sep 17 00:00:00 2001
+From: Katy Feng <fkaty@vmware.com>
+Date: Fri, 25 Aug 2023 11:58:48 -0700
+Subject: [PATCH] Allow only X509 certs to verify the SAML token signature.
+
+Upstream-Status: Backport from https://github.com/vmware/open-vm-tools/commit/74b6d0d9000eda1a2c8f31c40c725fb0b8520b16
+CVE: CVE-2023-20900
+Signed-off-by: Priyal Doshi <pdoshi@mvista.com>
+---
+ open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c b/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c
+index 2906d29..57db3b8 100644
+--- a/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c
++++ b/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c
+@@ -1275,7 +1275,14 @@ VerifySignature(xmlDocPtr doc,
+ */
+ bRet = RegisterID(xmlDocGetRootElement(doc), "ID");
+ if (bRet == FALSE) {
+- g_warning("failed to register ID\n");
++ g_warning("Failed to register ID\n");
++ goto done;
++ }
++
++ /* Use only X509 certs to validate the signature */
++ if (xmlSecPtrListAdd(&(dsigCtx->keyInfoReadCtx.enabledKeyData),
++ BAD_CAST xmlSecKeyDataX509Id) < 0) {
++ g_warning("Failed to limit allowed key data\n");
+ goto done;
+ }
+
+--
+2.7.4
+
diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Properly-check-authorization-on-incoming-guestOps-re.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Properly-check-authorization-on-incoming-guestOps-re.patch
new file mode 100644
index 0000000000..1c6657ae9f
--- /dev/null
+++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Properly-check-authorization-on-incoming-guestOps-re.patch
@@ -0,0 +1,39 @@
+From d16eda269413bdb04e85c242fa28db264697c45f Mon Sep 17 00:00:00 2001
+From: John Wolfe <jwolfe@vmware.com>
+Date: Sun, 21 Aug 2022 07:56:49 -0700
+Subject: [PATCH] Properly check authorization on incoming guestOps requests.
+
+Fix public pipe request checks. Only a SessionRequest type should
+be accepted on the public pipe.
+
+Upstream-Status: Backport from https://github.com/vmware/open-vm-tools/commit/70a74758bfe0042c27f15ce590fb21a2bc54d745
+CVE: CVE-2022-31676
+Signed-off-by: Priyal Doshi <pdoshi@mvista.com>
+---
+ open-vm-tools/vgauth/serviceImpl/proto.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/open-vm-tools/vgauth/serviceImpl/proto.c b/open-vm-tools/vgauth/serviceImpl/proto.c
+index f097fb6..0ebaa7b 100644
+--- a/open-vm-tools/vgauth/serviceImpl/proto.c
++++ b/open-vm-tools/vgauth/serviceImpl/proto.c
+@@ -1,5 +1,5 @@
+ /*********************************************************
+- * Copyright (C) 2011-2016,2019 VMware, Inc. All rights reserved.
++ * Copyright (C) 2011-2016,2019-2022 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+@@ -1202,6 +1202,10 @@ Proto_SecurityCheckRequest(ServiceConnection *conn,
+ VGAuthError err;
+ gboolean isSecure = ServiceNetworkIsConnectionPrivateSuperUser(conn);
+
++ if (conn->isPublic && req->reqType != PROTO_REQUEST_SESSION_REQ) {
++ return VGAUTH_E_PERMISSION_DENIED;
++ }
++
+ switch (req->reqType) {
+ /*
+ * This comes over the public connection; alwsys let it through.
+--
+2.7.4
diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb b/meta-oe/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb
index 34a81d21f0..e3b15e35b6 100644
--- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb
+++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb
@@ -21,7 +21,7 @@ LICENSE_modules/freebsd/vmxnet = "GPL-2.0"
LICENSE_modules/linux = "GPL-2.0"
LICENSE_modules/solaris = "CDDL-1.0"
-SRC_URI = "git://github.com/vmware/open-vm-tools.git;protocol=https \
+SRC_URI = "git://github.com/vmware/open-vm-tools.git;protocol=https;branch=master \
file://tools.conf \
file://vmtoolsd.service \
file://vmtoolsd.init \
@@ -43,6 +43,8 @@ SRC_URI = "git://github.com/vmware/open-vm-tools.git;protocol=https \
file://0002-hgfsServerLinux-Consider-64bit-time_t-possibility.patch;patchdir=.. \
file://0001-utilBacktrace-Ignore-Warray-bounds.patch;patchdir=.. \
file://0001-hgfsmounter-Makefile.am-support-usrmerge.patch;patchdir=.. \
+ file://0001-Properly-check-authorization-on-incoming-guestOps-re.patch;patchdir=.. \
+ file://0001-Allow-only-X509-certs-to-verify-the-SAML-token-signa.patch;patchdir=.. \
"
SRCREV = "d3edfd142a81096f9f58aff17d84219b457f4987"
diff --git a/meta-oe/recipes-support/opencl/clinfo_2.2.18.04.06.bb b/meta-oe/recipes-support/opencl/clinfo_2.2.18.04.06.bb
index 9fd88ced95..831b15a455 100644
--- a/meta-oe/recipes-support/opencl/clinfo_2.2.18.04.06.bb
+++ b/meta-oe/recipes-support/opencl/clinfo_2.2.18.04.06.bb
@@ -7,7 +7,7 @@ HOMEPAGE = "https://github.com/Oblomov/clinfo"
LICENSE = "CC0-1.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=fd8857f774dfb0eefe1e80c8f9240a7e"
-SRC_URI = "git://github.com/Oblomov/clinfo.git;protocol=https"
+SRC_URI = "git://github.com/Oblomov/clinfo.git;protocol=https;branch=master"
SRCREV = "59d0daf898e48d76ccbb788acbba258fa0a8ba7c"
diff --git a/meta-oe/recipes-support/opencv/ade_0.1.1f.bb b/meta-oe/recipes-support/opencv/ade_0.1.1f.bb
index 3861802158..7e9bbc31c9 100644
--- a/meta-oe/recipes-support/opencv/ade_0.1.1f.bb
+++ b/meta-oe/recipes-support/opencv/ade_0.1.1f.bb
@@ -4,7 +4,7 @@ and processing framework. ADE Framework is suitable for \
organizing data flow processing and execution."
HOMEPAGE = "https://github.com/opencv/ade"
-SRC_URI = "git://github.com/opencv/ade.git \
+SRC_URI = "git://github.com/opencv/ade.git;branch=master;protocol=https \
file://0001-use-GNUInstallDirs-for-detecting-install-paths.patch \
"
diff --git a/meta-oe/recipes-support/opencv/opencv_4.1.0.bb b/meta-oe/recipes-support/opencv/opencv_4.1.0.bb
index 19d5d0c891..d7a0158749 100644
--- a/meta-oe/recipes-support/opencv/opencv_4.1.0.bb
+++ b/meta-oe/recipes-support/opencv/opencv_4.1.0.bb
@@ -37,12 +37,12 @@ IPP_FILENAME = "${@ipp_filename(d)}"
IPP_MD5 = "${@ipp_md5sum(d)}"
SRCREV_FORMAT = "opencv_contrib_ipp_boostdesc_vgg"
-SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
- git://github.com/opencv/opencv_contrib.git;destsuffix=contrib;name=contrib \
- git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20180723;destsuffix=ipp;name=ipp \
- git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=boostdesc;name=boostdesc \
- git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=vgg;name=vgg \
- git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=face;name=face \
+SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=master;protocol=https \
+ git://github.com/opencv/opencv_contrib.git;destsuffix=contrib;name=contrib;branch=master;protocol=https \
+ git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20180723;destsuffix=ipp;name=ipp;protocol=https \
+ git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=boostdesc;name=boostdesc;protocol=https \
+ git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=vgg;name=vgg;protocol=https \
+ git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=face;name=face;protocol=https \
file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
file://0002-Make-opencv-ts-create-share-library-intead-of-static.patch \
file://0003-To-fix-errors-as-following.patch \
diff --git a/meta-oe/recipes-support/openldap/openldap/CVE-2021-27212.patch b/meta-oe/recipes-support/openldap/openldap/CVE-2021-27212.patch
new file mode 100644
index 0000000000..c6bac80061
--- /dev/null
+++ b/meta-oe/recipes-support/openldap/openldap/CVE-2021-27212.patch
@@ -0,0 +1,31 @@
+From 9badb73425a67768c09bcaed1a9c26c684af6c30 Mon Sep 17 00:00:00 2001
+From: Howard Chu <hyc@openldap.org>
+Date: Sat, 6 Feb 2021 20:52:06 +0000
+Subject: [PATCH] ITS#9454 fix issuerAndThisUpdateCheck
+
+
+Signed-off-by: Howard Chu <hyc@openldap.org>
+
+Upstream-Status: Backport [https://git.openldap.org/openldap/openldap/-/commit/9badb73425a67768c09bcaed1a9c26c684af6c30]
+CVE: CVE-2021-27212
+Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
+---
+ servers/slapd/schema_init.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c
+index 31be115..8b1e255 100644
+--- a/servers/slapd/schema_init.c
++++ b/servers/slapd/schema_init.c
+@@ -3900,6 +3900,8 @@ issuerAndThisUpdateCheck(
+ break;
+ }
+ }
++ if ( tu->bv_len < STRLENOF("YYYYmmddHHmmssZ") ) return LDAP_INVALID_SYNTAX;
++
+ x.bv_val += tu->bv_len + 1;
+ x.bv_len -= tu->bv_len + 1;
+
+--
+2.25.1
+
diff --git a/meta-oe/recipes-support/openldap/openldap/CVE-2022-29155.patch b/meta-oe/recipes-support/openldap/openldap/CVE-2022-29155.patch
new file mode 100644
index 0000000000..2860b95220
--- /dev/null
+++ b/meta-oe/recipes-support/openldap/openldap/CVE-2022-29155.patch
@@ -0,0 +1,277 @@
+From 11e136f15085a4bda5701e910988966bed699977 Mon Sep 17 00:00:00 2001
+From: Hitendra Prajapati <hprajapati@mvista.com>
+Date: Wed, 18 May 2022 13:57:59 +0530
+Subject: [PATCH] CVE-2022-29155
+
+Upstream-Status: Backport [https://git.openldap.org/openldap/openldap/-/commit/87df6c19915042430540931d199a39105544a134]
+CVE: CVE-2022-29155
+Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
+
+---
+ servers/slapd/back-sql/search.c | 123 +++++++++++++++++++++++++++-----
+ 1 file changed, 105 insertions(+), 18 deletions(-)
+
+diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c
+index bb0f1e2..1770bde 100644
+--- a/servers/slapd/back-sql/search.c
++++ b/servers/slapd/back-sql/search.c
+@@ -63,6 +63,38 @@ static void send_paged_response(
+ ID *lastid );
+ #endif /* ! BACKSQL_ARBITRARY_KEY */
+
++/* Look for chars that need to be escaped, return count of them.
++ * If out is non-NULL, copy escape'd val to it.
++ */
++static int
++backsql_val_escape( Operation *op, struct berval *in, struct berval *out )
++{
++ char *ptr, *end;
++ int q = 0;
++
++ ptr = in->bv_val;
++ end = ptr + in->bv_len;
++ while (ptr < end) {
++ if ( *ptr == '\'' )
++ q++;
++ ptr++;
++ }
++ if ( q && out ) {
++ char *dst;
++ out->bv_len = in->bv_len + q;
++ out->bv_val = op->o_tmpalloc( out->bv_len + 1, op->o_tmpmemctx );
++ ptr = in->bv_val;
++ dst = out->bv_val;
++ while (ptr < end ) {
++ if ( *ptr == '\'' )
++ *dst++ = '\'';
++ *dst++ = *ptr++;
++ }
++ *dst = '\0';
++ }
++ return q;
++}
++
+ static int
+ backsql_attrlist_add( backsql_srch_info *bsi, AttributeDescription *ad )
+ {
+@@ -429,6 +461,8 @@ backsql_process_sub_filter( backsql_srch_info *bsi, Filter *f,
+ backsql_info *bi = (backsql_info *)bsi->bsi_op->o_bd->be_private;
+ int i;
+ int casefold = 0;
++ int escaped = 0;
++ struct berval escval, *fvalue;
+
+ if ( !f ) {
+ return 0;
+@@ -462,50 +496,68 @@ backsql_process_sub_filter( backsql_srch_info *bsi, Filter *f,
+
+ BER_BVZERO( &bv );
+ if ( f->f_sub_initial.bv_val ) {
+- bv.bv_len += f->f_sub_initial.bv_len;
++ bv.bv_len += f->f_sub_initial.bv_len + backsql_val_escape( NULL, &f->f_sub_initial, NULL );
+ }
+ if ( f->f_sub_any != NULL ) {
+ for ( a = 0; f->f_sub_any[ a ].bv_val != NULL; a++ ) {
+- bv.bv_len += f->f_sub_any[ a ].bv_len;
++ bv.bv_len += f->f_sub_any[ a ].bv_len + backsql_val_escape( NULL, &f->f_sub_any[ a ], NULL );
+ }
+ }
+ if ( f->f_sub_final.bv_val ) {
+- bv.bv_len += f->f_sub_final.bv_len;
++ bv.bv_len += f->f_sub_final.bv_len + backsql_val_escape( NULL, &f->f_sub_final, NULL );
+ }
+ bv.bv_len = 2 * bv.bv_len - 1;
+ bv.bv_val = ch_malloc( bv.bv_len + 1 );
+
+ s = 0;
+ if ( !BER_BVISNULL( &f->f_sub_initial ) ) {
+- bv.bv_val[ s ] = f->f_sub_initial.bv_val[ 0 ];
+- for ( i = 1; i < f->f_sub_initial.bv_len; i++ ) {
++ fvalue = &f->f_sub_initial;
++ escaped = backsql_val_escape( bsi->bsi_op, fvalue, &escval );
++ if ( escaped )
++ fvalue = &escval;
++ bv.bv_val[ s ] = fvalue->bv_val[ 0 ];
++ for ( i = 1; i < fvalue->bv_len; i++ ) {
+ bv.bv_val[ s + 2 * i - 1 ] = '%';
+- bv.bv_val[ s + 2 * i ] = f->f_sub_initial.bv_val[ i ];
++ bv.bv_val[ s + 2 * i ] = fvalue->bv_val[ i ];
+ }
+ bv.bv_val[ s + 2 * i - 1 ] = '%';
+ s += 2 * i;
++ if ( escaped )
++ bsi->bsi_op->o_tmpfree( escval.bv_val, bsi->bsi_op->o_tmpmemctx );
+ }
+
+ if ( f->f_sub_any != NULL ) {
+ for ( a = 0; !BER_BVISNULL( &f->f_sub_any[ a ] ); a++ ) {
+- bv.bv_val[ s ] = f->f_sub_any[ a ].bv_val[ 0 ];
+- for ( i = 1; i < f->f_sub_any[ a ].bv_len; i++ ) {
++ fvalue = &f->f_sub_any[ a ];
++ escaped = backsql_val_escape( bsi->bsi_op, fvalue, &escval );
++ if ( escaped )
++ fvalue = &escval;
++ bv.bv_val[ s ] = fvalue->bv_val[ 0 ];
++ for ( i = 1; i < fvalue->bv_len; i++ ) {
+ bv.bv_val[ s + 2 * i - 1 ] = '%';
+- bv.bv_val[ s + 2 * i ] = f->f_sub_any[ a ].bv_val[ i ];
++ bv.bv_val[ s + 2 * i ] = fvalue->bv_val[ i ];
+ }
+ bv.bv_val[ s + 2 * i - 1 ] = '%';
+ s += 2 * i;
++ if ( escaped )
++ bsi->bsi_op->o_tmpfree( escval.bv_val, bsi->bsi_op->o_tmpmemctx );
+ }
+ }
+
+ if ( !BER_BVISNULL( &f->f_sub_final ) ) {
+- bv.bv_val[ s ] = f->f_sub_final.bv_val[ 0 ];
+- for ( i = 1; i < f->f_sub_final.bv_len; i++ ) {
++ fvalue = &f->f_sub_final;
++ escaped = backsql_val_escape( bsi->bsi_op, fvalue, &escval );
++ if ( escaped )
++ fvalue = &escval;
++ bv.bv_val[ s ] = fvalue->bv_val[ 0 ];
++ for ( i = 1; i < fvalue->bv_len; i++ ) {
+ bv.bv_val[ s + 2 * i - 1 ] = '%';
+- bv.bv_val[ s + 2 * i ] = f->f_sub_final.bv_val[ i ];
++ bv.bv_val[ s + 2 * i ] = fvalue->bv_val[ i ];
+ }
+- bv.bv_val[ s + 2 * i - 1 ] = '%';
++ bv.bv_val[ s + 2 * i - 1 ] = '%';
+ s += 2 * i;
++ if ( escaped )
++ bsi->bsi_op->o_tmpfree( escval.bv_val, bsi->bsi_op->o_tmpmemctx );
+ }
+
+ bv.bv_val[ s - 1 ] = '\0';
+@@ -561,11 +613,17 @@ backsql_process_sub_filter( backsql_srch_info *bsi, Filter *f,
+ f->f_sub_initial.bv_val, 0 );
+ #endif /* BACKSQL_TRACE */
+
++ fvalue = &f->f_sub_initial;
++ escaped = backsql_val_escape( bsi->bsi_op, fvalue, &escval );
++ if ( escaped )
++ fvalue = &escval;
+ start = bsi->bsi_flt_where.bb_val.bv_len;
+ backsql_strfcat_x( &bsi->bsi_flt_where,
+ bsi->bsi_op->o_tmpmemctx,
+ "b",
+- &f->f_sub_initial );
++ fvalue );
++ if ( escaped )
++ bsi->bsi_op->o_tmpfree( escval.bv_val, bsi->bsi_op->o_tmpmemctx );
+ if ( casefold && BACKSQL_AT_CANUPPERCASE( at ) ) {
+ ldap_pvt_str2upper( &bsi->bsi_flt_where.bb_val.bv_val[ start ] );
+ }
+@@ -586,12 +644,18 @@ backsql_process_sub_filter( backsql_srch_info *bsi, Filter *f,
+ i, f->f_sub_any[ i ].bv_val );
+ #endif /* BACKSQL_TRACE */
+
++ fvalue = &f->f_sub_any[ i ];
++ escaped = backsql_val_escape( bsi->bsi_op, fvalue, &escval );
++ if ( escaped )
++ fvalue = &escval;
+ start = bsi->bsi_flt_where.bb_val.bv_len;
+ backsql_strfcat_x( &bsi->bsi_flt_where,
+ bsi->bsi_op->o_tmpmemctx,
+ "bc",
+- &f->f_sub_any[ i ],
++ fvalue,
+ '%' );
++ if ( escaped )
++ bsi->bsi_op->o_tmpfree( escval.bv_val, bsi->bsi_op->o_tmpmemctx );
+ if ( casefold && BACKSQL_AT_CANUPPERCASE( at ) ) {
+ /*
+ * Note: toupper('%') = '%'
+@@ -611,11 +675,17 @@ backsql_process_sub_filter( backsql_srch_info *bsi, Filter *f,
+ f->f_sub_final.bv_val, 0 );
+ #endif /* BACKSQL_TRACE */
+
++ fvalue = &f->f_sub_final;
++ escaped = backsql_val_escape( bsi->bsi_op, fvalue, &escval );
++ if ( escaped )
++ fvalue = &escval;
+ start = bsi->bsi_flt_where.bb_val.bv_len;
+ backsql_strfcat_x( &bsi->bsi_flt_where,
+ bsi->bsi_op->o_tmpmemctx,
+ "b",
+- &f->f_sub_final );
++ fvalue );
++ if ( escaped )
++ bsi->bsi_op->o_tmpfree( escval.bv_val, bsi->bsi_op->o_tmpmemctx );
+ if ( casefold && BACKSQL_AT_CANUPPERCASE( at ) ) {
+ ldap_pvt_str2upper( &bsi->bsi_flt_where.bb_val.bv_val[ start ] );
+ }
+@@ -1183,6 +1253,8 @@ backsql_process_filter_attr( backsql_srch_info *bsi, Filter *f, backsql_at_map_r
+ struct berval *filter_value = NULL;
+ MatchingRule *matching_rule = NULL;
+ struct berval ordering = BER_BVC("<=");
++ struct berval escval;
++ int escaped = 0;
+
+ Debug( LDAP_DEBUG_TRACE, "==>backsql_process_filter_attr(%s)\n",
+ at->bam_ad->ad_cname.bv_val, 0, 0 );
+@@ -1237,6 +1309,10 @@ equality_match:;
+ casefold = 1;
+ }
+
++ escaped = backsql_val_escape( bsi->bsi_op, filter_value, &escval );
++ if ( escaped )
++ filter_value = &escval;
++
+ /* FIXME: directoryString filtering should use a similar
+ * approach to deal with non-prettified values like
+ * " A non prettified value ", by using a LIKE
+@@ -1317,6 +1393,10 @@ equality_match:;
+ casefold = 1;
+ }
+
++ escaped = backsql_val_escape( bsi->bsi_op, filter_value, &escval );
++ if ( escaped )
++ filter_value = &escval;
++
+ /*
+ * FIXME: should we uppercase the operands?
+ */
+@@ -1350,7 +1430,7 @@ equality_match:;
+ &at->bam_sel_expr,
+ &ordering,
+ '\'',
+- &f->f_av_value,
++ filter_value,
+ (ber_len_t)STRLENOF( /* (' */ "')" ),
+ /* ( */ "')" );
+ }
+@@ -1374,13 +1454,17 @@ equality_match:;
+ case LDAP_FILTER_APPROX:
+ /* we do our best */
+
++ filter_value = &f->f_av_value;
++ escaped = backsql_val_escape( bsi->bsi_op, filter_value, &escval );
++ if ( escaped )
++ filter_value = &escval;
+ /*
+ * maybe we should check type of at->sel_expr here somehow,
+ * to know whether upper_func is applicable, but for now
+ * upper_func stuff is made for Oracle, where UPPER is
+ * safely applicable to NUMBER etc.
+ */
+- (void)backsql_process_filter_like( bsi, at, 1, &f->f_av_value );
++ (void)backsql_process_filter_like( bsi, at, 1, filter_value );
+ break;
+
+ default:
+@@ -1394,6 +1478,9 @@ equality_match:;
+
+ }
+
++ if ( escaped )
++ bsi->bsi_op->o_tmpfree( escval.bv_val, bsi->bsi_op->o_tmpmemctx );
++
+ Debug( LDAP_DEBUG_TRACE, "<==backsql_process_filter_attr(%s)\n",
+ at->bam_ad->ad_cname.bv_val, 0, 0 );
+
+--
+2.25.1
+
diff --git a/meta-oe/recipes-support/openldap/openldap/CVE-2023-2953-1.patch b/meta-oe/recipes-support/openldap/openldap/CVE-2023-2953-1.patch
new file mode 100644
index 0000000000..f4b4eb95d5
--- /dev/null
+++ b/meta-oe/recipes-support/openldap/openldap/CVE-2023-2953-1.patch
@@ -0,0 +1,30 @@
+From 752d320cf96e46f24c0900f1a8f6af0a3fc3c4ce Mon Sep 17 00:00:00 2001
+From: Howard Chu <hyc@openldap.org>
+Date: Wed, 24 Aug 2022 14:40:51 +0100
+Subject: [PATCH] ITS#9904 ldif_open_url: check for ber_strdup failure
+
+Code present since 1999, df8f7cbb9b79be3be9205d116d1dd0b263d6861a
+
+Upstream-Status: Backport [https://git.openldap.org/openldap/openldap/-/commit/752d320cf96e46f24c0900f1a8f6af0a3fc3c4ce]
+CVE: CVE-2023-2953
+Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
+---
+ libraries/libldap/fetch.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libraries/libldap/fetch.c b/libraries/libldap/fetch.c
+index 9e426dc647..536871bcfe 100644
+--- a/libraries/libldap/fetch.c
++++ b/libraries/libldap/fetch.c
+@@ -69,6 +69,8 @@ ldif_open_url(
+ }
+
+ p = ber_strdup( urlstr );
++ if ( p == NULL )
++ return NULL;
+
+ /* But we should convert to LDAP_DIRSEP before use */
+ if ( LDAP_DIRSEP[0] != '/' ) {
+--
+GitLab
+
diff --git a/meta-oe/recipes-support/openldap/openldap/CVE-2023-2953-2.patch b/meta-oe/recipes-support/openldap/openldap/CVE-2023-2953-2.patch
new file mode 100644
index 0000000000..02c43bc445
--- /dev/null
+++ b/meta-oe/recipes-support/openldap/openldap/CVE-2023-2953-2.patch
@@ -0,0 +1,76 @@
+From 6563fab9e2feccb0a684d0398e78571d09fb808b Mon Sep 17 00:00:00 2001
+From: Howard Chu <hyc@openldap.org>
+Date: Thu, 25 Aug 2022 16:13:21 +0100
+Subject: [PATCH] ITS#9904 ldap_url_parsehosts: check for strdup failure
+
+Avoid unnecessary strdup in IPv6 addr parsing, check for strdup
+failure when dup'ing scheme.
+
+Code present since 2000, 8da110a9e726dbc612b302feafe0109271e6bc59
+
+Upstream-Status: Backport [https://git.openldap.org/openldap/openldap/-/commit/6563fab9e2feccb0a684d0398e78571d09fb808b]
+CVE: CVE-2023-2953
+Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
+---
+ libraries/libldap/url.c | 21 ++++++++++++---------
+ 1 file changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c
+index dcf2aac9e8..493fd7ce47 100644
+--- a/libraries/libldap/url.c
++++ b/libraries/libldap/url.c
+@@ -1385,24 +1385,22 @@ ldap_url_parsehosts(
+ }
+ ludp->lud_port = port;
+ ludp->lud_host = specs[i];
+- specs[i] = NULL;
+ p = strchr(ludp->lud_host, ':');
+ if (p != NULL) {
+ /* more than one :, IPv6 address */
+ if ( strchr(p+1, ':') != NULL ) {
+ /* allow [address] and [address]:port */
+ if ( *ludp->lud_host == '[' ) {
+- p = LDAP_STRDUP(ludp->lud_host+1);
+- /* copied, make sure we free source later */
+- specs[i] = ludp->lud_host;
+- ludp->lud_host = p;
+- p = strchr( ludp->lud_host, ']' );
++ p = strchr( ludp->lud_host+1, ']' );
+ if ( p == NULL ) {
+ LDAP_FREE(ludp);
+ ldap_charray_free(specs);
+ return LDAP_PARAM_ERROR;
+ }
+- *p++ = '\0';
++ /* Truncate trailing ']' and shift hostname down 1 char */
++ *p = '\0';
++ AC_MEMCPY( ludp->lud_host, ludp->lud_host+1, p - ludp->lud_host );
++ p++;
+ if ( *p != ':' ) {
+ if ( *p != '\0' ) {
+ LDAP_FREE(ludp);
+@@ -1428,14 +1426,19 @@ ldap_url_parsehosts(
+ }
+ }
+ }
+- ldap_pvt_hex_unescape(ludp->lud_host);
+ ludp->lud_scheme = LDAP_STRDUP("ldap");
++ if ( ludp->lud_scheme == NULL ) {
++ LDAP_FREE(ludp);
++ ldap_charray_free(specs);
++ return LDAP_NO_MEMORY;
++ }
++ specs[i] = NULL;
++ ldap_pvt_hex_unescape(ludp->lud_host);
+ ludp->lud_next = *ludlist;
+ *ludlist = ludp;
+ }
+
+ /* this should be an array of NULLs now */
+- /* except entries starting with [ */
+ ldap_charray_free(specs);
+ return LDAP_SUCCESS;
+ }
+--
+GitLab
+
diff --git a/meta-oe/recipes-support/openldap/openldap_2.4.57.bb b/meta-oe/recipes-support/openldap/openldap_2.4.57.bb
index a282523a3c..7c2ea7c452 100644
--- a/meta-oe/recipes-support/openldap/openldap_2.4.57.bb
+++ b/meta-oe/recipes-support/openldap/openldap_2.4.57.bb
@@ -23,8 +23,11 @@ SRC_URI = "http://www.openldap.org/software/download/OpenLDAP/openldap-release/$
file://thread_stub.patch \
file://openldap-CVE-2015-3276.patch \
file://remove-user-host-pwd-from-version.patch \
+ file://CVE-2022-29155.patch \
+ file://CVE-2023-2953-1.patch \
+ file://CVE-2023-2953-2.patch \
+ file://CVE-2021-27212.patch \
"
-
SRC_URI[md5sum] = "e3349456c3a66e5e6155be7ddc3f042c"
SRC_URI[sha256sum] = "c7ba47e1e6ecb5b436f3d43281df57abeffa99262141aec822628bc220f6b45a"
diff --git a/meta-oe/recipes-support/opensc/opensc/CVE-2023-40660.patch b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40660.patch
new file mode 100644
index 0000000000..74e547298f
--- /dev/null
+++ b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40660.patch
@@ -0,0 +1,55 @@
+Origin: https://github.com/OpenSC/OpenSC/commit/868f76fb31255fd3fdacfc3e476452efeb61c3e7
+From: Frank Morgner <frankmorgner@gmail.com>
+Date: Wed, 21 Jun 2023 12:27:23 +0200
+Subject: Fixed PIN authentication bypass
+
+If two processes are accessing a token, then one process may leave the
+card usable with an authenticated PIN so that a key may sign/decrypt any
+data. This is especially the case if the token does not support a way of
+resetting the authentication status (logout).
+
+We have some tracking of the authentication status in software via
+PKCS#11, Minidriver (os-wise) and CryptoTokenKit, which is why a
+PIN-prompt will appear even though the card may technically be unlocked
+as described in the above example. However, before this change, an empty
+PIN was not verified (likely yielding an error during PIN-verification),
+but it was just checked whether the PIN is authenticated. This defeats
+the purpose of the PIN verification, because an empty PIN is not the
+correct one. Especially during OS Logon, we don't want that kind of
+shortcut, but we want the user to verify the correct PIN (even though
+the token was left unattended and authentication at the computer).
+
+This essentially reverts commit e6f7373ef066cfab6e3162e8b5f692683db23864.
+
+CVE: CVE-2023-40660
+Upstream-Status: Backport [https://salsa.debian.org/opensc-team/opensc/-/commit/940e8bc764047c873f88bb1396933a5368d03533]
+Signed-off-by: Virendra Thakur <virendrak@kpit.com>
+---
+ src/libopensc/pkcs15-pin.c | 13 -------------
+ 1 file changed, 13 deletions(-)
+
+diff --git a/src/libopensc/pkcs15-pin.c b/src/libopensc/pkcs15-pin.c
+index 80a185fecd..393234efe4 100644
+--- a/src/libopensc/pkcs15-pin.c
++++ b/src/libopensc/pkcs15-pin.c
+@@ -307,19 +307,6 @@
+ LOG_FUNC_RETURN(ctx, SC_ERROR_INVALID_PIN_REFERENCE);
+ auth_info = (struct sc_pkcs15_auth_info *)pin_obj->data;
+
+- /*
+- * if pin cache is disabled, we can get here with no PIN data.
+- * in this case, to avoid error or unnecessary pin prompting on pinpad,
+- * check if the PIN has been already verified and the access condition
+- * is still open on card.
+- */
+- if (pinlen == 0) {
+- r = sc_pkcs15_get_pin_info(p15card, pin_obj);
+-
+- if (r == SC_SUCCESS && auth_info->logged_in == SC_PIN_STATE_LOGGED_IN)
+- LOG_FUNC_RETURN(ctx, r);
+- }
+-
+ r = _validate_pin(p15card, auth_info, pinlen);
+
+ if (r)
+
diff --git a/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-1.patch b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-1.patch
new file mode 100644
index 0000000000..3ecff558cf
--- /dev/null
+++ b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-1.patch
@@ -0,0 +1,47 @@
+Origin: https://github.com/OpenSC/OpenSC/commit/245efe608d083fd4e4ec96793fdefd218e26fde7
+From: Jakub Jelen <jjelen@redhat.com>
+Date: Thu, 17 Aug 2023 13:54:42 +0200
+Subject: pkcs15: Avoid buffer overflow when getting last update
+
+Thanks oss-fuzz
+
+https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60769
+
+CVE: CVE-2023-40661
+Upstream-Status: Backport [https://salsa.debian.org/opensc-team/opensc/-/commit/8026fb4ca0ed53d970c6c497252eb264d4192d50]
+Signed-off-by: Virendra Thakur <virendrak@kpit.com>
+Comment: Hunk refreshed based on codebase.
+
+---
+ src/libopensc/pkcs15.c | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/src/libopensc/pkcs15.c b/src/libopensc/pkcs15.c
+index eb7fc6afcd..4215b733a8 100644
+--- a/src/libopensc/pkcs15.c
++++ b/src/libopensc/pkcs15.c
+@@ -528,7 +528,7 @@
+ struct sc_context *ctx = p15card->card->ctx;
+ struct sc_file *file = NULL;
+ struct sc_asn1_entry asn1_last_update[C_ASN1_LAST_UPDATE_SIZE];
+- unsigned char *content, last_update[32];
++ unsigned char *content, last_update[32] = {0};
+ size_t lupdate_len = sizeof(last_update) - 1;
+ int r, content_len;
+ size_t size;
+@@ -564,9 +564,11 @@
+ if (r < 0)
+ return NULL;
+
+- p15card->tokeninfo->last_update.gtime = strdup((char *)last_update);
+- if (!p15card->tokeninfo->last_update.gtime)
+- return NULL;
++ if (asn1_last_update[0].flags & SC_ASN1_PRESENT) {
++ p15card->tokeninfo->last_update.gtime = strdup((char *)last_update);
++ if (!p15card->tokeninfo->last_update.gtime)
++ return NULL;
++ }
+ done:
+ sc_log(ctx, "lastUpdate.gtime '%s'", p15card->tokeninfo->last_update.gtime);
+ return p15card->tokeninfo->last_update.gtime;
+
diff --git a/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-2.patch b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-2.patch
new file mode 100644
index 0000000000..39e729c5a9
--- /dev/null
+++ b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-2.patch
@@ -0,0 +1,32 @@
+Origin: https://github.com/OpenSC/OpenSC/commit/440ca666eff10cc7011901252d20f3fc4ea23651
+From: Jakub Jelen <jjelen@redhat.com>
+Date: Thu, 17 Aug 2023 13:41:36 +0200
+Subject: setcos: Avoid buffer underflow
+
+Thanks oss-fuzz
+
+https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60672
+CVE: CVE-2023-40661
+Upstream-Status: Backport [https://salsa.debian.org/opensc-team/opensc/-/commit/8026fb4ca0ed53d970c6c497252eb264d4192d50]
+Signed-off-by: Virendra Thakur <virendrak@kpit.com>
+Comment: Hunk refreshed based on codebase.
+---
+ src/pkcs15init/pkcs15-setcos.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/pkcs15init/pkcs15-setcos.c b/src/pkcs15init/pkcs15-setcos.c
+index 1b56afe6d9..1907b47f9d 100644
+--- a/src/pkcs15init/pkcs15-setcos.c
++++ b/src/pkcs15init/pkcs15-setcos.c
+@@ -346,6 +346,10 @@
+
+ /* Replace the path of instantiated key template by the path from the object data. */
+ memcpy(&file->path, &key_info->path, sizeof(file->path));
++ if (file->path.len < 2) {
++ sc_file_free(file);
++ LOG_TEST_RET(ctx, SC_ERROR_INVALID_DATA, "Invalid path");
++ }
+ file->id = file->path.value[file->path.len - 2] * 0x100
+ + file->path.value[file->path.len - 1];
+
+
diff --git a/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-3.patch b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-3.patch
new file mode 100644
index 0000000000..7950cf91df
--- /dev/null
+++ b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-3.patch
@@ -0,0 +1,31 @@
+Origin: https://github.com/OpenSC/OpenSC/commit/41d61da8481582e12710b5858f8b635e0a71ab5e
+From: Jakub Jelen <jjelen@redhat.com>
+Date: Wed, 20 Sep 2023 10:13:57 +0200
+Subject: oberthur: Avoid buffer overflow
+
+Thanks oss-fuzz
+
+https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60650
+CVE: CVE-2023-40661
+Upstream-Status: Backport [https://salsa.debian.org/opensc-team/opensc/-/commit/8026fb4ca0ed53d970c6c497252eb264d4192d50]
+Signed-off-by: Virendra Thakur <virendrak@kpit.com>
+Comment: Hunk refreshed based on codebase.
+---
+ src/pkcs15init/pkcs15-oberthur.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/pkcs15init/pkcs15-oberthur.c b/src/pkcs15init/pkcs15-oberthur.c
+index ad2cabd530..c441ab1e76 100644
+--- a/src/pkcs15init/pkcs15-oberthur.c
++++ b/src/pkcs15init/pkcs15-oberthur.c
+@@ -688,6 +688,9 @@
+ if (object->type != SC_PKCS15_TYPE_PRKEY_RSA)
+ LOG_TEST_RET(ctx, SC_ERROR_NOT_SUPPORTED, "Create key failed: RSA only supported");
+
++ if (key_info->path.len < 2)
++ LOG_TEST_RET(ctx, SC_ERROR_OBJECT_NOT_VALID, "The path needs to be at least to bytes long");
++
+ sc_log(ctx, "create private key ID:%s", sc_pkcs15_print_id(&key_info->id));
+ /* Here, the path of private key file should be defined.
+ * Nevertheless, we need to instantiate private key to get the ACLs. */
+
diff --git a/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-4.patch b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-4.patch
new file mode 100644
index 0000000000..797f8ad3b1
--- /dev/null
+++ b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-4.patch
@@ -0,0 +1,28 @@
+Origin: https://github.com/OpenSC/OpenSC/commit/578aed8391ef117ca64a9e0cba8e5c264368a0ec
+From: Frank Morgner <frankmorgner@gmail.com>
+Date: Thu, 8 Dec 2022 00:27:18 +0100
+Subject: sc_pkcs15init_rmdir: prevent out of bounds write
+
+fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53927
+CVE: CVE-2023-40661
+Upstream-Status: Backport [https://salsa.debian.org/opensc-team/opensc/-/commit/8026fb4ca0ed53d970c6c497252eb264d4192d50]
+Signed-off-by: Virendra Thakur <virendrak@kpit.com>
+Comment: Hunk refreshed based on codebase.
+---
+ src/pkcs15init/pkcs15-lib.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/pkcs15init/pkcs15-lib.c b/src/pkcs15init/pkcs15-lib.c
+index 91cee37310..3df03c6e1f 100644
+--- a/src/pkcs15init/pkcs15-lib.c
++++ b/src/pkcs15init/pkcs15-lib.c
+@@ -666,6 +666,8 @@
+
+ path = df->path;
+ path.len += 2;
++ if (path.len > SC_MAX_PATH_SIZE)
++ return SC_ERROR_INTERNAL;
+
+ nfids = r / 2;
+ while (r >= 0 && nfids--) {
+
diff --git a/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-5.patch b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-5.patch
new file mode 100644
index 0000000000..e173e65575
--- /dev/null
+++ b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-5.patch
@@ -0,0 +1,30 @@
+Origin: https://github.com/OpenSC/OpenSC/commit/c449a181a6988cc1e8dc8764d23574e48cdc3fa6
+From: =?UTF-8?q?Veronika=20Hanul=C3=ADkov=C3=A1?= <vhanulik@redhat.com>
+Date: Mon, 19 Jun 2023 16:14:51 +0200
+Subject: pkcs15-cflex: check path length to prevent underflow
+
+Thanks OSS-Fuzz
+https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58932
+CVE: CVE-2023-40661
+Upstream-Status: Backport [https://salsa.debian.org/opensc-team/opensc/-/commit/8026fb4ca0ed53d970c6c497252eb264d4192d50]
+Signed-off-by: Virendra Thakur <virendrak@kpit.com>
+Comment: Hunk refreshed based on codebase.
+---
+ src/pkcs15init/pkcs15-cflex.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/pkcs15init/pkcs15-cflex.c b/src/pkcs15init/pkcs15-cflex.c
+index d06568073d..ce1d48e62c 100644
+--- a/src/pkcs15init/pkcs15-cflex.c
++++ b/src/pkcs15init/pkcs15-cflex.c
+@@ -56,6 +56,9 @@
+ int r = 0;
+ /* Select the parent DF */
+ path = df->path;
++ if (path.len < 2) {
++ return SC_ERROR_INVALID_ARGUMENTS;
++ }
+ path.len -= 2;
+ r = sc_select_file(p15card->card, &path, &parent);
+ if (r < 0)
+
diff --git a/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-6.patch b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-6.patch
new file mode 100644
index 0000000000..abb524de29
--- /dev/null
+++ b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-6.patch
@@ -0,0 +1,30 @@
+Origin: https://github.com/OpenSC/OpenSC/commit/df5a176bfdf8c52ba89c7fef1f82f6f3b9312bc1
+From: Veronika Hanulikova <xhanulik@fi.muni.cz>
+Date: Fri, 10 Feb 2023 11:47:34 +0100
+Subject: Check array bounds
+
+Thanks OSS-Fuzz
+https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54312
+CVE: CVE-2023-40661
+Upstream-Status: Backport [https://salsa.debian.org/opensc-team/opensc/-/commit/8026fb4ca0ed53d970c6c497252eb264d4192d50]
+Signed-off-by: Virendra Thakur <virendrak@kpit.com>
+Comment: Hunk refreshed based on codebase.
+---
+ src/libopensc/muscle.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/libopensc/muscle.c b/src/libopensc/muscle.c
+index 61a4ec24d8..9d01e0c113 100644
+--- a/src/libopensc/muscle.c
++++ b/src/libopensc/muscle.c
+@@ -183,6 +183,9 @@
+ sc_apdu_t apdu;
+ int r;
+
++ if (dataLength + 9 > MSC_MAX_APDU)
++ return SC_ERROR_INVALID_ARGUMENTS;
++
+ sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0x54, 0x00, 0x00);
+ apdu.lc = dataLength + 9;
+ if (card->ctx->debug >= 2)
+
diff --git a/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-7.patch b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-7.patch
new file mode 100644
index 0000000000..858a996ed7
--- /dev/null
+++ b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-7.patch
@@ -0,0 +1,40 @@
+Origin: https://github.com/OpenSC/OpenSC/commit/5631e9843c832a99769def85b7b9b68b4e3e3959
+From: Veronika Hanulikova <xhanulik@fi.muni.cz>
+Date: Fri, 3 Mar 2023 16:07:38 +0100
+Subject: Check length of string before making copy
+
+Thanks OSS-Fuzz
+https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55851
+https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55998
+CVE: CVE-2023-40661
+Upstream-Status: Backport [https://salsa.debian.org/opensc-team/opensc/-/commit/8026fb4ca0ed53d970c6c497252eb264d4192d50]
+Signed-off-by: Virendra Thakur <virendrak@kpit.com>
+Comment: Hunk refreshed based on codebase.
+---
+ src/pkcs15init/profile.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/pkcs15init/profile.c b/src/pkcs15init/profile.c
+index 2b793b0282..3bad1e8536 100644
+--- a/src/pkcs15init/profile.c
++++ b/src/pkcs15init/profile.c
+@@ -1465,6 +1465,8 @@
+ while (argc--) {
+ unsigned int op, method, id;
+
++ if (strlen(*argv) >= sizeof(oper))
++ goto bad;
+ strlcpy(oper, *argv++, sizeof(oper));
+ if ((what = strchr(oper, '=')) == NULL)
+ goto bad;
+@@ -2128,6 +2130,9 @@
+ return get_uint(cur, value, type);
+ }
+
++ if (strlen(value) >= sizeof(temp))
++ return 1;
++
+ n = strcspn(value, "0123456789x");
+ strlcpy(temp, value, (sizeof(temp) > n) ? n + 1 : sizeof(temp));
+
+
diff --git a/meta-oe/recipes-support/opensc/opensc_0.20.0.bb b/meta-oe/recipes-support/opensc/opensc_0.20.0.bb
index a815980c4f..3eb0c1e558 100644
--- a/meta-oe/recipes-support/opensc/opensc_0.20.0.bb
+++ b/meta-oe/recipes-support/opensc/opensc_0.20.0.bb
@@ -13,7 +13,15 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
#v0.19.0
SRCREV = "45e29056ccde422e70ed3585084a7f150c632515"
-SRC_URI = "git://github.com/OpenSC/OpenSC \
+SRC_URI = "git://github.com/OpenSC/OpenSC;branch=master;protocol=https \
+ file://CVE-2023-40660.patch \
+ file://CVE-2023-40661-1.patch \
+ file://CVE-2023-40661-2.patch \
+ file://CVE-2023-40661-3.patch \
+ file://CVE-2023-40661-4.patch \
+ file://CVE-2023-40661-5.patch \
+ file://CVE-2023-40661-6.patch \
+ file://CVE-2023-40661-7.patch \
"
DEPENDS = "virtual/libiconv openssl"
diff --git a/meta-oe/recipes-support/picocom/picocom_git.bb b/meta-oe/recipes-support/picocom/picocom_git.bb
index 3d26b9364b..801300e707 100644
--- a/meta-oe/recipes-support/picocom/picocom_git.bb
+++ b/meta-oe/recipes-support/picocom/picocom_git.bb
@@ -9,7 +9,7 @@ PV = "${BASEPV}+git${SRCPV}"
SRCREV = "90385aabe2b51f39fa130627d46b377569f82d4a"
-SRC_URI = "git://github.com/npat-efault/picocom \
+SRC_URI = "git://github.com/npat-efault/picocom;branch=master;protocol=https \
file://0001-Fix-building-with-musl.patch \
"
diff --git a/meta-oe/recipes-support/pidgin/funyahoo-plusplus_git.bb b/meta-oe/recipes-support/pidgin/funyahoo-plusplus_git.bb
index 3a437659e7..0e3e5ff733 100644
--- a/meta-oe/recipes-support/pidgin/funyahoo-plusplus_git.bb
+++ b/meta-oe/recipes-support/pidgin/funyahoo-plusplus_git.bb
@@ -7,7 +7,7 @@ DEPENDS = "pidgin json-glib glib-2.0"
inherit pkgconfig
-SRC_URI = "git://github.com/EionRobb/funyahoo-plusplus;branch=master;protocol=git"
+SRC_URI = "git://github.com/EionRobb/funyahoo-plusplus;branch=master;protocol=https"
SRCREV = "fbbd9c591100aa00a0487738ec7b6acd3d924b3f"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/pidgin/icyque_git.bb b/meta-oe/recipes-support/pidgin/icyque_git.bb
index 0f32dc3a39..2905e16fcc 100644
--- a/meta-oe/recipes-support/pidgin/icyque_git.bb
+++ b/meta-oe/recipes-support/pidgin/icyque_git.bb
@@ -9,7 +9,7 @@ PV = "0.1+gitr${SRCPV}"
inherit pkgconfig
-SRC_URI = "git://github.com/EionRobb/icyque"
+SRC_URI = "git://github.com/EionRobb/icyque;branch=master;protocol=https"
SRCREV = "513fc162d5d1a201c2b044e2b42941436d1069d5"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/pidgin/purple-skypeweb_git.bb b/meta-oe/recipes-support/pidgin/purple-skypeweb_git.bb
index 092e6059b8..854920d2ee 100644
--- a/meta-oe/recipes-support/pidgin/purple-skypeweb_git.bb
+++ b/meta-oe/recipes-support/pidgin/purple-skypeweb_git.bb
@@ -7,7 +7,7 @@ DEPENDS = "pidgin json-glib glib-2.0 zlib"
inherit pkgconfig
-SRC_URI = "git://github.com/EionRobb/skype4pidgin;branch=master;protocol=git"
+SRC_URI = "git://github.com/EionRobb/skype4pidgin;branch=master;protocol=https"
SRCREV = "14f1b69b6292bbdc98cca484b050ec8359394c4e"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/poco/poco_1.9.4.bb b/meta-oe/recipes-support/poco/poco_1.9.4.bb
index fcd5219759..1c3a4ebb03 100644
--- a/meta-oe/recipes-support/poco/poco_1.9.4.bb
+++ b/meta-oe/recipes-support/poco/poco_1.9.4.bb
@@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=4267f48fc738f50380cbeeb76f95cebc"
DEPENDS = "libpcre zlib"
SRC_URI = " \
- git://github.com/pocoproject/poco.git;branch=poco-${PV} \
+ git://github.com/pocoproject/poco.git;branch=poco-${PV};protocol=https \
file://0001-Don-t-try-to-install-non-existing-Encodings-testsuit.patch \
file://0001-riscv-Enable-double-operations-when-using-double-flo.patch \
file://run-ptest \
diff --git a/meta-oe/recipes-support/pps-tools/pps-tools_1.0.2.bb b/meta-oe/recipes-support/pps-tools/pps-tools_1.0.2.bb
index c8baa5d9ca..5b53587745 100644
--- a/meta-oe/recipes-support/pps-tools/pps-tools_1.0.2.bb
+++ b/meta-oe/recipes-support/pps-tools/pps-tools_1.0.2.bb
@@ -5,7 +5,7 @@ LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
SRCREV = "cb48b7ecf7079ceba7081c78d4e61e507b0e8d2d"
-SRC_URI = "git://github.com/ago/pps-tools.git"
+SRC_URI = "git://github.com/ago/pps-tools.git;branch=master;protocol=https"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/remmina/remmina_1.3.6.bb b/meta-oe/recipes-support/remmina/remmina_1.3.6.bb
index 1c2f270e32..3b1e8706ce 100644
--- a/meta-oe/recipes-support/remmina/remmina_1.3.6.bb
+++ b/meta-oe/recipes-support/remmina/remmina_1.3.6.bb
@@ -10,7 +10,7 @@ DEPENDS_append_libc-musl = " libexecinfo"
LDFLAGS_append_libc-musl = " -lexecinfo"
SRCREV = "cc391370d8b4c07597617e0a771a9732f0802411"
-SRC_URI = "git://gitlab.com/Remmina/Remmina;protocol=https \
+SRC_URI = "git://gitlab.com/Remmina/Remmina;protocol=https;branch=master \
"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/rsnapshot/rsnapshot_git.bb b/meta-oe/recipes-support/rsnapshot/rsnapshot_git.bb
index 33f5dccca2..6fe8aa76f2 100644
--- a/meta-oe/recipes-support/rsnapshot/rsnapshot_git.bb
+++ b/meta-oe/recipes-support/rsnapshot/rsnapshot_git.bb
@@ -25,7 +25,7 @@ RDEPENDS_${PN} = "rsync \
SRCREV = "a9e29850fc33c503c289e245c7bad350eed746d9"
PV = "1.4.3+git${SRCPV}"
-SRC_URI = "git://github.com/DrHyde/${BPN};branch=master;protocol=git \
+SRC_URI = "git://github.com/DrHyde/${BPN};branch=master;protocol=https \
file://configure-fix-cmd_rsync.patch \
"
diff --git a/meta-oe/recipes-support/sass/libsass_3.6.3.bb b/meta-oe/recipes-support/sass/libsass_3.6.3.bb
index d893be2231..4b4fe55669 100644
--- a/meta-oe/recipes-support/sass/libsass_3.6.3.bb
+++ b/meta-oe/recipes-support/sass/libsass_3.6.3.bb
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=8f34396ca205f5e119ee77aae91fa27d"
inherit autotools
-SRC_URI = "git://github.com/sass/libsass.git;branch=master"
+SRC_URI = "git://github.com/sass/libsass.git;branch=master;protocol=https"
SRCREV = "e1c16e09b4a953757a15149deaaf28a3fd81dc97"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/sass/sassc_git.bb b/meta-oe/recipes-support/sass/sassc_git.bb
index 3c7a55cc3d..985d519f93 100644
--- a/meta-oe/recipes-support/sass/sassc_git.bb
+++ b/meta-oe/recipes-support/sass/sassc_git.bb
@@ -6,7 +6,7 @@ DEPENDS = "libsass"
inherit autotools pkgconfig
-SRC_URI = "git://github.com/sass/sassc.git"
+SRC_URI = "git://github.com/sass/sassc.git;branch=master;protocol=https"
SRCREV = "46748216ba0b60545e814c07846ca10c9fefc5b6"
S = "${WORKDIR}/git"
PV = "3.6.1"
diff --git a/meta-oe/recipes-support/satyr/satyr_0.28.bb b/meta-oe/recipes-support/satyr/satyr_0.28.bb
index fbf018d7f5..a928681ae8 100644
--- a/meta-oe/recipes-support/satyr/satyr_0.28.bb
+++ b/meta-oe/recipes-support/satyr/satyr_0.28.bb
@@ -7,7 +7,7 @@ LICENSE = "GPLv2"
inherit autotools-brokensep python3native pkgconfig
-SRC_URI = "git://github.com/abrt/satyr.git \
+SRC_URI = "git://github.com/abrt/satyr.git;branch=master;protocol=https \
file://0002-fix-compile-failure-against-musl-C-library.patch \
"
SRCREV = "8b5547b89b712b39a59f1d8b366e7de0f5f46108"
diff --git a/meta-oe/recipes-support/serial-utils/pty-forward-native.bb b/meta-oe/recipes-support/serial-utils/pty-forward-native.bb
index 7f59b3ecad..87d9c52903 100644
--- a/meta-oe/recipes-support/serial-utils/pty-forward-native.bb
+++ b/meta-oe/recipes-support/serial-utils/pty-forward-native.bb
@@ -6,7 +6,7 @@ SECTION = "console/network"
SRCREV = "00dbec2636ae0385ad028587e20e446272ff97ec"
PV = "1.1+gitr${SRCPV}"
-SRC_URI = "git://github.com/freesmartphone/cornucopia.git;protocol=https"
+SRC_URI = "git://github.com/freesmartphone/cornucopia.git;protocol=https;branch=master"
S = "${WORKDIR}/git/tools/serial_forward"
inherit autotools native
diff --git a/meta-oe/recipes-support/serial-utils/serial-forward_git.bb b/meta-oe/recipes-support/serial-utils/serial-forward_git.bb
index 0ef829856c..dcad8f7104 100644
--- a/meta-oe/recipes-support/serial-utils/serial-forward_git.bb
+++ b/meta-oe/recipes-support/serial-utils/serial-forward_git.bb
@@ -6,7 +6,7 @@ SECTION = "console/devel"
SRCREV = "07c6fdede0870edc37a8d51d033b6e7e29aa7c91"
PV = "1.1+gitr${SRCPV}"
-SRC_URI = "git://github.com/freesmartphone/cornucopia.git \
+SRC_URI = "git://github.com/freesmartphone/cornucopia.git;branch=master;protocol=https \
file://0001-serial_forward-Disable-default-static-linking.patch;striplevel=3 \
"
S = "${WORKDIR}/git/tools/serial_forward"
diff --git a/meta-oe/recipes-support/span-lite/span-lite_git.bb b/meta-oe/recipes-support/span-lite/span-lite_git.bb
index 96ec829b74..abb3ec2f36 100644
--- a/meta-oe/recipes-support/span-lite/span-lite_git.bb
+++ b/meta-oe/recipes-support/span-lite/span-lite_git.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "https://github.com/martinmoene/span-lite"
LICENSE = "BSL-1.0"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
-SRC_URI += "git://github.com/martinmoene/span-lite"
+SRC_URI += "git://github.com/martinmoene/span-lite;branch=master;protocol=https"
SRCREV = "e03d1166ccc8481d993dc02aae703966301a5e6e"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/spdlog/spdlog_1.5.0.bb b/meta-oe/recipes-support/spdlog/spdlog_1.5.0.bb
index 39629cce0d..9294d1a70e 100644
--- a/meta-oe/recipes-support/spdlog/spdlog_1.5.0.bb
+++ b/meta-oe/recipes-support/spdlog/spdlog_1.5.0.bb
@@ -4,7 +4,7 @@ LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRCREV = "cf6f1dd01e660d5865d68bf5fa78f6376b89470a"
-SRC_URI = "git://github.com/gabime/spdlog.git;protocol=git;branch=v1.x;"
+SRC_URI = "git://github.com/gabime/spdlog.git;protocol=https;branch=v1.x;"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/spitools/spitools_git.bb b/meta-oe/recipes-support/spitools/spitools_git.bb
index 625756873b..b9ed1bcd7b 100644
--- a/meta-oe/recipes-support/spitools/spitools_git.bb
+++ b/meta-oe/recipes-support/spitools/spitools_git.bb
@@ -10,7 +10,7 @@ SRCREV = "4a36a84f7df291ddaebd397aecf0c8515256a8e0"
S = "${WORKDIR}/git"
-SRC_URI = "git://github.com/cpb-/spi-tools.git;protocol=git"
+SRC_URI = "git://github.com/cpb-/spi-tools.git;protocol=https;branch=master"
inherit autotools
diff --git a/meta-oe/recipes-support/syslog-ng/files/CVE-2022-38725.patch b/meta-oe/recipes-support/syslog-ng/files/CVE-2022-38725.patch
new file mode 100644
index 0000000000..4a09c8c7fa
--- /dev/null
+++ b/meta-oe/recipes-support/syslog-ng/files/CVE-2022-38725.patch
@@ -0,0 +1,629 @@
+From 73b5c300b8fde5e7a4824baa83a04931279abb37 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?=
+ <laszlo.varady@protonmail.com>
+Date: Sat, 20 Aug 2022 12:42:38 +0200
+Subject: [PATCH] CVE-2022-38725
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: László Várady <laszlo.varady@protonmail.com>
+Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
+
+Upstream-Status: Backport from [https://github.com/syslog-ng/syslog-ng/commit/b5a060f2ebb8d794f508436a12e4d4163f94b1b8 && https://github.com/syslog-ng/syslog-ng/commit/81a07263f1e522a376d3a30f96f51df3f2879f8a && https://github.com/syslog-ng/syslog-ng/commit/4b8dc56ca8eaeac4c8751a305eb7eeefab8dc89d && https://github.com/syslog-ng/syslog-ng/commit/73b5c300b8fde5e7a4824baa83a04931279abb37 && https://github.com/syslog-ng/syslog-ng/commit/45f051239312e43bd4f92b9339fe67c6798a0321 && https://github.com/syslog-ng/syslog-ng/commit/09f489c89c826293ff8cbd282cfc866ab56054c4 && https://github.com/syslog-ng/syslog-ng/commit/8c6e2c1c41b0fcc5fbd464c35f4dac7102235396 && https://github.com/syslog-ng/syslog-ng/commit/56f881c5eaa3d8c02c96607c4b9e4eaf959a044d]
+CVE: CVE-2022-38725
+Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
+---
+ lib/timeutils/scan-timestamp.c | 68 +++++----
+ lib/timeutils/tests/test_scan-timestamp.c | 133 ++++++++++++++++--
+ modules/syslogformat/CMakeLists.txt | 2 +
+ modules/syslogformat/Makefile.am | 2 +
+ modules/syslogformat/syslog-format.c | 12 +-
+ modules/syslogformat/tests/CMakeLists.txt | 1 +
+ modules/syslogformat/tests/Makefile.am | 9 ++
+ .../syslogformat/tests/test_syslog_format.c | 104 ++++++++++++++
+ 8 files changed, 284 insertions(+), 47 deletions(-)
+ create mode 100644 modules/syslogformat/tests/CMakeLists.txt
+ create mode 100644 modules/syslogformat/tests/Makefile.am
+ create mode 100644 modules/syslogformat/tests/test_syslog_format.c
+
+diff --git a/lib/timeutils/scan-timestamp.c b/lib/timeutils/scan-timestamp.c
+index 41ead1a..ec9746b 100644
+--- a/lib/timeutils/scan-timestamp.c
++++ b/lib/timeutils/scan-timestamp.c
+@@ -34,41 +34,43 @@ scan_day_abbrev(const gchar **buf, gint *left, gint *wday)
+ {
+ *wday = -1;
+
+- if (*left < 3)
++ const gsize abbrev_length = 3;
++
++ if (*left < abbrev_length)
+ return FALSE;
+
+ switch (**buf)
+ {
+ case 'S':
+- if (strncasecmp(*buf, "Sun", 3) == 0)
++ if (strncasecmp(*buf, "Sun", abbrev_length) == 0)
+ *wday = 0;
+- else if (strncasecmp(*buf, "Sat", 3) == 0)
++ else if (strncasecmp(*buf, "Sat", abbrev_length) == 0)
+ *wday = 6;
+ break;
+ case 'M':
+- if (strncasecmp(*buf, "Mon", 3) == 0)
++ if (strncasecmp(*buf, "Mon", abbrev_length) == 0)
+ *wday = 1;
+ break;
+ case 'T':
+- if (strncasecmp(*buf, "Tue", 3) == 0)
++ if (strncasecmp(*buf, "Tue", abbrev_length) == 0)
+ *wday = 2;
+- else if (strncasecmp(*buf, "Thu", 3) == 0)
++ else if (strncasecmp(*buf, "Thu", abbrev_length) == 0)
+ *wday = 4;
+ break;
+ case 'W':
+- if (strncasecmp(*buf, "Wed", 3) == 0)
++ if (strncasecmp(*buf, "Wed", abbrev_length) == 0)
+ *wday = 3;
+ break;
+ case 'F':
+- if (strncasecmp(*buf, "Fri", 3) == 0)
++ if (strncasecmp(*buf, "Fri", abbrev_length) == 0)
+ *wday = 5;
+ break;
+ default:
+ return FALSE;
+ }
+
+- (*buf) += 3;
+- (*left) -= 3;
++ (*buf) += abbrev_length;
++ (*left) -= abbrev_length;
+ return TRUE;
+ }
+
+@@ -77,57 +79,59 @@ scan_month_abbrev(const gchar **buf, gint *left, gint *mon)
+ {
+ *mon = -1;
+
+- if (*left < 3)
++ const gsize abbrev_length = 3;
++
++ if (*left < abbrev_length)
+ return FALSE;
+
+ switch (**buf)
+ {
+ case 'J':
+- if (strncasecmp(*buf, "Jan", 3) == 0)
++ if (strncasecmp(*buf, "Jan", abbrev_length) == 0)
+ *mon = 0;
+- else if (strncasecmp(*buf, "Jun", 3) == 0)
++ else if (strncasecmp(*buf, "Jun", abbrev_length) == 0)
+ *mon = 5;
+- else if (strncasecmp(*buf, "Jul", 3) == 0)
++ else if (strncasecmp(*buf, "Jul", abbrev_length) == 0)
+ *mon = 6;
+ break;
+ case 'F':
+- if (strncasecmp(*buf, "Feb", 3) == 0)
++ if (strncasecmp(*buf, "Feb", abbrev_length) == 0)
+ *mon = 1;
+ break;
+ case 'M':
+- if (strncasecmp(*buf, "Mar", 3) == 0)
++ if (strncasecmp(*buf, "Mar", abbrev_length) == 0)
+ *mon = 2;
+- else if (strncasecmp(*buf, "May", 3) == 0)
++ else if (strncasecmp(*buf, "May", abbrev_length) == 0)
+ *mon = 4;
+ break;
+ case 'A':
+- if (strncasecmp(*buf, "Apr", 3) == 0)
++ if (strncasecmp(*buf, "Apr", abbrev_length) == 0)
+ *mon = 3;
+- else if (strncasecmp(*buf, "Aug", 3) == 0)
++ else if (strncasecmp(*buf, "Aug", abbrev_length) == 0)
+ *mon = 7;
+ break;
+ case 'S':
+- if (strncasecmp(*buf, "Sep", 3) == 0)
++ if (strncasecmp(*buf, "Sep", abbrev_length) == 0)
+ *mon = 8;
+ break;
+ case 'O':
+- if (strncasecmp(*buf, "Oct", 3) == 0)
++ if (strncasecmp(*buf, "Oct", abbrev_length) == 0)
+ *mon = 9;
+ break;
+ case 'N':
+- if (strncasecmp(*buf, "Nov", 3) == 0)
++ if (strncasecmp(*buf, "Nov", abbrev_length) == 0)
+ *mon = 10;
+ break;
+ case 'D':
+- if (strncasecmp(*buf, "Dec", 3) == 0)
++ if (strncasecmp(*buf, "Dec", abbrev_length) == 0)
+ *mon = 11;
+ break;
+ default:
+ return FALSE;
+ }
+
+- (*buf) += 3;
+- (*left) -= 3;
++ (*buf) += abbrev_length;
++ (*left) -= abbrev_length;
+ return TRUE;
+ }
+
+@@ -302,7 +306,7 @@ __parse_usec(const guchar **data, gint *length)
+ src++;
+ (*length)--;
+ }
+- while (isdigit(*src))
++ while (*length > 0 && isdigit(*src))
+ {
+ src++;
+ (*length)--;
+@@ -316,19 +320,21 @@ __parse_usec(const guchar **data, gint *length)
+ static gboolean
+ __has_iso_timezone(const guchar *src, gint length)
+ {
+- return (length >= 5) &&
++ return (length >= 6) &&
+ (*src == '+' || *src == '-') &&
+ isdigit(*(src+1)) &&
+ isdigit(*(src+2)) &&
+ *(src+3) == ':' &&
+ isdigit(*(src+4)) &&
+ isdigit(*(src+5)) &&
+- !isdigit(*(src+6));
++ (length < 7 || !isdigit(*(src+6)));
+ }
+
+ static guint32
+ __parse_iso_timezone(const guchar **data, gint *length)
+ {
++ g_assert(*length >= 6);
++
+ gint hours, mins;
+ const guchar *src = *data;
+ guint32 tz = 0;
+@@ -338,8 +344,10 @@ __parse_iso_timezone(const guchar **data, gint *length)
+ hours = (*(src + 1) - '0') * 10 + *(src + 2) - '0';
+ mins = (*(src + 4) - '0') * 10 + *(src + 5) - '0';
+ tz = sign * (hours * 3600 + mins * 60);
++
+ src += 6;
+ (*length) -= 6;
++
+ *data = src;
+ return tz;
+ }
+@@ -393,7 +401,7 @@ __parse_bsd_timestamp(const guchar **data, gint *length, WallClockTime *wct)
+ if (!scan_pix_timestamp((const gchar **) &src, &left, wct))
+ return FALSE;
+
+- if (*src == ':')
++ if (left && *src == ':')
+ {
+ src++;
+ left--;
+@@ -444,7 +452,7 @@ scan_rfc3164_timestamp(const guchar **data, gint *length, WallClockTime *wct)
+ * looking at you, skip that as well, so we can reliably detect IPv6
+ * addresses as hostnames, which would be using ":" as well. */
+
+- if (*src == ':')
++ if (left && *src == ':')
+ {
+ ++src;
+ --left;
+diff --git a/lib/timeutils/tests/test_scan-timestamp.c b/lib/timeutils/tests/test_scan-timestamp.c
+index 4508139..ad657c6 100644
+--- a/lib/timeutils/tests/test_scan-timestamp.c
++++ b/lib/timeutils/tests/test_scan-timestamp.c
+@@ -49,17 +49,21 @@ fake_time_add(time_t diff)
+ }
+
+ static gboolean
+-_parse_rfc3164(const gchar *ts, gchar isotimestamp[32])
++_parse_rfc3164(const gchar *ts, gint len, gchar isotimestamp[32])
+ {
+ UnixTime stamp;
+- const guchar *data = (const guchar *) ts;
+- gint length = strlen(ts);
++ const guchar *tsu = (const guchar *) ts;
++ gint tsu_len = len < 0 ? strlen(ts) : len;
+ GString *result = g_string_new("");
+ WallClockTime wct = WALL_CLOCK_TIME_INIT;
+
+-
++ const guchar *data = tsu;
++ gint length = tsu_len;
+ gboolean success = scan_rfc3164_timestamp(&data, &length, &wct);
+
++ cr_assert(length >= 0);
++ cr_assert(data == &tsu[tsu_len - length]);
++
+ unix_time_unset(&stamp);
+ convert_wall_clock_time_to_unix_time(&wct, &stamp);
+
+@@ -70,16 +74,21 @@ _parse_rfc3164(const gchar *ts, gchar isotimestamp[32])
+ }
+
+ static gboolean
+-_parse_rfc5424(const gchar *ts, gchar isotimestamp[32])
++_parse_rfc5424(const gchar *ts, gint len, gchar isotimestamp[32])
+ {
+ UnixTime stamp;
+- const guchar *data = (const guchar *) ts;
+- gint length = strlen(ts);
++ const guchar *tsu = (const guchar *) ts;
++ gint tsu_len = len < 0 ? strlen(ts) : len;
+ GString *result = g_string_new("");
+ WallClockTime wct = WALL_CLOCK_TIME_INIT;
+
++ const guchar *data = tsu;
++ gint length = tsu_len;
+ gboolean success = scan_rfc5424_timestamp(&data, &length, &wct);
+
++ cr_assert(length >= 0);
++ cr_assert(data == &tsu[tsu_len - length]);
++
+ unix_time_unset(&stamp);
+ convert_wall_clock_time_to_unix_time(&wct, &stamp);
+
+@@ -90,31 +99,60 @@ _parse_rfc5424(const gchar *ts, gchar isotimestamp[32])
+ }
+
+ static gboolean
+-_rfc3164_timestamp_eq(const gchar *ts, const gchar *expected, gchar converted[32])
++_rfc3164_timestamp_eq(const gchar *ts, gint len, const gchar *expected, gchar converted[32])
+ {
+- cr_assert(_parse_rfc3164(ts, converted));
++ cr_assert(_parse_rfc3164(ts, len, converted));
+ return strcmp(converted, expected) == 0;
+ }
+
+ static gboolean
+-_rfc5424_timestamp_eq(const gchar *ts, const gchar *expected, gchar converted[32])
++_rfc5424_timestamp_eq(const gchar *ts, gint len, const gchar *expected, gchar converted[32])
+ {
+- cr_assert(_parse_rfc5424(ts, converted));
++ cr_assert(_parse_rfc5424(ts, len, converted));
+ return strcmp(converted, expected) == 0;
+ }
+
+ #define _expect_rfc3164_timestamp_eq(ts, expected) \
+ ({ \
+ gchar converted[32]; \
+- cr_expect(_rfc3164_timestamp_eq(ts, expected, converted), "Parsed RFC3164 timestamp does not equal expected, ts=%s, converted=%s, expected=%s", ts, converted, expected); \
++ cr_expect(_rfc3164_timestamp_eq(ts, -1, expected, converted), "Parsed RFC3164 timestamp does not equal expected, ts=%s, converted=%s, expected=%s", ts, converted, expected); \
++ })
++
++#define _expect_rfc3164_timestamp_len_eq(ts, len, expected) \
++ ({ \
++ gchar converted[32]; \
++ cr_expect(_rfc3164_timestamp_eq(ts, len, expected, converted), "Parsed RFC3164 timestamp does not equal expected, ts=%s, converted=%s, expected=%s", ts, converted, expected); \
++ })
++
++#define _expect_rfc3164_fails(ts, len) \
++ ({ \
++ WallClockTime wct = WALL_CLOCK_TIME_INIT; \
++ const guchar *data = (guchar *) ts; \
++ gint length = len < 0 ? strlen(ts) : len; \
++ cr_assert_not(scan_rfc3164_timestamp(&data, &length, &wct)); \
+ })
+
+ #define _expect_rfc5424_timestamp_eq(ts, expected) \
+ ({ \
+ gchar converted[32]; \
+- cr_expect(_rfc5424_timestamp_eq(ts, expected, converted), "Parsed RFC5424 timestamp does not equal expected, ts=%s, converted=%s, expected=%s", ts, converted, expected); \
++ cr_expect(_rfc5424_timestamp_eq(ts, -1, expected, converted), "Parsed RFC5424 timestamp does not equal expected, ts=%s, converted=%s, expected=%s", ts, converted, expected); \
++ })
++
++#define _expect_rfc5424_timestamp_len_eq(ts, len, expected) \
++ ({ \
++ gchar converted[32]; \
++ cr_expect(_rfc5424_timestamp_eq(ts, len, expected, converted), "Parsed RFC5424 timestamp does not equal expected, ts=%s, converted=%s, expected=%s", ts, converted, expected); \
+ })
+
++#define _expect_rfc5424_fails(ts, len) \
++ ({ \
++ WallClockTime wct = WALL_CLOCK_TIME_INIT; \
++ const guchar *data = (guchar *) ts; \
++ gint length = len < 0 ? strlen(ts) : len; \
++ cr_assert_not(scan_rfc5424_timestamp(&data, &length, &wct)); \
++ })
++
++
+ Test(parse_timestamp, standard_bsd_format)
+ {
+ _expect_rfc3164_timestamp_eq("Oct 1 17:46:12", "2017-10-01T17:46:12.000+02:00");
+@@ -148,6 +186,75 @@ Test(parse_timestamp, standard_bsd_format_year_in_the_past)
+ _expect_rfc3164_timestamp_eq("Dec 31 17:46:12", "2017-12-31T17:46:12.000+01:00");
+ }
+
++Test(parse_timestamp, non_zero_terminated_rfc3164_iso_input_is_handled_properly)
++{
++ gchar *ts = "2022-08-17T05:02:28.417Z whatever";
++ gint ts_len = 24;
++
++ _expect_rfc3164_timestamp_len_eq(ts, strlen(ts), "2022-08-17T05:02:28.417+00:00");
++ _expect_rfc3164_timestamp_len_eq(ts, ts_len + 5, "2022-08-17T05:02:28.417+00:00");
++ _expect_rfc3164_timestamp_len_eq(ts, ts_len, "2022-08-17T05:02:28.417+00:00");
++
++ /* no "Z" parsed, timezone defaults to local, forced CET */
++ _expect_rfc3164_timestamp_len_eq(ts, ts_len - 1, "2022-08-17T05:02:28.417+02:00");
++
++ /* msec is partially parsed as we trim the string from the right */
++ _expect_rfc3164_timestamp_len_eq(ts, ts_len - 2, "2022-08-17T05:02:28.410+02:00");
++ _expect_rfc3164_timestamp_len_eq(ts, ts_len - 3, "2022-08-17T05:02:28.400+02:00");
++ _expect_rfc3164_timestamp_len_eq(ts, ts_len - 4, "2022-08-17T05:02:28.000+02:00");
++ _expect_rfc3164_timestamp_len_eq(ts, ts_len - 5, "2022-08-17T05:02:28.000+02:00");
++
++ for (gint i = 6; i < ts_len; i++)
++ _expect_rfc3164_fails(ts, ts_len - i);
++
++}
++
++Test(parse_timestamp, non_zero_terminated_rfc3164_bsd_pix_or_asa_input_is_handled_properly)
++{
++ gchar *ts = "Aug 17 2022 05:02:28: whatever";
++ gint ts_len = 21;
++
++ _expect_rfc3164_timestamp_len_eq(ts, strlen(ts), "2022-08-17T05:02:28.000+02:00");
++ _expect_rfc3164_timestamp_len_eq(ts, ts_len + 5, "2022-08-17T05:02:28.000+02:00");
++ _expect_rfc3164_timestamp_len_eq(ts, ts_len, "2022-08-17T05:02:28.000+02:00");
++
++ /* no ":" at the end, that's a problem, unrecognized */
++ _expect_rfc3164_fails(ts, ts_len - 1);
++
++ for (gint i = 1; i < ts_len; i++)
++ _expect_rfc3164_fails(ts, ts_len - i);
++}
++
++Test(parse_timestamp, non_zero_terminated_rfc5424_input_is_handled_properly)
++{
++ gchar *ts = "2022-08-17T05:02:28.417Z whatever";
++ gint ts_len = 24;
++
++ _expect_rfc5424_timestamp_len_eq(ts, strlen(ts), "2022-08-17T05:02:28.417+00:00");
++ _expect_rfc5424_timestamp_len_eq(ts, ts_len + 5, "2022-08-17T05:02:28.417+00:00");
++ _expect_rfc5424_timestamp_len_eq(ts, ts_len, "2022-08-17T05:02:28.417+00:00");
++
++ /* no "Z" parsed, timezone defaults to local, forced CET */
++ _expect_rfc5424_timestamp_len_eq(ts, ts_len - 1, "2022-08-17T05:02:28.417+02:00");
++
++ /* msec is partially parsed as we trim the string from the right */
++ _expect_rfc5424_timestamp_len_eq(ts, ts_len - 2, "2022-08-17T05:02:28.410+02:00");
++ _expect_rfc5424_timestamp_len_eq(ts, ts_len - 3, "2022-08-17T05:02:28.400+02:00");
++ _expect_rfc5424_timestamp_len_eq(ts, ts_len - 4, "2022-08-17T05:02:28.000+02:00");
++ _expect_rfc5424_timestamp_len_eq(ts, ts_len - 5, "2022-08-17T05:02:28.000+02:00");
++
++ for (gint i = 6; i < ts_len; i++)
++ _expect_rfc5424_fails(ts, ts_len - i);
++
++}
++
++Test(parse_timestamp, non_zero_terminated_rfc5424_timestamp_only)
++{
++ const gchar *ts = "2022-08-17T05:02:28.417+03:00";
++ gint ts_len = strlen(ts);
++ _expect_rfc5424_timestamp_len_eq(ts, ts_len, ts);
++}
++
+
+ Test(parse_timestamp, daylight_saving_behavior_at_spring_with_explicit_timezones)
+ {
+diff --git a/modules/syslogformat/CMakeLists.txt b/modules/syslogformat/CMakeLists.txt
+index fb55ea4..a2a92bb 100644
+--- a/modules/syslogformat/CMakeLists.txt
++++ b/modules/syslogformat/CMakeLists.txt
+@@ -24,4 +24,6 @@ target_include_directories(syslogformat
+ )
+ target_link_libraries(syslogformat PRIVATE syslog-ng)
+
++add_test_subdirectory(tests)
++
+ install(TARGETS syslogformat LIBRARY DESTINATION lib/syslog-ng/)
+diff --git a/modules/syslogformat/Makefile.am b/modules/syslogformat/Makefile.am
+index f13f88c..14cdf58 100644
+--- a/modules/syslogformat/Makefile.am
++++ b/modules/syslogformat/Makefile.am
+@@ -31,3 +31,5 @@ modules_syslogformat_libsyslogformat_la_DEPENDENCIES = \
+ modules/syslogformat modules/syslogformat/ mod-syslogformat: \
+ modules/syslogformat/libsyslogformat.la
+ .PHONY: modules/syslogformat/ mod-syslogformat
++
++include modules/syslogformat/tests/Makefile.am
+diff --git a/modules/syslogformat/syslog-format.c b/modules/syslogformat/syslog-format.c
+index 6d53a32..a69f39f 100644
+--- a/modules/syslogformat/syslog-format.c
++++ b/modules/syslogformat/syslog-format.c
+@@ -200,7 +200,7 @@ log_msg_parse_cisco_sequence_id(LogMessage *self, const guchar **data, gint *len
+
+ /* if the next char is not space, then we may try to read a date */
+
+- if (*src != ' ')
++ if (!left || *src != ' ')
+ return;
+
+ log_msg_set_value(self, handles.cisco_seqid, (gchar *) *data, *length - left - 1);
+@@ -216,6 +216,9 @@ log_msg_parse_cisco_timestamp_attributes(LogMessage *self, const guchar **data,
+ const guchar *src = *data;
+ gint left = *length;
+
++ if (!left)
++ return;
++
+ /* Cisco timestamp extensions, the first '*' indicates that the clock is
+ * unsynced, '.' if it is known to be synced */
+ if (G_UNLIKELY(src[0] == '*'))
+@@ -564,7 +567,7 @@ log_msg_parse_sd(LogMessage *self, const guchar **data, gint *length, const MsgF
+ open_sd++;
+ do
+ {
+- if (!isascii(*src) || *src == '=' || *src == ' ' || *src == ']' || *src == '"')
++ if (!left || !isascii(*src) || *src == '=' || *src == ' ' || *src == ']' || *src == '"')
+ goto error;
+ /* read sd_id */
+ pos = 0;
+@@ -598,7 +601,8 @@ log_msg_parse_sd(LogMessage *self, const guchar **data, gint *length, const MsgF
+ strcpy(sd_value_name, logmsg_sd_prefix);
+ /* this strcat is safe, as sd_id_name is at most 32 chars */
+ strncpy(sd_value_name + logmsg_sd_prefix_len, sd_id_name, sizeof(sd_value_name) - logmsg_sd_prefix_len);
+- if (*src == ']')
++
++ if (left && *src == ']')
+ {
+ log_msg_set_value_by_name(self, sd_value_name, "", 0);
+ }
+@@ -615,7 +619,7 @@ log_msg_parse_sd(LogMessage *self, const guchar **data, gint *length, const MsgF
+ else
+ goto error;
+
+- if (!isascii(*src) || *src == '=' || *src == ' ' || *src == ']' || *src == '"')
++ if (!left || !isascii(*src) || *src == '=' || *src == ' ' || *src == ']' || *src == '"')
+ goto error;
+
+ /* read sd-param */
+diff --git a/modules/syslogformat/tests/CMakeLists.txt b/modules/syslogformat/tests/CMakeLists.txt
+new file mode 100644
+index 0000000..2e45b71
+--- /dev/null
++++ b/modules/syslogformat/tests/CMakeLists.txt
+@@ -0,0 +1 @@
++add_unit_test(CRITERION TARGET test_syslog_format DEPENDS syslogformat)
+diff --git a/modules/syslogformat/tests/Makefile.am b/modules/syslogformat/tests/Makefile.am
+new file mode 100644
+index 0000000..7ee66a5
+--- /dev/null
++++ b/modules/syslogformat/tests/Makefile.am
+@@ -0,0 +1,9 @@
++modules_syslogformat_tests_TESTS = \
++ modules/syslogformat/tests/test_syslog_format
++
++check_PROGRAMS += ${modules_syslogformat_tests_TESTS}
++
++EXTRA_DIST += modules/syslogformat/tests/CMakeLists.txt
++
++modules_syslogformat_tests_test_syslog_format_CFLAGS = $(TEST_CFLAGS) -I$(top_srcdir)/modules/syslogformat
++modules_syslogformat_tests_test_syslog_format_LDADD = $(TEST_LDADD) $(PREOPEN_SYSLOGFORMAT)
+diff --git a/modules/syslogformat/tests/test_syslog_format.c b/modules/syslogformat/tests/test_syslog_format.c
+new file mode 100644
+index 0000000..d0f5b40
+--- /dev/null
++++ b/modules/syslogformat/tests/test_syslog_format.c
+@@ -0,0 +1,104 @@
++/*
++ * Copyright (c) 2022 One Identity
++ * Copyright (c) 2022 László Várady
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
++ *
++ * As an additional exemption you are allowed to compile & link against the
++ * OpenSSL libraries as published by the OpenSSL project. See the file
++ * COPYING for details.
++ *
++ */
++
++#include <criterion/criterion.h>
++
++#include "apphook.h"
++#include "cfg.h"
++#include "syslog-format.h"
++#include "logmsg/logmsg.h"
++#include "msg-format.h"
++#include "scratch-buffers.h"
++
++#include <string.h>
++
++GlobalConfig *cfg;
++MsgFormatOptions parse_options;
++
++static void
++setup(void)
++{
++ app_startup();
++ syslog_format_init();
++
++ cfg = cfg_new_snippet();
++ msg_format_options_defaults(&parse_options);
++}
++
++static void
++teardown(void)
++{
++ scratch_buffers_explicit_gc();
++ app_shutdown();
++ cfg_free(cfg);
++}
++
++TestSuite(syslog_format, .init = setup, .fini = teardown);
++
++Test(syslog_format, parser_should_not_spin_on_non_zero_terminated_input, .timeout = 10)
++{
++ const gchar *data = "<182>2022-08-17T05:02:28.217 mymachine su: 'su root' failed for lonvick on /dev/pts/8";
++ /* chosen carefully to reproduce a bug */
++ gsize data_length = 27;
++
++ msg_format_options_init(&parse_options, cfg);
++ LogMessage *msg = msg_format_construct_message(&parse_options, (const guchar *) data, data_length);
++
++ gsize problem_position;
++ cr_assert(syslog_format_handler(&parse_options, msg, (const guchar *) data, data_length, &problem_position));
++
++ msg_format_options_destroy(&parse_options);
++ log_msg_unref(msg);
++}
++
++Test(syslog_format, cisco_sequence_id_non_zero_termination)
++{
++ const gchar *data = "<189>65536: ";
++ gsize data_length = strlen(data);
++
++ msg_format_options_init(&parse_options, cfg);
++ LogMessage *msg = msg_format_construct_message(&parse_options, (const guchar *) data, data_length);
++
++ gsize problem_position;
++ cr_assert(syslog_format_handler(&parse_options, msg, (const guchar *) data, data_length, &problem_position));
++ cr_assert_str_eq(log_msg_get_value_by_name(msg, ".SDATA.meta.sequenceId", NULL), "65536");
++
++ msg_format_options_destroy(&parse_options);
++ log_msg_unref(msg);
++}
++
++Test(syslog_format, minimal_non_zero_terminated_numeric_message_is_parsed_as_program_name)
++{
++ const gchar *data = "<189>65536";
++ gsize data_length = strlen(data);
++
++ msg_format_options_init(&parse_options, cfg);
++ LogMessage *msg = msg_format_construct_message(&parse_options, (const guchar *) data, data_length);
++
++ gsize problem_position;
++ cr_assert(syslog_format_handler(&parse_options, msg, (const guchar *) data, data_length, &problem_position));
++ cr_assert_str_eq(log_msg_get_value_by_name(msg, "PROGRAM", NULL), "65536");
++
++ msg_format_options_destroy(&parse_options);
++ log_msg_unref(msg);
++}
+--
+2.25.1
+
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.24.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.24.1.bb
index 10bf00fdce..6e90dabd14 100644
--- a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.24.1.bb
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.24.1.bb
@@ -9,6 +9,7 @@ SRC_URI += " \
file://0001-syslog-ng-fix-segment-fault-during-service-start.patch \
file://shebang.patch \
file://syslog-ng-tmp.conf \
+ file://CVE-2022-38725.patch \
"
SRC_URI[md5sum] = "ef9de066793f7358af7312b964ac0450"
diff --git a/meta-oe/recipes-support/thin-provisioning-tools/thin-provisioning-tools_0.8.5.bb b/meta-oe/recipes-support/thin-provisioning-tools/thin-provisioning-tools_0.8.5.bb
index 3f82734acd..5bcbea4600 100644
--- a/meta-oe/recipes-support/thin-provisioning-tools/thin-provisioning-tools_0.8.5.bb
+++ b/meta-oe/recipes-support/thin-provisioning-tools/thin-provisioning-tools_0.8.5.bb
@@ -7,7 +7,7 @@ SECTION = "devel"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
S = "${WORKDIR}/git"
-SRC_URI = "git://github.com/jthornber/thin-provisioning-tools;branch=main \
+SRC_URI = "git://github.com/jthornber/thin-provisioning-tools;branch=main;protocol=https \
file://0001-do-not-strip-pdata_tools-at-do_install.patch \
file://use-sh-on-path.patch \
"
diff --git a/meta-oe/recipes-support/toscoterm/toscoterm_git.bb b/meta-oe/recipes-support/toscoterm/toscoterm_git.bb
index aba485e1a4..4dddd54c5f 100644
--- a/meta-oe/recipes-support/toscoterm/toscoterm_git.bb
+++ b/meta-oe/recipes-support/toscoterm/toscoterm_git.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://main.c;start_line=5;end_line=16;md5=9ae4bf20caf291afa
# 0.2 version
SRCREV = "8586d617aed19fc75f5ae1e07270752c1b2f9a30"
-SRC_URI = "git://github.com/OSSystems/toscoterm.git"
+SRC_URI = "git://github.com/OSSystems/toscoterm.git;branch=master;protocol=https"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/udisks/udisks2/CVE-2021-3802.patch b/meta-oe/recipes-support/udisks/udisks2/CVE-2021-3802.patch
new file mode 100644
index 0000000000..0189833b49
--- /dev/null
+++ b/meta-oe/recipes-support/udisks/udisks2/CVE-2021-3802.patch
@@ -0,0 +1,63 @@
+From 2517b8feb13919c382e53ab5f9b63c5b5ee5b063 Mon Sep 17 00:00:00 2001
+From: Emilio Pozuelo Monfort <pochu@debian.org>
+Date: Fri, 5 Nov 2021 09:29:13 +0100
+Subject: [PATCH] udisks2 security update
+
+mount options: Always use errors=remount-ro for ext filesystems
+
+Stefan Walter found that udisks2, a service to access and manipulate
+storage devices, could cause denial of service via system crash if a
+corrupted or specially crafted ext2/3/4 device or image was mounted,
+which could happen automatically on certain environments.
+
+For Debian 9 stretch, this problem has been fixed in version
+2.1.8-1+deb9u1.
+
+Default mount options are focused primarily on data safety, mounting
+damaged ext2/3/4 filesystem as readonly would indicate something's wrong.
+
+Upstream-Status: Backport [http://security.debian.org/debian-security/pool/updates/main/u/udisks2/udisks2_2.1.8-1+deb9u1.debian.tar.xz]
+CVE: CVE-2021-3802
+
+Signed-off-by: Virendra Thakur <virendra.thakur@kpit.com>
+
+---
+ src/udiskslinuxfilesystem.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/src/udiskslinuxfilesystem.c b/src/udiskslinuxfilesystem.c
+index a5a3898c..eac8cab3 100644
+--- a/src/udiskslinuxfilesystem.c
++++ b/src/udiskslinuxfilesystem.c
+@@ -421,6 +421,21 @@ static const gchar *hfsplus_allow[] = { "creator", "type", "umask", "session", "
+ static const gchar *hfsplus_allow_uid_self[] = { "uid", NULL };
+ static const gchar *hfsplus_allow_gid_self[] = { "gid", NULL };
+
++/* ---------------------- ext2 -------------------- */
++
++static const gchar *ext2_defaults[] = { "errors=remount-ro", NULL };
++static const gchar *ext2_allow[] = { "errors=remount-ro", NULL };
++
++/* ---------------------- ext3 -------------------- */
++
++static const gchar *ext3_defaults[] = { "errors=remount-ro", NULL };
++static const gchar *ext3_allow[] = { "errors=remount-ro", NULL };
++
++/* ---------------------- ext4 -------------------- */
++
++static const gchar *ext4_defaults[] = { "errors=remount-ro", NULL };
++static const gchar *ext4_allow[] = { "errors=remount-ro", NULL };
++
+ /* ------------------------------------------------ */
+ /* TODO: support context= */
+
+@@ -434,6 +449,9 @@ static const FSMountOptions fs_mount_options[] =
+ { "udf", udf_defaults, udf_allow, udf_allow_uid_self, udf_allow_gid_self },
+ { "exfat", exfat_defaults, exfat_allow, exfat_allow_uid_self, exfat_allow_gid_self },
+ { "hfsplus", hfsplus_defaults, hfsplus_allow, hfsplus_allow_uid_self, hfsplus_allow_gid_self },
++ { "ext2", ext2_defaults, ext2_allow, NULL, NULL },
++ { "ext3", ext3_defaults, ext3_allow, NULL, NULL },
++ { "ext4", ext4_defaults, ext4_allow, NULL, NULL },
+ };
+
+ /* ------------------------------------------------ */
diff --git a/meta-oe/recipes-support/udisks/udisks2_git.bb b/meta-oe/recipes-support/udisks/udisks2_git.bb
index ecaf01e71d..58c8a9899a 100644
--- a/meta-oe/recipes-support/udisks/udisks2_git.bb
+++ b/meta-oe/recipes-support/udisks/udisks2_git.bb
@@ -17,7 +17,8 @@ DEPENDS += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
RDEPENDS_${PN} = "acl"
SRC_URI = " \
- git://github.com/storaged-project/udisks.git;branch=master \
+ git://github.com/storaged-project/udisks.git;branch=master;protocol=https \
+ file://CVE-2021-3802.patch \
"
PV = "2.8.4+git${SRCREV}"
SRCREV = "db5f487345da2eaa87976450ea51c2c465d9b82e"
diff --git a/meta-oe/recipes-support/uhubctl/uhubctl_2.1.0.bb b/meta-oe/recipes-support/uhubctl/uhubctl_2.1.0.bb
index b294d77bad..0bb48412a9 100644
--- a/meta-oe/recipes-support/uhubctl/uhubctl_2.1.0.bb
+++ b/meta-oe/recipes-support/uhubctl/uhubctl_2.1.0.bb
@@ -7,7 +7,7 @@ LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRCREV = "c9fa3c68a1b2c9790c731602b8bae2b513e80605"
-SRC_URI = "git://github.com/mvp/${BPN}"
+SRC_URI = "git://github.com/mvp/${BPN};branch=master;protocol=https"
S = "${WORKDIR}/git"
# uhubctl gets its program version from "git describe". As we use the source
diff --git a/meta-oe/recipes-support/uthash/uthash_2.1.0.bb b/meta-oe/recipes-support/uthash/uthash_2.1.0.bb
index 09cef44a85..3f4529e1a0 100644
--- a/meta-oe/recipes-support/uthash/uthash_2.1.0.bb
+++ b/meta-oe/recipes-support/uthash/uthash_2.1.0.bb
@@ -12,7 +12,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=a2513f7d2291df840527b76b2a8f9718"
SRCREV = "8b214aefcb81df86a7e5e0d4fa20e59a6c18bc02"
SRC_URI = "\
- git://github.com/troydhanson/${BPN}.git \
+ git://github.com/troydhanson/${BPN}.git;branch=master;protocol=https \
file://run-ptest \
"
diff --git a/meta-oe/recipes-support/utouch/utouch-evemu_git.bb b/meta-oe/recipes-support/utouch/utouch-evemu_git.bb
index 7c5a734394..e1ec1fda8b 100644
--- a/meta-oe/recipes-support/utouch/utouch-evemu_git.bb
+++ b/meta-oe/recipes-support/utouch/utouch-evemu_git.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
inherit autotools
-SRC_URI = "git://bitmath.org/git/evemu.git;protocol=http \
+SRC_URI = "git://bitmath.org/git/evemu.git;protocol=http;branch=master \
file://0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch \
"
SRCREV = "9752b50e922572e4cd214ac45ed95e4ee410fe24"
diff --git a/meta-oe/recipes-support/utouch/utouch-frame_git.bb b/meta-oe/recipes-support/utouch/utouch-frame_git.bb
index 1ebebfa9f5..5993956353 100644
--- a/meta-oe/recipes-support/utouch/utouch-frame_git.bb
+++ b/meta-oe/recipes-support/utouch/utouch-frame_git.bb
@@ -9,7 +9,7 @@ DEPENDS += "mtdev utouch-evemu"
inherit autotools pkgconfig
-SRC_URI = "git://bitmath.org/git/frame.git;protocol=http \
+SRC_URI = "git://bitmath.org/git/frame.git;protocol=http;branch=master \
file://remove-man-page-creation.patch \
file://0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch \
file://0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch \
diff --git a/meta-oe/recipes-support/utouch/utouch-mtview_git.bb b/meta-oe/recipes-support/utouch/utouch-mtview_git.bb
index 5f07bf28ee..65edaf1e5b 100644
--- a/meta-oe/recipes-support/utouch/utouch-mtview_git.bb
+++ b/meta-oe/recipes-support/utouch/utouch-mtview_git.bb
@@ -9,7 +9,7 @@ inherit autotools pkgconfig features_check
# depends on virtual/libx11
REQUIRED_DISTRO_FEATURES = "x11"
-SRC_URI = "git://bitmath.org/git/mtview.git;protocol=http"
+SRC_URI = "git://bitmath.org/git/mtview.git;protocol=http;branch=master"
SRCREV = "ad437c38dc111cf3990a03abf14efe1b5d89604b"
DEPENDS += "mtdev utouch-frame utouch-evemu libx11"
diff --git a/meta-oe/recipes-support/websocketpp/websocketpp_0.8.2.bb b/meta-oe/recipes-support/websocketpp/websocketpp_0.8.2.bb
index 79a5ac5c4e..673fc5899b 100644
--- a/meta-oe/recipes-support/websocketpp/websocketpp_0.8.2.bb
+++ b/meta-oe/recipes-support/websocketpp/websocketpp_0.8.2.bb
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=4d168d763c111f4ffc62249870e4e0ea"
DEPENDS = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'openssl boost zlib', '', d)} "
-SRC_URI = "git://github.com/zaphoyd/websocketpp.git;protocol=https \
+SRC_URI = "git://github.com/zaphoyd/websocketpp.git;protocol=https;branch=master \
file://0001-cmake-Use-GNUInstallDirs.patch \
file://855.patch \
file://857.patch \
diff --git a/meta-oe/recipes-support/xdelta/xdelta3_3.1.0.bb b/meta-oe/recipes-support/xdelta/xdelta3_3.1.0.bb
index d100030f9b..c161781989 100644
--- a/meta-oe/recipes-support/xdelta/xdelta3_3.1.0.bb
+++ b/meta-oe/recipes-support/xdelta/xdelta3_3.1.0.bb
@@ -7,7 +7,7 @@ SECTION = "console/utils"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
-SRC_URI = "git://github.com/jmacd/xdelta.git;branch=release3_1_apl"
+SRC_URI = "git://github.com/jmacd/xdelta.git;branch=release3_1_apl;protocol=https"
SRCREV = "4b4aed71a959fe11852e45242bb6524be85d3709"
S = "${WORKDIR}/git/xdelta3"
diff --git a/meta-oe/recipes-support/xorg-xrdp/xorgxrdp_0.2.5.bb b/meta-oe/recipes-support/xorg-xrdp/xorgxrdp_0.2.5.bb
index 481e7303b3..1ba4a32ba6 100644
--- a/meta-oe/recipes-support/xorg-xrdp/xorgxrdp_0.2.5.bb
+++ b/meta-oe/recipes-support/xorg-xrdp/xorgxrdp_0.2.5.bb
@@ -10,7 +10,7 @@ DEPENDS = "virtual/libx11 xserver-xorg xrdp nasm-native"
inherit features_check
REQUIRED_DISTRO_FEATURES = "x11 pam"
-SRC_URI = "git://github.com/neutrinolabs/xorgxrdp.git"
+SRC_URI = "git://github.com/neutrinolabs/xorgxrdp.git;branch=master;protocol=https"
SRCREV = "c122544f184d4031bbae1ad80fbab554c34a9427"
diff --git a/meta-oe/recipes-support/xrdp/xrdp_0.9.11.bb b/meta-oe/recipes-support/xrdp/xrdp_0.9.11.bb
index deda0fd1b5..36184705bc 100644
--- a/meta-oe/recipes-support/xrdp/xrdp_0.9.11.bb
+++ b/meta-oe/recipes-support/xrdp/xrdp_0.9.11.bb
@@ -10,7 +10,7 @@ DEPENDS = "openssl virtual/libx11 libxfixes libxrandr libpam nasm-native"
REQUIRED_DISTRO_FEATURES = "x11 pam"
-SRC_URI = "git://github.com/neutrinolabs/xrdp.git \
+SRC_URI = "git://github.com/neutrinolabs/xrdp.git;branch=master;protocol=https \
file://xrdp.sysconfig \
file://0001-Added-req_distinguished_name-in-etc-xrdp-openssl.con.patch \
file://0001-Fix-the-compile-error.patch \
diff --git a/meta-oe/recipes-support/xxhash/xxhash_0.7.3.bb b/meta-oe/recipes-support/xxhash/xxhash_0.7.3.bb
index 865adc5a1b..783af89bed 100644
--- a/meta-oe/recipes-support/xxhash/xxhash_0.7.3.bb
+++ b/meta-oe/recipes-support/xxhash/xxhash_0.7.3.bb
@@ -5,7 +5,7 @@ HOMEPAGE = "http://www.xxhash.com/"
LICENSE = "BSD-2-Clause & GPL-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=01a7eba4212ef1e882777a38585e7a9b"
-SRC_URI = "git://github.com/Cyan4973/xxHash.git"
+SRC_URI = "git://github.com/Cyan4973/xxHash.git;branch=master;protocol=https"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
SRCREV = "d408e9b0606d07b1ddc5452ffc0ec8512211b174"
diff --git a/meta-oe/recipes-support/zbar/zbar_git.bb b/meta-oe/recipes-support/zbar/zbar_git.bb
index 935e09cd53..46ca549c5c 100644
--- a/meta-oe/recipes-support/zbar/zbar_git.bb
+++ b/meta-oe/recipes-support/zbar/zbar_git.bb
@@ -10,7 +10,7 @@ PV = "0.10+git${SRCPV}"
# iPhoneSDK-1.3.1 tag
SRCREV = "67003d2a985b5f9627bee2d8e3e0b26d0c474b57"
-SRC_URI = "git://github.com/ZBar/Zbar \
+SRC_URI = "git://github.com/ZBar/Zbar;branch=master;protocol=https \
file://0001-make-relies-GNU-extentions.patch \
"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-support/zchunk/zchunk_1.1.6.bb b/meta-oe/recipes-support/zchunk/zchunk_1.1.6.bb
index e041132b1c..e4c0232bd9 100644
--- a/meta-oe/recipes-support/zchunk/zchunk_1.1.6.bb
+++ b/meta-oe/recipes-support/zchunk/zchunk_1.1.6.bb
@@ -4,7 +4,7 @@ AUTHOR = "Jonathan Dieter"
LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=cd6e590282010ce90a94ef25dd31410f"
-SRC_URI = "git://github.com/zchunk/zchunk.git;protocol=https"
+SRC_URI = "git://github.com/zchunk/zchunk.git;protocol=https;branch=master"
SRCREV = "f5593aa11584faa691c81b4898f0aaded47f8bf7"
S = "${WORKDIR}/git"