Skip to content

Commit 105469e

Browse files
[AUTO-CHERRYPICK] Fix CVE-2022-32149 in libcontainers-common - branch main (#10396)
Co-authored-by: sindhu-karri <33163197+sindhu-karri@users.noreply.github.com>
1 parent 79af982 commit 105469e

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From 7ee36713a66401f828dfe476196ca290f7c23ffe Mon Sep 17 00:00:00 2001
2+
From: Sindhu Karri <lakarri@microsoft.com>
3+
Date: Wed, 28 Aug 2024 05:01:17 +0000
4+
Subject: [PATCH] Fix CVE-2022-32149
5+
6+
---
7+
vendor/golang.org/x/text/language/parse.go | 5 +++++
8+
1 file changed, 5 insertions(+)
9+
10+
diff --git a/vendor/golang.org/x/text/language/parse.go b/vendor/golang.org/x/text/language/parse.go
11+
index 11acfd8..11d11f4 100644
12+
--- a/vendor/golang.org/x/text/language/parse.go
13+
+++ b/vendor/golang.org/x/text/language/parse.go
14+
@@ -133,6 +133,7 @@ func update(b *language.Builder, part ...interface{}) (err error) {
15+
}
16+
17+
var errInvalidWeight = errors.New("ParseAcceptLanguage: invalid weight")
18+
+var errTagListTooLarge = errors.New("tag list exceeds max length")
19+
20+
// ParseAcceptLanguage parses the contents of an Accept-Language header as
21+
// defined in http://www.ietf.org/rfc/rfc2616.txt and returns a list of Tags and
22+
@@ -150,6 +151,10 @@ func ParseAcceptLanguage(s string) (tag []Tag, q []float32, err error) {
23+
24+
entry, weight := split(entry, ';')
25+
26+
+ if strings.Count(s, "-") > 1000 {
27+
+ return nil, nil, errTagListTooLarge
28+
+ }
29+
+
30+
// Scan the language.
31+
t, err := Parse(entry)
32+
if err != nil {
33+
--
34+
2.33.8
35+

SPECS/libcontainers-common/libcontainers-common.spec

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
Summary: Configuration files common to github.com/containers
2727
Name: libcontainers-common
2828
Version: 20210626
29-
Release: 5%{?dist}
29+
Release: 6%{?dist}
3030
License: ASL 2.0 AND GPLv3
3131
Vendor: Microsoft Corporation
3232
Distribution: Mariner
@@ -51,6 +51,7 @@ Patch0: CVE-2021-44716.patch
5151
#Note (mfrw): The patch for CVE-2024-37298 only applies to podman.
5252
Patch1: CVE-2024-37298.patch
5353
Patch2: CVE-2021-43565.patch
54+
Patch3: CVE-2022-32149.patch
5455
BuildRequires: go-go-md2man
5556
Requires(post): grep
5657
Requires(post): util-linux
@@ -68,9 +69,11 @@ github.com/containers libraries, such as Buildah, CRI-O, Podman and Skopeo.
6869

6970
%setup -q -T -D -b 7 -n podman-%{podmanver}
7071
%patch 1 -p1
72+
%patch 3 -p1
7173

7274
%setup -q -T -D -b 9 -n common-%{commonver}
7375
%patch 0 -p1
76+
%patch 3 -p1
7477

7578
# copy the LICENSE file in the build root
7679
%patch 2 -p1 -d ../podman-%{podmanver}
@@ -168,6 +171,9 @@ fi
168171
%license LICENSE
169172
170173
%changelog
174+
* Tue Aug 27 2024 Sindhu Karri <lakarri@microsoft.com> - 20210626-6
175+
- Patch CVE-2022-32149
176+
171177
* Mon Jul 29 2024 Archana Choudhary <archana1@microsoft.com> - 20210626-5
172178
- Patch CVE-2021-43565
173179

0 commit comments

Comments
 (0)