Skip to content

Commit 1330d21

Browse files
CBL-Mariner-BotAnkita13-codejslobodzian
authored
[AUTO-CHERRYPICK] fluent-bit: Address CVE-2024-25431 - branch 3.0-dev (#11194)
Co-authored-by: Ankita Pareek <56152556+Ankita13-code@users.noreply.github.com> Co-authored-by: jslobodzian <joslobo@microsoft.com>
1 parent b05b26a commit 1330d21

2 files changed

Lines changed: 54 additions & 1 deletion

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
diff --git a/lib/wasm-micro-runtime-WAMR-1.3.0/core/iwasm/interpreter/wasm_loader.c b/lib/wasm-micro-runtime-WAMR-1.3.0/core/iwasm/interpreter/wasm_loader.c
2+
index 2a06f42..506ee29 100644
3+
--- a/lib/wasm-micro-runtime-WAMR-1.3.0/core/iwasm/interpreter/wasm_loader.c
4+
+++ b/lib/wasm-micro-runtime-WAMR-1.3.0/core/iwasm/interpreter/wasm_loader.c
5+
@@ -3980,14 +3980,22 @@ check_wasi_abi_compatibility(const WASMModule *module,
6+
/* clang-format on */
7+
8+
WASMExport *initialize = NULL, *memory = NULL, *start = NULL;
9+
+ uint32 import_function_count = module->import_function_count;
10+
+ WASMType *func_type;
11+
12+
/* (func (export "_start") (...) */
13+
start = wasm_loader_find_export(module, "", "_start", EXPORT_KIND_FUNC,
14+
error_buf, error_buf_size);
15+
if (start) {
16+
- WASMType *func_type =
17+
- module->functions[start->index - module->import_function_count]
18+
- ->func_type;
19+
+ if (start->index < import_function_count) {
20+
+ set_error_buf(
21+
+ error_buf, error_buf_size,
22+
+ "the builtin _start function can not be an import function");
23+
+ return false;
24+
+ }
25+
+
26+
+ func_type =
27+
+ module->functions[start->index - import_function_count]->func_type;
28+
if (func_type->param_count || func_type->result_count) {
29+
set_error_buf(error_buf, error_buf_size,
30+
"the signature of builtin _start function is wrong");
31+
@@ -3999,8 +4007,15 @@ check_wasi_abi_compatibility(const WASMModule *module,
32+
initialize = wasm_loader_find_export(
33+
module, "", "_initialize", EXPORT_KIND_FUNC, error_buf, error_buf_size);
34+
if (initialize) {
35+
- WASMType *func_type =
36+
- module->functions[initialize->index - module->import_function_count]
37+
+ if (initialize->index < import_function_count) {
38+
+ set_error_buf(error_buf, error_buf_size,
39+
+ "the builtin _initialize function can not be an "
40+
+ "import function");
41+
+ return false;
42+
+ }
43+
+
44+
+ func_type =
45+
+ module->functions[initialize->index - import_function_count]
46+
->func_type;
47+
if (func_type->param_count || func_type->result_count) {
48+
set_error_buf(

SPECS/fluent-bit/fluent-bit.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Distribution: Azure Linux
88
URL: https://fluentbit.io
99
Source0: https://github.com/fluent/%{name}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
1010
Patch0: CVE-2024-34250.patch
11+
Patch1: CVE-2024-25431.patch
1112
BuildRequires: bison
1213
BuildRequires: cmake
1314
BuildRequires: cyrus-sasl-devel
@@ -82,9 +83,13 @@ Development files for %{name}
8283
%{_libdir}/fluent-bit/*.so
8384

8485
%changelog
85-
* Tue Nov 05 2024 Paul Meyer <paul.meyer@microsoft.com> - 3.1.9-1
86+
* Tue Nov 23 2024 Paul Meyer <paul.meyer@microsoft.com> - 3.1.9-1
8687
- Update to 3.1.9 to enable Lua filter plugin using system luajit library.
8788
- Remove patches for CVE-2024-25629 and CVE-2024-28182 as they are fixed in 3.1.9.
89+
- [Jon Slobodzian] Reconciled with Fasttrack/3.0 on 11/23, updated Changelog date from 11/5.
90+
91+
* Fri Nov 15 2024 Ankita Pareek <ankitapareek@microsoft.com> - 3.0.6-3
92+
- Address CVE-2024-25431
8893

8994
* Tue Oct 15 2024 Chris Gunn <chrisgun@microsoft.com> - 3.0.6-2
9095
- CVE-2024-34250

0 commit comments

Comments
 (0)