# containerd v2.0.7

2025-11-06 · [릴리스 노트 원문](https://github.com/containerd/containerd/releases/tag/v2.0.7) · [전체 정리](https://ratatosk.io/ko/releases/containerd/v2.0.7)

보안 6 (high 1) · 호환성 변경 2 · 중요 수정 11 · 기능·개선 2 · 의존성 갱신 2 · 기타 15

## 보안 (6)

### [high] containerd의 과도한 디렉터리 권한 수정

- 영향 대상: 영향받는 디렉터리가 있는 containerd v2 설치 환경. `temp` 디렉터리를 설정한 설치 환경 포함
- [CVE-2024-25621](https://www.cve.org/CVERecord?id=CVE-2024-25621), [GHSA-pwhc-rpq9-4c8w](https://github.com/containerd/containerd/security/advisories/GHSA-pwhc-rpq9-4c8w)

수정 전에는 디렉터리 권한이 지나치게 넓어 로컬 호스트 사용자가 메타데이터, 콘텐츠 또는 Kubernetes 로컬 볼륨 콘텐츠에 접근할 수 있었습니다. 기존의 영향받는 디렉터리와 새로 생성되는 디렉터리의 권한을 `0o700`으로 변경합니다. `/run/containerd`와 `/run/containerd/io.containerd.runtime.v2.task`의 권한은 `0o711`로 유지합니다.

>   * [**GHSA-pwhc-rpq9-4c8w**](https://github.com/containerd/containerd/security/advisories/GHSA-pwhc-rpq9-4c8w)

### [medium] containerd CRI Attach 고루틴 누수 수정

- 영향 대상: containerd의 CRI Attach 구현을 사용하는 환경
- [CVE-2025-64329](https://www.cve.org/CVERecord?id=CVE-2025-64329), [GHSA-m6hq-p25p-ffr2](https://github.com/containerd/containerd/security/advisories/GHSA-m6hq-p25p-ffr2)

`kubectl attach`와 같은 CRI Attach 호출을 반복하면 고루틴이 누수되어 containerd의 메모리 사용량이 증가하고, 호스트 메모리가 고갈될 수 있었습니다.

>   * [**GHSA-m6hq-p25p-ffr2**](https://github.com/containerd/containerd/security/advisories/GHSA-m6hq-p25p-ffr2)

### `runc` 콘솔 디바이스 마운트 보호 수정

- 영향 대상: 영향을 받는 `runc` 버전을 사용하면서 콘솔을 할당하는 컨테이너
- [GHSA-qw9x-cqr3-wc7r](https://github.com/advisories/GHSA-qw9x-cqr3-wc7r)

공격자가 `/dev/pts/$n`을 `/dev/console`에 바인드 마운트하는 데 영향을 줄 수 있는 경우, 영향을 받는 `runc` 버전에서는 읽기 전용이거나 마스킹되어야 하는 경로가 쓰기 가능해질 수 있었습니다. 보안 권고에 제시된 업스트림 수정으로 이 문제가 해결되지만, 릴리스 자료에는 containerd v2.0.7에 포함된 `runc` 버전이 명시되어 있지 않습니다.

>   * [**GHSA-qw9x-cqr3-wc7r**](https://github.com/opencontainers/runc/security/advisories/GHSA-qw9x-cqr3-wc7r)

### runc `/proc` 쓰기 리디렉션 수정

- 영향 대상: 영향을 받는 runc 버전에서 공유 마운트를 사용하는 컨테이너가 있는 환경
- [GHSA-cgrx-mc8f-2prm](https://github.com/advisories/GHSA-cgrx-mc8f-2prm)

공유 마운트를 사용하는 컨테이너에서 경합이 발생하면 runc가 `/proc`에 쓰는 데이터가 다른 procfs 파일로 리디렉션될 수 있었습니다. 여기에는 sysctl 쓰기도 포함됩니다. 어드바이저리에 따르면 병렬 컨테이너가 사용자 지정 공유 마운트를 사용하는 `docker buildx build` 중에도 같은 문제가 발생할 수 있습니다.

>   * [**GHSA-cgrx-mc8f-2prm**](https://github.com/opencontainers/runc/security/advisories/GHSA-cgrx-mc8f-2prm)

### runc `maskedPaths` 마운트 검증 수정 사항

- 영향 대상: runc `maskedPaths`에 파일 경로를 설정한 컨테이너
- [CVE-2025-31133](https://www.cve.org/CVERecord?id=CVE-2025-31133), [GHSA-9493-h29p-rfm2](https://github.com/advisories/GHSA-9493-h29p-rfm2)

runc가 파일을 마스킹하기 위해 컨테이너의 `/dev/null`을 사용할 때, 경쟁 상태로 `/dev/null`이 심볼릭 링크로 바뀌어 컨테이너 안에 임의의 소스를 마운트할 수 있었습니다. 또는 `/dev/null`이 삭제되어 `maskedPaths`가 아무런 알림 없이 건너뛰어질 수 있었습니다.

>   * [**GHSA-9493-h29p-rfm2**](https://github.com/opencontainers/runc/security/advisories/GHSA-9493-h29p-rfm2)

### `bootstrap.json` 생성 모드를 `0644`로 설정하는 런타임 shim

- 영향 대상: 런타임 shim이 `bootstrap.json`을 생성하는 환경 (추정)

> * **Create bootstrap.json with 0644 permission** ([#12184](https://github.com/containerd/containerd/pull/12184))
> * Create bootstrap.json with 0644 permission ([#12184](https://github.com/containerd/containerd/pull/12184))
>   * [`009622e04`](https://github.com/containerd/containerd/commit/009622e0424fa4234d67272339fb7e282c302190) fix: create bootstrap.json with 0644 permission

## 호환성 변경 (2)

### Containerd 디렉터리 권한 강화

- 영향 대상: `/var/lib/containerd`, `config.TempDir`, `/run/containerd/io.containerd.grpc.v1.cri` 또는 `/run/containerd/io.containerd.sandbox.controller.v1.shim`을 사용하는 설치 환경, userns 리매핑 컨테이너 및 기타 컨테이너의 태스크 디렉터리 (추정)

업그레이드 전에는 앞의 네 디렉터리 모드가 순서대로 `0o711`, `0o711`, `0o755`, `0o711`이었으며, 업그레이드 후에는 모두 `0o700`으로 변경됩니다. 태스크 디렉터리의 상위 디렉터리는 계속 `0o711`을 사용합니다. 태스크 디렉터리는 userns 리매핑 컨테이너에서 `0o710`을 사용하고, 그 외의 컨테이너에서는 `0o700`을 사용합니다.

근거: “- 0o700 for non-userns-remapped containers - 0o710 for userns-remapped containers with the remapped root group as the owner group.” https://github.com/containerd/containerd/commit/8cd112d8295bafcf4a992816ff9e07f5a78ff71b

>   * [`8cd112d82`](https://github.com/containerd/containerd/commit/8cd112d8295bafcf4a992816ff9e07f5a78ff71b) Fix directory permissions

### 임시 idmapped 바인드 마운트 읽기 전용 설정

- 영향 대상: user namespace와 임시 idmapped 바인드 마운트를 사용하는 overlayfs 구성

임시 마운트가 실수로 수정되는 것을 방지합니다.

근거: “The temporary idmap'ed bind mounts r/o and not MNT_DETACHED, which prevents accidental modification and makes unmount semantics more clear” https://github.com/containerd/containerd/pull/12223

>   * [`1c32accd7`](https://github.com/containerd/containerd/commit/1c32accd71d34e3cb5798214adf26911609d11f1) Make ovl idmap mounts read-only

## 중요 수정 (11)

### containerd-shim-runc-v2의 컨테이너 로그 유실 수정

- 영향 대상: `containerd-shim-runc-v2`를 사용하는 컨테이너 (추정)

init 또는 exec 프로세스 삭제 중 I/O가 빠르게 닫히면 2초 동안 drain을 기다리는 과정에서 컨테이너 로그가 유실될 수 있었습니다. 이제 shim은 I/O가 drain될 때까지 최대 10초 동안 기다리고, 그 뒤에도 시간 초과가 발생하면 오류를 로그로 남깁니다.

> * Fix lost container logs from quickly closing io ([#12376](https://github.com/containerd/containerd/pull/12376))
>   * [`f953ee8a3`](https://github.com/containerd/containerd/commit/f953ee8a3c1feeaa60a3c9d386afa424040d56de) bugfix:fix container logs lost because io close too quickly
> * **Fix lost container logs from quickly closing io** ([#12376](https://github.com/containerd/containerd/pull/12376))

### 파드 샌드박스 중복 정리 경로 수정

- 영향 대상: CRI 파드 샌드박스 태스크 정리

파드 샌드박스 태스크를 정리하는 동안 이벤트 구독자가 샌드박스 컨테이너의 개별 고루틴과 별도로 두 번째 정리 고루틴을 시작할 수 있었습니다. 이로 인해 `task.Delete` 호출이 동시에 실행되고, 최악의 경우 shim이 누수될 수 있었습니다. 이제 정리 중에는 구독자를 비활성화해 중복 정리 경로를 방지합니다.

> * **Disable event subscriber during task cleanup** ([#12406](https://github.com/containerd/containerd/pull/12406))

### `ctr shim shutdown` 하위 명령 추가

- 영향 대상: `ctr shim` 명령을 사용하는 환경

활성 컨테이너가 없을 때만 종료 요청을 보냅니다. `--api-version`은 2 또는 3을 허용하며 기본값은 3입니다.

> * **Disable event subscriber during task cleanup** ([#12406](https://github.com/containerd/containerd/pull/12406))
> * Disable event subscriber during task cleanup ([#12406](https://github.com/containerd/containerd/pull/12406))
>   * [`2a2329cbd`](https://github.com/containerd/containerd/commit/2a2329cbd02dc5e1a3010730fab01c618dad768c) cri/server/podsandbox: disable event subscriber

### 사용자 네임스페이스 이미지 `VOLUME` copy-up 수정

- 영향 대상: 사용자 네임스페이스를 사용하며 복사가 필요한 이미지 `VOLUME` 마운트가 있는 CRI 워크로드

copy-up 과정에서 파일을 UID/GID 변환 없이 복사하므로, 복사된 파일의 UID/GID는 컨테이너 내부에서 `0:0`입니다.

> * **Fix userns with container image VOLUME mounts that need copy** ([#12241](https://github.com/containerd/containerd/pull/12241))
> * Fix userns with container image VOLUME mounts that need copy ([#12241](https://github.com/containerd/containerd/pull/12241))
>   * [`3212afc2f`](https://github.com/containerd/containerd/commit/3212afc2f2d464157bcb24663360ee7dfa7207e6) integration: Add test for directives with userns
>   * [`b855c6e10`](https://github.com/containerd/containerd/commit/b855c6e10372eb43d51186ab156cdce3d9eefb04) cri: Fix userns with Dockerfile VOLUME mounts that need copy

### CRI Attach 모니터 누수 수정

- 영향 대상: `stdout` 또는 `stderr` 출력이 없는 컨테이너의 CRI Attach 세션 (추정)

수정 전에는 `stdout`이나 `stderr` 출력이 없는 컨테이너에 Attach로 연결하면 모니터 고루틴이 종료되지 않았습니다. 업그레이드 후에는 컨텍스트가 취소되면 모니터가 해제되고, `stdout` 및 `stderr` 쓰기 그룹에서 스트림 키가 제거됩니다.

>   * [`4d1edf4ad`](https://github.com/containerd/containerd/commit/4d1edf4addf8c31b096680f04fee499cabc75439) fix goroutine leak of container Attach

### 정리 재시도로 임시 idmapped 마운트 누수 방지

- 영향 대상: overlayfs와 임시 idmapped 마운트를 사용하는 사용자 네임스페이스

idmapped 디렉터리를 위한 임시 bind mount를 언마운트하지 못하면 정리를 한 번만 시도하기 때문에 마운트가 누수될 수 있었습니다. 이제 언마운트 오류가 발생하면 정리를 재시도합니다.

>   * [`05c0c99f4`](https://github.com/containerd/containerd/commit/05c0c99f432b341152b54ce49d9b43c5cf3d131f) core/mount: Retry unmounting idmapped directories

### ID 매핑 오버레이 준비 중 오류 발생 시 정리

- 영향 대상: 사용자 네임스페이스 ID 매핑 오버레이 마운트 (추정)

준비 중 오류가 발생하면 임시 마운트 위치나 마운트가 정리되지 않을 수 있었습니다. 이제 준비 함수가 오류를 반환할 때 오류 발생 전에 생성된 리소스도 정리됩니다.

>   * [`47205f814`](https://github.com/containerd/containerd/commit/47205f814d552a4eea9935375dd2f0874e107e5b) core/mount: Properly cleanup on doPrepareIDMappedOverlay errors

### idmapped 오버레이 오류 시 nil 클린업 호출 수정

- 영향 대상: idmapped 오버레이 마운트

오버레이 준비 과정에서 nil 클린업 함수와 함께 오류가 반환되면, 오류를 확인하기 전에 클린업을 defer했기 때문에 nil 함수를 호출할 수 있었습니다. 이제 마운트 경로는 클린업을 defer하기 전에 준비 오류를 반환합니다.

>   * [`6f4abd970`](https://github.com/containerd/containerd/commit/6f4abd970aeea241f07edc1e0fd74f69a9a05979) core/mount: Don't call nil function on errors

### overlayfs 레이어 ID 매핑에 필요한 바인드 마운트 감소

- 영향 대상: 사용자 네임스페이스와 여러 하위 레이어를 사용하는 overlayfs 구성 (추정)

여러 하위 레이어가 있는 idmapped overlayfs를 준비할 때는 이전에 각 레이어를 개별적으로 ID 매핑해 임시 바인드 마운트가 더 많이 생성됐습니다. 이제 모든 레이어가 들어 있는 디렉터리를 한 번만 ID 매핑하므로 overlayfs당 바인드 마운트 수가 줄고 성능이 향상됩니다.

>   * [`a2f0d65d7`](https://github.com/containerd/containerd/commit/a2f0d65d78871832da6d2aa452aeeb180cd6d8f5) core/mount: Only idmap once per overlayfs, not per layer

### `UnshareAfterEnterUserns`의 `pidfd` 누수 수정

- 영향 대상: `UnshareAfterEnterUserns`를 호출하는 설정 (추정)

> * Fix pidfd leak in UnshareAfterEnterUserns ([#12178](https://github.com/containerd/containerd/pull/12178))
>   * [`5bec0a332`](https://github.com/containerd/containerd/commit/5bec0a33297ad485f96116efb333ea750a27c926) sys: fix pidfd leak in UnshareAfterEnterUserns

### `UnshareAfterEnterUserns`의 pidfd 지원 사전 확인

- 영향 대상: pidfd를 지원하지 않는 커널에서 `UnshareAfterEnterUserns`를 호출하는 설정 (추정)

커널이 pidfd를 지원하지 않으면 함수가 `kernel doesn't support pidfd`를 반환합니다.

> * Fix pidfd leak in UnshareAfterEnterUserns ([#12178](https://github.com/containerd/containerd/pull/12178))
>   * [`5bec0a332`](https://github.com/containerd/containerd/commit/5bec0a33297ad485f96116efb333ea750a27c926) sys: fix pidfd leak in UnshareAfterEnterUserns
> * **Fix pidfd leak in UnshareAfterEnterUserns** ([#12178](https://github.com/containerd/containerd/pull/12178))

## 기능·개선 (2)

- `SystemdCgroup` CRI 기본 런타임 옵션에 추가
- hosts TOML의 호스트별 `dial_timeout` 설정 추가

## 의존성 갱신 (2)

그 외 2건 · 보안 언급 없음

- `* **Update runc binary to v1.3.3** ([#12479](https://github.com/containerd/containerd/pull/12479))`
- `` * runc:Update runc binary to v1.3.1 ([#12275](https://github.com/containerd/containerd/pull/12275)) * [`75c13ee3f`](https://github.com/containerd/containerd/commit/75c13ee3fc3657ee419395e20820d1cbd4bb2f88) runc:Update runc binary to v1.3.1 ``

## 기타 (15)

- v2.0.7 릴리스 노트와 mailmap 업데이트
- CI에서 사용하는 Go 버전에 1.24.9와 1.25.3 추가
- 기본 바이너리 빌드 및 대부분의 작업용 GitHub Actions 러너 이미지 업데이트
- CI 디렉터리 제외 설정에 `issues.exclude-dirs` 사용
- CI 린트 도구의 `golangci-lint` v1.64.2 업데이트
- CI `golangci-lint` 액션을 6.5.0으로 업데이트
- Fedora 43으로 CI 업데이트
- 비공개 저장소에서 `ubuntu-24.04-arm` runner를 건너뛰는 CI
- CI 계측 저장소의 추가 퍼저 제거
- install-runhcs-shim이 요청한 대상 체크아웃
- `DoPrepareIDMappedOverlay()` 정리 테스트 추가
- CI에서 사용하는 Go 버전을 1.23.12 및 1.24.6으로 업데이트
- Pidfd 복제 오류 보고 수정
- 간헐적 실패에 대응하기 위한 Windows CI 테스트 설정 변경
- Windows Server 2025 CI 커버리지 제거

---

정리 내용은 AI가 작성하므로 틀릴 수 있으며, 보증 없이 제공합니다.
