* [PATCH] libarchive: CVE-2017-14502
@ 2017-09-28 8:06 Zhixiong Chi
0 siblings, 0 replies; 3+ messages in thread
From: Zhixiong Chi @ 2017-09-28 8:06 UTC (permalink / raw)
To: openembedded-core
read_header in archive_read_support_format_rar.c suffers from an
off-by-one error for UTF-16 names in RAR archives, leading to an
out-of-bounds read in archive_read_format_rar_read_header.
Backport the patch from
https://github.com/libarchive/libarchive/commit
commit 5562545b5562f6d12a4ef991fae158bf4ccf92b6
CVE: CVE-2017-14502
Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
---
.../libarchive/libarchive/CVE-2017-14502.patch | 37 ++++++++++++++++++++++
.../libarchive/libarchive_3.3.2.bb | 1 +
2 files changed, 38 insertions(+)
create mode 100644 meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch
diff --git a/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch b/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch
new file mode 100644
index 0000000..72e1546
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch
@@ -0,0 +1,37 @@
+From 5562545b5562f6d12a4ef991fae158bf4ccf92b6 Mon Sep 17 00:00:00 2001
+From: Joerg Sonnenberger <joerg@bec.de>
+Date: Sat, 9 Sep 2017 17:47:32 +0200
+Subject: [PATCH] Avoid a read off-by-one error for UTF16 names in RAR
+ archives.
+
+Reported-By: OSS-Fuzz issue 573
+
+CVE: CVE-2017-14502
+
+Upstream-Status: Backport
+
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+---
+ libarchive/archive_read_support_format_rar.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
+index cbb14c3..751de69 100644
+--- a/libarchive/archive_read_support_format_rar.c
++++ b/libarchive/archive_read_support_format_rar.c
+@@ -1496,7 +1496,11 @@ read_header(struct archive_read *a, struct archive_entry *entry,
+ return (ARCHIVE_FATAL);
+ }
+ filename[filename_size++] = '\0';
+- filename[filename_size++] = '\0';
++ /*
++ * Do not increment filename_size here as the computations below
++ * add the space for the terminating NUL explicitly.
++ */
++ filename[filename_size] = '\0';
+
+ /* Decoded unicode form is UTF-16BE, so we have to update a string
+ * conversion object for it. */
+--
+1.9.1
+
diff --git a/meta/recipes-extended/libarchive/libarchive_3.3.2.bb b/meta/recipes-extended/libarchive/libarchive_3.3.2.bb
index 9e4588f..edc4d6a 100644
--- a/meta/recipes-extended/libarchive/libarchive_3.3.2.bb
+++ b/meta/recipes-extended/libarchive/libarchive_3.3.2.bb
@@ -34,6 +34,7 @@ EXTRA_OECONF += "--enable-largefile"
SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
file://bug929.patch \
file://CVE-2017-14166.patch \
+ file://CVE-2017-14502.patch \
"
SRC_URI[md5sum] = "4583bd6b2ebf7e0e8963d90879eb1b27"
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] libarchive: CVE-2017-14502
2017-09-27 4:25 Zhixiong Chi
@ 2017-09-27 10:52 ` Burton, Ross
0 siblings, 0 replies; 3+ messages in thread
From: Burton, Ross @ 2017-09-27 10:52 UTC (permalink / raw)
To: Zhixiong Chi; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 3308 bytes --]
This doesn't apply to master, can you rebase.
Ross
On 27 September 2017 at 05:25, Zhixiong Chi <zhixiong.chi@windriver.com>
wrote:
> read_header in archive_read_support_format_rar.c suffers from an
> off-by-one error for UTF-16 names in RAR archives, leading to an
> out-of-bounds read in archive_read_format_rar_read_header.
> Backport the patch from
> https://github.com/libarchive/libarchive/commit
> commit 5562545b5562f6d12a4ef991fae158bf4ccf92b6
>
> CVE: CVE-2017-14502
>
> Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
> ---
> .../libarchive/libarchive/CVE-2017-14502.patch | 35
> ++++++++++++++++++++++
> .../libarchive/libarchive_3.3.2.bb | 1 +
> 2 files changed, 36 insertions(+)
> create mode 100644 meta/recipes-extended/libarchive/libarchive/CVE-
> 2017-14502.patch
>
> diff --git a/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch
> b/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch
> new file mode 100644
> index 0000000..442c671
> --- /dev/null
> +++ b/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch
> @@ -0,0 +1,35 @@
> +From 5562545b5562f6d12a4ef991fae158bf4ccf92b6 Mon Sep 17 00:00:00 2001
> +From: Joerg Sonnenberger <joerg@bec.de>
> +Date: Sat, 9 Sep 2017 17:47:32 +0200
> +Subject: [PATCH] Avoid a read off-by-one error for UTF16 names in RAR
> + archives.
> +
> +Reported-By: OSS-Fuzz issue 573
> +
> +CVE: CVE-2017-14502
> +
> +Upstream-Status: Backport
> +---
> + libarchive/archive_read_support_format_rar.c | 6 +++++-
> + 1 file changed, 5 insertions(+), 1 deletion(-)
> +
> +diff --git a/libarchive/archive_read_support_format_rar.c
> b/libarchive/archive_read_support_format_rar.c
> +index cbb14c3..751de69 100644
> +--- a/libarchive/archive_read_support_format_rar.c
> ++++ b/libarchive/archive_read_support_format_rar.c
> +@@ -1496,7 +1496,11 @@ read_header(struct archive_read *a, struct
> archive_entry *entry,
> + return (ARCHIVE_FATAL);
> + }
> + filename[filename_size++] = '\0';
> +- filename[filename_size++] = '\0';
> ++ /*
> ++ * Do not increment filename_size here as the computations below
> ++ * add the space for the terminating NUL explicitly.
> ++ */
> ++ filename[filename_size] = '\0';
> +
> + /* Decoded unicode form is UTF-16BE, so we have to update a string
> + * conversion object for it. */
> +--
> +1.9.1
> +
> diff --git a/meta/recipes-extended/libarchive/libarchive_3.3.2.bb
> b/meta/recipes-extended/libarchive/libarchive_3.3.2.bb
> index 5c3895e..0196eb3 100644
> --- a/meta/recipes-extended/libarchive/libarchive_3.3.2.bb
> +++ b/meta/recipes-extended/libarchive/libarchive_3.3.2.bb
> @@ -32,6 +32,7 @@ PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4,"
> EXTRA_OECONF += "--enable-largefile"
>
> SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
> + file://CVE-2017-14502.patch \
> "
>
> SRC_URI[md5sum] = "4583bd6b2ebf7e0e8963d90879eb1b27"
> --
> 1.9.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
[-- Attachment #2: Type: text/html, Size: 4964 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] libarchive: CVE-2017-14502
@ 2017-09-27 4:25 Zhixiong Chi
2017-09-27 10:52 ` Burton, Ross
0 siblings, 1 reply; 3+ messages in thread
From: Zhixiong Chi @ 2017-09-27 4:25 UTC (permalink / raw)
To: openembedded-core
read_header in archive_read_support_format_rar.c suffers from an
off-by-one error for UTF-16 names in RAR archives, leading to an
out-of-bounds read in archive_read_format_rar_read_header.
Backport the patch from
https://github.com/libarchive/libarchive/commit
commit 5562545b5562f6d12a4ef991fae158bf4ccf92b6
CVE: CVE-2017-14502
Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
---
.../libarchive/libarchive/CVE-2017-14502.patch | 35 ++++++++++++++++++++++
.../libarchive/libarchive_3.3.2.bb | 1 +
2 files changed, 36 insertions(+)
create mode 100644 meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch
diff --git a/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch b/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch
new file mode 100644
index 0000000..442c671
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch
@@ -0,0 +1,35 @@
+From 5562545b5562f6d12a4ef991fae158bf4ccf92b6 Mon Sep 17 00:00:00 2001
+From: Joerg Sonnenberger <joerg@bec.de>
+Date: Sat, 9 Sep 2017 17:47:32 +0200
+Subject: [PATCH] Avoid a read off-by-one error for UTF16 names in RAR
+ archives.
+
+Reported-By: OSS-Fuzz issue 573
+
+CVE: CVE-2017-14502
+
+Upstream-Status: Backport
+---
+ libarchive/archive_read_support_format_rar.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
+index cbb14c3..751de69 100644
+--- a/libarchive/archive_read_support_format_rar.c
++++ b/libarchive/archive_read_support_format_rar.c
+@@ -1496,7 +1496,11 @@ read_header(struct archive_read *a, struct archive_entry *entry,
+ return (ARCHIVE_FATAL);
+ }
+ filename[filename_size++] = '\0';
+- filename[filename_size++] = '\0';
++ /*
++ * Do not increment filename_size here as the computations below
++ * add the space for the terminating NUL explicitly.
++ */
++ filename[filename_size] = '\0';
+
+ /* Decoded unicode form is UTF-16BE, so we have to update a string
+ * conversion object for it. */
+--
+1.9.1
+
diff --git a/meta/recipes-extended/libarchive/libarchive_3.3.2.bb b/meta/recipes-extended/libarchive/libarchive_3.3.2.bb
index 5c3895e..0196eb3 100644
--- a/meta/recipes-extended/libarchive/libarchive_3.3.2.bb
+++ b/meta/recipes-extended/libarchive/libarchive_3.3.2.bb
@@ -32,6 +32,7 @@ PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4,"
EXTRA_OECONF += "--enable-largefile"
SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
+ file://CVE-2017-14502.patch \
"
SRC_URI[md5sum] = "4583bd6b2ebf7e0e8963d90879eb1b27"
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-28 8:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-28 8:06 [PATCH] libarchive: CVE-2017-14502 Zhixiong Chi
-- strict thread matches above, loose matches on Subject: below --
2017-09-27 4:25 Zhixiong Chi
2017-09-27 10:52 ` Burton, Ross
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.