summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErnst Sjöstrand <ernst.sjostrand@verisure.com>2021-12-21 17:24:01 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-12-30 16:59:16 +0000
commit11880c6987905afa2c1d282195e75a666fbc025b (patch)
tree94d3351e9358c13247497469d7f56cc00d7e5d59
parent1e13a3f9146b7ff8f660980c81574aa08843e4c5 (diff)
downloadpoky-11880c6987905afa2c1d282195e75a666fbc025b.tar.gz
dropbear: Fix CVE-2020-36254
Dropbear shares a lot of code with other SSH implementations, so this is a port of CVE-2018-20685 to dropbear by the dropbear developers. Reference: https://github.com/mkj/dropbear/commit/8f8a3dff705fad774a10864a2e3dbcfa9779ceff CVE: CVE-2020-36254 Upstream-Status: Backport (From OE-Core rev: 10712b736d7cbde897c5aab30e969c04740dce34) Signed-off-by: Ernst Sjöstrand <ernst.sjostrand@verisure.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/dropbear/dropbear.inc4
-rw-r--r--meta/recipes-core/dropbear/dropbear/CVE-2020-36254.patch29
2 files changed, 32 insertions, 1 deletions
diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear.inc
index d41e8b36dc..b949a9a337 100644
--- a/meta/recipes-core/dropbear/dropbear.inc
+++ b/meta/recipes-core/dropbear/dropbear.inc
@@ -22,7 +22,9 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
22 file://dropbear.socket \ 22 file://dropbear.socket \
23 file://dropbear.default \ 23 file://dropbear.default \
24 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ 24 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
25 ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} " 25 ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} \
26 file://CVE-2020-36254.patch \
27 "
26 28
27PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \ 29PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
28 file://0006-dropbear-configuration-file.patch \ 30 file://0006-dropbear-configuration-file.patch \
diff --git a/meta/recipes-core/dropbear/dropbear/CVE-2020-36254.patch b/meta/recipes-core/dropbear/dropbear/CVE-2020-36254.patch
new file mode 100644
index 0000000000..64d0d96486
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/CVE-2020-36254.patch
@@ -0,0 +1,29 @@
1From c96c48d62aefc372f2105293ddf8cff2d116dc3a Mon Sep 17 00:00:00 2001
2From: Haelwenn Monnier <contact+github.com@hacktivis.me>
3Date: Mon, 25 May 2020 14:54:29 +0200
4Subject: [PATCH] scp.c: Port OpenSSH CVE-2018-20685 fix (#80)
5
6Reference:
7https://github.com/mkj/dropbear/commit/8f8a3dff705fad774a10864a2e3dbcfa9779ceff
8
9CVE: CVE-2020-36254
10Upstream-Status: Backport
11
12---
13 scp.c | 3 ++-
14 1 file changed, 2 insertions(+), 1 deletion(-)
15
16diff --git a/scp.c b/scp.c
17index 742ae00..7b8e7d2 100644
18--- a/scp.c
19+++ b/scp.c
20@@ -935,7 +935,8 @@ sink(int argc, char **argv)
21 size = size * 10 + (*cp++ - '0');
22 if (*cp++ != ' ')
23 SCREWUP("size not delimited");
24- if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) {
25+ if (*cp == '\0' || strchr(cp, '/') != NULL ||
26+ strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) {
27 run_err("error: unexpected filename: %s", cp);
28 exit(1);
29 }