Skip to content

Commit f9abe25

Browse files
[AUTO-CHERRYPICK] cri-o: patch CVE-2021-43565 - branch main (#9901)
Co-authored-by: Archana Choudhary <36061892+arc9693@users.noreply.github.com>
1 parent f5e5df1 commit f9abe25

2 files changed

Lines changed: 61 additions & 1 deletion

File tree

SPECS/cri-o/CVE-2021-43565.patch

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
From 5770296d904e90f15f38f77dfc2e43fdf5efc083 Mon Sep 17 00:00:00 2001
2+
From: Roland Shoemaker <roland@golang.org>
3+
Date: Tue, 9 Nov 2021 11:45:57 -0800
4+
Subject: [PATCH] ssh: don't assume packet plaintext size
5+
6+
When reading GCM and ChaChaPoly1305 packets, don't make assumptions
7+
about the size of the enciphered plaintext. This fixes two panics
8+
caused by standards non-compliant malformed packets.
9+
10+
Thanks to Rod Hynes, Psiphon Inc. for reporting this issue.
11+
12+
Fixes golang/go#49932
13+
Fixes CVE-2021-43565
14+
15+
Change-Id: I660cff39d197e0d04ec44d11d792b22d954df2ef
16+
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1262659
17+
Reviewed-by: Katie Hockman <katiehockman@google.com>
18+
Reviewed-by: Julie Qiu <julieqiu@google.com>
19+
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/368814
20+
Trust: Roland Shoemaker <roland@golang.org>
21+
Trust: Katie Hockman <katie@golang.org>
22+
Run-TryBot: Roland Shoemaker <roland@golang.org>
23+
TryBot-Result: Gopher Robot <gobot@golang.org>
24+
Reviewed-by: Julie Qiu <julie@golang.org>
25+
Reviewed-by: Katie Hockman <katie@golang.org>
26+
---
27+
ssh/cipher.go | 8 ++++
28+
ssh/cipher_test.go | 100 +++++++++++++++++++++++++++++++++++++++++++++
29+
2 files changed, 108 insertions(+)
30+
31+
diff --git a/vendor/golang.org/x/crypto/ssh/cipher.go b/vendor/golang.org/x/crypto/ssh/cipher.go
32+
index bddbde5dbd..f8bdf4984c 100644
33+
--- a/vendor/golang.org/x/crypto/ssh/cipher.go
34+
+++ b/vendor/golang.org/x/crypto/ssh/cipher.go
35+
@@ -394,6 +394,10 @@ func (c *gcmCipher) readCipherPacket(seqNum uint32, r io.Reader) ([]byte, error)
36+
}
37+
c.incIV()
38+
39+
+ if len(plain) == 0 {
40+
+ return nil, errors.New("ssh: empty packet")
41+
+ }
42+
+
43+
padding := plain[0]
44+
if padding < 4 {
45+
// padding is a byte, so it automatically satisfies
46+
@@ -710,6 +714,10 @@ func (c *chacha20Poly1305Cipher) readCipherPacket(seqNum uint32, r io.Reader) ([
47+
plain := c.buf[4:contentEnd]
48+
s.XORKeyStream(plain, plain)
49+
50+
+ if len(plain) == 0 {
51+
+ return nil, errors.New("ssh: empty packet")
52+
+ }
53+
+
54+
padding := plain[0]
55+
if padding < 4 {
56+
// padding is a byte, so it automatically satisfies

SPECS/cri-o/cri-o.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Summary: OCI-based implementation of Kubernetes Container Runtime Interfa
2626
# Define macros for further referenced sources
2727
Name: cri-o
2828
Version: 1.22.3
29-
Release: 4%{?dist}
29+
Release: 5%{?dist}
3030
License: ASL 2.0
3131
Vendor: Microsoft Corporation
3232
Distribution: Mariner
@@ -65,6 +65,7 @@ Patch9: CVE-2024-28180.patch
6565
Patch10: CVE-2024-21626.patch
6666
Patch11: CVE-2024-3154.patch
6767
Patch12: CVE-2024-3727.patch
68+
Patch13: CVE-2021-43565.patch
6869
BuildRequires: btrfs-progs-devel
6970
BuildRequires: device-mapper-devel
7071
BuildRequires: fdupes
@@ -217,6 +218,9 @@ mkdir -p /opt/cni/bin
217218
%{_fillupdir}/sysconfig.kubelet
218219

219220
%changelog
221+
* Mon Jul 22 2024 Archana Choudhary <archana1@microsoft.com> - 1.22.3-5
222+
- Patch CVE-2021-43565
223+
220224
* Wed Jun 26 2024 Muhammad Falak <mwani@microsoft.com> - 1.22.3-4
221225
- Bump release to rebuild with go 1.21.11
222226

0 commit comments

Comments
 (0)