diff options
| author | Ashish Sharma <asharma@mvista.com> | 2024-10-13 09:48:14 +0530 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-10-24 06:31:58 -0700 |
| commit | 419b3b4275d220fa77f9512d6fb3a0d81e3047d4 (patch) | |
| tree | ea46ff7ee848ec8eee94c105feb9cba19a9a58cb | |
| parent | 87ebb58a64fc46ca4d7d16b4bc218310ce5c2229 (diff) | |
| download | poky-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>
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 @@ | |||
| 1 | From 3006bc5d02ad3ae3c4f9274f60c1f9d2d834734b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Wei-Cheng Pan <legnaleurc@gmail.com> | ||
| 3 | Date: Mon, 29 Apr 2024 06:53:19 +0900 | ||
| 4 | Subject: [PATCH] fix: OOB in rar audio filter (#2149) | ||
| 5 | |||
| 6 | This patch ensures that `src` won't move ahead of `dst`, so `src` will | ||
| 7 | not OOB. Similar situation like in a1cb648. | ||
| 8 | |||
| 9 | CVE: CVE-2024-48957 | ||
| 10 | Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/3006bc5d02ad3ae3c4f9274f60c1f9d2d834734b] | ||
| 11 | Signed-off-by: Ashish Sharma <asharma@mvista.com> | ||
| 12 | |||
| 13 | libarchive/archive_read_support_format_rar.c | 7 +++++++ | ||
| 14 | 1 file changed, 7 insertions(+) | ||
| 15 | |||
| 16 | diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c | ||
| 17 | index 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 @@ | |||
| 1 | From a1cb648d52f5b6d3f31184d9b6a7cbca628459b7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Wei-Cheng Pan <legnaleurc@gmail.com> | ||
| 3 | Date: Mon, 29 Apr 2024 06:50:22 +0900 | ||
| 4 | Subject: [PATCH] fix: OOB in rar delta filter (#2148) | ||
| 5 | |||
| 6 | Ensure that `src` won't move ahead of `dst`, so `src` will not OOB. | ||
| 7 | Since `dst` won't move in this function, and we are only increasing `src` | ||
| 8 | position, this check should be enough. It should be safe to early return | ||
| 9 | because this function does not allocate resources. | ||
| 10 | |||
| 11 | CVE: CVE-2024-48958 | ||
| 12 | Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/a1cb648d52f5b6d3f31184d9b6a7cbca628459b7] | ||
| 13 | Signed-off-by: Ashish Sharma <asharma@mvista.com> | ||
| 14 | |||
| 15 | libarchive/archive_read_support_format_rar.c | 8 ++++++++ | ||
| 16 | 1 file changed, 8 insertions(+) | ||
| 17 | |||
| 18 | diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c | ||
| 19 | index 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" | |||
| 31 | SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \ | 31 | SRC_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 | " |
| 35 | UPSTREAM_CHECK_URI = "http://libarchive.org/" | 37 | UPSTREAM_CHECK_URI = "http://libarchive.org/" |
| 36 | 38 | ||
