summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMingli Yu <mingli.yu@windriver.com>2023-08-11 18:04:06 +0800
committerArmin Kuster <akuster808@gmail.com>2023-08-11 10:35:57 -0400
commit52ca385fc15bbbc8816ab487e1a703596b7db1e2 (patch)
tree3bd3400e3365175cd9a691f6637924d44902f98d
parent9fca75d8b251ec520d98d78b694f73a93c360a64 (diff)
downloadmeta-openembedded-52ca385fc15bbbc8816ab487e1a703596b7db1e2.tar.gz
yajl: Fix CVE-2023-33460
Backport 2 patches [1] [2] to fix CVE-2023-33460. [1] https://github.com/openEuler-BaseService/yajl/commit/3d65cb0c6db4d433e5e42ee7d91d8a04e21337cf [2] https://github.com/openEuler-BaseService/yajl/commit/23a122eddaa28165a6c219000adcc31ff9a8a698 Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/yajl/yajl/CVE-2023-33460_1.patch43
-rw-r--r--meta-oe/recipes-devtools/yajl/yajl/CVE-2023-33460_2.patch31
-rw-r--r--meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb5
3 files changed, 78 insertions, 1 deletions
diff --git a/meta-oe/recipes-devtools/yajl/yajl/CVE-2023-33460_1.patch b/meta-oe/recipes-devtools/yajl/yajl/CVE-2023-33460_1.patch
new file mode 100644
index 0000000000..c538991125
--- /dev/null
+++ b/meta-oe/recipes-devtools/yajl/yajl/CVE-2023-33460_1.patch
@@ -0,0 +1,43 @@
1From 3d65cb0c6db4d433e5e42ee7d91d8a04e21337cf Mon Sep 17 00:00:00 2001
2From: wujing <wujing50@huawei.com>
3Date: Thu, 14 Feb 2019 03:12:30 +0800
4Subject: [PATCH] yajl: fix memory leak problem
5
6reason: fix memory leak problem
7
8CVE: CVE-2023-33460
9
10Upstream-Status: Backport [https://github.com/openEuler-BaseService/yajl/commit/3d65cb0c6db4d433e5e42ee7d91d8a04e21337cf]
11
12Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
13---
14 src/yajl_tree.c | 6 +++++-
15 1 file changed, 5 insertions(+), 1 deletion(-)
16
17diff --git a/src/yajl_tree.c b/src/yajl_tree.c
18index 3d357a3..4b3cf2b 100644
19--- a/src/yajl_tree.c
20+++ b/src/yajl_tree.c
21@@ -143,7 +143,7 @@ static yajl_val context_pop(context_t *ctx)
22 ctx->stack = stack->next;
23
24 v = stack->value;
25-
26+ free (stack->key);
27 free (stack);
28
29 return (v);
30@@ -444,6 +444,10 @@ yajl_val yajl_tree_parse (const char *input,
31 snprintf(error_buffer, error_buffer_size, "%s", internal_err_str);
32 YA_FREE(&(handle->alloc), internal_err_str);
33 }
34+ while(ctx.stack != NULL) {
35+ yajl_val v = context_pop(&ctx);
36+ yajl_tree_free(v);
37+ }
38 yajl_free (handle);
39 return NULL;
40 }
41--
422.25.1
43
diff --git a/meta-oe/recipes-devtools/yajl/yajl/CVE-2023-33460_2.patch b/meta-oe/recipes-devtools/yajl/yajl/CVE-2023-33460_2.patch
new file mode 100644
index 0000000000..6e9b119b56
--- /dev/null
+++ b/meta-oe/recipes-devtools/yajl/yajl/CVE-2023-33460_2.patch
@@ -0,0 +1,31 @@
1From 23a122eddaa28165a6c219000adcc31ff9a8a698 Mon Sep 17 00:00:00 2001
2From: "zhang.jiujiu" <282627424@qq.com>
3Date: Tue, 7 Dec 2021 22:37:02 +0800
4Subject: [PATCH] fix memory leaks
5
6CVE: CVE-2023-33460
7
8Upstream-Status: Backport [https://github.com/openEuler-BaseService/yajl/commit/23a122eddaa28165a6c219000adcc31ff9a8a698]
9
10Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
11---
12 src/yajl_tree.c | 3 +++
13 1 file changed, 3 insertions(+)
14
15diff --git a/src/yajl_tree.c b/src/yajl_tree.c
16index b9e6604..0e7bde9 100644
17--- a/src/yajl_tree.c
18+++ b/src/yajl_tree.c
19@@ -456,6 +456,9 @@ yajl_val yajl_tree_parse (const char *input,
20 yajl_tree_free(v);
21 }
22 yajl_free (handle);
23+ //If the requested memory is not released in time, it will cause memory leakage
24+ if(ctx.root)
25+ yajl_tree_free(ctx.root);
26 return NULL;
27 }
28
29--
302.25.1
31
diff --git a/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb b/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb
index cf8dbb183e..aae3c6f3a1 100644
--- a/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb
+++ b/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb
@@ -8,7 +8,10 @@ HOMEPAGE = "http://lloyd.github.com/yajl/"
8LICENSE = "ISC" 8LICENSE = "ISC"
9LIC_FILES_CHKSUM = "file://COPYING;md5=39af6eb42999852bdd3ea00ad120a36d" 9LIC_FILES_CHKSUM = "file://COPYING;md5=39af6eb42999852bdd3ea00ad120a36d"
10 10
11SRC_URI = "git://github.com/lloyd/yajl;branch=master;protocol=https" 11SRC_URI = "git://github.com/lloyd/yajl;branch=master;protocol=https \
12 file://CVE-2023-33460_1.patch \
13 file://CVE-2023-33460_2.patch \
14"
12SRCREV = "a0ecdde0c042b9256170f2f8890dd9451a4240aa" 15SRCREV = "a0ecdde0c042b9256170f2f8890dd9451a4240aa"
13 16
14S = "${WORKDIR}/git" 17S = "${WORKDIR}/git"