Skip to content

Commit 75d7f61

Browse files
[AutoPR- Security] Patch moby-engine for CVE-2026-32288 [MEDIUM] (#16755)
Co-authored-by: Kanishk Bansal <103916909+Kanishk-Bansal@users.noreply.github.com>
1 parent 3c0c8cd commit 75d7f61

2 files changed

Lines changed: 128 additions & 1 deletion

File tree

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
From 33e8fee941df62e9e6d0c6abf91c47843e51b8cd Mon Sep 17 00:00:00 2001
2+
From: Damien Neil <dneil@google.com>
3+
Date: Mon, 23 Mar 2026 13:12:44 -0700
4+
Subject: [PATCH] archive/tar: limit the number of old GNU sparse format
5+
entries
6+
7+
We did not set a limit on the maximum size of sparse maps in
8+
the old GNU sparse format. Set a limit based on the cumulative
9+
size of the extension blocks used to encode the map (consistent
10+
with how we limit the sparse map size for other formats).
11+
12+
Add an additional limit to the total number of sparse file entries,
13+
regardless of encoding, to all sparse formats.
14+
15+
Thanks to Colin Walters (walters@verbum.org),
16+
Uuganbayar Lkhamsuren (https://github.com/uug4na),
17+
and Jakub Ciolek for reporting this issue.
18+
19+
Fixes #78301
20+
Fixes CVE-2026-32288
21+
22+
Upstream Patch reference: https://github.com/golang/go/commit/82b0cdb7411ea2cf02d3a45e6983cc7c8c009d9e.patch
23+
---
24+
.../vbatts/tar-split/archive/tar/format.go | 6 ++++
25+
.../vbatts/tar-split/archive/tar/reader.go | 28 ++++++++++++++++---
26+
2 files changed, 30 insertions(+), 4 deletions(-)
27+
28+
diff --git a/vendor/github.com/vbatts/tar-split/archive/tar/format.go b/vendor/github.com/vbatts/tar-split/archive/tar/format.go
29+
index 6097798..6f31845 100644
30+
--- a/vendor/github.com/vbatts/tar-split/archive/tar/format.go
31+
+++ b/vendor/github.com/vbatts/tar-split/archive/tar/format.go
32+
@@ -147,6 +147,12 @@ const (
33+
// Max length of a special file (PAX header, GNU long name or link).
34+
// This matches the limit used by libarchive.
35+
maxSpecialFileSize = 1 << 20
36+
+
37+
+ // Maximum number of sparse file entries.
38+
+ // We should never actually hit this limit
39+
+ // (every sparse encoding will first be limited by maxSpecialFileSize),
40+
+ // but this adds an additional layer of defense.
41+
+ maxSparseFileEntries = 1 << 20
42+
)
43+
44+
// blockPadding computes the number of bytes needed to pad offset up to the
45+
diff --git a/vendor/github.com/vbatts/tar-split/archive/tar/reader.go b/vendor/github.com/vbatts/tar-split/archive/tar/reader.go
46+
index 7a56fa1..439db66 100644
47+
--- a/vendor/github.com/vbatts/tar-split/archive/tar/reader.go
48+
+++ b/vendor/github.com/vbatts/tar-split/archive/tar/reader.go
49+
@@ -532,7 +532,8 @@ func (tr *Reader) readOldGNUSparseMap(hdr *Header, blk *block) (sparseDatas, err
50+
}
51+
s := blk.GNU().Sparse()
52+
spd := make(sparseDatas, 0, s.MaxEntries())
53+
- for {
54+
+ totalSize := len(s)
55+
+ for totalSize < maxSpecialFileSize {
56+
for i := 0; i < s.MaxEntries(); i++ {
57+
// This termination condition is identical to GNU and BSD tar.
58+
if s.Entry(i).Offset()[0] == 0x00 {
59+
@@ -543,7 +544,11 @@ func (tr *Reader) readOldGNUSparseMap(hdr *Header, blk *block) (sparseDatas, err
60+
if p.err != nil {
61+
return nil, p.err
62+
}
63+
- spd = append(spd, sparseEntry{Offset: offset, Length: length})
64+
+ var err error
65+
+ spd, err = appendSparseEntry(spd, sparseEntry{Offset: offset, Length: length})
66+
+ if err != nil {
67+
+ return nil, err
68+
+ }
69+
}
70+
71+
if s.IsExtended()[0] > 0 {
72+
@@ -555,10 +560,12 @@ func (tr *Reader) readOldGNUSparseMap(hdr *Header, blk *block) (sparseDatas, err
73+
tr.rawBytes.Write(blk[:])
74+
}
75+
s = blk.Sparse()
76+
+ totalSize += len(s)
77+
continue
78+
}
79+
return spd, nil // Done
80+
}
81+
+ return nil, errSparseTooLong
82+
}
83+
84+
// readGNUSparseMap1x0 reads the sparse map as stored in GNU's PAX sparse format
85+
@@ -631,7 +638,10 @@ func readGNUSparseMap1x0(r io.Reader) (sparseDatas, error) {
86+
if err1 != nil || err2 != nil {
87+
return nil, ErrHeader
88+
}
89+
- spd = append(spd, sparseEntry{Offset: offset, Length: length})
90+
+ spd, err = appendSparseEntry(spd, sparseEntry{Offset: offset, Length: length})
91+
+ if err != nil {
92+
+ return nil, err
93+
+ }
94+
}
95+
return spd, nil
96+
}
97+
@@ -665,12 +675,22 @@ func readGNUSparseMap0x1(paxHdrs map[string]string) (sparseDatas, error) {
98+
if err1 != nil || err2 != nil {
99+
return nil, ErrHeader
100+
}
101+
- spd = append(spd, sparseEntry{Offset: offset, Length: length})
102+
+ spd, err = appendSparseEntry(spd, sparseEntry{Offset: offset, Length: length})
103+
+ if err != nil {
104+
+ return nil, err
105+
+ }
106+
sparseMap = sparseMap[2:]
107+
}
108+
return spd, nil
109+
}
110+
111+
+func appendSparseEntry(spd sparseDatas, ent sparseEntry) (sparseDatas, error) {
112+
+ if len(spd) >= maxSparseFileEntries {
113+
+ return nil, errSparseTooLong
114+
+ }
115+
+ return append(spd, ent), nil
116+
+}
117+
+
118+
// Read reads from the current file in the tar archive.
119+
// It returns (0, io.EOF) when it reaches the end of that file,
120+
// until Next is called to advance to the next file.
121+
--
122+
2.45.4
123+

SPECS/moby-engine/moby-engine.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Summary: The open-source application container engine
44
Name: moby-engine
55
Version: 25.0.3
6-
Release: 16%{?dist}
6+
Release: 17%{?dist}
77
License: ASL 2.0
88
Group: Tools/Container
99
URL: https://mobyproject.org
@@ -32,6 +32,7 @@ Patch14: CVE-2025-58183.patch
3232
#This can be removed when upgraded to v25.0.15
3333
Patch15: fix-multiarch-image-push-tag.patch
3434
Patch16: CVE-2026-39882.patch
35+
Patch17: CVE-2026-32288.patch
3536

3637
%{?systemd_requires}
3738

@@ -127,6 +128,9 @@ fi
127128
%{_unitdir}/*
128129

129130
%changelog
131+
* Mon Apr 20 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 25.0.3-17
132+
- Patch for CVE-2026-32288
133+
130134
* Wed Apr 15 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 25.0.3-16
131135
- Patch for CVE-2026-39882
132136

0 commit comments

Comments
 (0)