summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSona Sarmadi <sona.sarmadi@enea.com>2017-08-29 10:31:17 +0200
committerAdrian Dudau <adrian.dudau@enea.com>2017-08-29 13:35:44 +0200
commit099300f1d986bd5a631b12601881fa7d5f990d64 (patch)
tree5d81b2f92ee4078e9e1f971e043cf93e11be4795
parent7da6ebdca2d6b30dd6240db73b0c7605c310a4f1 (diff)
downloadmeta-el-common-099300f1d986bd5a631b12601881fa7d5f990d64.tar.gz
libarchive: fix for CVE-2017-5601
An error in the lha_read_file_header_1() in libarchive 3.2.2 allows remote attackers to trigger an out-of-bounds read memory access and subsequently cause a crash via a specially crafted archive. References: ========== https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5601 https://secuniaresearch.flexerasoftware.com//secunia_research/2017-3 Upstream patch: https://github.com/libarchive/libarchive/commit/98dcbbf0bf4854bf987557e55e55fff7abbf3ea9 Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com> Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
-rw-r--r--recipes-extended/libarchive/libarchive/CVE-2017-5601.patch28
-rw-r--r--recipes-extended/libarchive/libarchive_%.bbappend5
2 files changed, 33 insertions, 0 deletions
diff --git a/recipes-extended/libarchive/libarchive/CVE-2017-5601.patch b/recipes-extended/libarchive/libarchive/CVE-2017-5601.patch
new file mode 100644
index 0000000..a5298f5
--- /dev/null
+++ b/recipes-extended/libarchive/libarchive/CVE-2017-5601.patch
@@ -0,0 +1,28 @@
1From 98dcbbf0bf4854bf987557e55e55fff7abbf3ea9 Mon Sep 17 00:00:00 2001
2From: Martin Matuska <martin@matuska.org>
3Date: Thu, 19 Jan 2017 22:00:18 +0100
4Subject: [PATCH] Fail with negative lha->compsize in lha_read_file_header_1()
5 Fixes a heap buffer overflow reported in Secunia SA74169
6
7CVE: CVE-2017-5601
8Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/98dcbbf0bf4854bf987557e55e55fff7abbf3ea9.patch]
9
10Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
11---
12 libarchive/archive_read_support_format_lha.c | 3 +++
13 1 file changed, 3 insertions(+)
14
15diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c
16index 52a5531b0..d77a7c2e4 100644
17--- a/libarchive/archive_read_support_format_lha.c
18+++ b/libarchive/archive_read_support_format_lha.c
19@@ -924,6 +924,9 @@ lha_read_file_header_1(struct archive_read *a, struct lha *lha)
20 /* Get a real compressed file size. */
21 lha->compsize -= extdsize - 2;
22
23+ if (lha->compsize < 0)
24+ goto invalid; /* Invalid compressed file size */
25+
26 if (sum_calculated != headersum) {
27 archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
28 "LHa header sum error");
diff --git a/recipes-extended/libarchive/libarchive_%.bbappend b/recipes-extended/libarchive/libarchive_%.bbappend
new file mode 100644
index 0000000..b57d134
--- /dev/null
+++ b/recipes-extended/libarchive/libarchive_%.bbappend
@@ -0,0 +1,5 @@
1# look for files in the layer first
2FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
3
4SRC_URI += "file://CVE-2017-5601.patch \
5 "