Skip to content

Commit 763fa41

Browse files
[AutoPR- Security] Patch moby-engine for CVE-2025-58183 [MEDIUM] (#15102)
1 parent 08159a4 commit 763fa41

2 files changed

Lines changed: 67 additions & 1 deletion

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
From 9d9605d279c66333caaf20b3f46a440d659c48c2 Mon Sep 17 00:00:00 2001
2+
From: AllSpark <allspark@microsoft.com>
3+
Date: Sat, 15 Nov 2025 06:37:02 +0000
4+
Subject: [PATCH] archive/tar: set a limit on the size of GNU sparse file 1.0
5+
regions; cap to maxSpecialFileSize; add errSparseTooLong; update reader to
6+
enforce limit
7+
8+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
9+
Upstream-reference: AI Backport of https://github.com/vbatts/tar-split/commit/55da7d6b43bd806ee785d783bdf66bcf302af118.patch
10+
---
11+
vendor/github.com/vbatts/tar-split/archive/tar/common.go | 1 +
12+
vendor/github.com/vbatts/tar-split/archive/tar/reader.go | 9 +++++++--
13+
2 files changed, 8 insertions(+), 2 deletions(-)
14+
15+
diff --git a/vendor/github.com/vbatts/tar-split/archive/tar/common.go b/vendor/github.com/vbatts/tar-split/archive/tar/common.go
16+
index dee9e47..e687a08 100644
17+
--- a/vendor/github.com/vbatts/tar-split/archive/tar/common.go
18+
+++ b/vendor/github.com/vbatts/tar-split/archive/tar/common.go
19+
@@ -34,6 +34,7 @@ var (
20+
errMissData = errors.New("archive/tar: sparse file references non-existent data")
21+
errUnrefData = errors.New("archive/tar: sparse file contains unreferenced data")
22+
errWriteHole = errors.New("archive/tar: write non-NUL byte in sparse hole")
23+
+ errSparseTooLong = errors.New("archive/tar: sparse map too long")
24+
)
25+
26+
type headerError []string
27+
diff --git a/vendor/github.com/vbatts/tar-split/archive/tar/reader.go b/vendor/github.com/vbatts/tar-split/archive/tar/reader.go
28+
index 40f6c86..7a56fa1 100644
29+
--- a/vendor/github.com/vbatts/tar-split/archive/tar/reader.go
30+
+++ b/vendor/github.com/vbatts/tar-split/archive/tar/reader.go
31+
@@ -576,12 +576,17 @@ func readGNUSparseMap1x0(r io.Reader) (sparseDatas, error) {
32+
cntNewline int64
33+
buf bytes.Buffer
34+
blk block
35+
+ totalSize int
36+
)
37+
38+
// feedTokens copies data in blocks from r into buf until there are
39+
// at least cnt newlines in buf. It will not read more blocks than needed.
40+
feedTokens := func(n int64) error {
41+
for cntNewline < n {
42+
+ totalSize += len(blk)
43+
+ if totalSize > maxSpecialFileSize {
44+
+ return errSparseTooLong
45+
+ }
46+
if _, err := mustReadFull(r, blk[:]); err != nil {
47+
return err
48+
}
49+
@@ -614,8 +619,8 @@ func readGNUSparseMap1x0(r io.Reader) (sparseDatas, error) {
50+
}
51+
52+
// Parse for all member entries.
53+
- // numEntries is trusted after this since a potential attacker must have
54+
- // committed resources proportional to what this library used.
55+
+ // numEntries is trusted after this since feedTokens limits the number of
56+
+ // tokens based on maxSpecialFileSize.
57+
if err := feedTokens(2 * numEntries); err != nil {
58+
return nil, err
59+
}
60+
--
61+
2.45.4
62+

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: 13%{?dist}
6+
Release: 14%{?dist}
77
License: ASL 2.0
88
Group: Tools/Container
99
URL: https://mobyproject.org
@@ -28,6 +28,7 @@ Patch10: CVE-2025-22868.patch
2828
Patch11: CVE-2025-22869.patch
2929
Patch12: CVE-2025-30204.patch
3030
Patch13: CVE-2024-51744.patch
31+
Patch14: CVE-2025-58183.patch
3132

3233
%{?systemd_requires}
3334

@@ -123,6 +124,9 @@ fi
123124
%{_unitdir}/*
124125

125126
%changelog
127+
* Sat Nov 15 2025 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 25.0.3-14
128+
- Patch for CVE-2025-58183
129+
126130
* Fri May 23 2025 Akhila Guruju <v-guakhila@microsoft.com> - 25.0.3-13
127131
- Patch CVE-2024-51744
128132

0 commit comments

Comments
 (0)