Skip to content

Commit 1e04206

Browse files
[AUTO-CHERRYPICK] kubevirt: Add patch for CVE-2024-24786 - branch main (#9148)
Co-authored-by: Rohit Rawat <rohitrawat@microsoft.com> Co-authored-by: Rohit Rawat <xordux@gmail.com>
1 parent 02ffe5c commit 1e04206

2 files changed

Lines changed: 59 additions & 3 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
From 6d8650a5d365c3f80dcf3cd32681dc9c33a04f2d Mon Sep 17 00:00:00 2001
2+
From: Rohit Rawat <xordux@gmail.com>
3+
Date: Thu, 16 May 2024 18:12:11 +0000
4+
Subject: [PATCH] protobuf-go: Fix CVE-2024-24786
5+
6+
---
7+
.../protobuf/encoding/protojson/well_known_types.go | 8 ++++++++
8+
.../protobuf/internal/encoding/json/decode.go | 2 +-
9+
2 files changed, 9 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 72924a9..95562c0 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+
@@ -328,6 +328,10 @@ func (d decoder) skipJSONValue() error {
16+
if err := d.skipJSONValue(); err != nil {
17+
return err
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+
}
25+
26+
@@ -341,6 +345,10 @@ func (d decoder) skipJSONValue() error {
27+
case json.ArrayClose:
28+
d.Read()
29+
return nil
30+
+ case json.EOF:
31+
+ // This can only happen if there's a bug in Decoder.Read.
32+
+ // Avoid an infinite loop if this does happen.
33+
+ return errors.New("unexpected EOF")
34+
default:
35+
// Skip array item.
36+
if err := d.skipJSONValue(); err != nil {
37+
diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go b/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
38+
index b13fd29..b2be4e8 100644
39+
--- a/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
40+
+++ b/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
41+
@@ -121,7 +121,7 @@ func (d *Decoder) Read() (Token, error) {
42+
43+
case ObjectClose:
44+
if len(d.openStack) == 0 ||
45+
- d.lastToken.kind == comma ||
46+
+ d.lastToken.kind&(Name|comma) != 0 ||
47+
d.openStack[len(d.openStack)-1] != ObjectOpen {
48+
return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString())
49+
}
50+
--
51+
2.33.8
52+

SPECS/kubevirt/kubevirt.spec

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Summary: Container native virtualization
2020
Name: kubevirt
2121
Version: 0.59.0
22-
Release: 17%{?dist}
22+
Release: 18%{?dist}
2323
License: ASL 2.0
2424
Vendor: Microsoft Corporation
2525
Distribution: Mariner
@@ -36,7 +36,8 @@ Patch3: CVE-2023-44487.patch
3636
Patch4: CVE-2024-21626.patch
3737
Patch5: Hp-volume-pod-should-respect-blockdevices.patch
3838
Patch6: CVE-2022-41723.patch
39-
Patch7: CVE-2023-45288.patch
39+
Patch7: CVE-2024-24786.patch
40+
Patch8: CVE-2023-45288.patch
4041
%global debug_package %{nil}
4142
BuildRequires: glibc-devel
4243
BuildRequires: glibc-static >= 2.35-7%{?dist}
@@ -216,9 +217,12 @@ install -p -m 0644 cmd/virt-handler/nsswitch.conf %{buildroot}%{_datadir}/kube-v
216217
%{_bindir}/virt-tests
217218

218219
%changelog
219-
* Thu Apr 18 2024 chrisgun@microsoft.com <chrisgun@microsoft.com> - 0.59.0-17
220+
* Thu Apr 18 2024 chrisgun@microsoft.com <chrisgun@microsoft.com> - 0.59.0-18
220221
- Fix for CVE-2023-45288
221222

223+
* Fri May 17 2024 Rohit Rawat <rohitrawat@microsoft.com> - 0.59.0-17
224+
- Add patch for CVE-2024-24786
225+
222226
* Mon May 06 2024 Rachel Menge <rachelmenge@microsoft.com> - 0.59.0-16
223227
- Bump release to rebuild against glibc 2.35-7
224228

0 commit comments

Comments
 (0)