From: Peter Marko <[email protected]>

Pick patch from PR mentioned in v3.8.5 release notes.

Signed-off-by: Peter Marko <[email protected]>
Signed-off-by: Yoann Congal <[email protected]>
---
 ...25-60753.patch => CVE-2025-60753-01.patch} |  0
 .../libarchive/CVE-2025-60753-02.patch        | 46 +++++++++++++++++++
 .../libarchive/libarchive_3.6.2.bb            |  3 +-
 3 files changed, 48 insertions(+), 1 deletion(-)
 rename meta/recipes-extended/libarchive/libarchive/{CVE-2025-60753.patch => 
CVE-2025-60753-01.patch} (100%)
 create mode 100644 
meta/recipes-extended/libarchive/libarchive/CVE-2025-60753-02.patch

diff --git a/meta/recipes-extended/libarchive/libarchive/CVE-2025-60753.patch 
b/meta/recipes-extended/libarchive/libarchive/CVE-2025-60753-01.patch
similarity index 100%
rename from meta/recipes-extended/libarchive/libarchive/CVE-2025-60753.patch
rename to meta/recipes-extended/libarchive/libarchive/CVE-2025-60753-01.patch
diff --git 
a/meta/recipes-extended/libarchive/libarchive/CVE-2025-60753-02.patch 
b/meta/recipes-extended/libarchive/libarchive/CVE-2025-60753-02.patch
new file mode 100644
index 0000000000..525ee2462c
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/CVE-2025-60753-02.patch
@@ -0,0 +1,46 @@
+From cfb02de558d843dc5355c4aa2aeb4af49f88bdb9 Mon Sep 17 00:00:00 2001
+From: Martin Matuska <[email protected]>
+Date: Mon, 8 Dec 2025 21:40:46 +0100
+Subject: [PATCH] tar: fix off-bounds read resulting from #2787 (3150539ed)
+
+CVE: CVE-2025-60753
+Upstream-Status: Backport 
[https://github.com/libarchive/libarchive/commit/cfb02de558d843dc5355c4aa2aeb4af49f88bdb9]
+Signed-off-by: Peter Marko <[email protected]>
+---
+ tar/subst.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/tar/subst.c b/tar/subst.c
+index a466f653..53497ad0 100644
+--- a/tar/subst.c
++++ b/tar/subst.c
+@@ -239,7 +239,7 @@ apply_substitution(struct bsdtar *bsdtar, const char 
*name, char **result,
+ 
+               char isEnd = 0;
+               do {
+-            isEnd = *name == '\0';
++                      isEnd = *name == '\0';
+                       if (regexec(&rule->re, name, 10, matches, 0))
+                               break;
+ 
+@@ -294,13 +294,13 @@ apply_substitution(struct bsdtar *bsdtar, const char 
*name, char **result,
+ 
+                       realloc_strcat(result, rule->result + j);
+                       if (matches[0].rm_eo > 0) {
+-                name += matches[0].rm_eo;
+-            } else {
+-                // We skip a character because the match is 0-length
+-                // so we need to add it to the output
+-                realloc_strncat(result, name, 1);
+-                name += 1;
+-            }
++                              name += matches[0].rm_eo;
++                      } else if (!isEnd) {
++                              // We skip a character because the match is 
0-length
++                              // so we need to add it to the output
++                              realloc_strncat(result, name, 1);
++                              name += 1;
++                      }
+               } while (rule->global && !isEnd); // Testing one step after 
because sed et al. run 0-length patterns a last time on the empty string at the 
end
+       }
+ 
diff --git a/meta/recipes-extended/libarchive/libarchive_3.6.2.bb 
b/meta/recipes-extended/libarchive/libarchive_3.6.2.bb
index 66f30ec89b..e74326b40f 100644
--- a/meta/recipes-extended/libarchive/libarchive_3.6.2.bb
+++ b/meta/recipes-extended/libarchive/libarchive_3.6.2.bb
@@ -48,7 +48,8 @@ SRC_URI = 
"http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
            
file://0001-Merge-pull-request-2749-from-KlaraSystems-des-tempdi.patch \
            
file://0001-Merge-pull-request-2753-from-KlaraSystems-des-temp-f.patch \
            file://0001-Merge-pull-request-2768-from-Commandoss-master.patch \
-           file://CVE-2025-60753.patch \
+           file://CVE-2025-60753-01.patch \
+           file://CVE-2025-60753-02.patch \
            "
 UPSTREAM_CHECK_URI = "http://libarchive.org/";
 
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#229720): 
https://lists.openembedded.org/g/openembedded-core/message/229720
Mute This Topic: https://lists.openembedded.org/mt/117362648/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to