Skip to content

Commit 0583621

Browse files
v-smalavathurikenm1jslobodzian
committed
[Medium] grpc: Fix CVE-2024-25629 (#12324)
Signed-off-by: Sreenivasulu Malavathula <v-smalavathu@microsoft.com> Co-authored-by: Riken Maharjan <106988478+rikenm1@users.noreply.github.com> Co-authored-by: jslobodzian <joslobo@microsoft.com>
1 parent 6e0d053 commit 0583621

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

SPECS/grpc/CVE-2024-25629.patch

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From 664fc964bf2dac86c3adbedb5d9d9e0e46d1c79d Mon Sep 17 00:00:00 2001
2+
From: Sreenivasulu Malavathula <v-smalavathu@microsoft.com>
3+
Date: Sun, 9 Feb 2025 12:50:08 -0600
4+
Subject: [PATCH] Address CVE-2024-25629
5+
6+
---
7+
third_party/cares/cares/ares__read_line.c | 8 ++++++++
8+
1 file changed, 8 insertions(+)
9+
10+
diff --git a/third_party/cares/cares/ares__read_line.c b/third_party/cares/cares/ares__read_line.c
11+
index c62ad2a2..d6625a38 100644
12+
--- a/third_party/cares/cares/ares__read_line.c
13+
+++ b/third_party/cares/cares/ares__read_line.c
14+
@@ -49,6 +49,14 @@ int ares__read_line(FILE *fp, char **buf, size_t *bufsize)
15+
if (!fgets(*buf + offset, bytestoread, fp))
16+
return (offset != 0) ? 0 : (ferror(fp)) ? ARES_EFILE : ARES_EOF;
17+
len = offset + strlen(*buf + offset);
18+
+
19+
+ /* Probably means there was an embedded NULL as the first character in
20+
+ * the line, throw away line */
21+
+ if (len == 0) {
22+
+ offset = 0;
23+
+ continue;
24+
+ }
25+
+
26+
if ((*buf)[len - 1] == '\n')
27+
{
28+
(*buf)[len - 1] = 0;
29+
--
30+
2.45.2
31+

SPECS/grpc/grpc.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Open source remote procedure call (RPC) framework
22
Name: grpc
33
Version: 1.42.0
4-
Release: 8%{?dist}
4+
Release: 9%{?dist}
55
License: ASL 2.0
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -11,6 +11,7 @@ Source0: https://github.com/grpc/grpc/archive/v%{version}/%{name}-%{versi
1111
Source1: %{name}-%{version}-submodules.tar.gz
1212

1313
Patch0: CVE-2023-32067.patch
14+
Patch1: CVE-2024-25629.patch
1415
BuildRequires: abseil-cpp-devel
1516
BuildRequires: c-ares-devel
1617
BuildRequires: cmake
@@ -151,6 +152,9 @@ export GRPC_PYTHON_BUILD_SYSTEM_ABSL=True
151152

152153

153154
%changelog
155+
* Wed Feb 12 2025 Sreeniavsulu Malavathula <v-smalavathu@microsoft.com> - 1.42.0-9
156+
- Patch to fix CVE-2024-25629.patch in the grpc submodules package
157+
154158
* Mon Dec 10 2024 Ankita Pareek <ankitapareek@microsoft.com> - 1.42.0-8
155159
- Address CVE-2023-32067 in the grpc submodules package
156160

0 commit comments

Comments
 (0)