Skip to content

cgroups: Fix eBPF program leaks#5322

Open
rata wants to merge 3 commits into
opencontainers:mainfrom
rata:fix-ebpf-leak
Open

cgroups: Fix eBPF program leaks#5322
rata wants to merge 3 commits into
opencontainers:mainfrom
rata:fix-ebpf-leak

Conversation

@rata

@rata rata commented Jun 15, 2026

Copy link
Copy Markdown
Member

A new version of the cgroups dependency (v0.0.7) includes fixes for eBPF program leaks. They were fixed in this PR (from Argentina, with love :-P): opencontainers/cgroups#60

Let's update to that version and not exclude any fd from leaks :)

Please note that the cgroups module added a method to an interface, that we needed to add to a mock so tests compile. I put it in the same commit as the upgrade itself so we don't break bisect unnecessarily.

@rata rata force-pushed the fix-ebpf-leak branch 3 times, most recently from 81f81a9 to 95244d6 Compare June 18, 2026 16:23
@rata rata changed the title cgroups: Fix epbf program leaks cgroups: Fix eBPF program leaks Jun 18, 2026
@rata rata marked this pull request as ready for review June 18, 2026 16:41
@rata

rata commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

Created this to consider moving the mock to the cgroup repo: opencontainers/cgroups#61

rata added 2 commits June 18, 2026 18:52
This new version includes fixes for EPBF fd leaks:
	opencontainers/cgroups#60

Let's update to it.

However, the Stats() method was added in the new release to the
interface, so tests were failing with:
	# github.com/opencontainers/runc/libcontainer [github.com/opencontainers/runc/libcontainer.test]
./container_linux_test.go:125:18: cannot use &mockCgroupManager{…} (value of type *mockCgroupManager) as cgroups.Manager value in struct literal: *mockCgroupManager does not implement cgroups.Manager (missing method Stats)

Let's add the method to the mock too.

In the future, probably the mock should come from the cgroups module.

Signed-off-by: Rodrigo Campos <rodrigo@amutable.com>
Now the cgroups dependency has been upgraded and it doesn't cause these
leaks anymore. Let's remove the exclude.

Signed-off-by: Rodrigo Campos <rodrigo@amutable.com>
@rata

rata commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

I guess this should have a changelog entry, saying the leak was fixed.

@rata rata requested review from cyphar and kolyshkin June 19, 2026 09:06
Signed-off-by: Rodrigo Campos <rodrigo@amutable.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant