summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshish Sharma <asharma@mvista.com>2024-10-13 09:48:14 +0530
committerSteve Sakoman <steve@sakoman.com>2024-10-24 06:31:58 -0700
commit419b3b4275d220fa77f9512d6fb3a0d81e3047d4 (patch)
treeea46ff7ee848ec8eee94c105feb9cba19a9a58cb
parent87ebb58a64fc46ca4d7d16b4bc218310ce5c2229 (diff)
downloadpoky-419b3b4275d220fa77f9512d6fb3a0d81e3047d4.tar.gz
libarchive: Fix CVE-2024-48957 & CVE-2024-48958
Backport fix: * CVE-2024-48957 - Upstream-Status: Backport from https://github.com/libarchive/libarchive/commit/3006bc5d02ad3ae3c4f9274f60c1f9d2d834734b * CVE-2024-48958 - Upstream-Status: Backport from https://github.com/libarchive/libarchive/commit/a1cb648d52f5b6d3f31184d9b6a7cbca628459b7 (From OE-Core rev: 584ce77f3aae332c66e2140497506301200ec9ca) Signed-off-by: Ashish Sharma <asharma@mvista.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-extended/libarchive/libarchive/CVE-2024-48957.patch33
-rw-r--r--meta/recipes-extended/libarchive/libarchive/CVE-2024-48958.patch37
-rw-r--r--meta/recipes-extended/libarchive/libarchive_3.6.2.bb2
3 files changed, 72 insertions, 0 deletions
diff --git a/meta/recipes-extended/libarchive/libarchive/CVE-2024-48957.patch b/meta/recipes-extended/libarchive/libarchive/CVE-2024-48957.patch
new file mode 100644
index 0000000000..fa3c8534d9
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/CVE-2024-48957.patch
@@ -0,0 +1,33 @@
1From 3006bc5d02ad3ae3c4f9274f60c1f9d2d834734b Mon Sep 17 00:00:00 2001
2From: Wei-Cheng Pan <legnaleurc@gmail.com>
3Date: Mon, 29 Apr 2024 06:53:19 +0900
4Subject: [PATCH] fix: OOB in rar audio filter (#2149)
5
6This patch ensures that `src` won't move ahead of `dst`, so `src` will
7not OOB. Similar situation like in a1cb648.
8
9CVE: CVE-2024-48957
10Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/3006bc5d02ad3ae3c4f9274f60c1f9d2d834734b]
11Signed-off-by: Ashish Sharma <asharma@mvista.com>
12
13 libarchive/archive_read_support_format_rar.c | 7 +++++++
14 1 file changed, 7 insertions(+)
15
16diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
17index 619ee81e2..4fc6626ca 100644
18--- a/libarchive/archive_read_support_format_rar.c
19+++ b/libarchive/archive_read_support_format_rar.c
20@@ -3722,6 +3722,13 @@ execute_filter_audio(struct rar_filter *filter, struct rar_virtual_machine *vm)
21 memset(&state, 0, sizeof(state));
22 for (j = i; j < length; j += numchannels)
23 {
24+ /*
25+ * The src block should not overlap with the dst block.
26+ * If so it would be better to consider this archive is broken.
27+ */
28+ if (src >= dst)
29+ return 0;
30+
31 int8_t delta = (int8_t)*src++;
32 uint8_t predbyte, byte;
33 int prederror;
diff --git a/meta/recipes-extended/libarchive/libarchive/CVE-2024-48958.patch b/meta/recipes-extended/libarchive/libarchive/CVE-2024-48958.patch
new file mode 100644
index 0000000000..7ab2a96ca8
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/CVE-2024-48958.patch
@@ -0,0 +1,37 @@
1From a1cb648d52f5b6d3f31184d9b6a7cbca628459b7 Mon Sep 17 00:00:00 2001
2From: Wei-Cheng Pan <legnaleurc@gmail.com>
3Date: Mon, 29 Apr 2024 06:50:22 +0900
4Subject: [PATCH] fix: OOB in rar delta filter (#2148)
5
6Ensure that `src` won't move ahead of `dst`, so `src` will not OOB.
7Since `dst` won't move in this function, and we are only increasing `src`
8position, this check should be enough. It should be safe to early return
9because this function does not allocate resources.
10
11CVE: CVE-2024-48958
12Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/a1cb648d52f5b6d3f31184d9b6a7cbca628459b7]
13Signed-off-by: Ashish Sharma <asharma@mvista.com>
14
15 libarchive/archive_read_support_format_rar.c | 8 ++++++++
16 1 file changed, 8 insertions(+)
17
18diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
19index 79669a8f4..619ee81e2 100644
20--- a/libarchive/archive_read_support_format_rar.c
21+++ b/libarchive/archive_read_support_format_rar.c
22@@ -3612,7 +3612,15 @@ execute_filter_delta(struct rar_filter *filter, struct rar_virtual_machine *vm)
23 {
24 uint8_t lastbyte = 0;
25 for (idx = i; idx < length; idx += numchannels)
26+ {
27+ /*
28+ * The src block should not overlap with the dst block.
29+ * If so it would be better to consider this archive is broken.
30+ */
31+ if (src >= dst)
32+ return 0;
33 lastbyte = dst[idx] = lastbyte - *src++;
34+ }
35 }
36
37 filter->filteredblockaddress = length;
diff --git a/meta/recipes-extended/libarchive/libarchive_3.6.2.bb b/meta/recipes-extended/libarchive/libarchive_3.6.2.bb
index a7a3e47412..e1eca79004 100644
--- a/meta/recipes-extended/libarchive/libarchive_3.6.2.bb
+++ b/meta/recipes-extended/libarchive/libarchive_3.6.2.bb
@@ -31,6 +31,8 @@ EXTRA_OECONF += "--enable-largefile --without-iconv"
31SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \ 31SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
32 file://0001-pax-writer-fix-multiple-security-vulnerabilities.patch \ 32 file://0001-pax-writer-fix-multiple-security-vulnerabilities.patch \
33 file://CVE-2024-26256.patch \ 33 file://CVE-2024-26256.patch \
34 file://CVE-2024-48957.patch \
35 file://CVE-2024-48958.patch \
34 " 36 "
35UPSTREAM_CHECK_URI = "http://libarchive.org/" 37UPSTREAM_CHECK_URI = "http://libarchive.org/"
36 38