Unblock POSIX message queues in Landlock - #23302
Merged
Merged
Conversation
- Sandboxed glibc tests open POSIX queues for reading and fail with `EACCES` when Landlock handles read restrictions. - Limit the extra right to read-restricted profiles because Landlock rejects rights omitted from the ruleset's handled mask.
7 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts Homebrew’s Linux Landlock sandbox rules to avoid EACCES failures when POSIX message queues are opened for reading under profiles that enable Landlock read restrictions (i.e., when read access is being handled by the ruleset).
Changes:
- Grant
ACCESS_FS_READ_FILEon/dev/mqueueonly when Landlock is handling read restrictions (@deny_read), preserving expected behaviour for POSIX message queues. - Update the Landlock sandbox spec to reflect the new access mask used for
/dev/mqueuein read-restricted profiles.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Library/Homebrew/extend/os/linux/sandbox/landlock.rb | Adds conditional read-file permission for /dev/mqueue when @deny_read is enabled so message-queue reads don’t fail under Landlock. |
| Library/Homebrew/test/sandbox_landlock_spec.rb | Updates the expected /dev/mqueue access mask in the “standard device and POSIX IPC paths” test to match the new permissions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MikeMcQuaid
enabled auto-merge
July 25, 2026 18:21
cho-m
approved these changes
Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EACCESwhen Landlock handles read restrictions.See Homebrew/homebrew-core#294936 (comment)
brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?OpenAI 5.6 sol xhigh with local review and unit testing (not done on a Linux machine).