[9.0.0] fix Wasi rights system to work with wasi-libc#6462
Merged
pchickey merged 5 commits intorelease-9.0.0from May 26, 2023
Merged
[9.0.0] fix Wasi rights system to work with wasi-libc#6462pchickey merged 5 commits intorelease-9.0.0from
pchickey merged 5 commits intorelease-9.0.0from
Conversation
added 4 commits
May 25, 2023 14:16
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 DetailsThis 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 |
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
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.
#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_READandFD_WRITErights 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_READandFD_WRITEbits infs_rights_basefor a file'sfd_fdstat_get.fd_readandfd_writeThis PR is just for the
release-9.0.0branch, I will work on upstreaming it tomainbut the situation there is slightly more complex because the test also needs to pass under the preview 2 implementation.