Files
Jing Chen ff3425ac1f Fix crash and resource-leak bugs in the containerd shim
- runsc/debug.go: the SIGUSR2 stack dumper never exited its loop, so one
signal pinned a core for the life of the shim.
- proc/init_state.go: the start-failure path closed p.io unconditionally,
but Init.Create leaves it nil for terminal containers. The nil deref
killed the shim, and with it the pod.
- proc/utils.go: getLastRuntimeError leaked the log file it opened, on
every failed runsc command.
- utils/volumes.go: configureShm wrote into a nil annotation map, which
IsSandbox permits.
- runsc/epoll.go: the cgroups v1 OOM watcher panicked on the first
publish failure, which is normal under CRI-O. Reuse forward's leniency
check; the panic under containerd is kept.
- runsccmd/runsc.go: cmdOutput returned slices aliasing sync.Pool buffers
that putBuf immediately recycled.
2026-08-26 22:47:36 +00:00

63 lines
2.0 KiB
Python

load("//tools:defs.bzl", "go_library", "go_test")
package(
default_applicable_licenses = ["//:license"],
licenses = ["notice"],
)
go_library(
name = "proc",
srcs = [
"deleted_state.go",
"exec.go",
"exec_state.go",
"init.go",
"init_state.go",
"io.go",
"proc.go",
"types.go",
"utils.go",
],
visibility = [
"//pkg/shim:__subpackages__",
"//shim:__subpackages__",
],
deps = [
"//pkg/atomicbitops",
"//pkg/cleanup",
"//pkg/shim/v1/extension",
"//pkg/shim/v1/runsccmd",
"//pkg/shim/v1/utils",
"@com_github_containerd_console//:go_default_library",
"@com_github_containerd_containerd_v2//core/mount:go_default_library",
"@com_github_containerd_containerd_v2//pkg/protobuf/types:go_default_library",
"@com_github_containerd_containerd_v2//pkg/stdio:go_default_library",
"@com_github_containerd_errdefs//:go_default_library",
"@com_github_containerd_errdefs_pkg//errgrpc:go_default_library",
"@com_github_containerd_fifo//:go_default_library",
"@com_github_containerd_go_runc//:go_default_library",
"@com_github_containerd_log//:go_default_library",
"@com_github_opencontainers_runtime_spec//specs-go:go_default_library",
"@org_golang_x_sys//unix:go_default_library",
],
)
go_test(
name = "proc_test",
size = "small",
srcs = [
"init_state_test.go",
"update_test.go",
"utils_test.go",
],
library = ":proc",
deps = [
"//pkg/shim/v1/runsccmd",
"@com_github_containerd_console//:go_default_library",
"@com_github_containerd_containerd_v2//pkg/protobuf/types:go_default_library",
"@com_github_containerd_containerd_v2//pkg/stdio:go_default_library",
"@com_github_containerd_errdefs//:go_default_library",
"@com_github_containerd_go_runc//:go_default_library",
],
)