Skip to content

Commit cbb50d2

Browse files
Patch moby-containerd-cc for CVE-2025-64329
1 parent 85a07a8 commit cbb50d2

File tree

2 files changed

+73
-1
lines changed

2 files changed

+73
-1
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
From 711fc7f7388bdb317a813a791d9e8d38f725a85f Mon Sep 17 00:00:00 2001
2+
From: AllSpark <[email protected]>
3+
Date: Mon, 10 Nov 2025 03:04:25 +0000
4+
Subject: [PATCH] fix(cri): prevent goroutine leak in ContainerIO.Attach by
5+
honoring ctx cancellation and removing writer group entries; plumb context
6+
through attach call
7+
8+
Signed-off-by: Azure Linux Security Servicing Account <[email protected]>
9+
Upstream-reference: AI Backport from Build Backport-Build-ID-978512
10+
---
11+
pkg/cri/io/container_io.go | 14 +++++++++++---
12+
pkg/cri/server/container_attach.go | 2 +-
13+
2 files changed, 12 insertions(+), 4 deletions(-)
14+
15+
diff --git a/pkg/cri/io/container_io.go b/pkg/cri/io/container_io.go
16+
index 70bc8b7..e158410 100644
17+
--- a/pkg/cri/io/container_io.go
18+
+++ b/pkg/cri/io/container_io.go
19+
@@ -17,6 +17,7 @@
20+
package io
21+
22+
import (
23+
+ "context"
24+
"errors"
25+
"io"
26+
"strings"
27+
@@ -134,7 +135,7 @@ func (c *ContainerIO) Pipe() {
28+
29+
// Attach attaches container stdio.
30+
// TODO(random-liu): Use pools.Copy in docker to reduce memory usage?
31+
-func (c *ContainerIO) Attach(opts AttachOptions) {
32+
+func (c *ContainerIO) Attach(ctx context.Context, opts AttachOptions) {
33+
var wg sync.WaitGroup
34+
key := util.GenerateID()
35+
stdinKey := streamKey(c.id, "attach-"+key, Stdin)
36+
@@ -175,8 +176,15 @@ func (c *ContainerIO) Attach(opts AttachOptions) {
37+
}
38+
39+
attachStream := func(key string, close <-chan struct{}) {
40+
- <-close
41+
- logrus.Infof("Attach stream %q closed", key)
42+
+ select {
43+
+ case <-close:
44+
+ logrus.Infof("Attach stream %q closed", key)
45+
+ case <-ctx.Done():
46+
+ logrus.Infof("Attach client of %q cancelled", key)
47+
+ // Avoid writeGroup heap up
48+
+ c.stdoutGroup.Remove(key)
49+
+ c.stderrGroup.Remove(key)
50+
+ }
51+
// Make sure stdin gets closed.
52+
if stdinStreamRC != nil {
53+
stdinStreamRC.Close()
54+
diff --git a/pkg/cri/server/container_attach.go b/pkg/cri/server/container_attach.go
55+
index cd79f3b..aa6519a 100644
56+
--- a/pkg/cri/server/container_attach.go
57+
+++ b/pkg/cri/server/container_attach.go
58+
@@ -79,6 +79,6 @@ func (c *criService) attachContainer(ctx context.Context, id string, stdin io.Re
59+
},
60+
}
61+
// TODO(random-liu): Figure out whether we need to support historical output.
62+
- cntr.IO.Attach(opts)
63+
+ cntr.IO.Attach(ctx, opts)
64+
return nil
65+
}
66+
--
67+
2.45.4
68+

SPECS/moby-containerd-cc/moby-containerd-cc.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Summary: Industry-standard container runtime for confidential containers
77
Name: moby-%{upstream_name}
88
Version: 1.7.7
9-
Release: 9%{?dist}
9+
Release: 10%{?dist}
1010
License: ASL 2.0
1111
Group: Tools/Container
1212
URL: https://www.containerd.io
@@ -25,6 +25,7 @@ Patch5: CVE-2023-45288.patch
2525
Patch7: CVE-2023-44487.patch
2626
Patch8: CVE-2025-27144.patch
2727
Patch9: CVE-2024-40635.patch
28+
Patch10:CVE-2025-64329.patch
2829

2930
%{?systemd_requires}
3031

@@ -82,6 +83,9 @@ fi
8283
%config(noreplace) %{_sysconfdir}/containerd/config.toml
8384

8485
%changelog
86+
* Wed Nov 12 2025 Azure Linux Security Servicing Account <[email protected]> - 1.7.7-10
87+
- Patch for CVE-2025-64329
88+
8589
* Wed Apr 16 2025 Manuel Huber <[email protected]> - 1.7.7-9
8690
- Fix CVE-2024-40635
8791

0 commit comments

Comments
 (0)