Skip to content

Commit b9cf434

Browse files
azurelinux-securityKanishk BansalKanishk-Bansaljslobodzian
authored
[AutoPR- Security] Patch fluent-bit for CVE-2025-12970 [HIGH] (microsoft#15194)
Signed-off-by: Kanishk Bansal <[email protected]> Co-authored-by: Kanishk Bansal <[email protected]> Co-authored-by: Kanishk Bansal <[email protected]> Co-authored-by: jslobodzian <[email protected]>
1 parent d331eff commit b9cf434

File tree

4 files changed

+203
-5
lines changed

4 files changed

+203
-5
lines changed
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
From 8a25d3b24fa4edde3e9cfdb878ce6c2c6e3d7e5b Mon Sep 17 00:00:00 2001
2+
From: Eduardo Silva <[email protected]>
3+
Date: Thu, 2 Oct 2025 16:36:54 -0600
4+
Subject: [PATCH] in_docker: add helper for container name parsing
5+
6+
Signed-off-by: Eduardo Silva <[email protected]>
7+
Signed-off-by: Azure Linux Security Servicing Account <[email protected]>
8+
Upstream-reference: https://github.com/fluent/fluent-bit/pull/10972.patch
9+
---
10+
plugins/in_docker/cgroup_v1.c | 32 +----------------------
11+
plugins/in_docker/cgroup_v2.c | 32 +----------------------
12+
plugins/in_docker/docker.c | 48 +++++++++++++++++++++++++++++++++++
13+
plugins/in_docker/docker.h | 2 ++
14+
4 files changed, 52 insertions(+), 62 deletions(-)
15+
16+
diff --git a/plugins/in_docker/cgroup_v1.c b/plugins/in_docker/cgroup_v1.c
17+
index ab40147..86a64b1 100644
18+
--- a/plugins/in_docker/cgroup_v1.c
19+
+++ b/plugins/in_docker/cgroup_v1.c
20+
@@ -213,36 +213,6 @@ static char *get_config_file(struct flb_docker *ctx, char *id)
21+
return path;
22+
}
23+
24+
-static char *extract_name(char *line, char *start)
25+
-{
26+
- int skip = 9;
27+
- int len = 0;
28+
- char *name;
29+
- char buff[256];
30+
- char *curr;
31+
-
32+
- if (start != NULL) {
33+
- curr = start + skip;
34+
- while (*curr != '"') {
35+
- buff[len++] = *curr;
36+
- curr++;
37+
- }
38+
-
39+
- if (len > 0) {
40+
- name = (char *) flb_calloc(len + 1, sizeof(char));
41+
- if (!name) {
42+
- flb_errno();
43+
- return NULL;
44+
- }
45+
- memcpy(name, buff, len);
46+
-
47+
- return name;
48+
- }
49+
- }
50+
-
51+
- return NULL;
52+
-}
53+
-
54+
static char *get_container_name(struct flb_docker *ctx, char *id)
55+
{
56+
char *container_name = NULL;
57+
@@ -266,7 +236,7 @@ static char *get_container_name(struct flb_docker *ctx, char *id)
58+
while ((line = read_line(f))) {
59+
char *index = strstr(line, DOCKER_NAME_ARG);
60+
if (index != NULL) {
61+
- container_name = extract_name(line, index);
62+
+ container_name = docker_extract_name(line, index);
63+
flb_free(line);
64+
break;
65+
}
66+
diff --git a/plugins/in_docker/cgroup_v2.c b/plugins/in_docker/cgroup_v2.c
67+
index 295483c..301fceb 100644
68+
--- a/plugins/in_docker/cgroup_v2.c
69+
+++ b/plugins/in_docker/cgroup_v2.c
70+
@@ -230,36 +230,6 @@ static char *get_config_file(struct flb_docker *ctx, char *id)
71+
return path;
72+
}
73+
74+
-static char *extract_name(char *line, char *start)
75+
-{
76+
- int skip = 9;
77+
- int len = 0;
78+
- char *name;
79+
- char buff[256];
80+
- char *curr;
81+
-
82+
- if (start != NULL) {
83+
- curr = start + skip;
84+
- while (*curr != '"') {
85+
- buff[len++] = *curr;
86+
- curr++;
87+
- }
88+
-
89+
- if (len > 0) {
90+
- name = (char *) flb_calloc(len + 1, sizeof(char));
91+
- if (!name) {
92+
- flb_errno();
93+
- return NULL;
94+
- }
95+
- memcpy(name, buff, len);
96+
-
97+
- return name;
98+
- }
99+
- }
100+
-
101+
- return NULL;
102+
-}
103+
-
104+
static char *get_container_name(struct flb_docker *ctx, char *id)
105+
{
106+
char *container_name = NULL;
107+
@@ -283,7 +253,7 @@ static char *get_container_name(struct flb_docker *ctx, char *id)
108+
while ((line = read_line(f))) {
109+
char *index = strstr(line, DOCKER_NAME_ARG);
110+
if (index != NULL) {
111+
- container_name = extract_name(line, index);
112+
+ container_name = docker_extract_name(line, index);
113+
flb_free(line);
114+
break;
115+
}
116+
diff --git a/plugins/in_docker/docker.c b/plugins/in_docker/docker.c
117+
index 2a1389e..5701c68 100644
118+
--- a/plugins/in_docker/docker.c
119+
+++ b/plugins/in_docker/docker.c
120+
@@ -29,9 +29,57 @@
121+
#include <string.h>
122+
#include <stdlib.h>
123+
#include <stdint.h>
124+
+#include <ctype.h>
125+
126+
#include "docker.h"
127+
128+
+char *docker_extract_name(const char *line, const char *start)
129+
+{
130+
+ const char *curr;
131+
+ const char *end;
132+
+ size_t len;
133+
+ char *name;
134+
+
135+
+ if (line == NULL || start == NULL) {
136+
+ return NULL;
137+
+ }
138+
+
139+
+ curr = start + strlen(DOCKER_NAME_ARG);
140+
+ if (*curr != ':') {
141+
+ curr = strchr(curr, ':');
142+
+ if (curr == NULL) {
143+
+ return NULL;
144+
+ }
145+
+ }
146+
+
147+
+ curr++;
148+
+ while (*curr != '\0' && isspace((unsigned char) *curr)) {
149+
+ curr++;
150+
+ }
151+
+
152+
+ if (*curr != '"') {
153+
+ return NULL;
154+
+ }
155+
+
156+
+ curr++;
157+
+ end = strchr(curr, '"');
158+
+ if (end == NULL || end <= curr) {
159+
+ return NULL;
160+
+ }
161+
+
162+
+ len = end - curr;
163+
+ name = flb_malloc(len + 1);
164+
+ if (name == NULL) {
165+
+ flb_errno();
166+
+ return NULL;
167+
+ }
168+
+
169+
+ memcpy(name, curr, len);
170+
+ name[len] = '\0';
171+
+
172+
+ return name;
173+
+}
174+
+
175+
static int cb_docker_collect(struct flb_input_instance *i_ins,
176+
struct flb_config *config, void *in_context);
177+
178+
diff --git a/plugins/in_docker/docker.h b/plugins/in_docker/docker.h
179+
index e6f61c1..9a1c9ae 100644
180+
--- a/plugins/in_docker/docker.h
181+
+++ b/plugins/in_docker/docker.h
182+
@@ -119,4 +119,6 @@ struct flb_docker {
183+
int in_docker_collect(struct flb_input_instance *i_ins,
184+
struct flb_config *config, void *in_context);
185+
docker_info *in_docker_init_docker_info(char *id);
186+
+char *docker_extract_name(const char *line, const char *start);
187+
+
188+
#endif
189+
--
190+
2.45.4
191+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"Signatures": {
3-
"fluent-bit-3.1.9.tar.gz": "ac3a3e235e7f8a92d35f10c99f400f0b0571417a92e3c4caa467073733d42547"
3+
"fluent-bit-3.1.10.tar.gz": "9ec909e8ce04bc8f3b09862c781956c40da18f60e8ae92b154114b4e20edc5fa"
44
}
55
}

SPECS/fluent-bit/fluent-bit.spec

Lines changed: 9 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
3-
Version: 3.1.9
4-
Release: 6%{?dist}
3+
Version: 3.1.10
4+
Release: 2%{?dist}
55
License: Apache-2.0
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
@@ -15,6 +15,7 @@ Patch4: CVE-2024-50609.patch
1515
Patch5: CVE-2025-31498.patch
1616
Patch6: CVE-2025-54126.patch
1717
Patch7: CVE-2025-58749.patch
18+
Patch8: CVE-2025-12970.patch
1819
BuildRequires: bison
1920
BuildRequires: cmake
2021
BuildRequires: cyrus-sasl-devel
@@ -89,6 +90,12 @@ Development files for %{name}
8990
%{_libdir}/fluent-bit/*.so
9091

9192
%changelog
93+
* Mon Dec 01 2025 Azure Linux Security Servicing Account <[email protected]> - 3.1.10-2
94+
- Patch for CVE-2025-12970
95+
96+
* Mon Dec 01 2025 Kanishk Bansal <[email protected]> - 3.1.10-1
97+
- Upgrade to 3.1.10
98+
9299
* Thu Sep 25 2025 Aditya Singh <[email protected]> - 3.1.9-6
93100
- Patch for CVE-2025-58749
94101

cgmanifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3718,8 +3718,8 @@
37183718
"type": "other",
37193719
"other": {
37203720
"name": "fluent-bit",
3721-
"version": "3.1.9",
3722-
"downloadUrl": "https://github.com/fluent/fluent-bit/archive/refs/tags/v3.1.9.tar.gz"
3721+
"version": "3.1.10",
3722+
"downloadUrl": "https://github.com/fluent/fluent-bit/archive/refs/tags/v3.1.10.tar.gz"
37233723
}
37243724
}
37253725
},

0 commit comments

Comments
 (0)