fix CVE-2022-26280

(cherry picked from commit 211f12ff0d59610d877e35df403a26782b28c296)
This commit is contained in:
wangkerong 2022-07-04 10:23:19 +08:00 committed by openeuler-sync-bot
parent 5aef6a179f
commit efbbaa7d87
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From cfaa28168a07ea4a53276b63068f94fce37d6aff Mon Sep 17 00:00:00 2001
From: Tim Kientzle <kientzle@acm.org>
Date: Thu, 24 Mar 2022 10:35:00 +0100
Subject: [PATCH] ZIP reader: fix possible out-of-bounds read in
zipx_lzma_alone_init()
Fixes #1672
Conflict:NA
Reference:https://github.com/libarchive/libarchive/commit/cfaa28168a07ea4a53276b63068f94fce37d6aff
---
libarchive/archive_read_support_format_zip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libarchive/archive_read_support_format_zip.c b/libarchive/archive_read_support_format_zip.c
index 38ada70b5..9d6c900b2 100644
--- a/libarchive/archive_read_support_format_zip.c
+++ b/libarchive/archive_read_support_format_zip.c
@@ -1667,7 +1667,7 @@ zipx_lzma_alone_init(struct archive_read *a, struct zip *zip)
*/
/* Read magic1,magic2,lzma_params from the ZIPX stream. */
- if((p = __archive_read_ahead(a, 9, NULL)) == NULL) {
+ if(zip->entry_bytes_remaining < 9 || (p = __archive_read_ahead(a, 9, NULL)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated lzma data");
return (ARCHIVE_FATAL);

View File

@ -2,7 +2,7 @@
Name: libarchive
Version: 3.4.3
Release: 4
Release: 5
Summary: Multi-format archive and compression library
License: BSD
@ -26,6 +26,7 @@ Patch6006: backport-0001-CVE-2021-31566.patch
Patch6007: backport-0002-CVE-2021-31566.patch
Patch6008: backport-0003-CVE-2021-31566.patch
Patch6009: backport-0004-CVE-2021-31566.patch
Patch6010: backport-CVE-2022-26280.patch
%description
%{name} is an open-source BSD-licensed C programming library that
@ -157,6 +158,9 @@ run_testsuite
%{_mandir}/man5/*
%changelog
* Mon Jul 04 2022 wangkeorng <wangkerong@partners.com> - 3.4.3-5
- fix CVE-2022-26280
* Wed Jan 12 2022 yangcheng <yangcheng87@huawei.com> - 3.4.3-4
- Type:CVE
- ID:CVE-2021-23177,CVE-2021-31566