summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamon Fried <rfried.dev@gmail.com>2021-02-10 09:15:22 +0200
committerKhem Raj <raj.khem@gmail.com>2021-02-09 23:45:05 -0800
commit8cb6756a835b997d39530934289f5f077e6d5eb8 (patch)
tree12ffd509845fe24eb2f3ced01dc90829fff812c1
parentf4521965f6d5afe0fb64562bba147c4b405c6005 (diff)
downloadmeta-openembedded-8cb6756a835b997d39530934289f5f077e6d5eb8.tar.gz
fluentbit: Fix SIGSEGV caused by using flb_free instead of mk_mem_free
Signed-off-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/0001-bin-fix-SIGSEGV-caused-by-using-flb_free-instead-of-.patch43
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/0002-parser-Fix-SIGSEGV-caused-by-using-flb_free-instead-.patch82
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb4
3 files changed, 128 insertions, 1 deletions
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0001-bin-fix-SIGSEGV-caused-by-using-flb_free-instead-of-.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-bin-fix-SIGSEGV-caused-by-using-flb_free-instead-of-.patch
new file mode 100644
index 000000000..a6ff5991c
--- /dev/null
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-bin-fix-SIGSEGV-caused-by-using-flb_free-instead-of-.patch
@@ -0,0 +1,43 @@
1From 3d7390c89c2205d1eed0384be0bb65adb675e60d Mon Sep 17 00:00:00 2001
2From: Ramon Fried <ramon@neureality.ai>
3Date: Tue, 9 Feb 2021 18:59:59 +0200
4Subject: [PATCH] bin: fix SIGSEGV caused by using flb_free instead of
5 mk_mem_free
6
7Upstream-Status: Accepted
8Signed-off-by: Ramon Fried <ramon@neureality.ai>
9---
10 src/fluent-bit.c | 6 +++---
11 1 file changed, 3 insertions(+), 3 deletions(-)
12
13diff --git a/src/fluent-bit.c b/src/fluent-bit.c
14index c0c73b4..989cfde 100644
15--- a/src/fluent-bit.c
16+++ b/src/fluent-bit.c
17@@ -289,7 +289,7 @@ static int input_set_property(struct flb_input_instance *in, char *kv)
18 in->p->name, key);
19 }
20
21- flb_free(key);
22+ mk_mem_free(key);
23 return ret;
24 }
25
26@@ -314,7 +314,7 @@ static int output_set_property(struct flb_output_instance *out, char *kv)
27 }
28
29 ret = flb_output_set_property(out, key, value);
30- flb_free(key);
31+ mk_mem_free(key);
32 return ret;
33 }
34
35@@ -340,7 +340,7 @@ static int filter_set_property(struct flb_filter_instance *filter, char *kv)
36 }
37
38 ret = flb_filter_set_property(filter, key, value);
39- flb_free(key);
40+ mk_mem_free(key);
41 return ret;
42 }
43
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0002-parser-Fix-SIGSEGV-caused-by-using-flb_free-instead-.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0002-parser-Fix-SIGSEGV-caused-by-using-flb_free-instead-.patch
new file mode 100644
index 000000000..91675dfc6
--- /dev/null
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0002-parser-Fix-SIGSEGV-caused-by-using-flb_free-instead-.patch
@@ -0,0 +1,82 @@
1From 7c3b1dfb174312594d3317c24ed71c60398f653f Mon Sep 17 00:00:00 2001
2From: Ramon Fried <ramon@neureality.ai>
3Date: Wed, 10 Feb 2021 04:23:36 +0200
4Subject: [PATCH] parser: Fix SIGSEGV caused by using flb_free instead of
5 mk_mem_free
6
7Upstream-Status: Backport (fix only for 1.3.5)
8Signed-off-by: Ramon Fried <ramon@neureality.ai>
9---
10 src/flb_parser.c | 28 ++++++++++++++--------------
11 1 file changed, 14 insertions(+), 14 deletions(-)
12
13diff --git a/src/flb_parser.c b/src/flb_parser.c
14index d35c568..7c20e12 100644
15--- a/src/flb_parser.c
16+++ b/src/flb_parser.c
17@@ -490,7 +490,7 @@ int flb_parser_conf_file(const char *file, struct flb_config *config)
18 MK_RCONF_STR);
19 if (str) {
20 time_keep = flb_utils_bool(str);
21- flb_free(str);
22+ mk_mem_free(str);
23 }
24 else {
25 time_keep = FLB_FALSE;
26@@ -522,23 +522,23 @@ int flb_parser_conf_file(const char *file, struct flb_config *config)
27
28 flb_debug("[parser] new parser registered: %s", name);
29
30- flb_free(name);
31- flb_free(format);
32+ mk_mem_free(name);
33+ mk_mem_free(format);
34
35 if (regex) {
36- flb_free(regex);
37+ mk_mem_free(regex);
38 }
39 if (time_fmt) {
40- flb_free(time_fmt);
41+ mk_mem_free(time_fmt);
42 }
43 if (time_key) {
44- flb_free(time_key);
45+ mk_mem_free(time_key);
46 }
47 if (time_offset) {
48- flb_free(time_offset);
49+ mk_mem_free(time_offset);
50 }
51 if (types_str) {
52- flb_free(types_str);
53+ mk_mem_free(types_str);
54 }
55
56 decoders = NULL;
57@@ -548,19 +548,19 @@ int flb_parser_conf_file(const char *file, struct flb_config *config)
58 return 0;
59
60 fconf_error:
61- flb_free(name);
62- flb_free(format);
63+ mk_mem_free(name);
64+ mk_mem_free(format);
65 if (regex) {
66- flb_free(regex);
67+ mk_mem_free(regex);
68 }
69 if (time_fmt) {
70- flb_free(time_fmt);
71+ mk_mem_free(time_fmt);
72 }
73 if (time_key) {
74- flb_free(time_key);
75+ mk_mem_free(time_key);
76 }
77 if (types_str) {
78- flb_free(types_str);
79+ mk_mem_free(types_str);
80 }
81 if (decoders) {
82 flb_parser_decoder_list_destroy(decoders);
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb b/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb
index 0b7d11e16..eac267041 100644
--- a/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb
@@ -16,7 +16,9 @@ SRC_URI = "http://fluentbit.io/releases/1.3/fluent-bit-${PV}.tar.gz \
16 file://cross-build-init-system-detection.patch \ 16 file://cross-build-init-system-detection.patch \
17 file://builtin-nan.patch \ 17 file://builtin-nan.patch \
18 file://0001-ppc-Fix-signature-for-co_create-API.patch \ 18 file://0001-ppc-Fix-signature-for-co_create-API.patch \
19 " 19 file://0001-bin-fix-SIGSEGV-caused-by-using-flb_free-instead-of-.patch \
20 file://0002-parser-Fix-SIGSEGV-caused-by-using-flb_free-instead-.patch \
21 "
20SRC_URI[md5sum] = "6eae6dfd0a874e5dd270c36e9c68f747" 22SRC_URI[md5sum] = "6eae6dfd0a874e5dd270c36e9c68f747"
21SRC_URI[sha256sum] = "e037c76c89269c8dc4027a08e442fefd2751b0f1e0f9c38f9a4b12d781a9c789" 23SRC_URI[sha256sum] = "e037c76c89269c8dc4027a08e442fefd2751b0f1e0f9c38f9a4b12d781a9c789"
22 24