Skip to content

Harden monit-access-helper.sh cgroupv2 mount point detection#599

Open
gberche-orange wants to merge 2 commits into
cloudfoundry:ubuntu-jammyfrom
orange-cloudfoundry:fix-issue-585
Open

Harden monit-access-helper.sh cgroupv2 mount point detection#599
gberche-orange wants to merge 2 commits into
cloudfoundry:ubuntu-jammyfrom
orange-cloudfoundry:fix-issue-585

Conversation

@gberche-orange
Copy link
Copy Markdown

Restrict the inspection of /proc/self/mounts to cgroupv2 device (1st column) in addition to existing cgroup fstype (column 3).

Also fail fast in case of multiple detected mount points.

Fix #585


NOTE: this repository uses a "Merge Forward" strategy

Changes should be made in the earliest applicable branch, and
merged forward through subsequent branches.

  1. Create a PR into the oldest branch (ubuntu-<short_name>)
  2. After this PR has been merged create a merge-to-<next_short_name> branch
  3. Merge ubuntu-<short_name> into merge-to-<next_short_name>
  4. Create a PR to merge merge-to-<next_short_name> into ubuntu-<next_short_name>
  5. Repeat as needed for subsequent branches

Restrict the inspection of /proc/self/mounts to cgroupv2 device (1st column) in addition to existing cgroup fstype (column 3).

Also fail fast in case of multiple detected mount points.

Fix cloudfoundry#585
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Review Change Stack

Warning

Rate limit exceeded

@gberche-orange has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 21 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4d710f04-7760-4289-8d44-90db9bf4fd9b

📥 Commits

Reviewing files that changed from the base of the PR and between 1e4a114 and 50cc4d1.

📒 Files selected for processing (1)
  • stemcell_builder/stages/bosh_monit/assets/monit-access-helper.sh

Walkthrough

This PR hardens the cgroup v2 mount resolution in the monit access helper script. The permit_monit_access function now validates cgroup2 filesystem mounts more strictly by matching on both the mount source and filesystem type fields from /proc/self/mounts, counts matching mounts, and verifies that the 0:: cgroup path exists. This prevents the script from failing when multiple cgroup2 filesystems are mounted in the system, such as when container orchestration tools like Cilium mount additional cgroup2 filesystems alongside the system's unified hierarchy.

Suggested reviewers

  • aramprice
  • mariash
  • rkoster
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and clearly summarizes the main change: hardening cgroupv2 mount point detection in monit-access-helper.sh.
Description check ✅ Passed The description includes the required merge-forward strategy instructions and explains the specific changes (matching device column and fail-fast on multiple mounts), and references the linked issue #585.
Linked Issues check ✅ Passed The PR addresses all coding requirements from issue #585: matching both device column (1st) and cgroup2 fs type (3rd column) and failing fast when multiple mount points are detected.
Out of Scope Changes check ✅ Passed All changes are scoped to hardening the cgroupv2 mount point detection logic as required by issue #585; no unrelated changes are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 13, 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.

monit fails on 1.1183: monit wrapper confused with cgroupv2 originated from bosh release workload

1 participant