Skip to content

Commit 55d64f6

Browse files
committed
Merge branch 'main' into 2.0
2 parents 239aa51 + 40a1be4 commit 55d64f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1810
-1263
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,6 @@
9393
/toolkit/scripts/toolchain/container/* @microsoft/cbl-mariner-admins
9494
/toolkit/scripts/toolchain/cgmanifest.json @microsoft/cbl-mariner-admins
9595
/toolkit/scripts/toolchain/create_toolchain_in_container.sh @microsoft/cbl-mariner-admins
96+
97+
# Modifications to the trusted CA certificates require admin approval.
98+
/SPECS/*ca-certificates*/*

.pipelines/containerSourceData/scripts/BuildGoldenContainer.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,14 @@ function initialization {
204204
# the below value of DISTRO_IDENTIFIER in the image tag.
205205
# TODO: We may need to update this value for Azure Linux 3.0.
206206
DISTRO_IDENTIFIER="cm"
207+
END_OF_LIFE_1_YEAR=$(date -d "+1 year" "+%Y-%m-%dT%H:%M:%SZ")
207208

208209
echo "Golden Image Name -> $GOLDEN_IMAGE_NAME"
209210
echo "Base ACR Container Name -> $BASE_IMAGE_NAME"
210211
echo "Base ACR Container Tag -> $BASE_IMAGE_TAG"
211212
echo "Azure Linux Version -> $AZURE_LINUX_VERSION"
212213
echo "Distro Identifier -> $DISTRO_IDENTIFIER"
214+
echo "End of Life -> $END_OF_LIFE_1_YEAR"
213215
}
214216

215217
function prepare_dockerfile {
@@ -322,16 +324,31 @@ function finalize {
322324
echo "$GOLDEN_IMAGE_NAME_FINAL" >> "$OUTPUT_DIR/PublishedContainers-$IMAGE.txt"
323325
}
324326

327+
function oras_attach {
328+
local image_name=$1
329+
oras attach \
330+
--artifact-type "application/vnd.microsoft.artifact.lifecycle" \
331+
--annotation "vnd.microsoft.artifact.lifecycle.end-of-life.date=$END_OF_LIFE_1_YEAR" \
332+
"$image_name"
333+
}
334+
325335
function publish_to_acr {
326336
CONTAINER_IMAGE=$1
327337
if [[ ! "$PUBLISH_TO_ACR" =~ [Tt]rue ]]; then
328338
echo "+++ Skip publishing to ACR"
329339
return
330340
fi
341+
local oras_access_token
342+
343+
echo "+++ az login into Azure ACR $ACR"
344+
oras_access_token=$(az acr login --name "$ACR" --expose-token --output tsv --query accessToken)
345+
oras login "$ACR.azurecr.io" \
346+
--username "00000000-0000-0000-0000-000000000000" \
347+
--password "$oras_access_token"
348+
331349
echo "+++ Publish container $CONTAINER_IMAGE"
332-
echo "login into ACR: $ACR"
333-
az acr login --name "$ACR"
334350
docker image push "$CONTAINER_IMAGE"
351+
oras_attach "$CONTAINER_IMAGE"
335352
}
336353

337354
function generate_image_sbom {

.pipelines/containerSourceData/scripts/PublishContainers.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,11 @@ do
264264

265265
amd64_image=${image_name%-*}-amd64
266266
docker pull "$amd64_image"
267-
oras_attach "$amd64_image"
268267

269268
# Some container images are only built for AMD64 architecture.
270269
if [[ $ARCHITECTURE_TO_BUILD == *"ARM64"* ]]; then
271270
arm64_image=${image_name%-*}-arm64
272271
docker pull "$arm64_image"
273-
oras_attach "$arm64_image"
274272
fi
275273

276274
if [[ $container_registry != "$TARGET_ACR" ]]; then

SPECS/ca-certificates/ca-certificates.signatures.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
"README.usr": "0d2e90b6cf575678cd9d4f409d92258ef0d676995d4d733acdb2425309a38ff8",
1212
"bundle2pem.sh": "a61e0d9f34e21456cfe175e9a682f56959240e66dfeb75bd2457226226aa413a",
1313
"certdata.base.txt": "771a6c9995ea00bb4ce50fd842a252454fe9b26acad8b0568a1055207442db57",
14-
"certdata.microsoft.txt": "71599549e0fd94f5afe074ef553cb102d0b38eb94fd8ce11fe9c29c33492ed24",
14+
"certdata.microsoft.txt": "89655788a99b61c94aa18ad060b7e032d3e63b9db1417b1496e767662126c75a",
1515
"certdata2pem.py": "4f5848c14210758f19ab9fdc9ffd83733303a48642a3d47c4d682f904fdc0f33",
1616
"pem2bundle.sh": "f96a2f0071fb80e30332c0bd95853183f2f49a3c98d5e9fc4716aeeb001e3426",
1717
"trust-fixes": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b",
1818
"update-ca-trust": "0c0c0600587db7f59ba5e399666152ea6de6059f37408f3946c43438d607efdd",
1919
"update-ca-trust.8.txt": "2470551bd11cc393ddf4cf43cf101c29d9f308c15469ee5e78908cfcf2437579"
2020
}
21-
}
21+
}

