test: switch /etc probe from /etc/os-release to /etc/group#39
Merged
congwang-mk merged 1 commit intomainfrom May 6, 2026
Merged
test: switch /etc probe from /etc/os-release to /etc/group#39congwang-mk merged 1 commit intomainfrom
congwang-mk merged 1 commit intomainfrom
Conversation
Signed-off-by: Cong Wang <cwang@multikernel.io>
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.
Summary
Follow-up to commit 4f9b2eb (the /etc/passwd test-leak fix), which switched the canonical "denied read" probe to
/etc/os-release. That choice broke CI on Debian/Ubuntu/Fedora runners because/etc/os-releaseis a symlink to/usr/lib/os-releaseon those distros — Landlock checks the resolved file, so reads succeeded whenever/usrwas infs_read, defeating four assertions:test_landlock::test_cannot_read_outside_allowedtest_sandbox::test_denied_pathtest_sandbox::test_nested_sandboxtest_sandbox::test_nested_sandbox_via_cliSwitches every probe to
/etc/group: real (never-symlinked) file on every Linux distro with users, innocuous content, and no virtualization handler in sandlock.Test plan
cargo test --release -p sandlock-core --test integration— all 14 affected tests pass locallycargo test --release -p sandlock-core --lib -- chroot::resolve procfs::tests— 21 unit tests passcargo test --release -p sandlock-cli --test cli_test— CLI denied-path test passes🤖 Generated with Claude Code