Patch review
cover Patch review
Please review this set of patches for dunfell and have comments back by end of day Tuesday.
Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/5210
The following changes since commit 9aefb4e46cf4fbf14b46f9adaf3771854553e7f3:
curl: CVE-2023-27534 SFTP path ~ resolving discrepancy (2023-04-14 07:14:33 -1000)
are available in the Git repository at:
https://git.openembedded.org/openembedded-core-contrib stable/dunfell-nut
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=stable/dunfell-nut
Hitendra Prajapati (2):
curl: CVE-2023-27538 fix SSH connection too eager reuse
screen: CVE-2023-24626 allows sending SIGHUP to arbitrary PIDs
Peter Marko (1):
go: ignore CVE-2022-41716
Shubham Kulkarni (2):
go-runtime: Security fix for CVE-2022-41722
go: Security fix for CVE-2020-29510
Vivek Kumbhar (1):
go: fix CVE-2023-24537 Infinite loop in parsing
rajmohan r (1):
systemd: Fix CVE-2023-26604
.../systemd/systemd/CVE-2023-26604-1.patch | 115 ++++++++ .../systemd/systemd/CVE-2023-26604-2.patch | 264 ++++++++++++++++++ .../systemd/systemd/CVE-2023-26604-3.patch | 182 ++++++++++++ .../systemd/systemd/CVE-2023-26604-4.patch | 32 +++ meta/recipes-core/systemd/systemd_244.5.bb | 4 + meta/recipes-devtools/go/go-1.14.inc | 7 + .../go/go-1.14/CVE-2020-29510.patch | 65 +++++ .../go/go-1.14/CVE-2022-41722-1.patch | 53 ++++ .../go/go-1.14/CVE-2022-41722-2.patch | 104 +++++++ .../go/go-1.14/CVE-2023-24537.patch | 76 +++++ .../screen/screen/CVE-2023-24626.patch | 40 +++ meta/recipes-extended/screen/screen_4.8.0.bb | 1 + .../curl/curl/CVE-2023-27538.patch | 31 ++ meta/recipes-support/curl/curl_7.69.1.bb | 1 + 14 files changed, 975 insertions(+) create mode 100644 meta/recipes-core/systemd/systemd/CVE-2023-26604-1.patch create mode 100644 meta/recipes-core/systemd/systemd/CVE-2023-26604-2.patch create mode 100644 meta/recipes-core/systemd/systemd/CVE-2023-26604-3.patch create mode 100644 meta/recipes-core/systemd/systemd/CVE-2023-26604-4.patch create mode 100644 meta/recipes-devtools/go/go-1.14/CVE-2020-29510.patch create mode 100644 meta/recipes-devtools/go/go-1.14/CVE-2022-41722-1.patch create mode 100644 meta/recipes-devtools/go/go-1.14/CVE-2022-41722-2.patch create mode 100644 meta/recipes-devtools/go/go-1.14/CVE-2023-24537.patch create mode 100644 meta/recipes-extended/screen/screen/CVE-2023-24626.patch create mode 100644 meta/recipes-support/curl/curl/CVE-2023-27538.patch
Signature · 1 line
2.34.1
PATCH 1/7 curl: CVE-2023-27538 fix SSH connection too eager reuse
From: Hitendra Prajapati <[email protected]>
Upstream-Status: Backport from https://github.com/curl/curl/commit/af369db4d3833272b8ed443f7fcc2e757a0872eb
--- .../curl/curl/CVE-2023-27538.patch | 31 +++++++++++++++++++ meta/recipes-support/curl/curl_7.69.1.bb | 1 + 2 files changed, 32 insertions(+) create mode 100644 meta/recipes-support/curl/curl/CVE-2023-27538.patch
meta/recipes-support/curl/curl/CVE-2023-27538.patch new file +31 -0
@@ -0,0 +1,31 @@ +From af369db4d3833272b8ed443f7fcc2e757a0872eb Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg <[email protected]> +Date: Fri, 10 Mar 2023 08:22:51 +0100 +Subject: [PATCH] url: fix the SSH connection reuse check + +Reported-by: Harry Sintonen +Closes #10735 + +CVE: CVE-2023-27538 +Upstream-Status: Backport [https://github.com/curl/curl/commit/af369db4d3833272b8ed443f7fcc2e757a0872eb] +Signed-off-by: Hitendra Prajapati <[email protected]> +--- + lib/url.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/url.c b/lib/url.c +index 8da0245..9f14a7b 100644 +--- a/lib/url.c ++++ b/lib/url.c +@@ -1266,7 +1266,7 @@ ConnectionExists(struct Curl_easy *data, + } + } + +- if(get_protocol_family(needle->handler->protocol) == PROTO_FAMILY_SSH) { ++ if(get_protocol_family(needle->handler->protocol) & PROTO_FAMILY_SSH) { + if(!ssh_config_matches(needle, check)) + continue; + } +-- +2.25.1 +
meta/recipes-support/curl/curl_7.69.1.bb +1 -0
@@ -44,6 +44,7 @@ SRC_URI = "https://curl.haxx.se/download/curl-${PV}.tar.bz2 \ file://CVE-2022-43552.patch \ file://CVE-2023-23916.patch \ file://CVE-2023-27534.patch \ + file://CVE-2023-27538.patch \ " SRC_URI[md5sum] = "ec5fc263f898a3dfef08e805f1ecca42"
Signature · 1 line
2.34.1
PATCH 2/7 go-runtime: Security fix for CVE-2022-41722
In reply to Steve SakomanFrom: Shubham Kulkarni <[email protected]>
path/filepath: do not Clean("a/../c:/b") into c:\b on Windows
Backport from https://github.com/golang/go/commit/bdf07c2e168baf736e4c057279ca12a4d674f18c
--- meta/recipes-devtools/go/go-1.14.inc | 2 + .../go/go-1.14/CVE-2022-41722-1.patch | 53 +++++++++ .../go/go-1.14/CVE-2022-41722-2.patch | 104 ++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 meta/recipes-devtools/go/go-1.14/CVE-2022-41722-1.patch create mode 100644 meta/recipes-devtools/go/go-1.14/CVE-2022-41722-2.patch
meta/recipes-devtools/go/go-1.14.inc +2 -0
@@ -53,6 +53,8 @@ SRC_URI += "\ file://CVE-2022-41717.patch \ file://CVE-2022-1962.patch \ file://CVE-2022-41723.patch \ + file://CVE-2022-41722-1.patch \ + file://CVE-2022-41722-2.patch \ " SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch"
meta/recipes-devtools/go/go-1.14/CVE-2022-41722-1.patch new file +53 -0
53 lines not on this page · raw message
meta/recipes-devtools/go/go-1.14/CVE-2022-41722-2.patch new file +104 -0
104 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 3/7 systemd: Fix CVE-2023-26604
In reply to Steve SakomanFrom: rajmohan r <[email protected]>
Below patch files to fix CVE-2023-26604 CVE-2023-26604-1.patch, CVE-2023-26604-2.patch and CVE-2023-26604-3.patch and CVE-2023-26604-4.patch
make pager secure when under euid is changed or explicitly requested
Reference:
CVE-2023-26604-1.patch:
https://github.com/systemd/systemd/pull/17270/commits/612ebf6c913dd0e4197c44909cb3157f5c51a2f0
CVE-2023-26604-2.patch:
https://github.com/systemd/systemd/pull/17270/commits/1b5b507cd2d1d7a2b053151abb548475ad9c5c3b
CVE-2023-26604-3.patch:
https://github.com/systemd/systemd/pull/17270/commits/0a42426d797406b4b01a0d9c13bb759c2629d108
CVE-2023-26604-4.patch:
https://github.com/systemd/systemd/pull/17359/commits/b8f736b30e20a2b44e7c34bb4e43b0d97ae77e3c
--- .../systemd/systemd/CVE-2023-26604-1.patch | 115 ++++++++ .../systemd/systemd/CVE-2023-26604-2.patch | 264 ++++++++++++++++++ .../systemd/systemd/CVE-2023-26604-3.patch | 182 ++++++++++++ .../systemd/systemd/CVE-2023-26604-4.patch | 32 +++ meta/recipes-core/systemd/systemd_244.5.bb | 4 + 5 files changed, 597 insertions(+) create mode 100644 meta/recipes-core/systemd/systemd/CVE-2023-26604-1.patch create mode 100644 meta/recipes-core/systemd/systemd/CVE-2023-26604-2.patch create mode 100644 meta/recipes-core/systemd/systemd/CVE-2023-26604-3.patch create mode 100644 meta/recipes-core/systemd/systemd/CVE-2023-26604-4.patch
meta/recipes-core/systemd/systemd/CVE-2023-26604-1.patch new file +115 -0
@@ -0,0 +1,115 @@ +From 612ebf6c913dd0e4197c44909cb3157f5c51a2f0 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering <[email protected]> +Date: Mon, 31 Aug 2020 19:37:13 +0200 +Subject: [PATCH] pager: set $LESSSECURE whenver we invoke a pager + +Some extra safety when invoked via "sudo". With this we address a +genuine design flaw of sudo, and we shouldn't need to deal with this. +But it's still a good idea to disable this surface given how exotic it +is. + +Prompted by #5666 + +CVE: CVE-2023-26604 +Upstream-Status: Backport [https://github.com/systemd/systemd/pull/17270/commits/612ebf6c913dd0e4197c44909cb3157f5c51a2f0] +Comments: Hunk not refreshed +Signed-off-by: rajmohan r <[email protected]> +--- + man/less-variables.xml | 9 +++++++++ + man/systemctl.xml | 1 + + man/systemd.xml | 1 + + src/shared/pager.c | 23 +++++++++++++++++++++-- + 4 files changed, 32 insertions(+), 2 deletions(-) + +diff --git a/man/less-variables.xml b/man/less-variables.xml +index 08e513c99f8e..c52511ca8e18 100644 +--- a/man/less-variables.xml ++++ b/man/less-variables.xml +@@ -64,6 +64,15 @@ + the invoking terminal is determined to be UTF-8 compatible).</para></listitem> + </varlistentry> + ++ <varlistentry id='lesssecure'> ++ <term><varname>$SYSTEMD_LESSSECURE</varname></term> ++ ++ <listitem><para>Takes a boolean argument. Overrides the <varname>$LESSSECURE</varname> environment ++ variable when invoking the pager, which controls the "secure" mode of less (which disables commands ++ such as <literal>|</literal> which allow to easily shell out to external command lines). By default ++ less secure mode is enabled, with this setting it may be disabled.</para></listitem> ++ </varlistentry> ++ + <varlistentry id='colors'> + <term><varname>$SYSTEMD_COLORS</varname></term> + +diff --git a/man/systemctl.xml b/man/systemctl.xml +index 1c5502883700..a3f0c3041a57 100644 +--- a/man/systemctl.xml ++++ b/man/systemctl.xml +@@ -2240,6 +2240,7 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err + <xi:include href="less-variables.xml" xpointer="pager"/> + <xi:include href="less-variables.xml" xpointer="less"/> + <xi:include href="less-variables.xml" xpointer="lesscharset"/> ++ <xi:include href="less-variables.xml" xpointer="lesssecure"/> + <xi:include href="less-variables.xml" xpointer="colors"/> + <xi:include href="less-variables.xml" xpointer="urlify"/> + </refsect1> +diff --git a/man/systemd.xml b/man/systemd.xml +index a9040545c2ab..c92cfef77689 100644 +--- a/man/systemd.xml ++++ b/man/systemd.xml +@@ -692,6 +692,7 @@ + <xi:include href="less-variables.xml" xpointer="pager"/> + <xi:include href="less-variables.xml" xpointer="less"/> + <xi:include href="less-variables.xml" xpointer="lesscharset"/> ++ <xi:include href="less-variables.xml" xpointer="lesssecure"/> + <xi:include href="less-variables.xml" xpointer="colors"/> + <xi:include href="less-variables.xml" xpointer="urlify"/> + +diff --git a/src/shared/pager.c b/src/shared/pager.c +index e03be6d23b2d..9c21881241f5 100644 +--- a/src/shared/pager.c ++++ b/src/shared/pager.c +@@ -9,6 +9,7 @@ + #include <unistd.h> + + #include "copy.h" ++#include "env-util.h" + #include "fd-util.h" + #include "fileio.h" + #include "io-util.h" +@@ -152,8 +153,7 @@ int pager_open(PagerFlags flags) { + _exit(EXIT_FAILURE); + } + +- /* Initialize a good charset for less. This is +- * particularly important if we output UTF-8 ++ /* Initialize a good charset for less. This is particularly important if we output UTF-8 + * characters. */ + less_charset = getenv("SYSTEMD_LESSCHARSET"); + if (!less_charset && is_locale_utf8()) +@@ -164,6 +164,25 @@ int pager_open(PagerFlags flags) { + _exit(EXIT_FAILURE); + } + ++ /* People might invoke us from sudo, don't needlessly allow less to be a way to shell out ++ * privileged stuff. */ ++ r = getenv_bool("SYSTEMD_LESSSECURE"); ++ if (r == 0) { /* Remove env var if off */ ++ if (unsetenv("LESSSECURE") < 0) { ++ log_error_errno(errno, "Failed to uset environment variable LESSSECURE: %m"); ++ _exit(EXIT_FAILURE); ++ } ++ } else { ++ /* Set env var otherwise */ ++ if (r < 0) ++ log_warning_errno(r, "Unable to parse $SYSTEMD_LESSSECURE, ignoring: %m"); ++ ++ if (setenv("LESSSECURE", "1", 1) < 0) { ++ log_error_errno(errno, "Failed to set environment variable LESSSECURE: %m"); ++ _exit(EXIT_FAILURE); ++ } ++ } ++ + if (pager_args) { + r = loop_write(exe_name_pipe[1], pager_args[0], strlen(pager_args[0]) + 1, false); + if (r < 0) {
meta/recipes-core/systemd/systemd/CVE-2023-26604-2.patch new file +264 -0
264 lines not on this page · raw message
meta/recipes-core/systemd/systemd/CVE-2023-26604-3.patch new file +182 -0
182 lines not on this page · raw message
meta/recipes-core/systemd/systemd/CVE-2023-26604-4.patch new file +32 -0
@@ -0,0 +1,32 @@ +From b8f736b30e20a2b44e7c34bb4e43b0d97ae77e3c Mon Sep 17 00:00:00 2001 +From: Lennart Poettering <[email protected]> +Date: Thu, 15 Oct 2020 10:54:48 +0200 +Subject: [PATCH] pager: lets check SYSTEMD_PAGERSECURE with secure_getenv() + +I can't think of any real vulnerability about this, but it still feels +better to check a variable with "secure" in its name with +secure_getenv() rather than plain getenv(). + +Paranoia FTW! + +CVE: CVE-2023-26604 +Upstream-Status: Backport [https://github.com/systemd/systemd/pull/17359/commits/b8f736b30e20a2b44e7c34bb4e43b0d97ae77e3c] +Comments: Hunk refreshed +Signed-off-by: rajmohan r <[email protected]> +--- + src/shared/pager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/shared/pager.c b/src/shared/pager.c +index a72d9ea..250519c 100644 +--- a/src/shared/pager.c ++++ b/src/shared/pager.c +@@ -170,7 +170,7 @@ int pager_open(PagerFlags flags) { + * pager. If they didn't, use secure mode when under euid is changed. If $SYSTEMD_PAGERSECURE + * wasn't explicitly set, and we autodetect the need for secure mode, only use the pager we + * know to be good. */ +- int use_secure_mode = getenv_bool("SYSTEMD_PAGERSECURE"); ++ int use_secure_mode = getenv_bool_secure("SYSTEMD_PAGERSECURE"); + bool trust_pager = use_secure_mode >= 0; + if (use_secure_mode == -ENXIO) { + uid_t uid;
meta/recipes-core/systemd/systemd_244.5.bb +4 -0
@@ -35,6 +35,10 @@ SRC_URI += "file://touchscreen.rules \ file://CVE-2021-3997-2.patch \ file://CVE-2021-3997-3.patch \ file://CVE-2022-3821.patch \ + file://CVE-2023-26604-1.patch \ + file://CVE-2023-26604-2.patch \ + file://CVE-2023-26604-3.patch \ + file://CVE-2023-26604-4.patch \ " # patches needed by musl
Signature · 1 line
2.34.1
PATCH 4/7 go: ignore CVE-2022-41716
In reply to Steve SakomanFrom: Peter Marko <[email protected]>
This CVE is specific to Microsoft Windows, ignore it.
Patch fixing it (https://go-review.googlesource.com/c/go/+/446916)
also adds a redundant check to generic os/exec which could be backported but it should not be necessary as backport always takes a small risk to break old code.
--- meta/recipes-devtools/go/go-1.14.inc | 3 +++ 1 file changed, 3 insertions(+)
meta/recipes-devtools/go/go-1.14.inc +3 -0
@@ -82,3 +82,6 @@ CVE_CHECK_WHITELIST += "CVE-2021-41772" # Fixes code that was added in go1.16, does not exist in 1.14 CVE_CHECK_WHITELIST += "CVE-2022-30630" + +# This is specific to Microsoft Windows +CVE_CHECK_WHITELIST += "CVE-2022-41716"
Signature · 1 line
2.34.1
PATCH 5/7 screen: CVE-2023-24626 allows sending SIGHUP to arbitrary PIDs
In reply to Steve SakomanFrom: Hitendra Prajapati <[email protected]>
Upstream-Status: Backport from https://git.savannah.gnu.org/cgit/screen.git/commit/?id=e9ad41bfedb4537a6f0de20f00b27c7739f168f7
--- .../screen/screen/CVE-2023-24626.patch | 40 +++++++++++++++++++ meta/recipes-extended/screen/screen_4.8.0.bb | 1 + 2 files changed, 41 insertions(+) create mode 100644 meta/recipes-extended/screen/screen/CVE-2023-24626.patch
meta/recipes-extended/screen/screen/CVE-2023-24626.patch new file +40 -0
@@ -0,0 +1,40 @@ +From e9ad41bfedb4537a6f0de20f00b27c7739f168f7 Mon Sep 17 00:00:00 2001 +From: Alexander Naumov <[email protected]> +Date: Mon, 30 Jan 2023 17:22:25 +0200 +Subject: fix: missing signal sending permission check on failed query messages + +Signed-off-by: Alexander Naumov <[email protected]> + +CVE: CVE-2023-24626 +Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/screen.git/commit/?id=e9ad41bfedb4537a6f0de20f00b27c7739f168f7] +Signed-off-by: Hitendra Prajapati <[email protected]> +--- + socket.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/socket.c b/socket.c +index bb68b35..9d87445 100644 +--- a/socket.c ++++ b/socket.c +@@ -1285,11 +1285,16 @@ ReceiveMsg() + else + queryflag = -1; + +- Kill(m.m.command.apid, ++ if (CheckPid(m.m.command.apid)) { ++ Msg(0, "Query attempt with bad pid(%d)!", m.m.command.apid); ++ } ++ else { ++ Kill(m.m.command.apid, + (queryflag >= 0) + ? SIGCONT + : SIG_BYE); /* Send SIG_BYE if an error happened */ +- queryflag = -1; ++ queryflag = -1; ++ } + } + break; + case MSG_COMMAND: +-- +2.25.1 +
meta/recipes-extended/screen/screen_4.8.0.bb +1 -0
@@ -22,6 +22,7 @@ SRC_URI = "${GNU_MIRROR}/screen/screen-${PV}.tar.gz \ file://0001-fix-for-multijob-build.patch \ file://0001-Remove-more-compatibility-stuff.patch \ file://CVE-2021-26937.patch \ + file://CVE-2023-24626.patch \ " SRC_URI[md5sum] = "d276213d3acd10339cd37848b8c4ab1e"
Signature · 1 line
2.34.1
PATCH 6/7 go: Security fix for CVE-2020-29510
In reply to Steve SakomanFrom: Shubham Kulkarni <[email protected]>
encoding/xml: replace comments inside directives with a space
Backport from https://github.com/golang/go/commit/a9cfd55e2b09735a25976d1b008a0a3c767494f8
--- meta/recipes-devtools/go/go-1.14.inc | 1 + .../go/go-1.14/CVE-2020-29510.patch | 65 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 meta/recipes-devtools/go/go-1.14/CVE-2020-29510.patch
meta/recipes-devtools/go/go-1.14.inc +1 -0
@@ -55,6 +55,7 @@ SRC_URI += "\ file://CVE-2022-41723.patch \ file://CVE-2022-41722-1.patch \ file://CVE-2022-41722-2.patch \ + file://CVE-2020-29510.patch \ " SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch"
meta/recipes-devtools/go/go-1.14/CVE-2020-29510.patch new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 7/7 go: fix CVE-2023-24537 Infinite loop in parsing
In reply to Steve SakomanFrom: Vivek Kumbhar <[email protected]>
Setting a large line or column number using a //line directive can cause integer overflow even in small source files.
Limit line and column numbers in //line directives to 2^30-1, which is small enough to avoid int32 overflow on all reasonbly-sized files.
--- meta/recipes-devtools/go/go-1.14.inc | 1 + .../go/go-1.14/CVE-2023-24537.patch | 76 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 meta/recipes-devtools/go/go-1.14/CVE-2023-24537.patch
meta/recipes-devtools/go/go-1.14.inc +1 -0
@@ -56,6 +56,7 @@ SRC_URI += "\ file://CVE-2022-41722-1.patch \ file://CVE-2022-41722-2.patch \ file://CVE-2020-29510.patch \ + file://CVE-2023-24537.patch \ " SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch"
meta/recipes-devtools/go/go-1.14/CVE-2023-24537.patch new file +76 -0
76 lines not on this page · raw message
Signature · 1 line
2.34.1