summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorHitendra Prajapati <hprajapati@mvista.com>2022-12-02 15:11:09 +0530
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-23 23:05:56 +0000
commitfca99f770aa0d1b96b40fc7f6f5356d1a3f323f2 (patch)
tree5f9c8af3962a006c9e767f9c9731c4ad0d6bdcc4 /meta
parenta3e3b740e140d036122f7b11e2ac452bda548444 (diff)
downloadpoky-fca99f770aa0d1b96b40fc7f6f5356d1a3f323f2.tar.gz
libarchive: CVE-2022-36227 NULL pointer dereference in archive_write.c
Upstream-Status: Backport from https://github.com/libarchive/libarchive/commit/bff38efe8c110469c5080d387bec62a6ca15b1a5 (From OE-Core rev: a6e4e67cf8f2e98cc2cc3f5c66722a35cc0dda46) Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-extended/libarchive/libarchive/CVE-2022-36227.patch42
-rw-r--r--meta/recipes-extended/libarchive/libarchive_3.6.1.bb3
2 files changed, 44 insertions, 1 deletions
diff --git a/meta/recipes-extended/libarchive/libarchive/CVE-2022-36227.patch b/meta/recipes-extended/libarchive/libarchive/CVE-2022-36227.patch
new file mode 100644
index 0000000000..d0d143710c
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/CVE-2022-36227.patch
@@ -0,0 +1,42 @@
1From b5332ed6d59ba5113a0a2c67fd82b69fcd5cde68 Mon Sep 17 00:00:00 2001
2From: obiwac <obiwac@gmail.com>
3Date: Fri, 22 Jul 2022 22:41:10 +0200
4Subject: [PATCH] libarchive: CVE-2022-36227 Handle a `calloc` returning NULL
5 (fixes #1754)
6
7Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/bff38efe8c110469c5080d387bec62a6ca15b1a5]
8CVE: CVE-2022-36227
9Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com
10---
11 libarchive/archive_write.c | 8 ++++++++
12 1 file changed, 8 insertions(+)
13
14diff --git a/libarchive/archive_write.c b/libarchive/archive_write.c
15index 66592e8..27626b5 100644
16--- a/libarchive/archive_write.c
17+++ b/libarchive/archive_write.c
18@@ -201,6 +201,10 @@ __archive_write_allocate_filter(struct archive *_a)
19 struct archive_write_filter *f;
20
21 f = calloc(1, sizeof(*f));
22+
23+ if (f == NULL)
24+ return (NULL);
25+
26 f->archive = _a;
27 f->state = ARCHIVE_WRITE_FILTER_STATE_NEW;
28 if (a->filter_first == NULL)
29@@ -548,6 +552,10 @@ archive_write_open2(struct archive *_a, void *client_data,
30 a->client_data = client_data;
31
32 client_filter = __archive_write_allocate_filter(_a);
33+
34+ if (client_filter == NULL)
35+ return (ARCHIVE_FATAL);
36+
37 client_filter->open = archive_write_client_open;
38 client_filter->write = archive_write_client_write;
39 client_filter->close = archive_write_client_close;
40--
412.25.1
42
diff --git a/meta/recipes-extended/libarchive/libarchive_3.6.1.bb b/meta/recipes-extended/libarchive/libarchive_3.6.1.bb
index 24d7918bf9..79e13e514f 100644
--- a/meta/recipes-extended/libarchive/libarchive_3.6.1.bb
+++ b/meta/recipes-extended/libarchive/libarchive_3.6.1.bb
@@ -34,7 +34,8 @@ EXTRA_OECONF += "--enable-largefile"
34 34
35SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \ 35SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
36 file://0001-libarchive-Do-not-include-sys-mount.h-when-linux-fs..patch \ 36 file://0001-libarchive-Do-not-include-sys-mount.h-when-linux-fs..patch \
37 " 37 file://CVE-2022-36227.patch \
38 "
38UPSTREAM_CHECK_URI = "http://libarchive.org/" 39UPSTREAM_CHECK_URI = "http://libarchive.org/"
39 40
40SRC_URI[sha256sum] = "c676146577d989189940f1959d9e3980d28513d74eedfbc6b7f15ea45fe54ee2" 41SRC_URI[sha256sum] = "c676146577d989189940f1959d9e3980d28513d74eedfbc6b7f15ea45fe54ee2"