Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release 9.0.0 branch: fix directory open rights #6479

Merged
merged 3 commits into from
May 31, 2023

Conversation

pchickey
Copy link
Contributor

Backport of fixes added to #6463.

Fix to the fixes that became 9.0.2 release: #6462 and #6471. We intend to merge this PR and ship it as patch release 9.0.3.

In order to work with wasi-testsuite, it needs to be possible to
path_open(dirfd, ".", ...) with the same rights reported in the
fdstat of that dirfd. When we report the Rights::all() set, both
FD_READ and FD_WRITE are set in the base rights, which results in
unix rejecting an openat2(dirfd, ".", O_RDWR) with EISDIR.

By not having the FD_READ and FD_WRITE rights present in the base
rights, the open syscall defaults to O_RDONLY, which is the only
access mode allowed for opening directories.

Note: wasi-testsuite is used to test our wasi-common implementation upstream, but not in this release branch, which is why this problem did not get caught before releasing 9.0.2.

Pat Hickey added 2 commits May 30, 2023 15:28
in order to work with wasi-testsuite, it needs to be possible to
path_open(dirfd, ".", ...) with the same rights reported in the
fdstat of that dirfd. When we report the Rights::all() set, both
FD_READ and FD_WRITE are set in the base rights, which results in
unix rejecting an openat2(dirfd, ".", O_RDWR) with EISDIR.

By not having the FD_READ and FD_WRITE rights present in the base
rights, the open syscall defaults to O_RDONLY, which is the only
access mode allowed for opening directories.
@pchickey pchickey requested a review from a team as a code owner May 30, 2023 22:34
@pchickey pchickey requested review from fitzgen and sunfishcode and removed request for a team and fitzgen May 30, 2023 22:34
@github-actions github-actions bot added the wasi Issues pertaining to WASI label May 30, 2023
@github-actions
Copy link

Subscribe to Label Action

cc @kubkon

This issue or pull request has been labeled: "wasi"

Thus the following users have been cc'd because of the following labels:

  • kubkon: wasi

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@pchickey pchickey changed the title Pch/release 9 fix dir open rights release 9.0.0 branch: fix directory open rights May 30, 2023
@pchickey pchickey merged commit 61cc2fa into release-9.0.0 May 31, 2023
@pchickey pchickey deleted the pch/release-9-fix-dir-open-rights branch May 31, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi Issues pertaining to WASI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants