Patch libssh2 to address CVE-2020-22218 (#6214)

* Patch libssh2 to address CVE-2020-22218
* libssh2: Updating toolchain manifests
This commit is contained in:
suresh-thelkar 2023-09-18 14:11:43 +05:30 коммит произвёл GitHub
Родитель 94e6e8e1a4
Коммит 9177f76ef4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 39 добавлений и 13 удалений

Просмотреть файл

@ -0,0 +1,23 @@
From 41533173d27140400a17c49314efde6df54abdeb Mon Sep 17 00:00:00 2001
From: lutianxiong <lutianxiong@huawei.com>
Date: Wed, 27 May 2020 22:26:33 +0800
Subject: [PATCH] fix use-of-uninitialized-value
return error if malloc(0)
---
src/transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/transport.c b/src/transport.c
index 96fca6b8cc..adf96c2437 100644
--- a/src/transport.c
+++ b/src/transport.c
@@ -472,7 +472,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
/* Get a packet handle put data into. We get one to
hold all data, including padding and MAC. */
p->payload = LIBSSH2_ALLOC(session, total_num);
- if(!p->payload) {
+ if(total_num == 0 || !p->payload) {
return LIBSSH2_ERROR_ALLOC;
}
p->total_num = total_num;

Просмотреть файл

@ -3,7 +3,7 @@
Summary: libssh2 is a library implementing the SSH2 protocol.
Name: libssh2
Version: 1.9.0
Release: 2%{?dist}
Release: 3%{?dist}
License: BSD
URL: https://www.libssh2.org/
Group: System Environment/NetworkingLibraries
@ -11,6 +11,7 @@ Vendor: Microsoft Corporation
Distribution: Mariner
Source0: https://www.libssh2.org/download/libssh2-%{version}.tar.gz
Patch0: CVE-2019-17498.patch
Patch1: CVE-2020-22218.patch
BuildRequires: openssl-devel
BuildRequires: zlib-devel
@ -28,8 +29,7 @@ Requires: libssh2
These are the header files of libssh2.
%prep
%setup -q
%patch0 -p1
%autosetup -p1
%build
./configure --prefix=%{_prefix} \
@ -59,6 +59,9 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';'
%{_mandir}/man3/*
%changelog
* Wed Sep 13 2023 Suresh Thelkar <sthelkar@microsoft.com> - 1.9.0-3
- Add patch for CVE-2020-22218
* Tue Feb 08 2022 Thomas Crain <thcrain@microsoft.com> - 1.9.0-2
- Remove unused `%%define sha1` lines
- License verified

Просмотреть файл

@ -186,8 +186,8 @@ cpio-lang-2.13-4.cm2.aarch64.rpm
e2fsprogs-libs-1.46.5-3.cm2.aarch64.rpm
libsolv-0.7.24-1.cm2.aarch64.rpm
libsolv-devel-0.7.24-1.cm2.aarch64.rpm
libssh2-1.9.0-2.cm2.aarch64.rpm
libssh2-devel-1.9.0-2.cm2.aarch64.rpm
libssh2-1.9.0-3.cm2.aarch64.rpm
libssh2-devel-1.9.0-3.cm2.aarch64.rpm
krb5-1.19.4-2.cm2.aarch64.rpm
nghttp2-1.46.0-3.cm2.aarch64.rpm
curl-8.2.1-1.cm2.aarch64.rpm

Просмотреть файл

@ -186,8 +186,8 @@ cpio-lang-2.13-4.cm2.x86_64.rpm
e2fsprogs-libs-1.46.5-3.cm2.x86_64.rpm
libsolv-0.7.24-1.cm2.x86_64.rpm
libsolv-devel-0.7.24-1.cm2.x86_64.rpm
libssh2-1.9.0-2.cm2.x86_64.rpm
libssh2-devel-1.9.0-2.cm2.x86_64.rpm
libssh2-1.9.0-3.cm2.x86_64.rpm
libssh2-devel-1.9.0-3.cm2.x86_64.rpm
krb5-1.19.4-2.cm2.x86_64.rpm
nghttp2-1.46.0-3.cm2.x86_64.rpm
curl-8.2.1-1.cm2.x86_64.rpm

Просмотреть файл

@ -199,9 +199,9 @@ libsolv-0.7.24-1.cm2.aarch64.rpm
libsolv-debuginfo-0.7.24-1.cm2.aarch64.rpm
libsolv-devel-0.7.24-1.cm2.aarch64.rpm
libsolv-tools-0.7.24-1.cm2.aarch64.rpm
libssh2-1.9.0-2.cm2.aarch64.rpm
libssh2-debuginfo-1.9.0-2.cm2.aarch64.rpm
libssh2-devel-1.9.0-2.cm2.aarch64.rpm
libssh2-1.9.0-3.cm2.aarch64.rpm
libssh2-debuginfo-1.9.0-3.cm2.aarch64.rpm
libssh2-devel-1.9.0-3.cm2.aarch64.rpm
libstdc++-11.2.0-5.cm2.aarch64.rpm
libstdc++-devel-11.2.0-5.cm2.aarch64.rpm
libtasn1-4.19.0-1.cm2.aarch64.rpm

Просмотреть файл

@ -199,9 +199,9 @@ libsolv-0.7.24-1.cm2.x86_64.rpm
libsolv-debuginfo-0.7.24-1.cm2.x86_64.rpm
libsolv-devel-0.7.24-1.cm2.x86_64.rpm
libsolv-tools-0.7.24-1.cm2.x86_64.rpm
libssh2-1.9.0-2.cm2.x86_64.rpm
libssh2-debuginfo-1.9.0-2.cm2.x86_64.rpm
libssh2-devel-1.9.0-2.cm2.x86_64.rpm
libssh2-1.9.0-3.cm2.x86_64.rpm
libssh2-debuginfo-1.9.0-3.cm2.x86_64.rpm
libssh2-devel-1.9.0-3.cm2.x86_64.rpm
libstdc++-11.2.0-5.cm2.x86_64.rpm
libstdc++-devel-11.2.0-5.cm2.x86_64.rpm
libtasn1-4.19.0-1.cm2.x86_64.rpm