summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChee Yang Lee <chee.yang.lee@intel.com>2023-09-04 18:03:10 +0800
committerSteve Sakoman <steve@sakoman.com>2023-09-08 16:09:41 -1000
commit91ea1ab7c609a178a63a490b60e0aade309d10bb (patch)
tree6f2e1100b3f39b5c7c013216d576fb8230222da7
parent4c27009f166e20ca1a9ce51198158f43192d0cb7 (diff)
downloadpoky-91ea1ab7c609a178a63a490b60e0aade309d10bb.tar.gz
libssh2: fix CVE-2020-22218
(From OE-Core rev: a0b41511766130883e93b5b8a07801a836beeb67) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-support/libssh2/libssh2/CVE-2020-22218.patch34
-rw-r--r--meta/recipes-support/libssh2/libssh2_1.10.0.bb1
2 files changed, 35 insertions, 0 deletions
diff --git a/meta/recipes-support/libssh2/libssh2/CVE-2020-22218.patch b/meta/recipes-support/libssh2/libssh2/CVE-2020-22218.patch
new file mode 100644
index 0000000000..066233fcae
--- /dev/null
+++ b/meta/recipes-support/libssh2/libssh2/CVE-2020-22218.patch
@@ -0,0 +1,34 @@
1CVE: CVE-2020-22218
2Upstream-Status: Backport [ https://github.com/libssh2/libssh2/commit/642eec48ff3adfdb7a9e562b6d7fc865d1733f45 ]
3Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
4
5
6From 642eec48ff3adfdb7a9e562b6d7fc865d1733f45 Mon Sep 17 00:00:00 2001
7From: lutianxiong <lutianxiong@huawei.com>
8Date: Fri, 29 May 2020 01:25:40 +0800
9Subject: [PATCH] transport.c: fix use-of-uninitialized-value (#476)
10
11file:transport.c
12
13notes:
14return error if malloc(0)
15
16credit:
17lutianxiong
18---
19 src/transport.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22diff --git a/src/transport.c b/src/transport.c
23index 96fca6b8cc..adf96c2437 100644
24--- a/src/transport.c
25+++ b/src/transport.c
26@@ -472,7 +472,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
27 /* Get a packet handle put data into. We get one to
28 hold all data, including padding and MAC. */
29 p->payload = LIBSSH2_ALLOC(session, total_num);
30- if(!p->payload) {
31+ if(total_num == 0 || !p->payload) {
32 return LIBSSH2_ERROR_ALLOC;
33 }
34 p->total_num = total_num;
diff --git a/meta/recipes-support/libssh2/libssh2_1.10.0.bb b/meta/recipes-support/libssh2/libssh2_1.10.0.bb
index d5513373b0..8483a292c2 100644
--- a/meta/recipes-support/libssh2/libssh2_1.10.0.bb
+++ b/meta/recipes-support/libssh2/libssh2_1.10.0.bb
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=3e089ad0cf27edf1e7f261dfcd06acc7"
10SRC_URI = "http://www.libssh2.org/download/${BP}.tar.gz \ 10SRC_URI = "http://www.libssh2.org/download/${BP}.tar.gz \
11 file://fix-ssh2-test.patch \ 11 file://fix-ssh2-test.patch \
12 file://run-ptest \ 12 file://run-ptest \
13 file://CVE-2020-22218.patch \
13 " 14 "
14 15
15SRC_URI[sha256sum] = "2d64e90f3ded394b91d3a2e774ca203a4179f69aebee03003e5a6fa621e41d51" 16SRC_URI[sha256sum] = "2d64e90f3ded394b91d3a2e774ca203a4179f69aebee03003e5a6fa621e41d51"