Fix faccessat and add faccessat2#3578
Merged
sporksmith merged 3 commits intoshadow:mainfrom May 3, 2025
Merged
Conversation
6725fff to
2cd6e3d
Compare
Doesn't pass yet under shadow
The implementation actually matches the faccessat2 syscall, which has a flags parameter. faccessat doesn't (though the libc wrapper does).
This is just like faccessat2, except doesn't take a flags parameter.
stevenengler
approved these changes
May 3, 2025
Contributor
There was a problem hiding this comment.
Nice catch!
This looks similar to #3384. I wonder if we should audit all of these to make sure we don't have other instances of these 2/not-2 syscall handlers.
Maybe double check if you haven't that we don't need to make any changes to the libc wrappers in the shim? For example do we need to add faccessat2 somewhere in src/lib/preload-libc/gen_syscall_wrappers_c.py?
Contributor
Author
Yup, those are already excluded. |
sporksmith
added a commit
that referenced
this pull request
May 4, 2025
sporksmith
added a commit
that referenced
this pull request
May 4, 2025
sporksmith
added a commit
that referenced
this pull request
May 4, 2025
zydou
pushed a commit
to zydou/arti
that referenced
this pull request
May 6, 2025
Mostly to get the `faccessat` fix in <shadow/shadow#3578>. I don't *think* it's currently affecting these tests, but is a very confusing bug when it does bite.
hacklschorsch
pushed a commit
to LeastAuthority/chutney
that referenced
this pull request
May 21, 2025
In particular, shadow/shadow#3578 fixes `faccessat` behavior that `test-network.sh` depends on (via shell tests like `-x`). get faccessat fix
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.
Our
faccessathandler incorrectly took an extra flags parameter, which was garbage data. This led to a heisenbug in chutney shell scripts, since sometimes the corresponding register would happen to have 0 and work, but sometimes it would have garbage data and cause the syscall to return an error.This renames the old handler to
faccessat2, which does take the flags parameter, and addsfaccessat, which doesn't.