Skip to content

Handle disappearing Landlock paths - #23541

Merged
MikeMcQuaid merged 1 commit into
mainfrom
landlock-readable-path-race
Aug 16, 2026
Merged

Handle disappearing Landlock paths#23541
MikeMcQuaid merged 1 commit into
mainfrom
landlock-readable-path-race

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • Ignore ENOENT when derived readable paths vanish during setup.
  • Cover the race between command setup and Landlock application.

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

OpenAI Codex 5.6 Sol xhigh with local review and (unit) testing (as on macOS).


Copilot AI lite review requested due to automatic review settings August 16, 2026 16:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request hardens Homebrew’s Linux Landlock sandbox setup against a race where “readable” filesystem paths derived during command setup may disappear before apply! runs, causing unexpected ENOENT failures.

Changes:

  • Ignore Errno::ENOENT while adding readable-path Landlock rules during apply!.
  • Add an RSpec example covering the “path removed after command setup” race.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/extend/os/linux/sandbox/landlock.rb Rescues Errno::ENOENT when applying readable path rules so vanished paths don’t abort sandbox setup.
Library/Homebrew/test/sandbox_landlock_spec.rb Adds a test for a readable path being removed between command and apply!.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread Library/Homebrew/test/sandbox_landlock_spec.rb
- Ignore `ENOENT` when derived readable paths vanish during setup.
- Cover the race between command setup and Landlock application.
@MikeMcQuaid
MikeMcQuaid force-pushed the landlock-readable-path-race branch from 708398b to fef2da5 Compare August 16, 2026 18:10
@MikeMcQuaid
MikeMcQuaid enabled auto-merge August 16, 2026 18:11
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Aug 16, 2026
Merged via the queue into main with commit fba9b30 Aug 16, 2026
45 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the landlock-readable-path-race branch August 16, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants