-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[9.0.0] fix Wasi rights system to work with wasi-libc #6462
Merged
Conversation
This file contains 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
implementations such as wasi-libc use these as a mask for any rights they request for a new fd when invoking path_open
Subscribe to Label Actioncc @kubkon
This issue or pull request has been labeled: "wasi"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
pchickey
force-pushed
the
pch/release-9-wasi-rights-read-write
branch
from
May 26, 2023 00:23
4012e49
to
0d8a260
Compare
alexcrichton
approved these changes
May 26, 2023
sunfishcode
approved these changes
May 26, 2023
Closed
pchickey
pushed a commit
that referenced
this pull request
May 26, 2023
required in order to make 9.0.2 a valid patch release. * `struct FdStat` is public, so I backed out changes to it, and manually applied the rights bits in the implementation of fd_fdstat_get. * new `FileAccessMode` changed to be pub(crate), to make sure it doesnt appear in any pub interfaces. WasiCtx::insert_file and push_file reverted to their original type signature. Private helper insert_file_ used for the set_{stdio} implementations.
pchickey
pushed a commit
that referenced
this pull request
May 26, 2023
required in order to make 9.0.2 a valid patch release. * `struct FdStat` is public, so I backed out changes to it, and manually applied the rights bits in the implementation of fd_fdstat_get. * new `FileAccessMode` changed to be pub(crate), to make sure it doesnt appear in any pub interfaces. WasiCtx::insert_file and push_file reverted to their original type signature. Private helper insert_file_ used for the set_{stdio} implementations.
pchickey
pushed a commit
that referenced
this pull request
May 26, 2023
* fixes to #6462: make wasi-common API compatible with 9.0.1 required in order to make 9.0.2 a valid patch release. * `struct FdStat` is public, so I backed out changes to it, and manually applied the rights bits in the implementation of fd_fdstat_get. * new `FileAccessMode` changed to be pub(crate), to make sure it doesnt appear in any pub interfaces. WasiCtx::insert_file and push_file reverted to their original type signature. Private helper insert_file_ used for the set_{stdio} implementations. * add release notes for 9.0.1 and 9.0.2
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.
#6265 introduced a regression with programs using wasi-libc, reported at WebAssembly/wasi-libc#415.
Wasi-libc read the rights of the base directory (using
fd_fdstat_get
) and used those to mask the rights requested topath_open
. In 6265, I changed the behavior of fdstat_get to always report and empty set of rights. This means that Wasi-libc will always pass an empty set of rights topath_open
, which is a problem because theFD_READ
andFD_WRITE
rights are how path_open determines if a descriptor is to be opened for reading, writing, or both.The fix is as follows:
fd_fdstat_get
.FD_READ
andFD_WRITE
bits infs_rights_base
for a file'sfd_fdstat_get
.fd_read
andfd_write
This PR is just for the
release-9.0.0
branch, I will work on upstreaming it tomain
but the situation there is slightly more complex because the test also needs to pass under the preview 2 implementation.