SPECS/ca-certificates/ca-certificates.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Name: ca-certificates
4545
# When updating, "Epoch, "Version", AND "Release" tags must be updated in the "prebuilt-ca-certificates*" packages as well.
4646
Epoch: 1
4747
Version: 2.0.0
48-
Release: 16%{?dist}
48+
Release: 17%{?dist}
4949
License: MPLv2.0
5050
Vendor: Microsoft Corporation
5151
Distribution: Mariner
@@ -324,6 +324,9 @@ rm -f %{pkidir}/tls/certs/*.{0,pem}
324324
%{_bindir}/bundle2pem.sh
325325

326326
%changelog
327+
* Mon Apr 22 2024 CBL-Mariner Servicing Account <[email protected]> - 2.0.0-17
328+
- Updating Microsoft trusted root CAs.
329+
327330
* Fri Mar 29 2024 CBL-Mariner Servicing Account <[email protected]> - 2.0.0-16
328331
- Updating Microsoft trusted root CAs.
329332

SPECS/ca-certificates/certdata.microsoft.txt

Lines changed: 578 additions & 1 deletion
Large diffs are not rendered by default.

SPECS/git-lfs/CVE-2023-45288.patch

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
From 18bc0c1f8e741738490aa0a8415c372db4b20d62 Mon Sep 17 00:00:00 2001
2+
From: Muhammad Falak R Wani <[email protected]>
3+
Date: Tue, 23 Apr 2024 10:07:19 +0530
4+
Subject: [PATCH] http2: close connections when receiving too many headers
5+
6+
Adapted by @mfrw to apply on vendor directory for v0.17 to drop test
7+
files
8+
9+
Maintaining HPACK state requires that we parse and process
10+
all HEADERS and CONTINUATION frames on a connection.
11+
When a request's headers exceed MaxHeaderBytes, we don't
12+
allocate memory to store the excess headers but we do
13+
parse them. This permits an attacker to cause an HTTP/2
14+
endpoint to read arbitrary amounts of data, all associated
15+
with a request which is going to be rejected.
16+
Set a limit on the amount of excess header frames we
17+
will process before closing a connection.
18+
19+
Thanks to Bartek Nowotarski for reporting this issue.
20+
21+
Fixes CVE-2023-45288
22+
Fixes golang/go#65051
23+
24+
Change-Id: I15df097268df13bb5a9e9d3a5c04a8a141d850f6
25+
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/2130527
26+
Reviewed-by: Roland Shoemaker <[email protected]>
27+
Reviewed-by: Tatiana Bradley <[email protected]>
28+
Reviewed-on: https://go-review.googlesource.com/c/net/+/576155
29+
Reviewed-by: Dmitri Shuralyov <[email protected]>
30+
Auto-Submit: Dmitri Shuralyov <[email protected]>
31+
Reviewed-by: Than McIntosh <[email protected]>
32+
LUCI-TryBot-Result: Go LUCI <[email protected]>
33+
Signed-off-by: Muhammad Falak R Wani <[email protected]>
34+
---
35+
vendor/golang.org/x/net/http2/frame.go | 31 ++++++++++++++++++++++++++
36+
1 file changed, 31 insertions(+)
37+
38+
diff --git a/vendor/golang.org/x/net/http2/frame.go b/vendor/golang.org/x/net/http2/frame.go
39+
index c1f6b90..175c154 100644
40+
--- a/vendor/golang.org/x/net/http2/frame.go
41+
+++ b/vendor/golang.org/x/net/http2/frame.go
42+
@@ -1565,6 +1565,7 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) {
43+
if size > remainSize {
44+
hdec.SetEmitEnabled(false)
45+
mh.Truncated = true
46+
+ remainSize = 0
47+
return
48+
}
49+
remainSize -= size
50+
@@ -1577,6 +1578,36 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) {
51+
var hc headersOrContinuation = hf
52+
for {
53+
frag := hc.HeaderBlockFragment()
54+
+
55+
+ // Avoid parsing large amounts of headers that we will then discard.
56+
+ // If the sender exceeds the max header list size by too much,
57+
+ // skip parsing the fragment and close the connection.
58+
+ //
59+
+ // "Too much" is either any CONTINUATION frame after we've already
60+
+ // exceeded the max header list size (in which case remainSize is 0),
61+
+ // or a frame whose encoded size is more than twice the remaining
62+
+ // header list bytes we're willing to accept.
63+
+ if int64(len(frag)) > int64(2*remainSize) {
64+
+ if VerboseLogs {
65+
+ log.Printf("http2: header list too large")
66+
+ }
67+
+ // It would be nice to send a RST_STREAM before sending the GOAWAY,
68+
+ // but the struture of the server's frame writer makes this difficult.
69+
+ return nil, ConnectionError(ErrCodeProtocol)
70+
+ }
71+
+
72+
+ // Also close the connection after any CONTINUATION frame following an
73+
+ // invalid header, since we stop tracking the size of the headers after
74+
+ // an invalid one.
75+
+ if invalid != nil {
76+
+ if VerboseLogs {
77+
+ log.Printf("http2: invalid header: %v", invalid)
78+
+ }
79+
+ // It would be nice to send a RST_STREAM before sending the GOAWAY,
80+
+ // but the struture of the server's frame writer makes this difficult.
81+
+ return nil, ConnectionError(ErrCodeProtocol)
82+
+ }
83+
+
84+
if _, err := hdec.Write(frag); err != nil {
85+
return nil, ConnectionError(ErrCodeCompression)
86+
}
87+
--
88+
2.40.1
89+

SPECS/git-lfs/git-lfs.signatures.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Signatures": {
3-
"git-lfs-3.4.1-vendor.tar.gz": "a7b525a15b71a92ab789853a172345a4e4815de71ebe3486d5b843651b74cf1e",
4-
"git-lfs-3.4.1.tar.gz": "2a36239d7968ae18e1ba2820dc664c4ef753f10bf424f98bccaf44d527f19a17"
3+
"git-lfs-3.5.1-vendor.tar.gz": "ebe825559dba3bdc835ad510ed8c3468c9933f945086406a4ec6b79fd31bc104",
4+
"git-lfs-3.5.1.tar.gz": "d682a12c0bc48d08d28834dd0d575c91d53dd6c6db63c45c2db7c3dd2fb69ea4"
55
}
6-
}
6+
}

SPECS/git-lfs/git-lfs.spec

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%global debug_package %{nil}
22
Summary: Git extension for versioning large files
33
Name: git-lfs
4-
Version: 3.4.1
4+
Version: 3.5.1
55
Release: 1%{?dist}
66
Group: System Environment/Programming
77
Vendor: Microsoft Corporation
@@ -28,6 +28,7 @@ Source0: https://github.com/git-lfs/git-lfs/archive/v%{version}.tar.gz#/%{
2828
# See: https://reproducible-builds.org/docs/archives/
2929
# - For the value of "--mtime" use the date "2021-04-26 00:00Z" to simplify future updates.
3030
Source1: %{name}-%{version}-vendor.tar.gz
31+
Patch0: CVE-2023-45288.patch
3132

3233
BuildRequires: golang
3334
BuildRequires: which
@@ -41,10 +42,11 @@ Requires: git
4142
Git LFS is a command line extension and specification for managing large files with Git
4243

4344
%prep
44-
%autosetup
45+
%autosetup -N
4546

4647
%build
4748
tar --no-same-owner -xf %{SOURCE1}
49+
%autopatch -p1
4850
export GOPATH=%{our_gopath}
4951
export GOFLAGS="-buildmode=pie -trimpath -mod=vendor -modcacherw -ldflags=-linkmode=external"
5052
go generate ./commands
@@ -77,6 +79,10 @@ git lfs uninstall
7779
%{_mandir}/man5/*
7880

7981
%changelog
82+
* Tue Apr 23 2024 Muhammad Falak <[email protected]> - 3.5.1-1
83+
- Bump version to 3.5.1 to address CVE-2023-39325
84+
- Introduce patch to address CVE-2023-45288
85+
8086
* Thu Apr 18 2024 Andrew Phelps <[email protected]> - 3.4.1-1
8187
- Bump version to 3.4.1 based on AZL3 spec
8288
- Add BR on asciidoctor & drop un-needed BR

SPECS/less/CVE-2024-32487.patch

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
From 007521ac3c95bc76e3d59c6dbfe75d06c8075c33 Mon Sep 17 00:00:00 2001
2+
From: Mark Nudelman <[email protected]>
3+
Date: Thu, 11 Apr 2024 17:49:48 -0700
4+
Subject: [PATCH] Fix bug when viewing a file whose name contains a newline.
5+
6+
---
7+
filename.c | 31 +++++++++++++++++++++++++------
8+
1 file changed, 25 insertions(+), 6 deletions(-)
9+
10+
diff --git a/filename.c b/filename.c
11+
index f90e0e82..a52c6354 100644
12+
--- a/filename.c
13+
+++ b/filename.c
14+
@@ -133,6 +133,15 @@ static constant char * metachars(void)
15+
return (strchr(metachars(), c) != NULL);
16+
}
17+
18+
+/*
19+
+ * Must use quotes rather than escape char for this metachar?
20+
+ */
21+
+static int must_quote(char c)
22+
+{
23+
+ /* {{ Maybe the set of must_quote chars should be configurable? }} */
24+
+ return (c == '\n');
25+
+}
26+
+
27+
/*
28+
* Insert a backslash before each metacharacter in a string.
29+
*/
30+
@@ -164,6 +173,9 @@ public char * shell_quoten(constant char *s, size_t slen)
31+
* doesn't support escape chars. Use quotes.
32+
*/
33+
use_quotes = 1;
34+
+ } else if (must_quote(*p))
35+
+ {
36+
+ len += 3; /* open quote + char + close quote */
37+
} else
38+
{
39+
/*
40+
@@ -193,15 +205,22 @@ public char * shell_quoten(constant char *s, size_t slen)
41+
{
42+
while (*s != '\0')
43+
{
44+
- if (metachar(*s))
45+
+ if (!metachar(*s))
46+
{
47+
- /*
48+
- * Add the escape char.
49+
- */
50+
+ *p++ = *s++;
51+
+ } else if (must_quote(*s))
52+
+ {
53+
+ /* Surround the char with quotes. */
54+
+ *p++ = openquote;
55+
+ *p++ = *s++;
56+
+ *p++ = closequote;
57+
+ } else
58+
+ {
59+
+ /* Insert an escape char before the char. */
60+
strcpy(p, esc);
61+
p += esclen;
62+
+ *p++ = *s++;
63+
}
64+
- *p++ = *s++;
65+
}
66+
*p = '\0';
67+
}

0 commit comments

Comments
 (0)