Patch `libarchive` for CVE-2022-36227 (#4336)

* Patch `libarchive` for CVE-2022-36227
* libarchive: manifests: update entry

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
This commit is contained in:
Muhammad Falak R Wani 2022-12-01 12:48:29 +05:30 коммит произвёл GitHub
Родитель 0e7ec69279
Коммит 0ee40831e2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 50 добавлений и 11 удалений

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

@ -0,0 +1,35 @@
From bff38efe8c110469c5080d387bec62a6ca15b1a5 Mon Sep 17 00:00:00 2001
From: obiwac <obiwac@gmail.com>
Date: Fri, 22 Jul 2022 22:41:10 +0200
Subject: [PATCH] libarchive: Handle a `calloc` returning NULL (fixes #1754)
---
libarchive/archive_write.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libarchive/archive_write.c b/libarchive/archive_write.c
index 66592e826..27626b541 100644
--- a/libarchive/archive_write.c
+++ b/libarchive/archive_write.c
@@ -201,6 +201,10 @@ __archive_write_allocate_filter(struct archive *_a)
struct archive_write_filter *f;
f = calloc(1, sizeof(*f));
+
+ if (f == NULL)
+ return (NULL);
+
f->archive = _a;
f->state = ARCHIVE_WRITE_FILTER_STATE_NEW;
if (a->filter_first == NULL)
@@ -548,6 +552,10 @@ archive_write_open2(struct archive *_a, void *client_data,
a->client_data = client_data;
client_filter = __archive_write_allocate_filter(_a);
+
+ if (client_filter == NULL)
+ return (ARCHIVE_FATAL);
+
client_filter->open = archive_write_client_open;
client_filter->write = archive_write_client_write;
client_filter->close = archive_write_client_close;

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

@ -1,13 +1,14 @@
Summary: Multi-format archive and compression library
Name: libarchive
Version: 3.6.1
Release: 1%{?dist}
Release: 2%{?dist}
# Certain files have individual licenses. For more details see contents of "COPYING".
License: BSD AND Public Domain AND (ASL 2.0 OR CC0 1.0 OR OpenSSL)
Vendor: Microsoft Corporation
Distribution: Mariner
URL: https://www.libarchive.org/
Source0: https://github.com/libarchive/libarchive/releases/download/v%{version}/%{name}-%{version}.tar.gz
Patch0: CVE-2022-36227.patch
Provides: bsdtar = %{version}-%{release}
BuildRequires: xz-libs
@ -60,6 +61,9 @@ make %{?_smp_mflags} check
%{_libdir}/pkgconfig/*.pc
%changelog
* Thu Dec 01 2022 Muhammad Falak <mwani@microsoft.com> - 3.6.1-2
- Patch CVE-2022-36227
* Mon Jun 13 2022 Muhammad Falak <mwani@microsoft.com> - 3.6.1-1
- Bump version to 3.6.1 to address CVE-2022-26280

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

@ -173,8 +173,8 @@ openssl-static-1.1.1k-20.cm2.aarch64.rpm
libcap-2.60-1.cm2.aarch64.rpm
libcap-devel-2.60-1.cm2.aarch64.rpm
debugedit-5.0-1.cm2.aarch64.rpm
libarchive-3.6.1-1.cm2.aarch64.rpm
libarchive-devel-3.6.1-1.cm2.aarch64.rpm
libarchive-3.6.1-2.cm2.aarch64.rpm
libarchive-devel-3.6.1-2.cm2.aarch64.rpm
rpm-4.18.0-2.cm2.aarch64.rpm
rpm-build-4.18.0-2.cm2.aarch64.rpm
rpm-build-libs-4.18.0-2.cm2.aarch64.rpm

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

@ -173,8 +173,8 @@ openssl-static-1.1.1k-20.cm2.x86_64.rpm
libcap-2.60-1.cm2.x86_64.rpm
libcap-devel-2.60-1.cm2.x86_64.rpm
debugedit-5.0-1.cm2.x86_64.rpm
libarchive-3.6.1-1.cm2.x86_64.rpm
libarchive-devel-3.6.1-1.cm2.x86_64.rpm
libarchive-3.6.1-2.cm2.x86_64.rpm
libarchive-devel-3.6.1-2.cm2.x86_64.rpm
rpm-4.18.0-2.cm2.x86_64.rpm
rpm-build-4.18.0-2.cm2.x86_64.rpm
rpm-build-libs-4.18.0-2.cm2.x86_64.rpm

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

@ -141,9 +141,9 @@ krb5-1.19.3-2.cm2.aarch64.rpm
krb5-debuginfo-1.19.3-2.cm2.aarch64.rpm
krb5-devel-1.19.3-2.cm2.aarch64.rpm
krb5-lang-1.19.3-2.cm2.aarch64.rpm
libarchive-3.6.1-1.cm2.aarch64.rpm
libarchive-debuginfo-3.6.1-1.cm2.aarch64.rpm
libarchive-devel-3.6.1-1.cm2.aarch64.rpm
libarchive-3.6.1-2.cm2.aarch64.rpm
libarchive-debuginfo-3.6.1-2.cm2.aarch64.rpm
libarchive-devel-3.6.1-2.cm2.aarch64.rpm
libassuan-2.5.5-2.cm2.aarch64.rpm
libassuan-debuginfo-2.5.5-2.cm2.aarch64.rpm
libassuan-devel-2.5.5-2.cm2.aarch64.rpm

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

@ -141,9 +141,9 @@ krb5-1.19.3-2.cm2.x86_64.rpm
krb5-debuginfo-1.19.3-2.cm2.x86_64.rpm
krb5-devel-1.19.3-2.cm2.x86_64.rpm
krb5-lang-1.19.3-2.cm2.x86_64.rpm
libarchive-3.6.1-1.cm2.x86_64.rpm
libarchive-debuginfo-3.6.1-1.cm2.x86_64.rpm
libarchive-devel-3.6.1-1.cm2.x86_64.rpm
libarchive-3.6.1-2.cm2.x86_64.rpm
libarchive-debuginfo-3.6.1-2.cm2.x86_64.rpm
libarchive-devel-3.6.1-2.cm2.x86_64.rpm
libassuan-2.5.5-2.cm2.x86_64.rpm
libassuan-debuginfo-2.5.5-2.cm2.x86_64.rpm
libassuan-devel-2.5.5-2.cm2.x86_64.rpm