Skip to content

Commit d6a4e61

Browse files
authored
[Low] Patch fluent-bit for CVE-2025-58749 (microsoft#14730)
1 parent 8cd9163 commit d6a4e61

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
From 95f506a6e77d3ac7588eac7263f95558edfa7f3b Mon Sep 17 00:00:00 2001
2+
From: Liu Jia <[email protected]>
3+
Date: Mon, 15 Sep 2025 15:19:51 +0800
4+
Subject: [PATCH] Merge commit from fork
5+
6+
* fix overflow in check_bulk_memory_overflow
7+
8+
Upstream Patch reference: https://github.com/bytecodealliance/wasm-micro-runtime/commit/95f506a6e77d3ac7588eac7263f95558edfa7f3b.patch
9+
---
10+
.../core/iwasm/compilation/aot_emit_memory.c | 14 ++++++++++++--
11+
1 file changed, 12 insertions(+), 2 deletions(-)
12+
13+
diff --git a/lib/wasm-micro-runtime-WAMR-1.3.0/core/iwasm/compilation/aot_emit_memory.c b/lib/wasm-micro-runtime-WAMR-1.3.0/core/iwasm/compilation/aot_emit_memory.c
14+
index 8c35c3f..6a01c25 100644
15+
--- a/lib/wasm-micro-runtime-WAMR-1.3.0/core/iwasm/compilation/aot_emit_memory.c
16+
+++ b/lib/wasm-micro-runtime-WAMR-1.3.0/core/iwasm/compilation/aot_emit_memory.c
17+
@@ -880,7 +880,7 @@ static LLVMValueRef
18+
check_bulk_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
19+
LLVMValueRef offset, LLVMValueRef bytes)
20+
{
21+
- LLVMValueRef maddr, max_addr, cmp;
22+
+ LLVMValueRef maddr, max_addr, cmp, cmp1, offset1;
23+
LLVMValueRef mem_base_addr;
24+
LLVMBasicBlockRef block_curr = LLVMGetInsertBlock(comp_ctx->builder);
25+
LLVMBasicBlockRef check_succ;
26+
@@ -922,8 +922,18 @@ check_bulk_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
27+
if (mem_data_size > 0 && mem_offset + mem_len <= mem_data_size) {
28+
/* inside memory space */
29+
/* maddr = mem_base_addr + moffset */
30+
+ /* Perform zero extension in advance to avoid LLVMBuildInBoundsGEP2
31+
+ * interpreting a negative address due to sign extension when
32+
+ * mem_offset >= 2GiB */
33+
+ if (comp_ctx->pointer_size == sizeof(uint64)) {
34+
+ offset1 = I64_CONST(mem_offset);
35+
+ }
36+
+ else {
37+
+ offset1 = I32_CONST((uint32)mem_offset);
38+
+ }
39+
+ CHECK_LLVM_CONST(offset1);
40+
if (!(maddr = LLVMBuildInBoundsGEP2(comp_ctx->builder, INT8_TYPE,
41+
- mem_base_addr, &offset, 1,
42+
+ mem_base_addr, &offset1, 1,
43+
"maddr"))) {
44+
aot_set_last_error("llvm build add failed.");
45+
goto fail;
46+
--
47+
2.45.4
48+

SPECS/fluent-bit/fluent-bit.spec

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Fast and Lightweight Log processor and forwarder for Linux, BSD and OSX
22
Name: fluent-bit
33
Version: 3.0.6
4-
Release: 3%{?dist}
4+
Release: 4%{?dist}
55
License: Apache-2.0
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -15,6 +15,7 @@ Patch4: CVE-2024-27532.patch
1515
Patch5: CVE-2024-50608.patch
1616
Patch6: CVE-2024-50609.patch
1717
Patch7: CVE-2025-54126.patch
18+
Patch8: CVE-2025-58749.patch
1819
BuildRequires: bison
1920
BuildRequires: cmake
2021
BuildRequires: cyrus-sasl-devel
@@ -57,7 +58,7 @@ Development files for %{name}
5758
-DFLB_OUT_TD=Off \
5859
-DFLB_OUT_ES=Off \
5960
-DFLB_SHARED_LIB=On \
60-
%if %{with_check}
61+
%if 0%{?with_check}
6162
-DFLB_TESTS_RUNTIME=On \
6263
-DFLB_TESTS_INTERNAL=On \
6364
%endif
@@ -89,6 +90,9 @@ Development files for %{name}
8990
%{_libdir}/fluent-bit/*.so
9091

9192
%changelog
93+
* Thu Sep 25 2025 Aditya Singh <[email protected]> - 3.0.6-4
94+
- Patch for CVE-2025-58749
95+
9296
* Wed Aug 06 2025 Azure Linux Security Servicing Account <[email protected]> - 3.0.6-3
9397
- Patch for CVE-2025-54126
9498

0 commit comments

Comments
 (0)