diff options
author | Divya Chellam <divya.chellam@windriver.com> | 2025-07-02 12:21:30 +0530 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2025-07-09 08:43:32 -0700 |
commit | 28f102461ab6faafddd10448f136a55bb41d140f (patch) | |
tree | 3eb8b79ad6c975c2c206ebeef120588547f9068a | |
parent | 7bb9c2255b3aed8441fba1133f350b223a3b6379 (diff) | |
download | poky-28f102461ab6faafddd10448f136a55bb41d140f.tar.gz |
libarchive: fix CVE-2025-5914
A vulnerability has been identified in the libarchive library, specifically within the archiv
e_read_format_rar_seek_data() function. This flaw involves an integer overflow that can ultim
ately lead to a double-free condition. Exploiting a double-free vulnerability can result in m
emory corruption, enabling an attacker to execute arbitrary code or cause a denial-of-service
condition.
Reference:
https://nvd.nist.gov/vuln/detail/CVE-2025-5914
Upstream-patch:
https://github.com/libarchive/libarchive/commit/09685126fcec664e2b8ca595e1fc371bd494d209
(From OE-Core rev: b7d8249bda296620a5bbf592f4cdf566b4537563)
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | meta/recipes-extended/libarchive/libarchive/CVE-2025-5914.patch | 48 | ||||
-rw-r--r-- | meta/recipes-extended/libarchive/libarchive_3.7.9.bb | 1 |
2 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-extended/libarchive/libarchive/CVE-2025-5914.patch b/meta/recipes-extended/libarchive/libarchive/CVE-2025-5914.patch new file mode 100644 index 0000000000..89022b38fd --- /dev/null +++ b/meta/recipes-extended/libarchive/libarchive/CVE-2025-5914.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From 09685126fcec664e2b8ca595e1fc371bd494d209 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tobias Stoeckmann <stoeckmann@users.noreply.github.com> | ||
3 | Date: Sun, 11 May 2025 02:17:19 +0200 | ||
4 | Subject: [PATCH] rar: Fix double free with over 4 billion nodes (#2598) | ||
5 | |||
6 | If a system is capable of handling 4 billion nodes in memory, a double | ||
7 | free could occur because of an unsigned integer overflow leading to a | ||
8 | realloc call with size argument of 0. Eventually, the client will | ||
9 | release that memory again, triggering a double free. | ||
10 | |||
11 | Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> | ||
12 | |||
13 | CVE: CVE-2025-5914 | ||
14 | |||
15 | Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/09685126fcec664e2b8ca595e1fc371bd494d209] | ||
16 | |||
17 | Signed-off-by: Divya Chellam <divya.chellam@windriver.com> | ||
18 | --- | ||
19 | libarchive/archive_read_support_format_rar.c | 6 +++--- | ||
20 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
21 | |||
22 | diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c | ||
23 | index 9d155c6..9eb3c84 100644 | ||
24 | --- a/libarchive/archive_read_support_format_rar.c | ||
25 | +++ b/libarchive/archive_read_support_format_rar.c | ||
26 | @@ -335,8 +335,8 @@ struct rar | ||
27 | int found_first_header; | ||
28 | char has_endarc_header; | ||
29 | struct data_block_offsets *dbo; | ||
30 | - unsigned int cursor; | ||
31 | - unsigned int nodes; | ||
32 | + size_t cursor; | ||
33 | + size_t nodes; | ||
34 | char filename_must_match; | ||
35 | |||
36 | /* LZSS members */ | ||
37 | @@ -1186,7 +1186,7 @@ archive_read_format_rar_seek_data(struct archive_read *a, int64_t offset, | ||
38 | int whence) | ||
39 | { | ||
40 | int64_t client_offset, ret; | ||
41 | - unsigned int i; | ||
42 | + size_t i; | ||
43 | struct rar *rar = (struct rar *)(a->format->data); | ||
44 | |||
45 | if (rar->compression_method == COMPRESS_METHOD_STORE) | ||
46 | -- | ||
47 | 2.40.0 | ||
48 | |||
diff --git a/meta/recipes-extended/libarchive/libarchive_3.7.9.bb b/meta/recipes-extended/libarchive/libarchive_3.7.9.bb index 4dd6794bb1..c26a14e32e 100644 --- a/meta/recipes-extended/libarchive/libarchive_3.7.9.bb +++ b/meta/recipes-extended/libarchive/libarchive_3.7.9.bb | |||
@@ -31,6 +31,7 @@ EXTRA_OECONF += "--enable-largefile --without-iconv" | |||
31 | 31 | ||
32 | SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \ | 32 | SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \ |
33 | file://configurehack.patch \ | 33 | file://configurehack.patch \ |
34 | file://CVE-2025-5914.patch \ | ||
34 | " | 35 | " |
35 | UPSTREAM_CHECK_URI = "http://libarchive.org/" | 36 | UPSTREAM_CHECK_URI = "http://libarchive.org/" |
36 | 37 | ||