Skip to content

Handle hybrid cgroup mode in monit firewall logic#417

Merged
selzoc merged 1 commit intocloudfoundry:mainfrom
abg:firewall-handles-hybrid-jammy-cgroup-paths
Mar 2, 2026
Merged

Handle hybrid cgroup mode in monit firewall logic#417
selzoc merged 1 commit intocloudfoundry:mainfrom
abg:firewall-handles-hybrid-jammy-cgroup-paths

Conversation

@abg
Copy link
Member

@abg abg commented Mar 2, 2026

Replace the isCgroupAccessible heuristic (which rejected hybrid cgroup systems entirely) with filesystem-type detection using Statfs. On ubuntu-jammy (hybrid mode), cgroupv2 is mounted at /sys/fs/cgroup/unified; on ubuntu-noble (pure unified mode), it is at /sys/fs/cgroup. The cgroup path is now prefixed accordingly so that inode lookups resolve against the correct mount point.

For containerized environments (docker-cpi, garden-runc) where cgroup socket matching is rejected by the kernel due to cgroup namespace isolation, adjust the UID-fallback path. Rather than allowing just the current euid (typically root), explicit allow access for the "vcap" user.

@abg abg force-pushed the firewall-handles-hybrid-jammy-cgroup-paths branch from 441a049 to 7ed6c17 Compare March 2, 2026 03:37
Replace the isCgroupAccessible heuristic (which rejected hybrid cgroup
systems entirely) with filesystem-type detection using Statfs. On
ubuntu-jammy (hybrid mode), cgroupv2 is mounted at
/sys/fs/cgroup/unified; on ubuntu-noble (pure unified mode), it is at
/sys/fs/cgroup. The cgroup path is now prefixed accordingly so that
inode lookups resolve against the correct mount point.

For containerized environments (docker-cpi, garden-runc) where cgroup
socket matching is rejected by the kernel due to cgroup namespace
isolation, adjust the UID-fallback path. Rather than allowing just the
current euid (typically root), explicit allow access for the "vcap"
user.
@selzoc
Copy link
Member

selzoc commented Mar 2, 2026

Thanks @abg !

@selzoc selzoc merged commit 4cc3636 into cloudfoundry:main Mar 2, 2026
10 checks passed
@github-project-automation github-project-automation bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants