Skip to content

Commit 0f39b3c

Browse files
[AUTO-CHERRYPICK] etcd: Fix CVE-2024-24786 - branch main (#11654)
Co-authored-by: KavyaSree2610 <92566732+KavyaSree2610@users.noreply.github.com>
1 parent cc9942b commit 0f39b3c

2 files changed

Lines changed: 47 additions & 1 deletion

File tree

SPECS/etcd/CVE-2024-24786.patch

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 867d49d8c566b0f1284f8295ba1286d6c5e93edf Mon Sep 17 00:00:00 2001
2+
From: kavyasree <kkaitepalli@microsoft.com>
3+
Date: Mon, 9 Dec 2024 17:03:26 +0530
4+
Subject: [PATCH] Modified patch
5+
6+
---
7+
.../protobuf/encoding/protojson/well_known_types.go | 4 ++++
8+
.../protobuf/internal/encoding/json/decode.go | 2 +-
9+
2 files changed, 5 insertions(+), 1 deletion(-)
10+
11+
diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go
12+
index c85f846..634ba41 100644
13+
--- a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go
14+
+++ b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go
15+
@@ -348,6 +348,10 @@ func (d decoder) skipJSONValue() error {
16+
}
17+
}
18+
}
19+
+ case json.EOF:
20+
+ // This can only happen if there's a bug in Decoder.Read.
21+
+ // Avoid an infinite loop if this does happen.
22+
+ return errors.New("unexpected EOF")
23+
}
24+
return nil
25+
}
26+
diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go b/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
27+
index b13fd29..b2be4e8 100644
28+
--- a/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
29+
+++ b/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
30+
@@ -121,7 +121,7 @@ func (d *Decoder) Read() (Token, error) {
31+
32+
case ObjectClose:
33+
if len(d.openStack) == 0 ||
34+
- d.lastToken.kind == comma ||
35+
+ d.lastToken.kind&(Name|comma) != 0 ||
36+
d.openStack[len(d.openStack)-1] != ObjectOpen {
37+
return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString())
38+
}
39+
--
40+
2.34.1
41+

SPECS/etcd/etcd.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: A highly-available key value store for shared configuration
22
Name: etcd
33
Version: 3.5.12
4-
Release: 5%{?dist}
4+
Release: 6%{?dist}
55
License: ASL 2.0
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -14,6 +14,8 @@ Source1: etcd.service
1414
# generate_source_tarball.sh --srcTarball <source_tarball> --pkgVersion %%{version} --outFolder .
1515
Source2: %{name}-%{version}-vendor.tar.gz
1616
Patch0: CVE-2023-45288.patch
17+
Patch1: CVE-2024-24786.patch
18+
1719
BuildRequires: golang
1820

1921
%description
@@ -117,6 +119,9 @@ install -vdm755 %{buildroot}%{_sharedstatedir}/etcd
117119
/%{_docdir}/%{name}-%{version}-tools/*
118120

119121
%changelog
122+
* Mon Dec 09 2024 Kavya Sree Kaitepalli <kkaitepalli@microsoft.com> - 3.5.12-6
123+
- Patch for CVE-2024-24786
124+
120125
* Mon Sep 09 2024 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 3.5.12-5
121126
- Bump release to rebuild with go 1.22.7
122127

0 commit comments

Comments
 (0)