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

WASI: Greater isolation between fd and file functions #67

Closed
npmccallum opened this issue Mar 27, 2019 · 5 comments
Closed

WASI: Greater isolation between fd and file functions #67

npmccallum opened this issue Mar 27, 2019 · 5 comments
Labels
wasi:api Issues pertaining to the WASI API, not necessarily specific to Wasmtime.

Comments

@npmccallum
Copy link
Member

In one particular implementation of a WASM runtime (not yet public), we plan to support file descriptors but not a filesystem. It would be great if filesystem related functions could be a separate specification.

It would also generally be good to create a stronger separation between operations which work on file descriptors in general and those which work only on files in a filesystem. The precedent for this already exists in the __wasi_sock_*() functions.

@sunfishcode sunfishcode added the wasi:api Issues pertaining to the WASI API, not necessarily specific to Wasmtime. label Mar 27, 2019
@sunfishcode
Copy link
Member

Some preliminary thoughts here:

The API does use a naming scheme; __wasi_fd_* functions just operate on file descriptors, while __wasi_path_* operate on paths, so it's pretty easy to distinguish between them.

That said, the capability model doesn't depend on absolute paths at the syscall level, so there's no requirement for a traditional-looking filesystem (C:\ or /etc or anything else). In fact, it doesn't even need to be an actual filesystem; it's just a hierarchical namespace of resources, which could be entirely virtual, like Linux's /proc.

@npmccallum
Copy link
Member Author

I have (not yet public) reasons for wanting these calls in a separate module. See #74 for my preferred approach.

@sunfishcode
Copy link
Member

Ok. FWIW, others have requested we split out the command-line argument and environment variable handling into separate modules too. I think these are reasonable, but it does feel like something we should do once we have a proper forum, such as a CG Subgroup, which we'll hopefully have soon.

@npmccallum
Copy link
Member Author

I've requested an invite to the meeting. Hopefully, we'll be collaborating more directly in a short time.

@sunfishcode
Copy link
Member

The modularization PR has now landed, so this will be in the next snapshot!

howjmay pushed a commit to howjmay/wasmtime that referenced this issue Jan 24, 2022
pchickey pushed a commit to pchickey/wasmtime that referenced this issue May 16, 2023
…iance#67)

* On Windows, ignore access-denied errors from `sync_all`.

On Windows `sync_all` does `FlushFileBuffers` which fails with an
access-denied error if the file not opened for writing. Ignore this
error, for compatibility with POSIX-style APIs.

Fixes bytecodealliance#66.

* Ignore `ERROR_ACCESS_DENIED` from `sync_data` too.

* Temporarily disable directory syncing for now.
dhil added a commit to dhil/wasmtime that referenced this issue Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi:api Issues pertaining to the WASI API, not necessarily specific to Wasmtime.
Projects
None yet
Development

No branches or pull requests

2 participants