diff options
| -rw-r--r-- | meta/recipes-connectivity/openssh/openssh/CVE-2021-41617.patch | 48 | ||||
| -rw-r--r-- | meta/recipes-connectivity/openssh/openssh_8.7p1.bb | 1 |
2 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh/CVE-2021-41617.patch b/meta/recipes-connectivity/openssh/openssh/CVE-2021-41617.patch new file mode 100644 index 0000000000..bebde7f26d --- /dev/null +++ b/meta/recipes-connectivity/openssh/openssh/CVE-2021-41617.patch | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | From 1f0707e8e78ef290fd0f229df3fcd2236f29db89 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Changqing Li <changqing.li@windriver.com> | ||
| 3 | Date: Thu, 28 Oct 2021 11:11:05 +0800 | ||
| 4 | Subject: [PATCH] upstream: need initgroups() before setresgid(); reported by | ||
| 5 | anton@, | ||
| 6 | |||
| 7 | ok deraadt@ | ||
| 8 | |||
| 9 | OpenBSD-Commit-ID: 6aa003ee658b316960d94078f2a16edbc25087ce | ||
| 10 | |||
| 11 | CVE: CVE-2021-41617 | ||
| 12 | Upstream-Status: Backport [https://github.com/openssh/openssh-portable/commit/f3cbe43e28fe71427d41cfe3a17125b972710455 | ||
| 13 | https://github.com/openssh/openssh-portable/commit/bf944e3794eff5413f2df1ef37cddf96918c6bde] | ||
| 14 | |||
| 15 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 16 | --- | ||
| 17 | misc.c | 8 ++++++++ | ||
| 18 | 1 file changed, 8 insertions(+) | ||
| 19 | |||
| 20 | diff --git a/misc.c b/misc.c | ||
| 21 | index d988ce3..33eca1c 100644 | ||
| 22 | --- a/misc.c | ||
| 23 | +++ b/misc.c | ||
| 24 | @@ -56,6 +56,7 @@ | ||
| 25 | #ifdef HAVE_PATHS_H | ||
| 26 | # include <paths.h> | ||
| 27 | #include <pwd.h> | ||
| 28 | +#include <grp.h> | ||
| 29 | #endif | ||
| 30 | #ifdef SSH_TUN_OPENBSD | ||
| 31 | #include <net/if.h> | ||
| 32 | @@ -2629,6 +2630,13 @@ subprocess(const char *tag, const char *command, | ||
| 33 | } | ||
| 34 | closefrom(STDERR_FILENO + 1); | ||
| 35 | |||
| 36 | + if (geteuid() == 0 && | ||
| 37 | + initgroups(pw->pw_name, pw->pw_gid) == -1) { | ||
| 38 | + error("%s: initgroups(%s, %u): %s", tag, | ||
| 39 | + pw->pw_name, (u_int)pw->pw_gid, strerror(errno)); | ||
| 40 | + _exit(1); | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1) { | ||
| 44 | error("%s: setresgid %u: %s", tag, (u_int)pw->pw_gid, | ||
| 45 | strerror(errno)); | ||
| 46 | -- | ||
| 47 | 2.17.1 | ||
| 48 | |||
diff --git a/meta/recipes-connectivity/openssh/openssh_8.7p1.bb b/meta/recipes-connectivity/openssh/openssh_8.7p1.bb index 07cd6b74cd..d19833e56f 100644 --- a/meta/recipes-connectivity/openssh/openssh_8.7p1.bb +++ b/meta/recipes-connectivity/openssh/openssh_8.7p1.bb | |||
| @@ -24,6 +24,7 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar | |||
| 24 | file://fix-potential-signed-overflow-in-pointer-arithmatic.patch \ | 24 | file://fix-potential-signed-overflow-in-pointer-arithmatic.patch \ |
| 25 | file://sshd_check_keys \ | 25 | file://sshd_check_keys \ |
| 26 | file://add-test-support-for-busybox.patch \ | 26 | file://add-test-support-for-busybox.patch \ |
| 27 | file://CVE-2021-41617.patch \ | ||
| 27 | " | 28 | " |
| 28 | SRC_URI[sha256sum] = "7ca34b8bb24ae9e50f33792b7091b3841d7e1b440ff57bc9fabddf01e2ed1e24" | 29 | SRC_URI[sha256sum] = "7ca34b8bb24ae9e50f33792b7091b3841d7e1b440ff57bc9fabddf01e2ed1e24" |
| 29 | 30 | ||
